Skip to content

v0.20.0 — Slice 20: Engine Contract v18 (Set<string>, Labelled Loops, Stdlib) & Box Contract v20 (Routes, Trusted Proxies, Latency Histograms)

Pre-release
Pre-release

Choose a tag to compare

@robertguss robertguss released this 27 Nov 02:40
· 31 commits to main since this release
fc9c925

Highlights (Pre-1.0 Release)

v0.20.0 delivers Engine Contract v18 and Box Contract v20 while preserving all standing guardrails (41 VM opcodes, 0 new Cargo dependencies, 0 .config/architecture.toml cap increases, >= 90% coverage, and 6/6 @tsmodel specs):

Engine Contract v18 (#69)

  • Prototype-Free Insertion-Ordered Set<string> (Tag::Set): new Set(iterable?) (including export const start), s.add(v), s.has(v), s.delete(v), s.clear(), s.size, for…of / [...s] / .values() / .keys() / .entries(), state persistence across turns, bad_reply on JSON replies, exact JS TypeError separation vs Map, crossing __label taint, Z3 SymVal::Set (cache v8), and Verus (143 verified) + Lean 4 (NanBox.lean Tag.set, 0 sorryAx) + Kani (15/15) proofs.
  • Labelled break <label> & continue <label>: Nested while, do…while, for (;;), and for…of loops in both synchronous functions and export async function handle across await and intervening finally blocks (refusing labels on non-loop statements).
  • ES2023/ES2024 Stdlib & Constants: a.toSpliced(start, deleteCount?, item?), a.splice(start, deleteCount?, item?), s.isWellFormed(), s.toWellFormed(), Math.fround(x), and Number.MAX_VALUE / Number.MIN_VALUE with 0 divergences vs Node v24.20.0.

Box Contract v20 (#70)

  • Path-Prefix Routing (listen[].routes): Longest path-segment prefix dispatch on "http" listeners (/api matches /api, /api/, /api/v1, /api?q=1, never /apiv2), per-route parse: "text" | "json", optional top-level to fallback, and 0.063 ms p50 host-edge 404 {"error":"not_found"} fast-reject without waking any actor.
  • Spoof-Proof Reverse-Proxy Client IP Resolution (listen[].trustedProxies): Right-to-left X-Forwarded-For walk stopping at the first untrusted hop (ignored completely when TCP peer is outside trustedProxies), evaluated at header completion before maxBodyBytes (413) to feed allowCidrs (403 ip_denied) and per-IP rateLimit.
  • 22-Family GET /metrics with Latency Histogram: Added zero-allocation 11-bucket tts_box_http_request_duration_seconds (0.005..5 + +Inf, _sum, _count) across "http", "mcp", and "admin" listeners.

Verification Summary

  • cargo test --workspace & --doc: 294/294 PASS (0 warnings under rustfmt, clippy -D warnings, RUSTDOCFLAGS=-D warnings)
  • cargo llvm-cov --workspace --summary-only --fail-under-lines 90: 90.84% lines / 89.73% regions / 89.31% functions
  • cargo atlas policy & stages: 0 violations (49,360 / 50,500 core token-lines, 1,140 headroom)
  • Formal proofs: Verus 143, Lean 4 0 sorryAx, Kani 15/15, @tsmodel 6/6
  • External black-box conformance (trusted-ts-checks @ 95213fbaf6c36a0855416f5df35718e37a6207e8, slices/20/conformance.mjs): 36/36 PASS on v0.20.0 (33/36 exit 1 negative control on v0.19.0)
  • Reproducible benchmarks: docs/benchmarks-v0.20.0.md