On this page

0265. Harness VC rewrite: natives, syntax port, Rust VC deletion and budget

Context

ADR-0207 accepted a full VC rewrite in Harness with byte-identical object hashes and on-disk format (FMT_VERSION 1) and a no-regression budget against Rust. It left four questions to the remote plan (§7 decisions 1, 2, 4 and 5):

M14-frozen files (crates/harness/src/interp*.rs, interp/, plugins/cli/**, plugins/agent*) may not change without the maintainer's explicit OK. ADR-0176 keeps Rust as the canonical 1.0 compiler. Its consequences describe a bounded Harness implementation of a compiler phase, compared with the Rust phase on the same inputs, as the way to evaluate a phase.

Decision

Maintainer decided on 2026-11-17:

  1. Natives are new FFI trusted-tier plugins. plugins/sha256 provides the digest. plugins/vcfs provides root-handle durable file operations, stat, flock locks and uid. Neither includes plugins/cli/native headers, and no frozen file changes. Apps that use them carry ffi in their ceiling.
  2. Port the lexer, parser and formatter to Harness. A new pure-Harness library, plugins/hsyntax, ports lexer.rs, tokens.rs, the AST and ast::dump, parser.rs and fmt.rs. plugins/hvc uses it to split, join, merge headers and reformat. Its acceptance oracle is byte-identical output against the Rust formatter over the whole tracked .hn corpus and the pinned tests/fmt-version.corpus (ADR-0182) digest, on both backends. AST dump parity and diagnostic-code parity are also required. The previously recommended harness vc source Rust compiler service is not built.
    • Scope: lexer, parser and formatter only. Names, types, IR, the backends and harness fmt stay Rust.
    • Relation to ADR-0176: this is the bounded phase implementation that 0176's consequences anticipate, not a change of canonical compiler. Rust remains the bootstrap and canonical 1.0 compiler, and 0176 is not superseded. Rust fmt stays the formatting authority. Any change to Rust lexer, parser or formatter output must land in hsyntax in the same PR (the parity suite enforces this), and FMT_VERSION moves for both together.
  3. Delete Rust VC after cutover.
    • During the transition, Rust harness vc is the shipping local CLI and the live parity oracle.
    • Before cutover, a fixture-freeze step records golden object hashes, on-disk store fixtures, split/merge results and wire transcripts, all produced by Rust VC. Tests keep an oracle after it is gone.
    • Cutover switches harness vc dispatch to the launched Harness client.
    • Rust package tooling (pack, release, registry_render, deps) then stops reading through crate::vc.
    • A final PR deletes crates/harness/src/vc/*. That PR needs the maintainer's explicit yes at that time. It is a [human]-gated task and is never auto-merged.
  4. Speed budget. On every bench/vc-port/ row (C backend, best of 5, byte-identical output checked first), Harness/Rust is at most 1.05× wall time and 1.10× peak RSS, or within the measured run-to-run variation if that is larger. harness interp is held to correctness, not time. After deletion, the frozen Rust numbers and the cutover Harness numbers are the no-regression baseline.

Alternatives considered

Consequences