Skip to content

S7 — unfao/wire/sink.py + manager wiring + fixture e2e: the composed Hop-B sink (gate, order, interlock) #112

Description

@Polichinel

Part of epic #105. Depends on S3, S4, S5, S6 — the capstone.

Problem

The pieces exist after S1–S6 but nothing composes them, the §6 draws gate is still wired nowhere, and the manager has no contract mode.

Work

  • views_postprocessing/unfao/wire/sink.py: composed orchestrator, store port injected (DIP). Sequence per §4/§6/§11.4: delivery.draws.assert_draws_uncollapsed(values, header_sample_count, s_min=product.S_MIN) per target BEFORE any write → per-month shards (S3) → sidecar + delivery.parity (S4) → run manifest LAST (S5) → every upload carries §4.1a fields with name=product.CONSUMER_DOCUMENT_NAMEinterlock: product.UPLOAD_ENABLED=False default ⇒ artifacts written locally + logged, ZERO store calls; enablement only via explicit launch-config key (first live enablement gated on C-161 closure — NOT in this epic).
  • unfao/managers/unfao.py: thin declared contract-mode branch (launch-config key, e.g. "wire_contract": true — never inferred) in _read_forecast_data (→ S6 source_selection) and _save (→ sink). Legacy bodies untouched. No base-class changes.
  • tests/test_hop_b_sink_e2e.py: the epic's proof.

Acceptance criteria

(a) gate called before any write (fake-store call log); (b) upload order shards → sidecar → manifest LAST asserted; (c) §4.1a fields on every document, name="un_fao"; (d) default config ⇒ zero store calls (interlock golden test); (e) e2e: fixture Track-A artifacts in → every produced Hop-B byte equals the fixture (shard, sidecar via injected lookup, run manifest) — provenance passed through, nothing minted.

Oracle: the full tests/fixtures/wire_contract/ set + SHA256SUMS.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    implementationCode implementation workstoryA single reviewable unit of an epictestingTest/parity/validation work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions