Skip to content

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    implementationCode implementation workstoryA single reviewable unit of an epic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions