Skip to content

S6 — unfao/wire/source_selection.py: contract-mode Hop-A inbound (manifest selection, await-all-targets) #111

Closed

Description

@Polichinel

Part of epic #105. Depends on S1.

Problem

The manager's inbound is legacy-only (LEGACY_FORECAST_FILTERS at unfao.py:121). The contract inbound — resolve the newest manifested run by contract type, wait for ALL configured targets (§4.2a), verify + assemble via track_a_source — does not exist. And track_a_source.frames_for_target discards headers, which the sink needs (provenance pass-through, §10.2 determinism).

Work

  • Extend unfao/track_a_source.py: frames_for_target returns (frame, headers) — smallest surface, one existing reader to update.
  • views_postprocessing/unfao/wire/source_selection.py: store passed as a port (any object with the get_latest_file_id/get_file_metadata/download surface — DIP, fake-able); selection filters pinned from pipeline-core's shipped publisher constants (type="sampled_forecast_manifest" etc., golden-string tested; re-verify their values at build); newest run wins; refuses loud when any configured product.TARGETS manifest is absent (await-all-targets); identity verified vs the launch declaration (reuse delivery/identity.assert_forecast_identity).

Acceptance criteria

  • Dict-backed fake store serving the fixture Hop-A manifest + .tap.zip: returns per-target (frame, headers); assembled frame equals the existing test_track_a_source result.
  • Missing configured target → loud refusal naming the target.
  • No real store/network anywhere in tests.

Tests: tests/test_wire_source_selection.py (+ test_track_a_source.py update). Oracle: fixture Hop-A artifacts via fake store.

🤖 Generated with Claude Code

Activity

  1. added
    story
    implementation
    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/source_selection.py (157 lines) exists on development, is covered by the wire test suite, and resolved the producer run in the first FAO global-land delivery on 2026-07-27 — manifest selection and await-all-targets both exercised (3 of 3 targets resolved, 36 months each). It also carries the streaming resolve_run/TargetLease split that removed the run-0 OOM. 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

    implementationstory

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions