Skip to content

feat(wire): A1 — streaming per-target delivery (run-0 OOM fix) - #127

Merged
Polichinel merged 1 commit into
developmentfrom
feat/oom-a1-streaming-delivery
Jul 27, 2026
Merged

feat(wire): A1 — streaming per-target delivery (run-0 OOM fix)#127
Polichinel merged 1 commit into
developmentfrom
feat/oom-a1-streaming-delivery

Conversation

@Polichinel

Copy link
Copy Markdown
Collaborator

Part A of the run-0 OOM fix (expert review 2026-07-27; its five amendments folded in — single deliver_run signature, TargetLease value object, resolve pins file_ids, checks moved to where frames exist, staging per-run_id + upload ledger).

What

  • wire/source_selection.py: resolve_run (cheap: manifests + pinned shard file_ids; await-all-targets at resolve) + TargetLease.load() (heavy, per target: fetch-by-id → verify → declared identity → curationcoverage). fetch_run retired.
  • wire/sink.py: one signature, lease-consuming, one target resident at a time; incremental ragged-run refusal naming the disagreeing fact; per-run_id staging subdir; upload ledger lines; C-217 never-hash-manifests note.
  • managers/unfao.py: _read resolves, _validate asserts resolution (Template Method truthful), _save streams.

Memory

Forecast-leg peak at run-0 scale: ~12 GB → ~2.5 GB (one target + transients).

AC

  • Byte-parity e2e through resolve→lease→streamed sink: green under pinned toolchain (26/26 in the pyarrow-16.1 venv); CI authoritative.
  • Gate-before-any-write (empty staging on collapsed payload), upload order (manifest LAST), interlock zero-store-calls, §4.1a fields, pinned-id-only downloads, curation + coverage in lease — all tested.
  • Local full suite: only the 5 known toolchain-pinned tests + the C-46 machine-local datafactory-tag test fail locally (both environmental; CI green expected).

Refs #126 (Part A). 🤖 Generated with Claude Code

…-review amendments binding)

resolve_run replaces fetch_run: cheap resolution downloads manifests only and
PINS every shard's store file_id (fetch-by-id later — a newer run published
mid-delivery can never be mixed in). TargetLease (small value object) carries
manifest + pinned ids + declarations; lease.load() fetches, verifies
(track_a_source), checks declared identity, applies declared-region curation,
and asserts coverage — loaders return PRODUCT frames; checks live where frames
exist. sink.deliver_run keeps ONE signature, consuming leases one target at a
time: load → §6 gate → month shards → release; run-level facts checked
incrementally against the first target (ragged runs refuse loud, naming the
disagreeing fact). Staging in a per-run_id subdir; every upload ledger-logged;
docstrings pin the manifest-bytes-not-hash-stable rule (pipeline-core C-217).
Manager: _read resolves (Template Method stays truthful), _validate asserts
the resolution, _save streams; forecast coverage leaves _check_coverage (it
lives in the lease now).

Peak resident forecast data drops from all-targets (~12 GB at run-0 scale) to
one target (~2.5 GB). Byte-parity e2e green under the pinned toolchain (26/26);
gate-before-any-write, upload order, interlock, and §4.1a field tests all pass.

Refs #126 (Part A of the OOM fix). Expert review 2026-07-27.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Polichinel
Polichinel merged commit 43028a2 into development Jul 27, 2026
4 checks passed
@Polichinel
Polichinel deleted the feat/oom-a1-streaming-delivery branch July 27, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant