Skip to content

docs(wire): add wire-stability commitment + CI guard (#693 Phase 1) - #737

Merged
zackees merged 1 commit into
mainfrom
feat/693-wire-stability
Jun 14, 2026
Merged

zackees merged 1 commit into
mainfrom
feat/693-wire-stability

Conversation

@zackees

@zackees zackees commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Phase 1 of #693. Adds the social-contract document, a stdlib-only Python guard that diffs the current protobuf shape against a frozen snapshot, the baseline snapshot itself, and a small GitHub Actions job that runs the guard on every PR touching the wire.

What it protects

For every (message_or_enum, field_number) tuple that has ever shipped:

  • field number is frozen
  • field name is frozen
  • field type is frozen
  • the entry is never removed
  • enum value names + numbers are frozen

What is still freely allowed (and does not require touching the snapshot):

  • adding new fields with previously-unused numbers
  • adding new messages, enums, oneof variants
  • documentation / comment changes

Files

  • docs/WIRE_STABILITY.md — the contract: scope, frozen vs. additive rules, v1/v2 versioning posture, references (D-Bus, Docker API negotiation, sccache anti-pattern).
  • ci/check_wire_stability.py — Python stdlib parser + diff. Reads both crates/zccache/proto/zccache_v1.proto and crates/zccache/src/artifact/rust_plan_manifest.proto. Fails closed on syntax it does not model.
  • ci/wire_stability_snapshot.txt — baseline (260 fields across 53 message/enum types). Regenerate intentionally with --write-snapshot.
  • .github/workflows/wire-stability.yml — fires on PRs that touch the proto, the snapshot, the guard, or the doc. Pure Python; ~seconds, no Rust toolchain needed.

Acceptance

  • uv run python ci/check_wire_stability.py — wire stability OK: 260 fields across 53 message/enum types
  • Negative test (in-script): renaming Lookup.cache_key → CHANGED field: Lookup.1: ('cache_key', 'string') -> ('cache_key_RENAMED', 'string')
  • Negative test: removing Lookup.cache_key → REMOVED field: Lookup.1 (cache_key: string)
  • Workflow YAML validated against existing zccache workflow conventions (uses actions/checkout@v6 + astral-sh/setup-uv@v6, matches the project's other Python-tooling jobs).

What lands later

Phases 2-4 of #693 — the Hello / HelloReply handshake, daemon self-identifying its version on every connect, and the MaintenanceRequest surface — sit on top of this commitment and slot into the broker connection work already being built for #720.

Test plan

  • Run guard on current main: passes (260 fields / 53 types).
  • In-line Python harness verifies guard catches a renumber, rename, removal.
  • Workflow uses existing project actions (no new third-party deps).

Refs #693, #735

Phase 1 of #693: docs + CI groundwork that protects the
zccache protobuf wire from accidental field renumbering, renames, type
changes, and removals.

## Deliverables

- `docs/WIRE_STABILITY.md` — the social-contract: scope, what's
  frozen vs. what's allowed (additive changes), v1/v2 versioning
  posture, references.
- `ci/check_wire_stability.py` — Python-only parser that extracts
  `(message_or_enum, field_number) -> (field_name, field_type)`
  tuples from `crates/zccache/proto/zccache_v1.proto` and
  `crates/zccache/src/artifact/rust_plan_manifest.proto`, then
  diffs against the snapshot. Stdlib-only; no protoc / buf
  dependency. Fails closed on syntax it does not model.
- `ci/wire_stability_snapshot.txt` — baseline of the current wire
  (260 fields across 53 message/enum types) frozen as the canonical
  contract. Regenerate intentionally with `--write-snapshot`.
- `.github/workflows/wire-stability.yml` — runs the guard on PRs
  touching the proto files, the snapshot, the guard itself, or the
  doc. Small Python-only job (~seconds, no Rust toolchain).

## What lands later

Phases 2-4 of #693 — the `Hello`/`HelloReply` handshake, daemon
self-identifying version on every connect, and the
`MaintenanceRequest` surface — depend on this commitment being
in writing. They will plug into the broker connection path
already being built by #720.

Refs #693, #735
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant