feat(wire): S7/#112 — composed Hop-B sink + manager contract mode + e2e capstone#121
Merged
Conversation
… 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>
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.
The capstone story of epic #105.
What
unfao/wire/sink.py—deliver_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 withname="un_fao"→ §11.4 interlock (default ⇒ staged locally, ZERO store calls). Ragged runs refuse loud.unfao/managers/unfao.py— declared contract mode (wire_contractlaunch key): inbound viawire.source_selection, outbound viawire.sink, coverage via the frame seam;_ContractStorePortadaptsDatastoreModule(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 ⇒
DrawsCollapseErrorAND 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 Falsepinned) ✔(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