feat(wire): A1 — streaming per-target delivery (run-0 OOM fix) - #127
Merged
Conversation
…-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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 → curation → coverage).fetch_runretired.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:_readresolves,_validateasserts resolution (Template Method truthful),_savestreams.Memory
Forecast-leg peak at run-0 scale: ~12 GB → ~2.5 GB (one target + transients).
AC
Refs #126 (Part A). 🤖 Generated with Claude Code