Skip to content

feat(wire): S7/#112 — composed Hop-B sink + manager contract mode + e2e capstone#121

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

feat(wire): S7/#112 — composed Hop-B sink + manager contract mode + e2e capstone#121
Polichinel merged 1 commit into
developmentfrom
feat/hop-b-s7-sink

Conversation

@Polichinel

Copy link
Copy Markdown
Collaborator

The capstone story of epic #105.

What

  • unfao/wire/sink.pydeliver_run(per_target, *, lookup, staging_dir, store=None, upload_enabled=product.UPLOAD_ENABLED, ...): §6 gate first → shards (headers passed through untouched) → sidecar + delivery.parity → run manifest LAST → §4.1a fields with name="un_fao"§11.4 interlock (default ⇒ staged locally, ZERO store calls). Ragged runs refuse loud.
  • unfao/managers/unfao.py — declared contract mode (wire_contract launch key): inbound via wire.source_selection, outbound via wire.sink, coverage via the frame seam; _ContractStorePort adapts DatastoreModule (DIP). Legacy paths byte-untouched beside it.
  • tests/test_hop_b_sink_e2e.py — the epic's proof.

AC (all met — the S7 list verbatim)

(a) gate before any write: collapsed payload ⇒ DrawsCollapseError AND empty staging dir ✔
(b) upload order shards → sidecar → manifest LAST on the fake store's call log ✔
(c) §4.1a fields on every document, name="un_fao"
(d) default config ⇒ zero store calls (interlock golden test; product.UPLOAD_ENABLED is False pinned) ✔
(e) e2e byte parity: fixture Track-A in → fixture Hop-B out, byte for byte (toolchain-pinned) ✔

Local note: the 5 toolchain-pinned byte tests fail on the dev machine (pyarrow 23 there) and pass under the locked env — CI (poetry, pyarrow 16.1.0) is authoritative for them; verified green in a pinned venv (14/14).

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

🤖 Generated with Claude Code

… e2e capstone

wire/sink.deliver_run composes the epic in contract order: §6 draws gate per
target BEFORE any write → per-(target,month) shards re-embedding the producer's
own headers (nothing minted, §10.2) → sidecar built + gid-parity-checked →
run manifest staged and uploaded LAST (the §4.2 commit marker, sidecar inside
the commit) → every document under the §4.1a fields with name='un_fao' (the F1
fix) → §11.4 interlock: default config stages locally with ZERO store calls;
enabling requires the explicit wire_upload_enabled launch key, first live
enablement gated on C-161. Ragged runs (targets disagreeing on run_id, months,
or cell set) refuse loud.

Manager: thin declared contract-mode branches (configs['wire_contract'], never
inferred) in _read_forecast_data/_transform/_validate/_check_coverage/_save;
store adapted via _ContractStorePort (DIP — wire/ never sees Appwrite types);
legacy bodies unchanged beside them (WET, deletion is a later story).

e2e capstone: fixture Track-A artifacts through fetch_run + deliver_run with
fake ports → byte-identical fixture Hop-B artifacts; gate-first proven by an
empty staging dir on a collapsed payload; upload order and document fields
asserted on the fake store's call log; interlock golden test.

Part of epic #105. Closes #112.

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