Repository navigation
Releases
v0.25.0 — Box Contract v24: init Framework Templates, tts-box dev & HTTP SSE Streaming (Pre-1.0)
Pre-1.0 Release — Slice 25 (Engine Contract v20 preserved & Box Contract v24)
Highlights
- 6-file verified web-framework scaffolding (
tts-box init <dir> --template=hono|express, #89): Scaffoldspolicy.ts,policy.test.ts,manifest.json,box/adapter.mjs,box/app/{routes,server}.ts, andREADME.mddirectly from the verifiedexamples/hono-api/andexamples/express-app/reference apps while preserving byte-identical 4-file output forbasic,webhook, andmcp. - Checked watch-reload development supervisor (
tts-box dev, #89): Watches manifest, actor.tsgraphs, and Linux box sources; runstts checkbefore initial start and every edit reload (keeping the previous live server running on errors), preserves--dbSQLite WAL state across reloads, and performs Linux boxadapter.mjs/app/**fast-sync viaaudit --offline+ atomic staging +.stamprecomputation without re-runningnpm ci(683.1 msp50 actor reload /402.1 msp50 boxapp/*.tsfast-sync). - WHATWG HTTP Server-Sent Events streaming (
sse&streamBox, #88):- Declarative actor SSE replies (
{ status, headers?, sse: [...] }) and live sandboxed box streaming relay ({ status, headers?, streamBox: { box, fn, args } }) supporting bothasync function*generators and WebResponse(ReadableStream, { headers: { "content-type": "text/event-stream" } })over bounded NDJSON pipes under Landlock + seccompnet: false. - Measured
0.849 msfirst-byte p50 (54,167 events/s) for declarative actor SSE and0.969 msfirst-byte p50 (55,750 events/s) for live sandboxed boxstreamBoxSSE (100events/stream). - Expanded read-only
GET /metricsfrom26to 28 typed Prometheus metric families (tts_box_sse_streams_active,tts_box_sse_events_total).
- Declarative actor SSE replies (
Verification & Guardrails
- Commit:
2b512ba4abe38ded99ab1fd996d3d77a14d110fe - External Conformance:
trusted-ts-checks@82386d3c3b2f35e5c8217c314ec7845a5db53097slices/25/conformance.mjs— 48 / 48 PASS (negative control onv0.24.0:45 / 48, failing only4c,6v,6w) - Architecture & Coverage:
49,002 / 50,500core token-lines (1,498headroom,tts <= 15,000,0.config/architecture.tomlcap edits,0cargo atlasviolations),91.83%workspace line coverage,deslop-please:ok(0new allowlist entries) - Invariants & Formal Proofs:
41VM opcodes (0new opcodes/builtins,0new Cargo dependencies,0.rsedits incrates/), Verus143verified, Lean 40 sorryAx, Kani18 / 18,@tsmodel6 / 6(0stale anchors) - Full benchmark & verification report: docs/benchmarks-v0.25.0.md
v0.24.0 — Slice 24: Durable Caps.kv WAL Stores & Edge-Isolated Caps.crypto (Pre-1.0)
Highlights (Pre-1.0)
Engine Contract v20 (contract/contract.md) & Box Contract v23 (contract/boxes.md) — 41 VM opcodes preserved, 0 new Builtin variants, 0 new Cargo dependencies, 0 .config/architecture.toml cap edits, and 0 crates/tts-engine/src/runtime/ edits.
- Engine Contract v20 (
#85): Added typedCaps.kvandCaps.cryptocapability operations withfrom: "kv"/from: "crypto"answer envelopes, byte-for-bytecontract/node-driver.mjsdifferential parity, compile-time exit-2 refusals on unknown/missing fields,__labelcrossing taint enforcement againstkv[].allowLabels&crypto[].allowLabels,tts simcontinuation driving,KV&Cryptocolumns intts prove --cert, andtts-prove-cache-v10. - Box Contract v23 (
#86):- Durable WAL-Backed KV (
kv[],wal_kv): Top-levelkv[](0..=64stores withmaxKeys,maxValueBytes,maxTotalBytes,allowLabels) + per-process/poolkv: [...]grants, atomic SQLitewal_kvtable (get/put/delete/list, UTF-8 byte accounting, lexicographicprefixscanning,SIGKILLpersistence,wal backup/compact/verify/replaysupport) and matching in-memoryBTreeMapfallback without--db. - Edge-Isolated Crypto (
crypto[]): Top-levelcrypto[](0..=64hmac-sha256grants withenv+ optional distinctprevEnvrotation,allowLabels) + per-process/poolcrypto: [...]grants, puresha256&ctEqual,hmacSign& constant-time non-short-circuiting dual-secrethmacVerify(hex/base64) backed bytts_kernel::crypto, with all secret env vars scrubbed fromtts run& box children and redacted fromDebug,doctor, and JSON logs. - 26-Family Prometheus
/metrics: Addedtts_box_kv_ops_total(counter),tts_box_kv_bytes(gauge), andtts_box_crypto_ops_total(counter).
- Durable WAL-Backed KV (
Verification & Benchmarks (a49781bd)
- External Conformance (
trusted-ts-checks@29ecdde9):slices/24/conformance.mjs45/45PASS (negative control onv0.23.0:42/45, exit1, failing only2m,6t,6u). - Workspace Line Coverage:
91.91%lines (91.53%functions,89.26%regions;--fail-under-lines 90gate). - Architecture & Lint:
cargo atlas48,690 / 50,500core token-lines (1,810headroom,0violations),deslop-please --allow .deslop-please.allow:ok. - Formal Proofs: Verus
143verified (0errors), Lean 40 sorryAx, Kani18/18preserved,@tsmodel6/6. - Measured Benchmarks: See
docs/benchmarks-v0.24.0.md(0.294 msp50 in-memorykv.put/2,761 req/s,0.275 msp50 dual-secretprevEnvhmacVerify,8.262 msp50synchronous=FULLSQLitewal_kvput).
v0.23.0 — Slice 23: Architecture Slimming, tts-kernel::crypto, Kani 18/18 & v0.22.0 Red-Team Hardening
Pre-1.0 Pre-Release — Slice 23: Architecture Slimming, tts-kernel::crypto, Kani 18/18 & v0.22.0 Differential/Red-Team Hardening
trusted-ts v0.23.0 is a pure hardening, formal-verification, and architecture-slimming release preserving Engine Contract v19 and Box Contract v22 unchanged (41 VM opcodes, 0 new Cargo dependencies, 0 .config/architecture.toml cap edits, 0 crates/tts-engine/src/runtime/ edits).
Highlights & Merged PRs
- Workspace-wide Architecture Slimming (
#82,#83):- Reclaimed
-2,355core token-lines (50,086 → 47,731 / 50,500,2,769headroom):tts-engine18,584 / 19,500(-902),tts-prove8,839 / 9,500(-466),tts-kernel+tts-987net even after addingcrypto.rsand 3 new Kani harnesses.
- Reclaimed
- Shared Zero-Dependency
tts_kernel::crypto(#83):- Lifted pure-Rust
sha256_pair,sha256_hex,hmac_sha256,ct_eq,encode_base64,decode_base64_strict,decode_hex_32, anddecode_base64_32intocrates/tts-kernel/src/crypto.rs(#[cfg(not(verus_keep_ghost))]), deduplicatingsrc/bin/tts-box/{listen/auth.rs, listen/http_resp.rs, pkg/install.rs}.
- Lifted pure-Rust
- Kani Formal Verification
15/15 → 18/18(#83):- Added
kani_regex_nfa_compile_bounded_and_valid,kani_crypto_sha256_hmac_ct_eq_properties, andkani_base64_strict_roundtrip, verifying18/18harnesses with zero failures.
- Added
v0.22.0Differential Fuzzing, Red-Team Suite & Doc Sync (#84):- Added
tests/slice23_v022_fuzz_and_redteam.rs(5/5passing in1.19s): 180 seeded differentialRegExp& URI/Base64 turns vscontract/node-driver.mjs, 5 exponential ReDoS patterns up toN = 120, adversarial binary HTTP (parse: "base64",bodyBase64, non-canonical padding, conflicts, CRLFSet-Cookieinjection,413), 10<source>/app/**traversal/symlink/dotfile/node_modules/limit refusals + post-install.stamptamper checks, and NIST/RFC crypto vectors. - Published
docs/benchmarks-v0.23.0.mdand alignedCLAUDE.md,README.md,SECURITY.md,docs/security-model.md, anddocs/hands-on-testing.md.
- Added
Verification Scorecard (c0c34919)
- External Conformance (
trusted-ts-checks@667a5622,slices/22/conformance.mjs):42 / 42PASS - Workspace Line Coverage (
cargo llvm-cov):91.98%lines (91.59%functions,89.40%regions; gate>= 90%) - Architecture & Structural Lint:
cargo atlas policy&stages0violations (47,731 / 50,500,2,769headroom);deslop-please --allow .deslop-please.allowok - Formal Verification: Verus
143verified (0errors) · Lean 40 sorryAx· Kani18 / 18harnesses ·@tsmodel6 / 6specs (0stale anchors)
v0.22.0 — Slice 22: Engine Contract v19 & Box Contract v22 (Popular TS Web Frameworks in tts-box)
Pre-1.0 Pre-Release — Slice 22: Engine Contract v19 & Box Contract v22 (Popular TS Web Frameworks in tts-box)
trusted-ts v0.22.0 adds zero-dependency web encoding built-ins and linear-time, ReDoS-proof RegExp to tts (Engine Contract v19) and multi-dependency boxes, local <source>/app/** TypeScript/ESM source trees, binary HTTP (parse: "base64" + bodyBase64), preserved repeated response headers (Set-Cookie), and two sandboxed web-framework reference services (examples/hono-api/ and examples/express-app/) to tts-box (Box Contract v22) — while keeping 41 VM opcodes, 0 new Cargo dependencies, 0 .config/architecture.toml cap increases, and 0 runtime/ edits.
Highlights & Merged PRs
- Engine Contract v19 (
#79):- Added 8
Builtinvariants (argc <= 2,41VM opcodes preserved):encodeURIComponent,decodeURIComponent,btoa,atob, and pure-Rust Thompson NFA / PikeVMRegExp(.test,.match,.replace,.split). - Exact ECMA-262 UTF-16 URI encoding/decoding and WHATWG Latin-1 Base64 with byte-for-byte Node 24 parity and catchable
End::Erroron invalid inputs. - Linear-time
O(|pattern| * |input|)Thompson NFA (<= 256UTF-16 code units,<= 256states) with/pattern/flagsliterals, top-level/imported & localconstregex folding,i/g/m/sflags (grefused on.test()at compile time), up to9capture groups, compile-time refusal of backtracking/unsupported features (lookarounds, backreferences, named captures, octal escapes,\p{...},new RegExp(...), escaping regex values),__labeltaint propagation, Z3 symbolic semantics, and proof cachetts-prove-cache-v9.
- Added 8
- Box Contract v22 (
#80):- Multi-dependency boxes (
1..=64lockfile-pinned deps whenadapter.mjsis present; exact-1 preserved withoutadapter.mjs), multi-spectts-box add <source> <spec1> [<spec2> ...], and<source>/app/**regular non-symlink.ts/.mts/.js/.mjs/.jsontrees (1..=64files, max depth8, max4 MiB) validated byaudit, copied byinstall, and bound into canonical.stampdigests. - Binary HTTP fidelity:
listen[].parse: "base64"/listen[].routes[].parse: "base64", actor replybodyBase64(502 Bad Gatewayon malformed or conflictingbody+bodyBase64), and preserved repeated response headers (e.g., multipleSet-Cookie). - Two sandboxed reference services (
examples/hono-api/Fetch bridge &examples/express-app/Node stream bridge) plus live Shai-Hulud compromised-middleware confinement tests (tests/slice22_frameworks_and_box_v22.rs), locally smoke-verified with real npmhono+zod(2 pkgs) andexpress(65 transitive pkgs) inside Landlock v6 + 64-bit seccomp (net: false, zero sockets).
- Multi-dependency boxes (
- Contract Sync, Architecture Budget, Benchmarks & CI (
#81,trusted-ts-checks#44-@667a5622):- Verbatim sync of
contract/contract.md(v19) andcontract/boxes.md(v22). - Unified regex NFA compiler into
crates/tts-kernel/src/regex_nfa.rskeeping every crate strictly under.config/architecture.tomlcaps (50,086 / 50,500core token-lines,414headroom). - Full reproducible benchmarks in
docs/benchmarks-v0.22.0.md.
- Verbatim sync of
Measured Benchmark Highlights (--release --locked)
| Workload | tts / tts-box v0.22.0 |
Reference / Notes |
|---|---|---|
ReDoS /^(a+)+$/ (N = 26) |
0.098 ms |
2,955.27 ms Node V8 (30,194× faster) |
ReDoS /^(a+)+$/ (N = 28) |
0.157 ms |
11,911.43 ms Node V8 (75,945× faster) |
ReDoS /^(a+)+$/ (N = 100) |
0.093 ms |
Linear O(N) PikeVM immunity |
URI & Base64 (50× ops/turn) |
0.078 ms p50 / 0.180 ms p99 |
3.5× tighter p99 than Node (0.627 ms), 100% parity |
Linear RegExp (20× ops/turn) |
0.399 ms p50 / 0.656 ms p99 |
10.2× tighter p99 than Node (6.713 ms), 100% parity |
Sandboxed Hono Fetch Bridge (net: false) |
0.395 ms p50 / 1,465.0 req/s |
200 OK + 2× Set-Cookie, zero sockets in box |
Sandboxed Express Stream Bridge (net: false) |
0.302 ms p50 / 2,429.6 req/s |
200 OK + 2× Set-Cookie, zero sockets in box |
Binary 4 KiB HTTP (base64 + bodyBase64) |
0.243 ms p50 / 3,067.2 req/s |
Exact 0x00..0xFF round-trip + 2× Set-Cookie |
Verification Scorecard (37ed1e3d)
- External Conformance (
trusted-ts-checks@667a5622,slices/22/conformance.mjs):42 / 42PASS onv0.22.0(negative control onv0.21.0:39 / 42, exit1, failing2l,6r,6s). - Workspace Line Coverage (
cargo llvm-cov):91.53%lines (91.16%functions,88.94%regions; gate>= 90%). - Architecture & Structural Lint:
cargo atlas policy&stages0violations (50,086 / 50,500core token-lines,414headroom);deslop-please --allow .deslop-please.allowok. - Formal Verification: Verus
143verified (0errors) · Lean 40 sorryAx· Kani15 / 15harnesses ·@tsmodel6 / 6specs (0stale anchors).
v0.21.0 — Box Contract v21 (Per-Route Auth & Rate-Limit Overrides, Live SIGHUP CIDR Reload, Durable schedule[] Triggers & 23-Family /metrics)
Pre-1.0 release (0.21.0) — Slice 21: Box Contract v21 & Engine Contract v18 Preserved
What's New
- Per-route
auth&rateLimitoverrides onlisten[].routes[](Box Contract v21 §5, §6.7, #72):- Optional
"auth": null | <AuthObj>and"rateLimit": null | <RateLimitObj>overrides on"http"route entries (Inherit/Disabled/Override), enabling mixed-security single-port gateways (e.g.,/webhookshmac-sha256+ global rate limit,/apidual-secretbearer+ per-IP rate limit,/publicauth: null, rateLimit: null). - Anti-enumeration: enforces listener-level
auth(401 Unauthorized) before404 {"error":"not_found"}on unmatched paths without consuming rate-limit tokens or wakingtts. - Scrubs route-level
authenv/prevEnvsecrets fromtts run's environment with redactedDebug,doctor, and JSON logs.
- Optional
- Fail-closed
SIGHUPlive reload oflisten[].allowCidrs&listen[].trustedProxiesalongside TLS (Box Contract v21 §6.7, #72):- Re-reads
<manifest>onSIGHUPacrossserve,host, andmcp(including plain HTTP/MCP/admin manifests withouttls), staging active listeners'allowCidrsandtrustedProxiestogether with anylisten[].tlsandhttp[].tlsPEM files before mutating live state. - Atomically swaps TLS configs and per-listener CIDR policies (
tts_box_reloads_total += 1,"reload"log,http_poolflush) on success; fails closed across all listeners and outbound origins on any invalid PEM/key, corrupt JSON, missing active listener, or invalid CIDR (tts_box_reload_failures_total += 1,"reload_error"log).
- Re-reads
- Manifest-declared durable recurring
schedule[]triggers & headlesstts-box serve(Box Contract v21 §5, §6.1, §6.2, §6.8, §6.9, #73):- Optional top-level
schedule(0..=64entries{"name":"<id>","to":"<process>","everyMs":50..=86400000,"startImmediately"?:bool}) delivering monotonic 1-based{"from":"schedule","name":"<name>","tick":<n>}envelopes single-flight to staticprocessestargets. - Persists
schedule:<name> -> max_tickinwal_metaatomically within SQLite WAL turn transactions so monotonictickcontinuity survivesSIGKILL, onlinelimits.compactEvery, offlinewal compact,wal backup,wal verify, andreplay. - Enables headless
tts-box serveworker daemons (listen: []+ non-emptyschedule) with gracefulSIGTERM/SIGINTdrain.
- Optional top-level
- 23-family Prometheus
/metrics(tts_box_schedule_ticks_total) &"schedule_tick"JSON logs (Box Contract v21 §7.3, #73). - Reproducible
--release --lockedbenchmarks, verbatim Box Contract v21 sync & CI gates (#74):- Synced
contract/boxes.md(Box Contract v21) verbatim fromtrusted-ts-checks(dbc81df3dfc1b48e2cfffcce3b915c0753bed9e0, Engine Contract v18 preserved). - Measured benchmarks in
docs/benchmarks-v0.21.0.md.
- Synced
Verification Summary (ddd6bd82)
- Guardrails:
41VM opcodes preserved,0new Cargo dependencies,0.config/architecture.tomlcap increases (49,854 / 50,500core token-lines,646headroom,0policy/stage violations),0edits tocrates/tts-engine/src/runtime/. - Quality & Coverage:
cargo fmt,clippy -D warnings,cargo doc -D warnings,302/302workspace & doc tests,91.07%workspace line coverage (--fail-under-lines 90). - Formal Proofs: Verus
143(0errors), Lean 40 sorryAx, Kani15/15,@tsmodel6/6(167,600states). - External Conformance (
trusted-ts-checks@dbc81df3,slices/21/conformance.mjs):- Positive (
v0.21.0--release --locked):39 / 39PASS (exit0). - Negative control (
v0.20.0--release --locked):36 / 39(exit1— fails only6o,6p,6q).
- Positive (
Pull Requests
robertguss/trusted-ts-checks#43(dbc81df3) — Box Contract v21 & 39-check Slice 21 conformancerobertguss/trusted-ts#72(06d2f579) — Per-routeauth&rateLimitoverrides + fail-closedSIGHUPCIDR reloadrobertguss/trusted-ts#73(77192fac) — Durableschedule[]triggers, headlessserve,"schedule_tick"logs & 23-family/metricsrobertguss/trusted-ts#74(ddd6bd82) — Verbatim Box Contract v21 sync,v0.21.0bump, benchmarks, CI & docs
v0.20.0 — Slice 20: Engine Contract v18 (Set<string>, Labelled Loops, Stdlib) & Box Contract v20 (Routes, Trusted Proxies, Latency Histograms)
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?)(includingexport 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_replyon JSON replies, exact JSTypeErrorseparation vsMap, crossing__labeltaint, Z3SymVal::Set(cache v8), and Verus (143verified) + Lean 4 (NanBox.leanTag.set,0 sorryAx) + Kani (15/15) proofs. - Labelled
break <label>&continue <label>: Nestedwhile,do…while,for (;;), andfor…ofloops in both synchronous functions andexport async function handleacrossawaitand interveningfinallyblocks (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), andNumber.MAX_VALUE/Number.MIN_VALUEwith0divergences vs Nodev24.20.0.
Box Contract v20 (#70)
- Path-Prefix Routing (
listen[].routes): Longest path-segment prefix dispatch on"http"listeners (/apimatches/api,/api/,/api/v1,/api?q=1, never/apiv2), per-routeparse: "text" | "json", optional top-leveltofallback, and0.063 msp50 host-edge404 {"error":"not_found"}fast-reject without waking any actor. - Spoof-Proof Reverse-Proxy Client IP Resolution (
listen[].trustedProxies): Right-to-leftX-Forwarded-Forwalk stopping at the first untrusted hop (ignored completely when TCP peer is outsidetrustedProxies), evaluated at header completion beforemaxBodyBytes(413) to feedallowCidrs(403 ip_denied) and per-IPrateLimit. - 22-Family
GET /metricswith Latency Histogram: Added zero-allocation 11-buckettts_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 (0warnings underrustfmt,clippy -D warnings,RUSTDOCFLAGS=-D warnings)cargo llvm-cov --workspace --summary-only --fail-under-lines 90: 90.84% lines / 89.73% regions / 89.31% functionscargo atlas policy&stages: 0 violations (49,360 / 50,500core token-lines,1,140headroom)- Formal proofs: Verus
143, Lean 40 sorryAx, Kani15/15,@tsmodel6/6 - External black-box conformance (
trusted-ts-checks@95213fbaf6c36a0855416f5df35718e37a6207e8,slices/20/conformance.mjs):36/36PASS onv0.20.0(33/36exit1negative control onv0.19.0) - Reproducible benchmarks:
docs/benchmarks-v0.20.0.md
v0.19.0 — Slice 19: Pre-1.0 Hardening, 90.92% Coverage, Differential Fuzzing, SIGKILL WAL Soak & 3 Reference Services
Highlights (Pre-1.0 Hardening Release)
v0.19.0 battle-tests the entire v0.10.0–v0.18.0 stack end-to-end with zero breaking contract or schema changes (Engine Contract v17, Box Contract v19, 41 VM opcodes, 0 new Cargo dependencies, and 0 .config/architecture.toml budget increases):
- Core Architecture Slimming (
49,141 → 48,076 / 50,500,-1,065core token-lines reclaimed,2,424headroom) (#66): Behavior-preserving deduplication acrosstts-engine(-331),tts-prove(-296), andtts(-438), pullingdomain.rs(1,054),loop_inv.rs(1,081), andsim/manifest_spec.rs(943) comfortably below concentration caps with zero edits tocrates/tts-engine/src/runtime/(@tsmodel6/6lock hashes preserved). - Two Real Security & Concurrency Edge-Case Fixes (#66):
- Captured outbound
tls_gensynchronously at dispatch time sohttp[].retryacross aSIGHUPTLS reload never inserts a pre-reload TLS socket into the post-reloadkeepAlivepool. - Evaluated
listen[].allowCidrsimmediately at header completion (skip_body), returning403 {"error":"ip_denied"}beforemaxBodyBytes(413) and suppressing CORS headers on error responses to CIDR-denied peers while preserving TLS HSTS.
- Captured outbound
- Differential VM Fuzzing,
SIGKILLWAL Compaction Soak & Edge Chaos (#67):- Deterministic seeded sync + async CPS differential fuzzing vs Node
v24.20.0across--fuel=200/500/1000(13,341.8–14,720.5 ops/s,0divergences) plus Z3tts provesoundness checks. - Multi-cycle
SIGKILLcrash-recovery soak under--db+snapshotEvery: 5, compactEvery: 10(1.790 msp50 durable turn,7.846 msp50 post-SIGKILLrecovery,0lost200 OKwrites,wal verify --json+replayexact parity). - Malformed HTTP/1.1 wire chaos and outbound mTLS
keepAlive+retry+circuitBreaker+SIGHUPlive cert-rotation soak.
- Deterministic seeded sync + async CPS differential fuzzing vs Node
- Workspace Line Coverage Raised to
90.92%& CI Gate Raised85% → 90%(#67, #68):cargo llvm-cov --workspace --summary-only --fail-under-lines 90passes at90.92%lines (33,918 / 37,305),89.88%regions,89.29%functions. - Three Cross-Platform (
boxes: []) Production Reference Services (#68):examples/payments-webhook/— durable HMAC-SHA256 (prevEnv) Stripe-style webhook service with asynctry/catch/finally,Mapdedupe,pcitaint sanitization, outboundkeepAlive+retry+circuitBreaker, andlimits.compactEvery.examples/tenant-mcp-hub/— multi-tenant Streamable HTTP MCP2025-03-26hub routing to on-demandtenant:*poolswith proventenant_rawcrossing taint sanitization,bearer+prevEnv,allowCidrs, and per-IPrateLimit.examples/edge-tls-gateway/— symmetric mTLS gateway (listen[].tls.clientCa+http[].tls+ liveSIGHUProtation), HSTS, CORS, W3Ctraceparent+X-Request-Id, and/readyzgracefulSIGTERMdrain.
Verification Summary
cargo test --workspace&--doc: 285/285 PASS (0 warnings underrustfmt,clippy -D warnings,RUSTDOCFLAGS=-D warnings)cargo llvm-cov --workspace --summary-only --fail-under-lines 90: 90.92% lines / 89.88% regions / 89.29% functionscargo atlas policy&stages: 0 violations (48,076 / 50,500core token-lines,2,424headroom)- Formal proofs: Verus
141(0errors), Lean 40 sorryAx, Kani14/14,@tsmodel6/6 - External black-box conformance (
trusted-ts-checks@44cecc46548fad9232d9ec30f51ba373770a4461,slices/19/conformance.mjs):33/33PASS - Reproducible hardening benchmarks:
docs/benchmarks-v0.19.0.md
trusted-ts v0.18.0 (Slice 18 — Pre-1.0)
Highlights — Slice 18 (v0.18.0, Pre-1.0)
- Engine Contract v17 (
41VM opcodes —0new):do { … } while (cond);: Full support forbreak,continue,try/catch/finally,await caps.<op>(…)inexport async function handle(12.66 µs / wf—3.71xfaster than Node 24), and Z3tts prove.- Hex (
0x), binary (0b), octal (0o) &_-separated numeric literals across expressions, top-levelconst,start, and literal types (legacy octal010andBigInt1nremain refused). - 11 compile-time
Math.*&Number.*constants:Math.{PI,E,LN2,LN10,SQRT2}andNumber.{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), andMath.clz32(x)with byte-for-byte Node 24 parity, Lean 4 stack-safety mirror (0 sorryAx), and Z3tts provesupport (tts-prove-cache-v7).
- Box Contract v19 (
0new dependencies,0architecture cap bumps):- Outbound
http[].circuitBreaker: Completes thekeepAlive+retry+circuitBreakerresilience triad. Per-origin Closed → Open → Half-Open state machine evaluated at the logical call boundary after anyretry, fast-failing open calls with{"from":"http","tag":<tag>,"error":"circuit_open"}at0.189 msp50(3,826 req/s,547.3xfaster than a 100ms degraded upstream,0upstream hits). - Bounded per-IP
listen[].rateLimit: Optionalkey: "global" | "ip"andmaxKeys: 16..=65536isolating token buckets by kernel-verified peerIpAddrwith deterministic oldest-idle eviction (+4.4 µsp50overhead,0.076 msp50/9,303.6 req/s429shedding). - Host-edge
listen[].allowCidrs: IPv4/IPv6 CIDR allowlist (1..=64entries) across"http","mcp", and"admin"listeners rejecting disallowed peers BEFORE CORS/auth/rateLimit with403 Forbidden{"error":"ip_denied"}at0.246 msp50(3,454.1 req/s,0actor turns). - 21-metric
GET /metrics: Addstts_box_http_outbound_circuit_open_total(counter),tts_box_http_outbound_circuits_open(gauge), andtts_box_http_ip_denied_total(counter), plus"circuit_open","circuit_closed", and"ip_denied"JSON log events.
- Outbound
Verification
- External black-box conformance (
trusted-ts-checks4230ef2eslices/18/conformance.mjs):- Positive control (
v0.18.0@c387deed):31/31PASS (exit 0) - Negative control (
v0.17.0@57cf21d6):28/31(exit 1) — only2i,6j,6kfail
- Positive control (
- 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(100engine +30host seeds) - Formal Proofs & Architecture: Verus (
141 verified, 0 errors), Lean 4 (0 sorryAx), Kani (14/14),@tsmodel(6/6),cargo atlas(0violations,49,141 / 50,500core token-lines,1,359headroom) - 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 conformancetrusted-ts#63(a595eaf) — PR 18.1: Engine Contract v17 + Lean 4 mirror + Z3 domaintrusted-ts#64(4c9c51b) — PR 18.2: Box Contract v19 (http[].circuitBreaker, per-IPrateLimit,allowCidrs, 21/metrics)trusted-ts#65(c387dee) — PR 18.3: Releasev0.18.0, benchmarks, contract sync, CI & docs
trusted-ts v0.17.0 (Slice 17 — Pre-1.0)
Highlights — Slice 17 (v0.17.0, Pre-1.0)
- Architecture Budget Slimming (0 cap increases): Reclaimed
1,033+token-lines acrosstts-engineandtts-provevia behavior-preserving deduplication before adding Box v18, landing at48,202 / 50,500core token-lines (-305net belowv0.16.0,2,298headroom) with.config/architecture.tomluntouched and0new Cargo dependencies. - Engine Contract v16 (
41VM opcodes —0new):try/catch/finallyacrossawaitinexport async function handle: lifts the §2.2/§2.7 restriction soawait caps.<op>(…)works insidetry,catch, andfinallyblocks (preserving active exception handlers,catchbindings, andfinallycompletion state across suspension/resumption while keepingmemory,stack,unsupported, and fuel preemption non-catchable) —70.18 µs / workflow(1.35xfaster than Node 24).- Stdlib completions:
a.fill(value, start?, end?),Object.assign(target, source),Math.pow(a, b), andMath.imul(a, b)with byte-for-byte Node 24 parity, Lean 4 stack-safety mirror (0 sorryAx), and Z3tts provesupport (tts-prove-cache-v6).
- Box Contract v18 (
0new dependencies):- Idempotent outbound
http[].retry: bounded exponential backoff (maxAttempts: 2..=5,initialBackoffMs,maxBackoffMs,retryStatuses) strictly for idempotent methods (GET/HEAD/PUT/DELETE;POST/PATCHnever retried), bounded within effective call deadline (http[].timeoutMs/limits.deadline). - Online non-blocking WAL auto-compaction (
limits.compactEvery):10..=1_000_000under--db=<file>, snapshotting idle JSON-snapshottable actors, pruning supersededwal_turnsoutside open pending workflows and olderwal_snapshots, runningPRAGMA wal_checkpoint(PASSIVE), and emitting"event":"wal_compact"JSON logs (4.12xsmaller WAL at 200 turns,5.34xsmaller &14.32xfasterwal verifyat 1,000 turns). - TLS-only edge HSTS (
listen[].hsts): emitsStrict-Transport-Security: max-age=<n>[; includeSubDomains]on every HTTPS response across"http","mcp", and"admin"listeners (refused withoutlisten[].tls). - 18-metric
GET /metrics: addstts_box_http_outbound_retries_total(counter) andtts_box_wal_compactions_total(counter).
- Idempotent outbound
Verification
- External black-box conformance (
trusted-ts-checksd96d5709slices/17/conformance.mjs):- Positive control (
v0.17.0@57cf21d6):28/28PASS (exit 0) - Negative control (
v0.16.0@4234d6e3):25/28(exit 1) — only2h,6h,6ifail
- Positive control (
- Tests & Coverage:
cargo test --workspace(261/261),cargo llvm-cov(87.60%line coverage),contract/smoke/run.mjs,contract/compare.mjs corpus(19/19),npm test(31/31) - Formal Proofs & Architecture: Verus (
141 verified, 0 errors), Lean 4 (0 sorryAx), Kani (14/14),@tsmodel(6/6),cargo atlas(0violations,48,202 / 50,500core token-lines) - Benchmarks:
docs/benchmarks-v0.17.0.md
Merged PRs
trusted-ts-checks#39(d96d570) — PR 17.0: Engine Contract v16, Box Contract v18, and Slice 17 conformancetrusted-ts#60(a6a25dd) — PR 17.1: Codebase slimming + Engine Contract v16 + Lean 4 + Z3trusted-ts#61(0e7603a) — PR 17.2: Box Contract v18 (http[].retry,limits.compactEvery,listen[].hsts, 18/metrics)trusted-ts#62(57cf21d) — PR 17.3: Releasev0.17.0, benchmarks, contract sync, CI & docs
v0.16.0 (Pre-1.0 — Slice 16: Interface Extends, Rest Destructuring, Map Iteration, Outbound Keep-Alive Pooling, Dual-Secret Auth & W3C Traceparent)
Highlights (Pre-1.0 — Engine Contract v15 & Box Contract v17)
- Engine Contract v15 (41 VM opcodes preserved, 0 new opcodes, 0 new Cargo dependencies):
interface B extends A, C: Compile-time structural flattening across local and imported.tsmodules (coveringMessageType,Caps,tts-box mcpJSON Schema, and__labeltaint brands; refusing cycles, non-interface parents, generic parents, and duplicate keys).- Array & Object Rest Destructuring: Trailing
[head, ...tail] = arrand{ a, ...rest } = objacrossconst/letandfor..ofbindings with prototype-free ES2024 key order and__labeltaint propagation. MapErgonomics:m.clear()plusfor..ofand array spread ([...m.keys()],[...m.values()],[...m.entries()]) over live insertion order while keeping standalone iterator escapes refused.- ES2023
a.with(index, value)&Math.sqrt/Math.sign: Immutable indexed replacement with negative indices & catchable out-of-rangeRangeError, plus IEEE-754-0/NaNpreserving math. - Z3 & Formal Proofs: Compact linear SMT models (
tts-prove-cache-v5), Lean 4 mirror (0 sorryAx), Verus141, Kani14/14, andtsmodel6/6.
- Box Contract v17 (0 new Cargo dependencies):
- Outbound
http[].keepAliveConnection Pooling: Per-origin persistent HTTP/1.1 TCP &rustlsTLS/mTLS connection reuse (3.65xlower p50 mTLS latency:1.775 mscold →0.487 mswarm;3.42xcustom-CA throughput at2,057 req/s), one-shot stale-socket retry on idempotent methods, and atomic pool flush onSIGHUPTLS reload. - Dual-Secret
listen[].auth.prevEnvRotation: Constant-time non-short-circuiting verification (0.001 msp50 delta betweenenvandprevEnv) on bearer & HMAC-SHA256 listeners, child env scrubbing, andtts-box doctorvalidation. - W3C
traceparent& Per-Listenerlisten[].maxBodyBytes: Strict v00traceparentvalidation,--log-format=jsonlogging, and automatic outbound{ http: … }propagation (+12 µsoverhead); per-listener413enforcement onContent-Lengthandchunkedrequests before JSON parsing or actor dispatch. - 16-Metric
GET /metrics: Addedtts_box_http_outbound_pool_reuses_total(counter) andtts_box_wal_bytes(gauge).
- Outbound
Verification Summary
- PRs: trusted-ts-checks#37, trusted-ts-checks#38, #57, #58, #59
- External Black-Box Conformance (
slices/16/conformance.mjs):25/25PASS onv0.16.0(4234d6e); negative control22/25(exit 1, failing only Slice 16 checks2g,6f,6g) onv0.15.0(f400ba4). - Tests & Coverage:
254workspace + doc tests PASS,87.40%line coverage (cargo llvm-cov),19/19corpus parity,31/31npm test,100/100engine &30/30host sim. - Formal Proofs & Architecture: Verus
141 verified, 0 errors, Lean 40 sorryAx, Kani14/14,tsmodel6/6,cargo atlas0violations (48,507 / 50,500core token-lines,0cap increases). - Benchmarks: Full reproducible
--release --lockednumbers indocs/benchmarks-v0.16.0.md.