Skip to content

test(protocol): lifecycle wire contract v1 and Python-derived goldens (#86, 1/3) - #91

Merged
AetherAI3 merged 2 commits into
mainfrom
claude/nano86-lifecycle-wire-contract
Nov 8, 2026
Merged

AetherAI3 merged 2 commits into
mainfrom
claude/nano86-lifecycle-wire-contract

Conversation

@AetherAI3

Copy link
Copy Markdown
Owner

Summary

Publishes a versioned, language-neutral contract for the existing read-only lifecycle status call, plus golden fixtures generated by the real Python service and client, so another host language can read job state without re-creating scheduling or accounting. No endpoint, schema identity or service code changes. PR 1 of 3 for #86 (roadmap #67); PR 2 (Python parity fix) and PR 3 (TypeScript client) stack on this branch.

Key Changes

  • Frozen wire contract v1 — Pins request/MAC bytes, origin and redirect refusal, the 1 MiB cap, strict JSON, closed-envelope version policy and error mapping.
  • Closed job-state schema with invariants — Lets any client refuse inconsistent states (for example, settled usage while accounting is pending) instead of guessing.
  • Goldens from real code paths — Signing, 15 distinct histories (including confirmed zero via the real seal and predicate), service errors and 50 negatives.
  • Recorded Python gaps — Where the Python client is looser than the contract, a strict-xfail test records it rather than weakening the contract.

Verification

  • Wire-contract tests: 123 passed, 26 xfailed (strict), 0 skipped; regen.py --check byte-stable.
  • Repeated status reads leave the requests, events, links and jobs tables unchanged; only nonces are written.
  • Full suite, one file at a time on the stack head: 2686 passed, 18 skipped, 26 xfailed, 5 failed. All 5 are explained under Risk.

Risk / Follow-ups

Hashes (sha256, first 16)

CONTRACT.md 45857b87206cac34 · job-state.v1.schema.json 386fa428d167d39e · lifecycle-error.v1.schema.json 3bffff0703575773 · wire.v1.json 7020b187ec49d3fd · signing 927973afb308f67b · status-histories 8484ada41f3b1184 · errors 5b63d86f6a716e28 · negative d329b32b04ff807c · regen.py 528b97928713f78f · SHA256SUMS 450489c7ca3c15f2. Base main 27e8a5f; head 2acf815.

🤖 Generated with Claude Code

AetherAI3 and others added 2 commits November 7, 2026 18:45
Language-neutral contract for the existing read-only status surface:
request/MAC framing, origin and redirect rules, response cap, strict JSON,
closed job-state.v1 schema with cross-field invariants mirrored from
lifecycle.py, error mapping allowlists and the one-read side-effect rule.
wire.v1.json is generated from the Python constants.

Refs #86, #67

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ty tests

Generate signing vectors, status histories, error mappings and negative cases for
nano.qsearch.lifecycle-wire.v1 from the actual Python implementation
(fixtures/regen.py: LifecycleClient over a capturing transport and real
QSearchService.status_request on a temp store with an injected clock; the
confirmed-zero history uses the real hardware seal and #58 predicate). Pin all
v1 files in SHA256SUMS.

tests/test_qsearch_lifecycle_wire_contract.py checks regen --check byte
stability, SHA256SUMS, wire constants against Python, every history against the
schema and the Python client, read-only status (only nonces written), and an
independent strict reference reader for every negative. Places where
LifecycleClient is laxer than the contract (closed envelope, duplicate keys,
unsafe integers, error-body strict JSON) are xfail(strict=True).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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