Repository navigation
v0.22.0 — Slice 22: Engine Contract v19 & Box Contract v22 (Popular TS Web Frameworks in tts-box)
Pre-release
Pre-release
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).