Skip to content

feat(wire): S2/#107 — §2 contract header builder (pinned order, closed sub-objects)#116

Merged
Polichinel merged 1 commit into
developmentfrom
feat/hop-b-s2-header
Jul 20, 2026
Merged

feat(wire): S2/#107 — §2 contract header builder (pinned order, closed sub-objects)#116
Polichinel merged 1 commit into
developmentfrom
feat/hop-b-s2-header

Conversation

@Polichinel

Copy link
Copy Markdown
Collaborator

Second story of epic #105.

What

unfao/wire/header.py: build_header(...) — the 13 §2 keys in the pinned contract order; CONTRACT_VERSION="1.5"; the closed provenance sub-object enforced (extra/missing keys raise, named); id_semantics and sharding constructed internally (closure inherent). No clock/id minting — everything declared by the caller (§10.2 pass-through).

AC (all met)

  • json.dumps(build_header(...), indent=2) byte-equals the fixture Track-A metadata.json.
  • Equals the fixture arrow shard's embedded header (vf_arrow.load → state['metadata']).
  • Extra provenance key raises naming the key; provenance order re-pinned regardless of input dict order.
  • Suite green: 221 passed.

Closes #107. Epic #105 · Tracking #114.

🤖 Generated with Claude Code

…venance

build_header emits the 13 §2 keys in the contract-pinned order so independently
written headers byte-match the §10 fixture (proven: byte parity with the Track-A
metadata.json AND equality with the arrow shard's embedded header). The closed
provenance sub-object rejects extra/missing keys naming them; provenance key
order is re-pinned regardless of caller dict order. Mirrors the fixture
generator without importing it — the fixture stays canonical.

Part of epic #105. Closes #107.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Polichinel
Polichinel merged commit 4681c2b into development Jul 20, 2026
4 checks passed
@Polichinel
Polichinel deleted the feat/hop-b-s2-header branch July 20, 2026 00:00
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