Skip to content

v0.3.0

Latest

Choose a tag to compare

@github-actions github-actions released this 01 Dec 06:40

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, bridge now also builds _zaport.pyd / _zaport.so, a CPython extension module that converts arguments directly to the port's types and back (no JSON). str arguments 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.py falls back to the ctypes library when it cannot load (free-threaded builds, other Python implementations), ZIG_ANYTHING_BRIDGE=ctypes forces the fallback, and backend says which is in use. Both backends are verified against every recorded case. Calling levenshtein from Python now costs 0.42 µs instead of 6.7 µs (48.2 µs for the original; python bench/e2e.py).
  • bridge --targets cross-compiles the native artifacts for other platforms (all, or a list like linux-x64,darwin-arm64) into bridge/<platform>/, where index.cjs and port.py look 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 PCT fails below a percentage, --json for agents. gate --min-coverage PCT (or "min_coverage" in zig-anything.json) makes coverage part of done, and status shows the last result. MCP: zig_anything_coverage, plus targets for bridge and min_coverage for gate.
  • integrate rewrites CommonJS modules. The function's name is bound with require() of the new CommonJS binding (placed after a leading 'use strict'), and exports.f = … definitions are handled too.
  • integrate keeps async functions async. An async function (JavaScript, TypeScript) or async 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 with require(); bridge/index.mjs is its ES module entry (same exports). WebAssembly is compiled synchronously, so neither file uses top-level await. TypeScript declarations are also written as index.d.cts.
  • The binding's internal names are prefixed (zaCall, zaEncode, …), so a ported function may be named call, encode or join.
  • Bridge verification forces each backend with ZIG_ANYTHING_BRIDGE (native, wasm or ctypes), and a forced native fails loudly instead of falling back, so a native module that does not load can no longer pass as verified.
  • Through the ctypes binding, arguments of the wrong type now raise TypeError (as the native backends do) instead of ZigPortError.
  • --no-native now also applies to Python (only the ctypes library is built).

[0.2.0] - 2026-11-27

Added

  • Native Node bridge. bridge now also builds port.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=wasm forces WebAssembly; --no-native skips it). Both backends are verified against every recorded case. index.mjs also exports backend.
  • plan [path]: an ordered migration plan for a whole project. Callees come before callers, then hot code first (--hot takes profile --json output). Async, variadic and side-effecting functions are flagged, and each step gives its next command. --json for 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-run shows the rewrite. --rollback undoes it, refusing to discard later edits unless --force. status marks 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 next record).
  • record --effects: also records argument mutation and printed output, and diff/gate/bridge compare 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: record writes recording.json (options, runtime, source hash); record --check fails without writing anything if re-recording would change a case. diff --case 3,17 replays single cases.
  • setup-agent: registers the MCP server in .mcp.json (Claude Code), .cursor/mcp.json and .vscode/mcp.json, merging with existing configuration. --agents-md adds the workflow to AGENTS.md.
  • MCP: plan, fuzz and integrate tools, and the new record, diff and bridge options. Tool results are compacted (overwritten progress lines collapsed, long output cut to its head and tail) unless verbose: true. diff shows 3 mismatches and plan 10 steps by default.
  • Packages: an npm package (npx zig-anything) and PyPI wheels (pip install zig-anything) with the prebuilt binaries, built by packaging/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, cache and env fields.

Changed

  • Build caching: zig build is skipped when nothing it reads has changed, which was most of the time of diff and gate when nothing changed. --no-cache turns it off.
  • Recording runs, large recordings and large replays run in parallel processes (--jobs, "jobs").
  • When the port crashes or hangs on a case, diff reports 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.
  • diff reported JavaScript integers above 2^53 as different when they were the same double (JavaScript prints 2^56 − 8 as 72057594037927930 where the port prints 72057594037927928). 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 help now 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, plus inputs.jsonl. Runs twice to detect flaky cases. Recordings are reproducible.
  • build and diff: semantic comparison of every recorded case, crash detection, --tolerance, --strict-errors and --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.json configuration with environment overrides.
  • Examples: fuzzy-js (JavaScript, UTF-16 semantics) and levenshtein-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 with node --cpu-prof or cProfile and 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 bench end-to-end times.
  • Size-optimized release builds for Linux, macOS and Windows on x86_64 and aarch64.