0204. Bounded Harness VC wire protocol
- Status: Accepted (maintainer, 2026-11-17)
- Note: ADR-0242 keeps this ADR and ADR-0160 forbidding git compatibility in hvc and its wire; only the package client may run the git CLI for git sources.
- Date: 2026-11-08
- Plan: VR1–VR8, H5
- Review: Data, schemas and wire formats
Context
Local VC already owns hvc 1 objects, refs, two-stage sync and queue authority. ADR-0160 rejects all git format/protocol compatibility. HTTP v1 buffers capped messages; its curl client cannot send arbitrary binary request bodies (ADR-0181). Transferred gate/approval object strings are not remote authority.
Decision
Accepted: hvc-wire 1 with file exchange first, HTTPS later, immutable advertisement snapshots and bounded transfer leases. Reuse exact hvc objects; use typed small JSON control, raw bounded download packs, and hex upload fragments fitting the HTTP cap. No deltas, compression, permanent pack store, shallow history or git wire/object implementation.
Validate envelope hashes, every referenced kind and complete bounded closure before admission. Quarantine receives no authority indexes. Root in-flight and tracking objects for fsck/GC; promote under shared writer protection before CAS. Push changes one non-protected, non-queued branch with expected-old and durable request receipt; no force/delete/tag push. Only the local queue advances main. Serve only closure reachable from refs the authenticated actor may read.
Fetch updates tracking only; explicit sync adopts it. Reuse existing stage 1 dirty carry and stage 2 protected merge. Both-advanced (case-3) branch reconciliation is included: last-acknowledged tip, safety root and the existing merge3. Its proof records old acknowledged tip, remote tip, local parent and result; receiver verifies ancestry and recomputes the merge against supplied closure. For a resolved conflict, receiver validates expected remote tip and protected base but treats the resolution as a new authored commit, not proof of a clean merge. No hvc commit field changes; proof is session metadata bound to exact new commit.
Clone installs a protected mirror with no executable remote configuration; local queue cannot advance that mirror. A separate future authority-fork decision is needed to turn it into an independent server.
Alternatives considered
- Extend HTTP for binary uploads first — efficient, but blocks file/remotes on new HTTP effects; bounded hex is explicit v0 overhead.
- Single-writer branches, refuse all divergence — simpler viable launch default if Maintainer defers reconciliation; never silently discard local commits.
- Git protocol or pack compatibility — violates ADR-0160 and imports unrelated graph/format assumptions; not an acceptable default.
- Generic RPC/transport framework — duplicates HTTP adapters without serving an observed need; small operation schemas suffice.
Consequences
Remote plan defines byte grammar, limits, routes,
receipts and task tests. Wire version is separate from hvc format
version. Maintainer accepted this transfer surface, including
case-3 reconciliation, on 2026-11-17.