Repository navigation
Changelog
All notable changes to this project are documented here. The format follows Keep a Changelog, and the project uses Semantic Versioning.
[Unreleased]
[0.3.0] - 2026-12-01
Added
- Native CPython bridge. For Python units,
bridgenow also builds_zaport.pyd/_zaport.so, a CPython extension module that converts arguments directly to the port's types and back (no JSON).strarguments are read in place, and objects with the buffer protocol (array.array, numpy arrays,memoryview) whose element type matches a numeric slice parameter are passed without copying. A mutable slice parameter writes straight into the caller's buffer. Like the Node addon, it needs no Python headers or build tools, and works with every CPython from 3.8 on.port.pyfalls back to thectypeslibrary when it cannot load (free-threaded builds, other Python implementations),ZIG_ANYTHING_BRIDGE=ctypesforces the fallback, andbackendsays which is in use. Both backends are verified against every recorded case. Callinglevenshteinfrom Python now costs 0.42 µs instead of 6.7 µs (48.2 µs for the original;python bench/e2e.py). bridge --targetscross-compiles the native artifacts for other platforms (all, or a list likelinux-x64,darwin-arm64) intobridge/<platform>/, whereindex.cjsandport.pylook first. Linux builds target glibc 2.17. Only the current machine's build can be verified.coverage <unit>: line coverage of the original by the recorded cases, in the functions the cases reach, with the lines no case executes.--min PCTfails below a percentage,--jsonfor agents.gate --min-coverage PCT(or"min_coverage"inzig-anything.json) makes coverage part of done, andstatusshows the last result. MCP:zig_anything_coverage, plustargetsforbridgeandmin_coverageforgate.integraterewrites CommonJS modules. The function's name is bound withrequire()of the new CommonJS binding (placed after a leading'use strict'), andexports.f = …definitions are handled too.integratekeeps async functions async. Anasync function(JavaScript, TypeScript) orasync def(Python) is bound to an async wrapper around the port, so callers still get a promise or a coroutine.- The Python recorder awaits coroutines, so async Python functions can be recorded, benchmarked and verified like async JavaScript ones.
Changed
- The JavaScript binding is now
bridge/index.cjs, loadable withrequire();bridge/index.mjsis its ES module entry (same exports). WebAssembly is compiled synchronously, so neither file uses top-level await. TypeScript declarations are also written asindex.d.cts. - The binding's internal names are prefixed (
zaCall,zaEncode, …), so a ported function may be namedcall,encodeorjoin. - Bridge verification forces each backend with
ZIG_ANYTHING_BRIDGE(native,wasmorctypes), and a forcednativefails loudly instead of falling back, so a native module that does not load can no longer pass as verified. - Through the
ctypesbinding, arguments of the wrong type now raiseTypeError(as the native backends do) instead ofZigPortError. --no-nativenow also applies to Python (only thectypeslibrary is built).
[0.2.0] - 2026-11-27
Added
- Native Node bridge.
bridgenow also buildsport.node, a Node-API addon that converts arguments directly to the port's types and back (no JSON). TypedArrays whose element type matches a numeric slice parameter are passed without copying. It needs no Node headers or build tools, and falls back to the WebAssembly build when it cannot load (ZIG_ANYTHING_BRIDGE=wasmforces WebAssembly;--no-nativeskips it). Both backends are verified against every recorded case.index.mjsalso exportsbackend. plan [path]: an ordered migration plan for a whole project. Callees come before callers, then hot code first (--hottakesprofile --jsonoutput). Async, variadic and side-effecting functions are flagged, and each step gives its next command.--jsonfor agents.integrate <unit> [-- test command]: rewires the original source so callers run the port, after verifying the bridge. It then replays every recorded case through the rewritten file and runs the project's tests, and restores the original byte for byte if anything fails.--dry-runshows the rewrite.--rollbackundoes it, refusing to discard later edits unless--force.statusmarks integrated units.fuzz <unit>: coverage-guided input discovery. Mutates recorded inputs and keeps those that reach new code in the original (inputs.fuzz.jsonl, used by the nextrecord).record --effects: also records argument mutation and printed output, anddiff/gate/bridgecompare them.record --sandbox: blocks file writes, subprocesses and network access by the original while recording (Node's permission model; a Python audit hook). A guard against accidents, not a security boundary.- Reproducible recordings:
recordwritesrecording.json(options, runtime, source hash);record --checkfails without writing anything if re-recording would change a case.diff --case 3,17replays single cases. setup-agent: registers the MCP server in.mcp.json(Claude Code),.cursor/mcp.jsonand.vscode/mcp.json, merging with existing configuration.--agents-mdadds the workflow toAGENTS.md.- MCP:
plan,fuzzandintegratetools, and the newrecord,diffandbridgeoptions. Tool results are compacted (overwritten progress lines collapsed, long output cut to its head and tail) unlessverbose: true.diffshows 3 mismatches andplan10 steps by default. - Packages: an npm package (
npx zig-anything) and PyPI wheels (pip install zig-anything) with the prebuilt binaries, built bypackaging/build.py. Releases publish them when registry tokens are configured. bench/e2e.py: reproducible end-to-end timing against an earlier release (--baseline v0.1.1), plus per-call bridge cost.- Configuration:
sandbox,effects,jobs,cacheandenvfields.
Changed
- Build caching:
zig buildis skipped when nothing it reads has changed, which was most of the time ofdiffandgatewhen nothing changed.--no-cacheturns it off. - Recording runs, large recordings and large replays run in parallel processes (
--jobs,"jobs"). - When the port crashes or hangs on a case,
diffreports that case and continues with the rest instead of marking every later case "not run". - Languages are adapters (
src/adapters/); commands no longer branch on the language. - CI covers Linux, macOS and Windows on both x86_64 and arm64, the oldest supported Node (22) and Python (3.9), and builds and installs the npm package and a wheel.
- Release binaries are larger (about 0.75–1.1 MB) because of the new commands and the embedded Node-API runtime.
Fixed
- Bridge verification of a recording with side effects replayed without them, so it reported mismatches.
- Through the bridges, in-place changes the port makes to array arguments were lost. They are now copied back into the caller's arrays (lists in Python), as they would be in the original.
diffreported JavaScript integers above 2^53 as different when they were the same double (JavaScript prints 2^56 − 8 as72057594037927930where the port prints72057594037927928). Python integers are still compared exactly.- Output redirected to a file opened for appending (
zig-anything ... >> log) overwrote the start of the file. - Global flags after
--(for example in a test command) were taken as zig-anything's own.
[0.1.1] - 2026-11-21
Fixed
zig-anything helpnow describes whole-program support in its first line.
[0.1.0] - 2026-11-21
First release.
Added
scan: function discovery for JavaScript, TypeScript and Python, with type inference from annotations, defaults, body usage and names.init: port-unit scaffolding (manifest, Zig stub, generic comptime harness, build file).record: edge-case, semantic-trap and seeded random input generation, plusinputs.jsonl. Runs twice to detect flaky cases. Recordings are reproducible.buildanddiff: semantic comparison of every recorded case, crash detection,--tolerance,--strict-errorsand--json.bench: calibrated per-call and end-to-end timing of the original against the port, with a verdict.gate: the definition of done for a port, with an optional performance requirement.status: overview of all units, including stale-diff detection.mcp: Model Context Protocol server exposing all commands as tools.zig-anything.jsonconfiguration with environment overrides.- Examples:
fuzzy-js(JavaScript, UTF-16 semantics) andlevenshtein-py(Python, code points). bridge: call a finished port from the original code (WebAssembly for Node, a native library via ctypes for Python), with batch calls and verification against the recorded cases.- Program units (
init-cli): record and port whole command-line programs in any language, compared on stdout, stderr and exit code. profile: rank a script's functions by time withnode --cpu-proforcProfileand mark the portable ones.- Builds refresh each unit's generated runtime, so upgrading zig-anything upgrades existing units.
- Fixed: on Windows every child process started a hidden console host (~9 ms each), which inflated
benchend-to-end times. - Size-optimized release builds for Linux, macOS and Windows on x86_64 and aarch64.