v0.0.187
Fixed
-
Integer-overflow runtime traps now carry a precise
overflowtrap kind (#808). The #798@Int/@Natarithmetic-overflow guard trapped via a bareunreachable, so a dynamic overflow was classifiedkind="unreachable"and surfaced the generic non-exhaustive-matchFix paragraph — indistinguishable from an unrelatedunreachable. The guard now calls a newvera.overflow_traphost import (mirroringvera.contract_fail) immediately before itsunreachable; that signals an out-of-band channel_classify_trapchecks before thestr(exc)substring scan (which would otherwise match the trailingunreachablefirst), so the trap classifieskind="overflow"and carries the overflow Fix paragraph (the i64 / u64 range and therequires(...)remediation). Both runtimes provide the new import — the wasmtime host inexecute()and the browser/Noderuntime.mjs, whose dynamic import builder now bindsvera.overflow_trapso a--target browserbundle still instantiates and surfaces "Integer overflow" rather thanLinkError-ing on any arithmetic. The@Nat-subtraction underflow (#520) and@Nat→@Intwiden (#813) guards are unchanged and still classifyunreachable—tests/test_int_overflow_codegen.py::TestOverflowTrapKind808pins the newoverflowclassification (all five+/-/*sites, bothint_multrap branches, plus the lifted-closure andensures(...)-postcondition paths) and those two unchanged controls, andtests/test_browser.pypins the wasmtime↔Node parity. -
Host-import / allocation flags used only inside a
requires(...)/ensures(...)contract are now declared (#823). A builtin or allocation reachable only through a contract predicate had its host-import / memory / GC flag set too late for module assembly, so the import /(memory …)/$gc_spdeclaration was omitted and the orphanedcall/global.getfailed WAT compilation (unknown func: $vera.sin,unknown func: $vera.regex_match,unknown global: $gc_sp, …). Surfaced while wiring #808'svera.overflow_trap. Two fixes, by mechanism: (1) the per-function flag merge now runs after_compile_postconditions, covering every context-tracked family (sin/cos/powmath,json_*,html_*,map_*/set_*,decimal_*,http_*,inference_*,random_*) plus$alloc/$gc_spandvera.overflow_trap; (2) the body host-import pre-scan now also walks the contract predicates, coveringmd_*andregex_*, which are registered only by that scan (they have no per-function set-site). Both changes are purely additive — nothing between the old and new positions reads these flags (they are consumed only at module assembly). Pinned bytests/test_codegen.py::TestPostconditionHostImportPropagation823(math, allocation, regex, and Markdown builtins each in a postcondition over a scalar body).
Changed
- Documentation consistency pass (no code or behaviour change).
HISTORY.mdrestructured: the language-server stage (Stage 14) now ends at v0.0.170 and the verifier-soundness campaign is its own Stage 15; entries trimmed to one-liners with whole-sentence bold removed.- Removed the redundant defensive
nat_to_int(@Nat.0)from threespec/09-standard-library.mdreference examples —@Nat <: @Intis a first-class subtyping coercion (spec §2.2.1, "use a@Natanywhere@Intis expected — nonat_to_intcall"), so the explicit conversion was unnecessary. - Corrected stale counts and references across
vera/README.md,AGENTS.md,SKILL.md, andexamples/README.md: error-code range (E001–E702), ERROR_CODES count (123), test / conformance / example counts (5,442 / 103 / 35), the missing spec Chapter 8 row in SKILL's reference table, and theexamples/README.mdindex completed to list all 35 examples (including the interactiveread_char/inferenceones, flagged for their stdin / API-key needs). - Synced the
KNOWN_ISSUES.mdBugs table with the issue tracker'sbuglabels: added #775, labelled #766bug, and relabelled #758bug→limitation.