You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Highlights
A refinement below a composite's head is obligated at every position that gives a value the type, and a narrowing no step decides is disclosed (#1542). A tuple component, a constructor field, a handle's value and a resume argument are held to the refinement their type states, where several were passed over with no record.
Every position that binds or passes a value holds it to its type by subtyping, as a let does (#1896, #1819, #1885, #1866). A function value wider in its result or narrower in its parameter than the type it reaches is refused at check, and the order of a join's arms never decides a verdict.
The type a context names reaches every construct that types a value, and a literal takes the integer type that holds it (#1812, #1605).
What a type states of a value is assumed wherever the solver reads it, and a narrowing is never proved from the fact its own reader reads (#1814, #1897, #909).
A counterexample and the inputs vera test generates are a function of the program (#1785, #1871), and a counterexample lists the function's inputs as the program would write them.
The command line is read against one table of what each command takes (#1872), and a diagnostic from any stage names its file, quotes its line and points at its column (#1636).
The documents, the specification and the diagrams say what the compiler does: each statement a command can check was run against 0.2.8, and about 140 were corrected.
Added
A mutation pragma is filed under the line it is written on (#1838). mutmut files a # pragma: no mutate by its place in the syntax tree, so one written after the closing bracket of a statement that spans lines protected the statement's first line instead of its own. scripts/check_pragma_placement.py reads each pragma with tokenize and without the engine, and accepts it only in a shape it places by a local rule, filed under its own line: after the code of a line that starts its statement, outside every bracket; a bare pragma after code inside brackets; a block, start or end alone directly above a statement at its column; an end alone directly below a statement at its column, ending its block or the module. Every other shape is refused with a message saying where to write the pragma, including some that mutmut reads, since where libcst puts those turns on more than their neighbouring lines (a block's or a module's footer, a clause's own leading lines, a comment line after a backslash). It runs in the commit hook and CI's lint job, and its tests, a generated matrix of every place a comment can go among them, hold every pragma it accepts to mutmut's own visitor in the Mutation (diff) lane, and hold each documented shape accepted. The nine pragmas it found under vera/ are moved onto the lines they answer or deleted, and the mutants the old places suppressed by accident are answered. Three of the conditions they sat on (two in _closure_argument_component, one in _emit_written_store_guard) also carried four correctly filed pragmas whose reason was "unreachable", which hid the mutants that make the condition true, and the tests kill those: the three conditions are split into one test per operand, and no pragma is left on them.
Changed
The mutation (diff) check lists a pull request's surviving mutants and stays green (scripts/mutate_diff.py, #1838). A run with survivors exits 0 where it exited 1: its headline says Listed: N mutant(s) on the lines this pull request wrote survive the lane's tests., a notice annotation repeats it on the pull request, and the job summary says above the survivors what a listed mutant is and what is owed for one. The check is red only when the run itself fails (exit 2), survivors or not. The window is the lines the pull request writes, not two lines either side: each line the diff adds and, where a hunk removes lines and adds none, the line that now follows the removal, with the first line of a node that spans one (--context N still widens it). MUTATION.md and TESTING.md state the rule: a survivor the lane lists whose mutant makes the compiler accept, assume or prove more, or check less, gets a test that fails on it, a mutant placed on the first line of a node that spans a written line included; any other stays listed, in the run's own record and, once the pull request merges, in a comment on the standing issue, and no mutation result holds a merge.
A configured inference API key holding any character outside printable ASCII (a tab, a line end, another control character, or a character outside ASCII) is refused before any request is built (#1854). A key with a tab was sent as it was, since an HTTP header can carry one. The Err names the variable that holds the key (VERA_ANTHROPIC_API_KEY holds a character an HTTP header cannot carry ... Set it to the key alone.), and quotes nothing of the key. Upgrade: set the variable to the key alone, with no surrounding whitespace or line end.
ROADMAP.md lists only the stages ahead: Stages 19 and 20 are gone and their issues sit with the release that carries them or on the horizon; Stage 28's release table states the plan for v0.2.9 to v0.2.12; and a bug outside a mechanism cluster carries the milestone of the release that fixes it (#1880).
HISTORY.md's rows of v0.2.2 to v0.2.8 and its introductions of Stages 21 to 28 are a sentence or two again, By the numbers adds v0.2.0 and v0.2.7 with the chart redrawn, and scripts/check_history_rows.py holds a row to one sentence of at most 35 words and a stage's prose to 85, in the hook and in CI.
The Mutation (diff) lane's selection holds tests/test_rows_without_checks_1861.py (#1838). The class instrument of #1861 kills the mutants of the container-store refinement guard (_emit_written_store_guard) the rest of the selection left surviving, and reaches the closure-argument component reader (_closure_argument_component), which no other selected file reaches.
The documents, the specification and the diagrams say what the compiler does. Each statement a command can check was run against 0.2.8, and about 140 were wrong. README.md said a quantified ensures gets no runtime check, where the contract code generation does not lower is an ensures on a function that returns a String or an Array, disclosed as E543; vera verify examples/safe_divide.vera verifies 9 obligations, not 6; the warnings that disclose an obligation nothing guards are E504, E506, E539, E540 and E543; SKILL.md said Tuple<> is Unit, which is a parse error, and FAQ.md that Bool is Ord, which is E242; TESTING.md now documents the envelopes vera compile --json and vera run --json print; MUTATION.md gave the sweep's state schema as 2, which is 3; and vera/README.md named functions that do not exist.
The specification no longer contradicts itself or the reference compiler where a sentence was overruled by another section or by what runs:
§2.8 rule 5 states the variance the checker implements: a data type is covariant in its type arguments (Array<PosInt> <: Array<Int>), and a function type is contravariant in its parameters and covariant in its result and its effect row (§7.8). It said compound types have no variance. Its implementation note says the Int to Nat relaxation reaches a data type's type argument, so an Array<Int> where an Array<Nat> is expected is an obligated narrowing of its elements, checked at run time where the verifier cannot discharge it.
§2.6.5 says a refinement's guard is compiled and evaluated even where vera verify proves the predicate, and that a program vera verify accepts can still hold Tier 3 predicates whose guards are the check. It said a verified program never reaches the guard.
§5.9 follows §4.2: the type a result is expected at fixes a type argument whatever the literals' signs.
§2.1 says a let declares its type, as §4.7 and the grammar do.
§4.2 says a negative value in a @Nat context is no E149: it is a narrowing, which the verifier refutes (E503).
§2.2.2 lists every binding form in which reading a zero-size slot is E182, closure parameters among them.
§12.2.3 names the IO operations whose use makes a module export $alloc.
§3.7 defines @Fn, the name every binding written with a function type shares, and §3.3 and §3.10 list closure parameters and handler state as binding sites.
§5.9.1 and §7.6 bind the effect variable their examples use, so the E340 they describe is the error the compiler gives. §5.5 says an effect variable stands only in a function type's row, and a function's own row that names one is refused (E340).
§5.4 drops the note it said the compiler SHOULD emit for requires(true) and ensures(true), which are the canonical spelling of a function with no precondition and no postcondition.
§6.4.3 says Int division carries the overflow obligation for INT_MIN / -1 (E528). Its table said that case traps with no obligation.
§6.8's table says a refuted Tier 1 obligation is a vera verify error, where it said a compile error, and that a Tier 3 site no check can evaluate is disclosed and counted in no tier. The guarantee of a fully verified program loses the condition "if it compiles", since vera compile does not verify. The conformance program's summary is 9 verified, not 8. §6.8.1 names the ensures with no runtime check as one on a function that returns a String or an Array, where it named a quantified ensures.
§7.2 rule 6 says a qualified call of a user-declared effect's operation outside its row is E340 and a bare call outside a handle block is E217, as §7.4 does. It gave E340 for both.
§9.1.2 lists the eight prelude data types §8.4.1 reserves.
§11.1 describes the pipeline as it runs (vera compile does not verify, and code generation reads the typed program), §11.4.2 the registration passes, §11.11.2 how a handler clause is compiled, and §11.2.1 the refuted @Nat subtraction (E502). §11.8 says which contract has no runtime check, and that a false Tier 1 of one has no runtime backstop.
§12.2.2 lists every host import, where it listed 39 of them, and the State cell tables include compound, data and Map cells.
§0.5.8 lists vera compile and vera run among the commands that take --json. §0.8 says its table names the issue that tracks each planned feature and the chapters its design will extend, where it said each was specified in full in its target chapter.
§1.8 rule 11 says a trailing comment is claimed by the construct whose source span covers the comment's line and column, where it said the construct whose line range covers it.
§10.1 names the two places vera/grammar.lark departs from the chapter's rule names: start for program, and four productions with no rule of their own there.
§12.3.2 adds the third binding step, the other host families. §12.4.1 counts thirteen IO bindings, where it said eleven. §12.9.3 says two code-span shapes lie outside the round-trip property and the fixed point has no exceptions.
§13.8 names what its conformance run skips and no longer counts the programs that behave the same under both targets, a count that was out of date.
The 34 diagrams are redrawn against the code, and 30 of them changed. The pipeline diagrams draw the binding step, the typed program and vera verify's reconciliation, with verification off the compile path; the tiers diagram draws Tier 2 as specified and not implemented, and the obligations that are disclosed; the handler diagram draws a handler the checker accepts; the memory layout gives the allocation header's size field its 31 bits. The 35 places where a label ran past its card or the frame are fixed.
Prose in every document but this changelog and the history loses its em dashes, its accounts of how a rule came about, and its pointers to closed issues as open work. The limitation tables are checked against the compiler: eight rows are corrected, and two that no longer hold are removed. An empty Issue cell reads none, and docs/llms.txt separates a link from its description with a colon.
KNOWN_ISSUES.md gains rows for five bug classes the comparison found: the parsing built-ins' own grammar (#1869), a comparison of Unit values (#1870), what a counterexample lists (#1871), the command line's handling of flags and extra files (#1872) and unary negation of an @Int, which has no overflow obligation and no guard (#1875). The limitation tables gain a row for what vera run prints for a compound result (#1876), which TOOLCHAIN.md now states.
A pull request's suite runs in four shards on Linux and four on Windows, where it ran in three and two. A round of review ends with its slowest shard: on a pull request that samples the class-instrument matrices the two Windows shards ran 31.6 and 33.4 minutes against 13.6 to 16.8 for the three Linux ones, and on one that runs the matrices in full a Windows shard ran 48.2 minutes and the Linux ones 32.5 to 36.8. The eight cells' names are the required checks, and tests/test_ci_changes.py holds every cell of the shard job to that list, so a cell cannot be added that gates nothing.
The nightly mutation sweep's results go to one standing issue, Mutation sweep results (standing) (labelled testing and mutation-sweep), which the workflow finds by its title and creates when it is absent, and no night closes. Every scheduled night posts one comment there, red or green: the commit and the run, the mutants decided that night by verdict, the cycle's progress, the slices, and the night's new survivors counted by module, in at most 25 lines (three when nothing was decided). A cycle's close posts its score by module beside the cycle before's, and its survivors as a task list grouped by module, each line the file, the line and the mutation mutmut made (the engine's new show-mutations command, run with uv.lock's engine on the night that renders the comment), with the rule a survivor ends by: a killing cell, # pragma: no mutate with its reason, or a deletion. The stitch job renders the comments (scripts/mutate_sweep.py comment, from the night-report.json the stitch now writes beside the state), and a new results job with issues: write alone posts them; each comment's first line is a marker, so a rerun posts nothing twice. A cycle's close keeps its record in the state (comments, the last three closed cycles, newest first, each named by its number and its first night): its counts by module, each listed mutant with its module, function, number, line and status, and the engine's version, so a cycle whose comment was not rendered is rendered from it on a later night, even after the next cycle closes. The comment is rendered once and its parts (at most 10) kept beside the record, so every later night posts the same parts, each whose marker the issue lacks; a render past those bounds is neither kept nor posted. The engine shows the mutations only when its version is the one that ran the cycle, and its calls share 300 s of the render step's 600 s. A module's tasks, or the slow and at-import lists, longer than a comment are cut between two entries, the heading repeated. A night whose stitch rendered no comment, because it failed or never ran, posts two marked lines linking the run, and comments that exist but fail to download fail the results job so it can be rerun. A red dispatched night's comment points at the stitch summary alone, since the tracking issue takes scheduled nights. A dispatched night posts only with the new post input, and says so in its first line, naming the ref it ran on. Only a run on main whose stitch uploaded its state posts a cycle's close comment; a dispatched run on another ref renders it into the artifact, says in its stitch summary that it was not posted, and its night's comment points at the artifact. A cycle's marker carries the date of its first night beside its number (cycle=N from=YYYY-MM-DD gen=G part=K, G the id of the run that created the state, absent from an older state), so a reset state cannot collide with an older cycle. The red path's tracking issue is now found by its own title, so a failure is never reported on the standing issue. A closed cycle's record keeps the cycle before it per module (previous), for the comparison, which reports that cycle by the at-import rule at its own head. summary takes --cycle N to write a kept closed cycle's files (the last closed cycle's by default), and each close comment's command names its cycle.
The committed mutation score is the nightly sweep's fourth cycle, closed on 30 November: 88.6% ±1.2 caught, of 2,510 mutants sampled from the 121,975 of vera/ (mutation.json, which the README badge reads, and mutation-summary.csv). It was the soundness core's 83.3%, measured by hand.
MUTATION.md and TESTING.md no longer state the soundness core's 83.3% as the committed score: the badge reads mutation.json, which a release pull request writes from the last closed cycle (scripts/mutate_sweep.py summary), and until one first does, it holds the soundness-core baseline of June 2026. Cycle 2, the first the sweep closed (4 to 16 November 2026, at e4cd3725), scored 86.6% caught, 95% interval 85.1 to 87.9, over 2,253 scored mutants of 2,301 sampled from 118,969.
Fixed
A fact the verifier holds about a value still holds once the value is stored in a constructor's field and read back (#909): a callee's ensures, a refined return type, and a refined or @Nat parameter. let @Box = MkBox(mag(-5)); followed by a match that returns the field proves ensures(@Int.result >= 0) at Tier 1 where mag ensures it, and so do a generic Box<T>, an Option, a nested constructor, a constructor built in each arm of an if, an array literal, and a mag imported from another module. The verifier at 0.2.8 already proves them: the limitation's rows in KNOWN_ISSUES.md and ROADMAP.md were out of date and are removed, and tests/test_adt_field_facts_909.py pins each shape. A Nat component of a value the function did not build still carries no >= 0 where it is read at @Int (#1814).
A narrowing no step of the verification decides is disclosed, not passed over (#1542). Each function's obligations are settled from the records its verification made, and a site no step decided had no record: vera verify passed with no warning, and the program could carry the violating value or a run-time check no obligation claimed (W004). The sites known to reach it were a refinement binder inside a decreases measure (decreases(match @Option<Int>.0 { @Option<Small> -> @Nat.0 }), with type Small = { @Int | @Int.0 < 10 }), a handler clause binder whose payload mixes @Nat with a refined component (put(@Tuple<Nat, Small>) -> { ... }, throw(@Tuple<Nat, Small>) -> { ... }), a get clause's resume(@Int.0) at State<NonzeroNat>, and a with update's map_insert value at State<Map<Int, Pos>>. Such a site's obligation is now Tier 3: kept as tier3 where a run-time check guards it, which removes the W004 the last two drew, and disclosed with an E506 warning (tier3_unguarded) where no check can be emitted, as the first two now are. A program reaching these sites still passes vera verify, with the warning. No program in examples/ or tests/conformance/ has such a site, and no outcome a step decided changes.
A literal leaves open every integer type that holds its value, and the type a call's result is expected at gives it no other (#1605). let @Array<Nat> = array_slice([-3, 5], 1, 2) and let @Nat = second(-3, 5) were refused (E503) though the calls return [5] and 5: a Nat context made the call's type argument Nat whatever its literals held. A negative literal now leaves Int alone, so the call is at Int and the narrowing is the binding's, checked where the value binds. A literal written alone in 0 .. 255 leaves Byte open as well, so let @Byte = id(5) is accepted (E170 before), and an expression built from literals alone is read by its value as the run time computes it (spec §4.2). Breaking: a negative literal that does reach a @Nat binding through a generic call (let @Nat = id(0 - 3), a pipe, a tuple component, an element read, let @Array<Nat> = array_reverse([0 - 1, 5])) was refused by vera verify (E503) and now stops at run time, where the value binds (Negative value bound into a @Nat slot); where the binding narrows below its head into a refinement (let @Option<Small> = id(Some(0 - 3))) no check is emitted, and the narrowing is disclosed (E506, spec §2.6.5) as any other value's there is. A literal written at a Nat position, or beside a @Nat argument that fixes its type, is refused as before, and let @Array<Byte> = array_reverse([1, 2]) is still refused, at the argument now (E202, E170 before). A context that is a refinement of a composite (type ByteOpt = { @Option<Byte> | true }) completes a literal below it as the composite does: let @ByteOpt = idg(Some(5)) checks, where it was refused (E170) beside let @Option<Byte> = idg(Some(5)), which was not.
Breaking: vera/proposeEdit, vera/strengthenContract and vera/addEffect refuse an edit that introduces an obligation the solver did not finish (timeout), or moves one to timeout from tier3, tier3_unguarded or violated (#1610). The gate refused an edit that introduced a tier3 obligation and applied one that introduced a timeout: the proof delta files a timeout under timed_out, which no conjunct of the gate read. A check the solver did not finish is not a proof, so the gate now asks one rule of every obligation the edit leaves: it is verified, or it is what it was. An obligation that timed out before the edit and times out after it, moved or not, still applies. Upgrade: a client that proposed such an edit and relied on its being applied passes "force": true to vera/proposeEdit, which says out loud that the edit leaves a check unproved; vera/strengthenContract and vera/addEffect take no force, and their responses do not return the edited source (applied, ok, proof_delta, diagnostics, client, client_reason, and rewritten for vera/addEffect), so the client builds the full edited text itself and sends it to vera/proposeEdit with "force": true.
examples/factorial.vera states its domain, requires(@Nat.0 <= 20) (#1635): its contract admitted every @Nat and the run trapped with Integer overflow from 21, so vera test --distrust failed 80 of 100 trials. Every factorial the documents teach with ensures(@Nat.result >= 1) takes the same precondition.
A diagnostic names its file, quotes the line it is on and points at its column, from every stage (#1636). An E009 (an invalid escape or a malformed interpolation) and an E040 (a pipe whose right operand is not a call) gave a line and a column and nothing else: the text named no file and quoted no line, --json had no file and no source_line, and an E013 reporting a module's E009 named no file for it. Code generation's E614 (a typed hole) quoted no line. A runtime trap with a frame of the program's own (E800 from vera run, text and --json) named the line its function is declared on and quoted none; it now quotes that line, from the program or from the module the function is imported from, and points at it. Each stage built its location and cut its quote by hand; both are now built by one constructor, and scripts/check_diagnostic_fields.py refuses a location or a quote built anywhere else. A position inside a string literal counts the newlines before it, so a diagnostic in an interpolation after a newline in the literal is on its own line, where it was on the line the literal opens (#1632), and an E009 is at the escape's backslash or the \( that opens the segment, where it was at the literal's opening quote. E501's Precondition: line quotes the clause as vera fmt writes it, where it quoted every line the clause spans, whole, with whatever shared them (#1860); E136's copy of a module's alias and E163's spelling of a return type are written the same way. A fix that names text to replace (E341, E135, the apply_fn fixes) still quotes it as the program writes it, so it can be found and replaced. Breaking (text output): a diagnostic with no position in its file prints [E900] Error at main.vera:, where it printed line 0, column 0 after the file, and one with no file prints [E901] Error:, where it printed Error at line 0, column 0:; this covers E800 without a source frame and the command-line refusals E900 to E912. A consumer that matched the old header text matches Error at <file>: or Error: instead; --json is unchanged for these, with line and column still 0.
vera errors no longer lists E003 and E004, which no input ever raised (#1636): a malformed slot reference and a missing closing brace are E005. scripts/check_diagnostic_fields.py now fails a registered code that no site in vera/ can raise.
The language server's diagnostic ranges start on the character vera check puts its caret under (#1637). A diagnostic's column is 1-based, as every stage writes it and the command line reads it, and the server read it as 0-based, so every published range started one character late: E200 at line 6, column 3 of missing(@Int.0) covered issing, and a diagnostic on the last character of a line, E040 on a pipe's 1, had an empty range past it. A range now starts at the column and ends where the name or slot reference there ends, one character on, or at the end of the line.
The nightly mutation sweep no longer scores a function evaluated at import as survivors no test could kill (#1740). mutmut forks a mutant's worker after the modules are imported, so a function that runs only at import does not run under its mutant. A rule over the sources (at_import_units, by ast) finds them at its conservative closure: a function is one only if every mention of it in vera/ and tests/ is a direct call by its plain name in code run while its module is imported (a module or class body, a default, the body of another such function, the import branch of a __main__ guard). Any other mention makes it observable: an import of its name elsewhere (a re-export included), its name as a string, an attribute, a stored or passed name, a decorator, a call in the body of a method, a nested function, a lambda, a generator or coroutine function or a decorated one (or a call of one), in a generator expression past its leftmost iterable, in an annotation under from __future__ import annotations, or in a type alias's value. It selects 26 functions in the tree, among them vera/__init__.py's _read_version, vera/ast.py's _spelling and _stage, and the four the nights scored as survivors: monomorphize._builtin_return_tables, trap_registry._kinds and _emitters in cycle 2, fold._check_order in cycle 3. The rule decides nothing the engine runs: every mutant is run and kept as the engine decides it, and where a result is reported (the night's comment, the cycle's comment, mutate_sweep.py summary) a mutant the engine recorded as survived, of a function the rule selects, is counted and listed as evaluated at import, outside the survivor tasks and the score's total. A misreading can at worst move a real survivor off the task list; it can never hide a killed or killable mutant.
vera test reports a trial's arguments as the program would write them (#1768). A Bool argument was reported as the 1 or 0 the compiled function receives, a String argument was printed without its quotes on the trial line and with JSON's escapes in E703, and the two lines were written by different code. The trial line and E703 now write each argument as its literal, through the one renderer vera verify's counterexamples use: @Bool.0 = true, @String.0 = "q\"x\n". A generated String argument is the string the solver chose: the compiled function was called with the solver's text of it, which spells an invisible character and one outside the Basic Multilingual Plane as an escape, so requires(@String.0 == "\u{200B}") failed as a precondition violation on its own generated input; one reader of a solver's string value now serves both the trial and its report. Breaking for a consumer of vera test --json, two values each failure's args carries are corrected (spec §0.5.8): a Bool argument is a JSON boolean, true or false, where it was the number 1 or 0 the compiled function receives, and a generated String argument holding a character the solver's text spells as an escape (an invisible one such as U+200B, or one outside the Basic Multilingual Plane such as U+1F600) is that character, where it was the escape text (\u{200b}). A reader that compared a Bool with 1 compares it with true, and one that matched the escape text matches the character. Every other argument's JSON value is unchanged.
A counterexample, the requires fix computed from it, and the inputs vera test generates are now a function of the program, not of what the process ran before (#1785). Z3 hands a freed term's id to the next term made in its context, so the same query took different ids after different histories and Z3 picked a different satisfying model: the issue's program showed @Int.0 = 9, @Nat.0 = 20 or @Int.0 = 0, @Nat.0 = 0 by what had been verified first, and a warm session's cached replay disagreed with a fresh session in one process. Every shown model is now read in a new z3.Context holding the query's assertions, translated: a refutation's counterexample (SmtContext._check_refutation) and the tester's input search. Where that check does not answer sat or the translation is refused, the diagnostic says a counterexample was found and withholds its values rather than show the shared context's. No verdict, code, location or status moves; some counterexamples show another valid model. Where the values cannot be reproduced within the solver's budget they are withheld, and the diagnostic says so (A counterexample was found; its values are withheld because they could not be reproduced., spec §6.4).
The language server publishes a diagnostic located in an imported module on the import that brings that module in, with the module's location ahead of its message as vera check prints it (In imported module /path/lib.vera, line 8, column 3: Function 'word' body has type Int, expected String.), and, for a client that advertises relatedInformation, a related location at that line of the module (#1788). The server placed it at the module's line and column in the importing document, on a line that did not hold what the message named. The import is the one the resolver bound to the module's file, or for a module it could not read, the one it recorded failing, the document's own import before any other: a module reached only through another is published on the import of the module that reaches it, and a module that is not UTF-8 (its E024) on the import that names it. Every diagnostic of a module is published, in the compiler's order.
The language server reads a document with the line-end rule the commands read a file with, so a lone carriage return ends a line, as the protocol counts it (#1788). A buffer whose line ends were lone carriage returns was handed to the parser as one line, so its diagnostics, tier hints, hover, go-to-definition and completion answered on the wrong line or not at all, and the edit vera/proposeEdit, vera/strengthenContract and vera/addEffect send replaced its first line alone, leaving the rest of the old text after the new. A CRLF or LF buffer was already read right; a mixed one is now read as vera check reads its file, a carriage return inside a string literal included. A buffer that begins with a byte-order mark, which vera check drops from a file, was handed to the parser whole and drew E006 (Unexpected character U+FEFF) at its start with nothing analysed; the mark is dropped as the file reader drops it, and a position on the buffer's first line counts it, one UTF-16 unit to the right of the compiler's column.
The type a context names reaches every construct that types a value (#1812). A value that leaves a type variable open (None, [], Ok(1), a generic call no argument of which fixes its variable, an index over an empty literal) took the type its position names only where a check listed the kind of value it repaired. An Exn handler's body and clauses, an array literal's element, a tuple's component, a generic call's argument, an ability operation's argument, a constructor's field that no expected type hands down (a data type with no type parameters, or a field the constructor's inference fixes), a closure's argument through apply_fn at the enclosing function's own T, a binding that held a literal beside a nested call's open variable, and a match scrutinee whose binding pattern names its type each missed some: the program was refused (E121, E170, E164, E213, E241, E613), or vera check accepted it and code generation dropped the function that held it (let @Array<Int> = array_reverse([]);: E602 at vera verify, E907 at vera run), or the check accepted it with the variable left open in the types and instances it recorded. Each of these now takes the type its context names (spec §5.9): a handler under a function returning Result<Int, String> whose body is Ok(1) and whose clause is Ok(0) checks, as an if of the same values did, and so do let @Int = idg([][0]), Box([][0]), MkP([][0], 1) with data P<T> { MkP(T, T) }, apply_fn(@Endo<T>.0, [][0]) inside a forall<T> function, compare(head_ord([]), 5), idg(Tuple(head_ord([]), 1)) at a Tuple<Int, Int> and match none_ord(()) { @Option<Int> -> 0 }. An ability operation's two arguments that each leave the other's variable open (eq(Ok(1), Err("e"))) are still refused. A typed hole in such a position is reported once, at the type the context names. One program that checked is refused: a match whose binding pattern names the scrutinee's type holds the scrutinee to it, so a constructor pattern beside it whose binder names another payload type is E314 (match none_of(()) { Some(@Int) -> 0, @Option<String> -> 1 }, with none_of leaving its variable open); no other program that checked is refused. A refined or Nat field that an Exn or State handler's body builds from a value nothing proves (Some(sc(x)) at an Option<Nat> handler, with sc proving nothing of its result) verified with a run-time check, and is now refused at vera verify where it is built (E503, E505), as the same construction is outside a handler. E341's message and fix name the handler's type where the function's return type gives it (handler's value is Result<Int, Int>, where it printed Result<Int, ?>).
What a type states of a value is assumed at every position the solver reads (#1814): an Int's i64 range and a Nat's 0 .. 2^63 - 1 at the head and inside a data value, a tuple or an array element, a refinement over a data type inside a type, and a recursive type's positions, at every depth of a construction and to a bounded depth of a value the solver can only name, of every parameter, refinement binder and stand-in other than the result of +, -, *, a negation or abs; an array element's refinement whose predicate calls a function is the exception, withheld as #1929 describes, so a goal that needs it is not proved. let Tuple<@Int, @Int> = @Tuple<Nat, Nat>.0 under ensures(@Int.result >= 0), an Array<Nat> element's sign and ensures(@Int.result <= 9223372036854775807) on the identity are proved where they were refused (E500) with counterexamples no value of the type has, and the int_overflow rows of @Int.0 + 0 and @Int.0 * 1 are proved. A refinement over a data type is decided where a value is given the type: code_e(Red) against a parameter of type NotRed = { @Color | @Color.0 != Red } is refused (E505) where it was a runtime check (E506), and code_e(Green) is proved. Breaking: a requires that admits only values outside what a parameter's type states (outside the i64 range, or an Array<Nat> element below 0) admits no argument and is refused (E538); no example, conformance program or documentation block has one. Breaking: a refinement over a data type whose predicate calls a helper with no postcondition stating its value ({ @Tuple<Int, Int> | fst(@Tuple<Int, Int>.0) > 0 } with fst ensuring true) refuses (E505) a value that satisfies it, where it was a runtime check, as { @Int | g(@Int.0) > 0 } with g ensuring true already did; no example, conformance program or documentation block has one: give the helper the postcondition that states its value. A generic function no call instantiates decides its concrete refined return with what its parameters' types state and the same disclosures as any other function: a return bounded by Int's range is proved where it was refused (E505), and one whose value comes through a narrowing with no check is a runtime check (E506) where it was proved. A narrowing into a constructor's Nat field is no longer proved from the postcondition of the callee the value is passed to: g(Link(@Int.0 - 1, End)), with g ensuring that field >= 0, is refused (E503) where it was proved while @Int.0 = 0 trapped, at any depth of the construction. Spec §6.8.2 names the element regime of its premise screen: the ranges an Array<Int> parameter's type states of its elements are premises the screen certifies, so a proof that rests on them keeps Tier 1 and is not disclosed with E540.
Breaking: a function value whose result is wider than the function type it reaches is refused at check (#1819). A fn(@Int -> @Int) closure was accepted where a fn(Int -> Nat) or a fn(Int -> Pos) was expected, and its result was trusted at the type's: a function declared -> @Nat returned -5 with vera check and vera verify clean, and a Pos read back proved later facts at Tier 1 that nothing had checked. Inside a function type the result now compares with no narrowing of a value, as the parameters do (E190, spec §2.8): a closure declared -> @Int guarantees no Nat. Declare the closure's result as the position states (fn(@Int -> @Nat) effects(pure) { ... }), and its own return is proved or checked; a function value held in a slot is wrapped, fn(@Int -> @Nat) effects(pure) { apply_fn(@IntToInt.0, @Int.0) }. fn(Int -> Nat) at fn(Int -> Int) and fn(Int -> Int) at fn(Nat -> Int) are admitted as before.
A tail-recursive function with a postcondition or a refined return type keeps its self tail calls, so a loop over a scalar measure runs at constant stack depth (#1851). An ensures that is compiled into a check (every one but a non-trivial ensures on a function returning a String or an Array, spec §11.8) is checked where a function returns to its caller: a function with a check after its body that calls itself in tail position compiles as an entry, which calls the body once and runs the check on what it returns, and a body, whose self tail calls transfer to the body. count_proved, whose ensures(@Nat.result >= 0) is proved, exhausted the call stack at 50,000 steps and now runs a million, as its ensures(true) twin does; a loop whose postcondition is checked at run time, a refined return, old and new state, a where helper and a loop that allocates on every hop do too. Preconditions, refined parameters and the decreases measure are still checked on every hop, and a self call that is not in tail position is checked when it returns. What is given up: a step inside the loop whose own instance of the postcondition fails no longer traps when the loop's answer satisfies the postcondition at the caller's arguments; a direct call at that step's arguments still does. Mutual recursion stays bounded by the call stack. Spec §6.2.2 and §11.8.3 state the rule.
A generic function's self-recursive tail call transfers (#1525): a clone's call still names the generic, and code generation, which recognised a function's own call by its name, compiled it as a plain call, so a generic counting loop exhausted the call stack at a million steps where its non-generic twin ran. One predicate now names a self tail call, resolved through the typed program, for the obligation table and code generation alike: the measure is checked at the call and the call transfers, under ensures(true) and under a postcondition.
The stack_exhausted trap's Fix paragraph says what still costs a tail call. It no longer names a postcondition or a refined return type, and it names what still compiles a call in tail position to a plain call: a guard on the call's result where it becomes a type with a Nat component, a tail call between two functions that recurse through each other under decreases, and a tail call of another function from a function with a postcondition that never calls itself in tail position. It also names a second source of the trap: the run-time guard of a decreases over a data type walks the structure at every recursive call, so the paragraph advises measuring such a loop by a Nat it carries, and offers writing the loop as one function calling itself beside keeping the recursion's depth inside the engine's call stack.
Spec §5.6.1 states what a measure costs: guarded iteration over a scalar measure runs at constant stack depth, and an ADT measure is ranked at each hop, at a cost and stack depth proportional to the structure it ranks.
Spec §11.8.4 states old and new for a function compiled as an entry and a body: the entry takes the old(State<T>) snapshot before it calls the body and reads new(State<T>) after the body returns, so old is the state when the caller called and new the state when the function returns to it.
No part of a configured inference API key reaches the Err of Inference.complete (#1854). A provider's HTTP error body is read up to 64 KiB, and the read was cut first and redacted after, so a key across the 64 KiB mark left its first part in the message (up to 39 of 40 characters). So did a credential-shaped token the host was not given (up to sk- and seven characters). Where the read stops, a proper prefix of the key and the start of such a token are now redacted too. An exception the transport raised was quoted unredacted: a key holding a line end, as one read from a file with CRLF line ends does, reached the Err whole (Invalid header value b'<key>\r\n'). Such a key is now refused before any request is built, with an Err that names the variable holding it. An exception's text is redacted and bounded like a provider's, the key as repr escapes it included. The key is matched character by character, each character in any form JSON, Python's repr or HTML may give it (\", \u0026, &), chosen for each occurrence on its own, and where the read stops, its leading characters in those forms are redacted, a cut inside a character's form included. A key the model name or the provider name holds (VERA_INFERENCE_MODEL, VERA_INFERENCE_PROVIDER) is redacted too, and so is every other provider's key the host holds, at each cut as well: each redaction removes every key the host holds, before each cut and as the Err leaves. The model name had been quoted whole in every provider message, the key refusal included, and a cut left the first part of a held key of a provider not selected.
vera verify no longer refuses a correct program for a run-time check the module was never meant to hold (#1861). The obligation table listed a check where code generation emits none, so the join with the compiled module reported E541 on a program whose every obligation was discharged. A value built in place (an array literal, set_add, map_insert, set_new()) at a refined collection type as a function's result, a block's last expression, or an if or match arm, at a return or a let, is now checked once, where the value reaches its position, so a function returning [@Int.0] as { @Array<Int> | array_length(@Array<Int>.0) > 0 } verifies and its return is checked at run time. An array literal or a join passed to a closure is checked as any closure argument is (below), and a join stored in a constructor field whose refinement is not over a scalar is disclosed (E506), as the same value stored directly is. The workaround of binding the value with a let first is no longer needed.
An argument passed to a function value is checked at the call, against the function type's refined parameter (#1861). Spec §6.7 has the compiler verify such an argument at the call site; where the solver could neither prove nor refute it, the run-time check was left to the entry of the closure that runs. For a function operand that was not a slot reference (apply_fn(if @Bool.0 then { @F.0 } else { @F.1 }, @Int.0), a match, a call's result, an index) no check stood anywhere, and vera verify refused the program (E541), including the overflow checks of a predicate such as { @Int | @Int.0 * @Int.0 * @Int.0 < 1000 }. For a slot, a closure that declares a wider parameter than its type, a fn(@Int -> @Int) bound at fn(Pos -> Int) (spec §2.8 rule 5), checks nothing at its entry, so -5 reached it with vera verify reporting a run-time check (E506) (#1885). A function value reached any way but a closure literal applied in place (a slot, a call's result, a join, an index) is now checked at the call and traps there (Refinement violation in closure argument); where the closure that runs declares the refined parameter itself, its entry checks it as well, so both run. A closure literal applied in place is checked at its own entry, as before, and the call adds nothing. Where the call checks the argument, it checks the argument's refined tuple components as well (Refinement violation in closure argument (tuple component)), and each refinement is checked as the program writes it, so a refinement over function values ({ @Array<F> | … } with F a function type) or over an alias ({ @Count | @Count.0 > 0 }) is checked where code generation would stop with an internal error, and one whose predicate names a constructor or a function ({ @Pt | match @Pt.0 { MkPt(@Int) -> @Int.0 > 0 } }) is checked too; a refinement a generic alias writes over its own type parameter ({ @Array<T> | … }), and a payload or element below the argument, are disclosed (E506). A program that passes such an argument to a function value that is no closure literal applied in place runs one more predicate check per call.
A tuple component below a value stored in a constructor field or an array element is disclosed, not claimed (#1861). Tuple(pair(x), 0) at Tuple<Tuple<Short, Int>, Int> listed the inner component's check, which the store does not make, so vera verify refused the program (E541); the component is now disclosed (E506).
set_add's element and map_insert's key are checked against a refined element type (#1861). let @Set<Pos> = set_add(set_new(), @Int.0) and let @Map<Pos, Int> = map_insert(map_new(), @Int.0, 1), with type Pos = { @Int | @Int.0 > 0 }, were refused by vera verify (E541), and vera verify --no-reconcile passed a module that stored -5; the element and the key now take the refinement's check, as an array literal's element and map_insert's value do, and trap at -5. The check binds the refinement as the program writes it, so one written over an alias (type Count = Int; type PosCount = { @Count | @Count.0 > 0 }) or a parameterised alias application (type Id<T> = T; { @Id<Int> | @Id<Int>.0 > 0 }) is checked too. As at the other stores, only a refinement over a scalar base (Int, Nat, Float64, Bool, Byte) is checked there; one over a String or a data type, and one a generic alias writes over its own type parameter (type Wrapped<T> = { @T | … }), are disclosed (E506).
An index into an array whose element type nothing fixes is refused at vera check (E164) (#1862): match [][0] { _ -> 1 }, [][0] + 1, "\([][0])", let @Array<Int> = [[][0]];, Tuple([][0], 1) at a typed binding, let @Int = identity([][0]); with identity a forall<T> function, Box([][0]) with Box a constructor of a data type with no type parameters, and @Array.0[0] over an Array written with no type argument. vera check accepted each with no diagnostic, vera verify warned that code generation skipped the function (E602), and vera run refused it (E907). An index into the result of a generic call whose type variable no argument fixes (empty(())[0]) is not refused: the variable is instantiated at the phantom type (spec §11.4.1), and the index traps where it is evaluated, as an index into any empty array does. A type reaches the index from a typed let, a function's result, a typed if branch, the argument of a function with no type parameters, and a generic constructor's argument where the constructor's type is expected (let @Option<Int> = Some([][0]);), and these check as before; an array literal's element, a Tuple component, any generic function's argument, a non-generic constructor's argument, an operand, an interpolated value and a match scrutinee type the index on their own first (spec §4.12.2). The fix names the type to write: bind the array at its type first (let @Array<Int> = [];) and index the binding, or index it where a type is expected (let @Int = [][0];). A match or a destructuring let over such an index draws E164 alone, where it drew E313; a match or a destructuring let over a value a typed hole leaves unknown (match ? + 1 { 1 -> 1 }, let Tuple<@Int, @Int> = ? + 1;, match Tuple([?][0], 1) { Tuple(1, _) -> 1 }) draws the hole's W001 alone, where it drew E313 or E311 beside it.
old() and new() naming an effect with no state (old(IO), new(Exn<Int>)) are refused at vera check (E189), as spec §7.9.2 requires (#1862). vera check accepted them, and vera verify stopped with an internal error (E699). The fix names the State cell to write as the function's row writes it (a refinement alias by its name, old(State<Positive>)), and the row entry to declare where the function has none.
Breaking: a sibling branch's or arm's type is no type a value is expected at, so the order of a join's arms never decides a verdict (spec §5.9, #1866). An if branch or a match arm whose type a call left open was checked again against its sibling's type, and the check told that type from one the context gives by comparing type objects. An index wrapped it in a new Array, so idg(match @Bool.0 { false -> @Int.0, true -> empty_ord(())[0] }) was accepted with empty_ord at the other arm's Int and refused (E613) with the arms swapped; a callee's parameter that was the shared Int object was taken for the sibling's, so take(head_ord([])) beside a Tuple<Option<Int>, Int> was refused in a branch and accepted outside one; a sibling's Nat placed a literal at Nat (E503); and a constructor's field expectation carried the sibling's type into the constructor's inference, so MkW(None, head_ord([]), None) beside a W<Int, Int> was accepted in three orders and refused in two. Each arm is now synthesized once, against the type the join's context expects, and the join completes in an arm's recorded types only the variables its constructors left open, never one a call's instantiation holds: a branch is judged as the same expression outside one, in every order. Breaking for a call that nothing but its sibling gives a type, accepted in some orders: it is refused with E613, whose fix now writes the binding as a block in the call's place, { let @Array<Int> = empty_ord(()); @Array<Int>.0 }, so no later read of a slot of that type reads it, and writes it only where each type name in it resolves where the call is. Breaking too: array_length([match @Nat.0 { 0 -> Tuple([1], []), 1 -> dup(None), _ -> Tuple([2], ["s"]) }]), with forall<T> fn dup(@Option<T> -> @Tuple<Array<T>, Array<T>>), was accepted in one arm order of three and is now refused (E302) in all three, as its literal and if forms already were: dup's two arrays are one type, which the first arm makes Array<Int>. The refusal of if @Bool.0 then { None } else { Some(3) } as the body of a forall<T> fn (@Bool -> @Option<T>) moves from E121 to E301, the code for branches of incompatible types. No example, conformance program, documentation example or benchmark solution changes verdict, and no compiled module changes.
An operation on a value of a zero-size type (Unit, a Future<Unit>, a refinement of Unit) has its meaning at run time (#1870). () == () is true and != is false, in a body, a requires, an ensures, an assert or an argument. vera check and vera verify accepted these and vera compile wrote the module, which failed to load (type mismatch) for every function in the file. show and hash of one evaluate it (show(IO.print("a")) printed unit without printing a), and a match on one takes its first arm (code generation dropped the function, E602). Operands are evaluated in order for their effects, so IO.print("a") == IO.print("b") prints ab. The verifier proves an equality of two such values at Tier 1, and refutes a claim that they differ. It had refuted a true requires(mk(1) == mk(1)) over a function returning a refinement of Unit (E501).
A prelude generic that reads its type parameter (option_unwrap_or, option_map, option_and_then, result_unwrap_or, result_map), and array_fold's accumulator, instantiated at a zero-size type is refused at vera check (E206), as a user generic is (#1870). option_unwrap_or(Some(()), ()) passed vera check and stopped vera verify with an internal error in the prelude (E699). array_fold at a Unit accumulator wrote a module that did not load.
A postcondition's reference to a zero-size result (@Unit.result) is refused at vera check (E182), as a read of a @Unit slot is (#1870). ensures(@Unit.result == ()) passed vera check and stopped vera verify with an internal error (E699). Upgrade: a postcondition about a Unit result says nothing, since the result has one value; write ensures(true).
An expression of type Never whose code did not end in an instruction that stops control (an if or a match whose arms all throw, a handle whose body and clause throw) is followed by unreachable wherever it stands (#1870). As a call argument, an array element, an index, a let value, an if condition, the right operand of &&, || or ==>, or a handler's value, it wrote a module that failed to load (type mismatch), behind a green vera check and vera verify. A Never part of a string interpolation dropped its function (E615), and so did a match on a Never scrutinee (E602); both run.
A refuted contract's counterexample lists the function's inputs, each written as the program would write it (#1871). It listed every constant the solver context had declared, the context's own among them (a call's stand-in _call_take_14_3, an array literal's _lit_7_16), a @Unit parameter as @Unit.0 = 0, and printed Counterexample: with nothing under it in a function with no parameters; each value was the solver's text of it (True, 1.600000000000000088817841970012523233890533447265625*(2**-4) for 0.1, a String with a raw newline, an array's carrier constant Array_Int!val!0). The counterexample now lists each parameter by its slot reference, and @T.result for an ensures, each value the literal the canonical formatter writes: true, 0.1, "q\"x\n", Some(7), Tuple(7, true), [4, -5]. A Float64 is the shortest decimal that reads back as the same value, and NaN and the infinities are nan(), infinity() and 0.0 - infinity(). An array longer than eight elements shows its first eight and how many more there are ([0, 1, 2, 3, 4, 5, 6, 7, ... and 2 more]); a value of more than 64 parts (each constructor, scalar and array a part, a shared subterm counted at each place it stands) shows its first 64, each later part written ..., followed by (elided past 64 parts); an input whose value has no literal form (a Map, a Set, a function) is named with its value has no literal form; a zero-size input is not listed, and with nothing to list there is no header. All ten diagnostics that carry a counterexample (E500, E501, E502, E503, E505 twice, E507, E526, E527, E528) write it through one function, and the fix a diagnostic offers is computed from the model's values rather than from the text.
A string literal holding a backslash is reasoned over as the string it is, so a false contract over one is no longer proved (#1871). The verifier handed the literal's text to Z3's StringVal, which reads \u{...} and \uXXXX as escapes, so the six characters of "\\u{41}" were modelled as "A": ensures(@Bool.result) over "\\u{41}" == "A" was proved at Tier 1, and the function trapped on that postcondition at run time. The same contract is now E500. Every solver string built from a Vera or a generated string goes through one builder, vera.literals.string_term, which hands every backslash to Z3 as itself, and a literal holding a code point Z3's string sort cannot hold (above U+2FFFF, or a lone surrogate) is still Tier 3 (#802).
A counterexample names its inputs as the function's signature does, and says so where the diagnostic's line may read a name differently (#1871). After let @Int = @Int.0 * 2;, an E503 at @Int.0 listed the parameter as @Int.0 = -1 under a caret on a slot that reads the let, -2. The block still lists the parameter by the signature's name, the scope its requires fix is written in, and where the line is in a body that binds a listed input's name again (a let, a match binder, a closure parameter), its header is Counterexample (the function's inputs, as its signature names them):; elsewhere it stays Counterexample:.
The command line is read against one table of what each command takes (vera/command_line.py), so an option is taken by exactly the commands that list it (#1872). vera check good.vera bad.vera printed OK: good.vera and exited 0 without reading bad.vera, and vera verify and vera fmt --check did the same; a command that reads a program now reads exactly one file, and a second is refused (E904) before either is read, its fix to run the command once for each file. A flag a command does not take (vera parse --json, vera fmt --json, vera check --wat, vera verify --fn f, vera lsp --json) was ignored, and an unknown one was read as the file when it came first (E900, file not found: --bogus) and ignored after it; each is refused (E901), naming the commands that take it. A flag after -- was read as the command's own (vera run f.vera -- --json printed the envelope and passed --json to the program); under vera run every token after -- is now the program's argument whatever it looks like (-1, --5, -, --json), and -- on any other command is refused (E901). A valued option with no value (vera compile f.vera -o wrote f.wasm) or with a value the command does not take (vera run --target browser, which ran under the core target) is refused (E903), and an option given twice, which took the first value, is refused whatever the two values are (E902). Each valued option has a domain, and a value outside it is refused (E903): vera test f.vera --trials 0 (or -5) printed Testing:, ran no trial and exited 0, and a count of trials is now a positive integer; --port is 0 to 65535; --fn is a function's name; and --timeout-ms and VERA_Z3_TIMEOUT_MS are at most 4294967295, past which Z3's unsigned budget wrapped silently (2**32 + 1 ms was 1 ms); the flag comes first in the budget's precedence, so VERA_Z3_TIMEOUT_MS is read and validated only when --timeout-ms is absent, where a malformed value in the environment refused vera verify --timeout-ms 1000. A valued option followed by another option has no value (E903), where vera run f.vera --fn --json looked for a function called --json (E906). The --name=value form is refused (E901) with a fix that writes it with a space, where --fn=add and --target=browser were ignored. A file whose name begins with a dash is named ./-name.vera, and the refusal of -name.vera says so. An empty operand or a directory, which were the internal-error code (E699), is E900. The options a command refuses together are E902: vera fmt --check --write, which exited 0 and only checked, vera compile --wat -o and vera compile --wat --target browser, which printed the core module's text and wrote nothing, beside vera verify --reconcile --no-reconcile as before. vera lsp lists --stdio, the flag editors pass by habit, since stdio is its one transport. vera builtins f.vera and vera version extra ignored the operand, and are refused (E904). vera <command> --help and -h, which reported file not found: --help, print the command's usage on stdout and exit 0, and vera --help and vera -h, which were E904, print the usage the same way; the usage text and each command's help are rendered from the table, which also renders a new table of the commands and their options in TOOLCHAIN.md. A command-line refusal is the --json envelope on stdout when --json stands before any --, and the diagnostic on stderr otherwise, exit 1 either way. Spec §0.5.8 now lists every command the table gives --json: vera ast, vera builtins, vera effects and vera errors beside the five it named.
Breaking: each of these exited 0 and now exits 1: a command line that names a second file; one with an option its command does not take, vera parse --json, vera fmt --json and vera serve --json among them; a token after -- on any command but vera run; vera run --target browser; a valued option with no value, or given twice; an operand to vera version, vera lsp, vera builtins, vera effects or vera errors; vera test --trials 0 and any --trials below 1; a --port outside 0 to 65535; a --timeout-ms or VERA_Z3_TIMEOUT_MS above 4294967295; a --fn that is not a function's name; the --name=value form; vera fmt --check --write, vera compile --wat -o and vera compile --wat --target browser. A command line that was E906 or E699 for these is now E903 or E900, exit 1 as before. Run a command once for each file, and drop the option, or give it to the command vera <command> --help shows takes it. vera run f.vera -- --json no longer turns on the envelope: put --json before the --.
Spec §0.5.8 states which --json output carries no ok (#1872). vera builtins, vera effects and vera errors read no program and print schema and items, and vera ast prints the program's tree, so on success the four print a listing, not a verdict, and carry no ok; their exit code is the signal, and a failure (a refused command line, or for vera ast a source that does not parse) is the envelope with ok false. Nothing any of them prints has changed: the section, which makes ok the exit signal, now says so.
The negation of an @Int is obligated and guarded like 0 - x (#1875). -@Int.0 at INT_MIN returned INT_MIN, and a contract vera verify proved over a negation failed at run time at that one input. Each negation of an @Int that is not a literal now carries an int_overflow obligation (E528), in a body, a requires, an ensures, a refinement predicate, a decreases measure, an assert, a closure and a where function, and traps with Integer overflow at INT_MIN where it is not proved. A function that negates a parameter either excludes INT_MIN with requires(@Int.0 > -9223372036854775808), which proves the obligation, or keeps a run-time check (Tier 3). A negated literal such as -9223372036854775808 and the negation of a @Nat carry none. examples/absolute_value.vera and every absolute value the documents teach gain that precondition.
Breaking: a function value whose parameter is narrower than the function type it reaches is refused at check (#1885). A fn(@Pos -> @Int) or a fn(@Nat -> @Int) closure was accepted where a fn(Int -> Int) was expected, by a let, an argument, a constructor field, an if or match join, a return, an array or tuple element, a match arm's binder (@F, or a constructor's sub-pattern), a handler's state, a generic instance chosen from another argument (array_map over an Array<Int>), or, inside a generic function, an argument or a destructured component whose function type holds the function's type variable, and nothing was recorded at the flow: the Pos closure trapped at its own entry on a value the function type admits, and the Nat closure bound -5 to its @Nat parameter with no check at all. Such a value is now refused with E190 (spec §2.8): the narrowing the checker permits for a value does not reach a function type's parameter, which holds no value to check. Two refinements of one base fit there only where they state the same predicate: whether one implies the other is the verifier's to decide, of a value, and a function type's positions hold none. So a fn(@Pos -> @Int) at fn(Big -> Int) is refused too, though Big implies Pos. Declare the closure's parameter at the type the position gives it and narrow inside (fn(@Int -> @Int) effects(pure) { let @Pos = @Int.0; ... }), or give the position the narrower type (array_map over an Array<Pos>). Where every position a type variable holds in one argument's declared type states one refinement (fn(@Pos -> @Pos) at fn(T -> T)), that argument pins nothing, and the variable is that refinement unless another argument gives it a different type (spec §4.2).
An exception that leaves an export no exception boundary wraps is named uncaught_exception under wasmtime 51 (#1894). wasmtime 51 reports it from a component call as uncaught exception propagated out of component, where 50 said thrown Wasm exception, and the WASI 0.2 host, which reads the kind from that text, reported the kind unknown. The trap registry now holds both texts, and wasmtime's UNCAUGHT_EXCEPTION trap code, which it lacked. A module compiled from Vera was not affected: every export that declares Exn<T> has a boundary that names the exception itself.
Breaking: every position that binds or passes a value at a written type holds the value to its type by subtyping, as a let does (#1896). Three positions had a judge of their own. A handler clause's parameter was compared with nothing: throw(@String) -> { @String.0 + 1 } under handle[Exn<Int>] checked, verified and added to an Int. A match binder asked whether its type and the value's were related in either direction, and skipped a function-typed scrutinee and one holding a type variable: a binder at another function type trapped indirect call type mismatch after a clean verify, @Option<Int> over an Option<T> given Some("abc") returned 4, and @Option<W> over an <IO> function's Option ran IO from a pure function. A call argument, a destructured component, an array element and a generic call's result taken at its expected type, whose pair holds a type variable, were fitted by the join, which compares an effect row inside a parameter's function type the wrong way round, so a fn(@P, @T -> @Int) closure, P pure, fitted fn(I, T -> Int) with I performing IO. Each position now reads each type variable a call left open as unknown, keeps the enclosing function's own, and asks whether the value's type is a subtype of the written one (spec §2.8, §4.9.1, §5.9, §7.5.1). A @Nat or refined binder over an Int stays a narrowing the verifier obligates (E503, refine_bind), a variable a call leaves open stays accepted (match None { Some(@Int) -> ... }), and no program in the examples, the conformance suite, the documents or the benchmark's solutions has any of the refused shapes. A function type that fits only by a narrowing is E190, as before; any other misfit is the position's own refusal:
a clause parameter at a type the operation's value does not fit is the new E342, and the slot takes the type the clause writes: write the parameter at the type the operation takes (throw(@Int) under Exn<Int>), and bind another type with a let in the clause body where it fits;
a binder at a type the value's is not a subtype of is E314: a function type with other parameters, arity, result or a narrower effect row, a concrete type over a value typed by the function's own type parameter (@Option<Int> over Option<T>, @Int over T, Tuple(@String, @Int) over Tuple<T, Int>), the type parameter over a concrete type (@T over an Int) and @Never over any other type; bind the value at the scrutinee's type;
a binder at a function type over a generic call's result whose type variable the call leaves open inside a function type (match mk(()) { Some(@II) -> apply_fn(@II.0, 3), None -> 7 }, mk returning Option<fn(X -> Int)>, II a fn(Int -> Int)) checked, verified clean and trapped indirect call type mismatch, and is E314, as is a binder over a data type whose parameter a constructor field holds inside a function type, left open the same way (Some(@Callback<Int>) over Some(mk(())), mk returning Callback<X> with data Callback<A> { MkCb(fn(A -> Int) effects(pure)) }), directly or through a field's Option, Array, Tuple or another such data type, recursive or behind an alias: the function was compiled at a type of its own, which no binder fixes. An ordinary open container stays accepted (Option<X>, or a data type's plain parameter beside a closed behaviour one). Fix the variable first, where the call is typed: type Instance = Option<fn(Int -> Int) effects(pure)>;, let @Instance = mk(());, and match @Instance.0, as E314's fix writes, under a name nothing in the program declares;
a constructor or literal pattern at a position whose type is the enclosing function's own type parameter, the scrutinee or a sub-pattern's (Some(@Int) over @A.0, Some(None) over an Option<T>, which drew E311 before) is E314: nothing says an A is an Option, and an instance at which the head matched read its field at whatever type the instance gave it (a Bool read as an Int, with every gate green); take the value at the type the pattern matches;
an argument, a component, an element or an adopted result with a parameter's effect row the wrong way round is E202 at an argument and E170 at a binding: write the closure at the position's type, with its parameters' effects.
Breaking: E542 is gone. It disclosed a match binder bound at a function type whose effect row is narrower than the value's (effect_bind, tier3_unguarded, since 0.2.7). That binder is refused at check (E314), so no program reaches the row, and the row kind and the code are deleted. A consumer that read E542 from vera verify --json reads E314 from vera check --json for the same program.
Breaking: a narrowing is no longer proved from the fact its own reader reads (#1897). A match arm that binds a component takes the component's declared refinement as a fact, read off the scrutinee's declared type. Where that type was given by a narrowing in the same function (let @Tuple<Small, Int> = @Tuple<Int, Int>.0, a constructor field, a tuple component, a store into an array, a Map or a Set, a put, an argument, a return), the fact is the narrowing's own goal, and it was asserted before the narrowing was asked: the narrowing was recorded verified, and a payload no check covers reached its reader with every gate green. A producer's own obligation is now discharged without the fact it publishes (spec §6.2.5, §2.6.4): the narrowing's own obligation is offered the facts a reader takes off the type it gives on no attempt, so a narrowing nothing else proves is refuted (E505) or left to its check. Every other obligation reads those facts where the narrowing is checked at run time (a @Nat component, a tuple component at an argument or a return), since the check runs before any reader; where no check covers it (a constructor payload, a tuple component at a let), they are withheld as a disclosed producer's are, and an obligation that held only from them is Tier 3 (E534, E532) with its own check. A refined tuple component is checked only where code generation takes the tuple apart (a function's or a closure's entry, a return, an argument applied to a function value), so at every other position (a let, a branch join, a store, a State write or get resume, a throw payload, a handle's value) its narrowing is now disclosed (E506, no check claimed, spec §2.6.5) rather than listed as checked: such a program failed vera verify with E541 and now passes with the warning. A fact also follows the value it is read from: a value carried on from a narrowing no check covers, through an array literal, a join, a call that returns its argument, a generic identity, a Stateput and get, a throw into a handler clause or a capturing closure, was read at the fresh term the solver made for it as established, and a consumer over it (a callee's requires, a @Nat binding, an ensures) was verified though its run trapped. In a function that holds a narrowing with no check, every term the solver makes for a value is now unestablished unless its lineage is known (an array literal, a built-in other than apply_fn, a call to a pure callee with no function-typed parameter, which is unestablished only where an argument is) or it is an effect operation's result, so such a consumer is Tier 3 with its own check; in such a function an obligation over an effectful or higher-order call's result can also go to Tier 3, and a get read inside a handle's body after a put of such a value is still read as established. A callee's postcondition, its refined return's predicate and the refinements inside its return type now follow its result the same way: handed a value such a narrowing typed, the callee's ensures was assumed outright and an obligation over it was verified though the callee's own check trapped, and it is now held apart as the result's type facts are, so such an obligation is Tier 3. A match on a binder of a value built in the same function (let @Chain = Link(5, Link(@Int.0 - 1, End)) matched one level down) read the inner field's fact as if the value came from elsewhere, and the field's narrowing was verified from it; that value is now read as built here, and the narrowing is refuted (E503, E505) or left to its check. A narrowing the program proves (from a requires, a branch condition or the value's own type) proves as before. No run changes.
A module whose only contact with the heap is a read of a parameter declares its memory, and loads (#1900). A function whose body matched an Option, a Result or a Tuple parameter, compared two Option parameters with ==, or called a private function that did, compiled to loads from a memory the module never declared, when nothing else in the module allocated or held a string: vera check, vera verify and vera compile passed, and the module failed at load (unknown memory 0), in vera run, in the browser bundle and for any embedder. The memory is now declared from the module's own instructions where it is assembled. Three documented examples had the shape: unwrap_or in SKILL.md, split in DE_BRUIJN.md and unwrap in spec §3.8.1.
Every module the compiler builds is validated before it is written (#1900). wasmtime.wat2wasm assembles text without validating it, so a module that does not load was written with exit 0. The core module is now validated after assembly, and the --target wasi-p2 component (both worlds) where it is built; one that does not validate is an internal compiler error (E699) naming the validator's message and, where it names one, the function, and no file is written. vera verify, which compiles the program for its reconciliation, reports the same E699.
A module path names one file in a program, and a file is one module under one path: a program that breaks either is refused, with E014 or E015 (#1904). The resolver looked an import up by its path in a cache before it looked for the importer's own file, so the first import of a path decided the file for every importer: with lib.vera and a/lib.vera both on disk, and a/mid.vera importing lib, vera run printed 22 when main.vera imported a.mid before lib and 11 when it imported lib first, where each import's own lookup (spec §8.6.1) gives 12, and vera check and vera verify were clean. And a file imported by two paths (a.lib from main.vera, lib from a/mid.vera) was read, checked and compiled twice, as two modules: two copies of each of its functions, and each data type it declares split in two, so a value built through one path was refused where the other path's type was expected (E202, "has type lib.Box, expected a.lib.Box"). Each import is now looked up from its own importing file, and spec §8.6.2 states the rule every later stage links by: a path names one file in a program, and a file is one module, under one path. An import that finds another file for a path the program has already bound is E014, naming the path, both files (as the lookups found them: a symbolic link is named as the link) and both importers, with a fix that states the rule: give one of the two modules another path, and change its imports, its own module line and the calls qualified by its old path to match; an import that reaches, by another path, a file the program already imports is E015, naming the file, both paths and both importers, with a fix that states the rule: import the file by one path everywhere, one that reaches it from both importers. A file reached by the same path through entries in two directories (two hard links) is E015 too, in either order: a module's imports are looked up from the directory of its file's one entry (a symbolic link followed), where the first import to reach the file had decided which directory that was. A refused import binds nothing, whatever module another import of the same path binds: a name its importer calls from it is E200, and a qualified call into it E230. A file the lookup finds that is gone or unreadable before it can be identified is E013 at the import. Whether two names are one file is the filesystem's answer (os.stat's device and file number, as os.path.samefile decides it), so a symbolic link, a hard link and, on a filesystem that ignores case, a spelling that differs only in case are the file they name. Whether a program is refused does not depend on the order its imports are resolved in, and a program with one conflict gets the same code in either order; in a program with more than one, the order decides which import is named first and which of the conflicts are reported (E014, E015 or both), since a refused import binds nothing and is not read, and each import a diagnostic names is a real conflict. Breaking for four shapes of program that ran, each by the cache's accident: one path naming two files is E014 (give one of the two modules another path, as the fix says); one file under two paths is E015 (import it by one path everywhere, as the fix says); one file reached by one path through hard links in two directories is E015 (import it through one of them); and an import whose own lookup finds no file is E012, where it was handed the module another import of the same path had found (write the path that reaches the module from that importer, or put the module where its lookup finds it). No example, conformance program, documentation example or vera-bench program has any of the four. The language server puts a module's diagnostics on the document's accepted import that reaches the module, never on a refused import, and on the document's first token where no import reaches it.
A cycle through two spellings of one file is E011 at the import that re-enters the file, before the file is read a second time: the resolver tracks the files in progress, not the paths (#1904).
A module that is not UTF-8 is read and reported once (E024), however many imports reach it; it was reported once per importer (#1904). E012 and E013 stay one per failing import, at each import.
A destructuring let of a user data type is translated (#1924): the linker now spells its constructor by its link name (Box$MkBox), as it spells every other constructor, so let MkBox<@Int> = MkBox(5); under ensures(@Int.result == 5) is proved where the block had no term and the postcondition was a runtime check (E522); a shape named by its type (let Box<…>), an alias of it or an imported type, reads the value's one constructor.
An element refinement whose predicate calls a function is no longer stated under the array's index quantifier (#1929): the call's result is one constant for every element, so type R = { @Int | ident(@Int.0) == @Int.0 } made every element of an Array<R> equal and vera verify proved @Array<R>.0[0] == @Array<R>.0[1], which a run refutes. A fact is stated of the elements only when it is about each element alone, at the element and at each position inside it. A goal that needs a withheld fact is not proved from it: an ensures that reads such an element, or a narrowing of one to R, is refused (E500, E505) even where every run holds it, as it was before.
Breaking: a refinement below a composite's head is obligated at every position that gives a value the type (#1542). With type Small = { @Int | @Int.0 < 10 } and mk an opaque call returning a Tuple<Int, Int>, a value given the type Tuple<Small, Int> at a destructuring let's binder (let Tuple<@Tuple<Small, Int>, @Int> = Tuple(mk(@Int.0), 1)), a match arm's or a sub-pattern's binder, an array literal's element, a map_insert key or value, or a set_add element had no row and no record: vera verify passed and the run carried 50 in the component. So did a slot bound to a construction at the unrefined type and then given the refined one (let @Option<Int> = Some(@Int.0) passed to a closure at fn(Option<Small> -> Int)). Each such position now has a row and a record, as spec §2.6.4 states of every position that gives a value a type whose components are refined: the narrowing is proved; refused with E505 and a counterexample where the solver refutes it; or, where the solver cannot decide it, reported with an E506 warning, as Tier 3 where a run-time check at the position guards the component and as a disclosure where no check can be emitted. A program whose narrowing the solver cannot decide still passes vera verify, with that warning. A program that relied on the silence and whose narrowing the solver refutes now fails vera verify with E505: give the producer the refined type, or test the component (if) before the value takes the type. At a pattern binder the one exclusion is a construction written as the binder's component itself, which is held at its own site; a join or a block of constructions there is obligated at the binder. A refined head does not answer for what is below it: with type Tagged = { @Tuple<Small, Int> | true }, a Tagged array element or Map value from that producer had its component recorded proved by the head's own check, and the component is now decided on its own row, so that program is refused (E505) as well. Not reached by this change: a @Nat below a refined alias over a composite (type Held = { @Tuple<Nat, Int> | true }) still has no row and no check at a binder or a store (#1945).
A refined or Nat value produced inside a handle is checked where the same value is checked outside one, and a get clause's resume argument is held to its cell's refinement (#1542). The obligation table listed every row below a handle's value (its body's, or a non-resuming Exn clause's) as one no run-time check guards, so Some(float_to_int(@Float64.0)) built as a State handle's value at Option<PosInt> returned a negative payload with vera verify disclosing it (E506), and a Tuple<Nat, Int> produced there returned -5 (E504). Code generation checks a construction by its own row and a closure argument at its leaves, inside a handle as outside, so those rows are now checks and the run traps. The Nat requirement was not handed into a handle at all: Some(sc(@Int.0)) built there at Option<Nat> was listed nowhere, verified clean and returned -5; it is now checked. A get clause's resume(x) at a refined cell (State<Pos>, State<{ @Set<Int> | set_size(@Set<Int>.0) > 0 }>) ran the Nat sign guard and not the refinement's predicate, so vera verify refused the program (E541), and vera run returned -5 at State<Pos> and let the empty set through at the Set cell; it now takes the predicate's check, as the initial value, put's argument and a with override do, and traps (Refinement violation in State get resume).
Breaking: a handle's value bound by a let at a tuple type whose component is refined outside the solver is refused (E541), where it was accepted with a warning (E506) (#1542). let @Tuple<Short, Int> = handle[State<Bool>](...) { ... } in { mk(@Int.0) }, with type Short = { @Int | string_length(to_string(@Int.0)) < 3 } and mk returning a Tuple<Int, Int>, gets the verdict the same value has at a let written directly: the row is listed as checked and no boundary decomposes a tuple at a let, so vera verify exits 1 where it exited 0. The same holds for an Exn handle's value at a tuple component the solver decides ({ @Int | @Int.0 < 10 }), which the verifier does not decide there. The run is unchanged. A tuple component refined outside the solver stays unchecked inside a handle as at a let: this is the part of #1542 that stays open; bind the component at its refined type with a let (let Tuple<@Int, @Int> = mk(@Int.0); let @Short = @Int.1;) and build the tuple from the slot, which is checked.