feat(contracts): M2 Adapter IPC v0.1 contract (JSON-over-stdio) with conformance teeth - #126
Merged
Merged
Conversation
…conformance teeth Distil the M2 Adapter IPC Spec v0.1 + Protocol Versioning & Compatibility Spec v0.1 (SourceOS Spec intake 2026-07-31) into an enforceable contract for the contract-runner <-> backend-adapter NDJSON protocol. - contracts/adapter-ipc.schema.json: draft 2020-12 schema for request/response envelopes, hello handshake, lane config (digest-pinned containers), and the canonical error-code registry. - scripts/validate-adapter-ipc.py: schema + semantic invariants (id correlation, ok/errors coupling, error-registry membership, MAJOR.MINOR protocol_version). - fixtures/protocol: 6 accept + 8 reject fixtures; wired into make validate. - docs/architecture/adapter-ipc-contract.md: home + provenance (source SHA-256, FIPS 180-4). Teeth: accept fixtures validate; each reject fixture must fire; negative control confirmed (weakening a reject fixture fails the run). make validate green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Distils the M2 Adapter IPC Spec v0.1 (JSON-over-stdio, Subprocess Plugins) and the M2 Protocol Versioning & Compatibility Spec v0.1 (SourceOS Spec intake 2026-07-31) into an enforceable contract for the contract-runner ⇄ backend-adapter NDJSON protocol. This is the canonical home per the estate's schema+validator+fixtures pattern.
Contents
contracts/adapter-ipc.schema.json— draft 2020-12 schema: request/response envelopes,hellohandshake, lane config (digest-pinned containers), canonical error-code registry.scripts/validate-adapter-ipc.py— schema + semantic invariants:idcorrelation,ok/errorscoupling (ok:false⇒non-empty,ok:true⇒empty), error-registry membership,MAJOR.MINORprotocol_version, digest-pinned containerized lanes.fixtures/protocol/*.ndjson— 6 accept fixtures (hello_ok, hello_incompatible, lock_hash_ok, task_run_ok, task_run_fail, deps_inventory_ok).fixtures/protocol/_reject/*.ndjson— 8 reject fixtures, each must fire.make validate(validate-adapter-ipc).docs/architecture/adapter-ipc-contract.md— home + provenance.Teeth
make validate-adapter-ipc→ 6 accepted, 8 rejected. Negative control confirmed locally: weakening a reject fixture (valid error code) makes the run fail. Fullmake validategreen (exit 0).Provenance
Source SHA-256 (FIPS 180-4)
59caac80044f046c4b5f37068ba70ab79c336b973f6714f12cdd91c5e7efd9f7.Deferred (not this slice)
Fixture-replay harness against a live adapter subprocess; capability-negotiation runtime (
missing_requiredfail-fast); referencepixiadapter; length-prefixed framing for streaming (MAJOR bump).