Skip to content

trusted-ts v0.18.0 (Slice 18 — Pre-1.0)

Pre-release
Pre-release

Choose a tag to compare

@robertguss robertguss released this 26 Nov 17:36
· 37 commits to main since this release
c387dee

Highlights — Slice 18 (v0.18.0, Pre-1.0)

  • Engine Contract v17 (41 VM opcodes — 0 new):
    • do { … } while (cond);: Full support for break, continue, try/catch/finally, await caps.<op>(…) in export async function handle (12.66 µs / wf — 3.71x faster than Node 24), and Z3 tts prove.
    • Hex (0x), binary (0b), octal (0o) & _-separated numeric literals across expressions, top-level const, start, and literal types (legacy octal 010 and BigInt 1n remain refused).
    • 11 compile-time Math.* & Number.* constants: Math.{PI,E,LN2,LN10,SQRT2} and Number.{MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,EPSILON,POSITIVE_INFINITY,NEGATIVE_INFINITY,NaN}.
    • 4 pure stdlib builtins: Object.is(a, b), s.codePointAt(index), String.fromCodePoint(cp), and Math.clz32(x) with byte-for-byte Node 24 parity, Lean 4 stack-safety mirror (0 sorryAx), and Z3 tts prove support (tts-prove-cache-v7).
  • Box Contract v19 (0 new dependencies, 0 architecture cap bumps):
    • Outbound http[].circuitBreaker: Completes the keepAlive + retry + circuitBreaker resilience triad. Per-origin Closed → Open → Half-Open state machine evaluated at the logical call boundary after any retry, fast-failing open calls with {"from":"http","tag":<tag>,"error":"circuit_open"} at 0.189 ms p50 (3,826 req/s, 547.3x faster than a 100ms degraded upstream, 0 upstream hits).
    • Bounded per-IP listen[].rateLimit: Optional key: "global" | "ip" and maxKeys: 16..=65536 isolating token buckets by kernel-verified peer IpAddr with deterministic oldest-idle eviction (+4.4 µs p50 overhead, 0.076 ms p50 / 9,303.6 req/s 429 shedding).
    • Host-edge listen[].allowCidrs: IPv4/IPv6 CIDR allowlist (1..=64 entries) across "http", "mcp", and "admin" listeners rejecting disallowed peers BEFORE CORS/auth/rateLimit with 403 Forbidden {"error":"ip_denied"} at 0.246 ms p50 (3,454.1 req/s, 0 actor turns).
    • 21-metric GET /metrics: Adds tts_box_http_outbound_circuit_open_total (counter), tts_box_http_outbound_circuits_open (gauge), and tts_box_http_ip_denied_total (counter), plus "circuit_open", "circuit_closed", and "ip_denied" JSON log events.

Verification

  • External black-box conformance (trusted-ts-checks 4230ef2e slices/18/conformance.mjs):
    • Positive control (v0.18.0 @ c387deed): 31/31 PASS (exit 0)
    • Negative control (v0.17.0 @ 57cf21d6): 28/31 (exit 1) — only 2i, 6j, 6k fail
  • Tests & Coverage: cargo test --workspace (270/270), cargo llvm-cov (87.86% line coverage), contract/smoke/run.mjs, contract/compare.mjs corpus (19/19), npm test (31/31), sim/run.mjs (100 engine + 30 host seeds)
  • Formal Proofs & Architecture: Verus (141 verified, 0 errors), Lean 4 (0 sorryAx), Kani (14/14), @tsmodel (6/6), cargo atlas (0 violations, 49,141 / 50,500 core token-lines, 1,359 headroom)
  • Benchmarks: docs/benchmarks-v0.18.0.md

Merged PRs

  • trusted-ts-checks#40 (4230ef2) — PR 18.0: Engine Contract v17, Box Contract v19, and Slice 18 conformance
  • trusted-ts#63 (a595eaf) — PR 18.1: Engine Contract v17 + Lean 4 mirror + Z3 domain
  • trusted-ts#64 (4c9c51b) — PR 18.2: Box Contract v19 (http[].circuitBreaker, per-IP rateLimit, allowCidrs, 21 /metrics)
  • trusted-ts#65 (c387dee) — PR 18.3: Release v0.18.0, benchmarks, contract sync, CI & docs