Skip to content

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

Closed

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_NAME → interlock: 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

Activity

  1. added
    story
    implementation
    testing
    on Jul 19, 2026
  2. added a commit that references this issue on Jul 20, 2026
  3. Polichinel commented on Jul 31, 2026

    @Polichinel
    CollaboratorAuthor

    Shipped and proven by run-0. unfao/wire/sink.py (173 lines) plus the manager wiring exist on development, with the fixture end-to-end test in place, and composed the entire first FAO global-land delivery on 2026-07-27: the no-collapse gate, the manifest-last commit ordering, and the §11.4 interlock all held; 108 shards + sidecar + manifest landed and the process exited cleanly. Closed during the development→main cleanup sweep; reopen if anything here is unfinished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    implementationstorytesting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions