v0.13.0 - Extension Modules, Contract Linking, Zig 0.16 Validation
Highlights
Packaged Extension Modules (zigttp-sdk)
Third-party virtual modules are now first-class. Extension authors depend on zigttp-sdk (a standalone Zig package) and declare a ModuleBinding with the zigttp-ext: prefix. Extensions get the full compile-time pipeline for free: contract extraction, type checking, flow analysis, trace/replay, and runtime sandboxing.
packages/zigttp-sdk/- SDK package with JSValue, ModuleFn, and all declarative typespackages/zigttp-ext-demo/- working demo extension (zigttp-ext:math)zts/module_binding_adapter.zig- zero-copy comptime adapter from SDK to internal typesbuild.zig.zonwithminimum_zig_versionpinned to0.16.0-dev.3073+28ae5d415
The VirtualModule enum is eliminated. All modules (built-in and extension) go through the unified ModuleBinding registry.
Cross-Handler Contract Linking
zts link system.json proves that a system of handlers communicates correctly at compile time. The linker resolves fetchSync URLs to target handler routes, checks response coverage, analyzes cross-boundary data flow, and detects failure cascades.
Zig 0.16.0-dev.3073 Validation
Pinned and validated against nightly 0.16.0-dev.3073+28ae5d415. Evented I/O networking still unimplemented upstream. Added nightly revalidation workflow to README.
zigttp:decode Module
Typed request ingress via import { decode } from "zigttp:decode". Schema-validated request parsing at the virtual module boundary.
Breaking Changes
VirtualModuleenum removed fromzts/modules/resolver.zig. Code usingVirtualModule.fromSpecifier()or iteratingstd.meta.fields(VirtualModule)must switch tobuiltin_modules.fromSpecifier()andbuiltin_modules.all.ResolveResult.virtualnow holds*const ModuleBindinginstead ofVirtualModule.- Registration functions (
registerVirtualModule, etc.) takecomptime binding: ModuleBindinginstead ofVirtualModule.
Other Changes
self_managed_ioflag onModuleBindingreplaces stringly-typed durable exclusion- SDK JSValue API tightened: NaN-boxing constants made private,
null_val/exception_valremoved - Comptime assertions for enum ordinal alignment between SDK and internal types
- Extension adapter uses zero-copy
@ptrCastfor args instead of per-element conversion - HandlerPool stress test stable on dev.3073 (5/5 runs)
- Long-header streaming test gated behind
ZTS_RUN_FLAKY_NIGHTLY_TESTS=1 - CLAUDE.md trimmed from 355 to 99 lines