zttp
v0.18.0: TypeScript handlers proven at compile time
zts subset - compile-time proof - compiler-in-the-loop agent
v0.18.0 tightens the proof loop end to end
Install once. Edit your code. Run
zttp dev --watch --prove and watch the compile-time
proofs update on every save. Ship only code the compiler can prove
and the contract diff keeps green.
Linux and macOS builds keep the first run short and start from a binary, not a toolchain.
zttp dev --watch --prove re-runs path and
guarantee proofs on every save, then hot-swaps only on
safe / safe_with_additions.
zttp expert asks when intent is ambiguous, runs
the proof pass, reads diagnostics, and repairs until the
compiler accepts the handler.
The subset is what makes compile-time proof tractable
Your handler code is checked as the spec.
No back-edges, no exceptions, no hidden I/O. The compiler walks
every path in finite time, enforces guarantees by default
(narrow with Spec<...> when you need a chosen
few), and emits a behavioral contract small enough to diff
between versions.
TypeScript, narrowed until the compiler can prove it
Unsupported features fail at parse time with a suggested alternative, not after deploy.
Compile-time proof for paths, types, and guarantees
$ zts check handler.ts --json --contract
→ PROVEN 7/7 paths + Spec<idempotent, deterministic>
✓
Automatic least-privilege sandboxing
The compiler extracts a contract of what the handler does, then restricts runtime access to exactly those proven values.
{
"env": ["API_KEY", "DB_URL"],
"egress": ["api.stripe.com"],
"cache": ["sessions"],
"sql": ["getUserById"],
"properties": {
"read_only": true,
"retry_safe": true
},
"proof": "complete"
}
Linear code. Parallel I/O. Crash recovery.
parallel() and race() from zttp:io
Handler code stays synchronous and linear. Concurrency happens in the I/O layer using OS threads.
3 API calls × 50ms each = ~50ms total
--durable <dir> enables crash recovery
Write-ahead oplog. Each I/O call persisted before returning. On crash, replay without touching the network.
sleep() - sleepUntil() - waitSignal()
Prove before deploy
Record every I/O boundary with --trace. Replay against new versions. Handlers = pure functions of (Request, VirtualModuleResponses).
--trace / --replay
Diff behavioral contracts and replay traces between handler
versions. Verdicts are safe,
safe_with_additions, breaking, or
needs_review - with a proof certificate.
zts prove old.json new.json
Every successful deploy and proven hot-swap appends one row to
.zttp/proofs.jsonl with verdicts, proven facts,
and contract sha. Export as markdown, HTML, or an SVG verdict
badge for the PR description.
zttp proofs list | show | diff | export
Three binaries. The proof loop in your terminal, the agent inside it.
init → dev → test → expert →
deploy
zttp verify against the embedded Ed25519
key
curl -fsSL
https://raw.githubusercontent.com/srdjan/zttp/main/install.sh
| sh
Pre-built binaries for macOS and Linux (x86_64, aarch64) -
v0.18.0
Zero-overhead composition. Native speed.
guard(auth) |> guard(log) |> handler |>
guard(cors)
Desugared to a single flat function with sequential if-checks at compile time. Zero runtime overhead.
zttp:auth
JWT + webhooks
zttp:crypto
SHA/HMAC/B64
zttp:validate
JSON Schema
zttp:decode
Parse + validate
zttp:cache
KV store + TTL
zttp:sql
SQLite
zttp:io
Parallel I/O
zttp:durable
Crash recovery
zttp:compose
Guards + pipe
zttp:router
Route matching
zttp:env
Environment
zttp:http
Cookies + CORS
zttp:url
URL parsing
zttp:id
UUID/ULID/nano
zttp:log
Structured logs
zttp:text
Escape + slug
zttp:time
ISO/HTTP dates
zttp:ratelimit
Token bucket
zttp:service
Service calls
zttp:scope
Resource scopes
20 modules implemented in Zig - zero interpretation overhead.
zttp vs the general-purpose runtimes
zttp trades generality for compile-time proof, least privilege, and deployment automation.
zttp
Write handlers. Prove them at compile time. Ship them.
Opinionated subset
Parse-time rejection of footguns
Compile-time verification
Every path, every type, every boolean
Compiler-in-the-loop agent
Writes, compiles, and repairs before review
Automatic sandboxing
Least-privilege derived from analysis
Structured I/O
Linear code, parallel execution
Durable execution
Crash recovery via write-ahead oplog
Deterministic replay
Record I/O boundaries, replay anywhere
Proven evolution
Diff contracts, classify changes into four verdicts
Guarantees by default
All enforced by default; Spec<...> narrows
to a chosen few
Proof ledger
A persistent verdict timeline for every deploy
Witness corpus
Counterexamples persist; regressions are caught, not
rediscovered
Native performance
~7ms cold start - 4.8MB - ~13MB baseline