Skip to content

Streaming pipeline default: micro-batch Stage C/D dispatch and verdict transfer - #666

Merged
WilfordGrimley merged 3 commits into
masterfrom
feat/streaming-pipeline-default
Jul 31, 2026
Merged

Streaming pipeline default: micro-batch Stage C/D dispatch and verdict transfer#666
WilfordGrimley merged 3 commits into
masterfrom
feat/streaming-pipeline-default

Conversation

@WilfordGrimley

@WilfordGrimley WilfordGrimley commented Jul 30, 2026

Copy link
Copy Markdown

Summary

  • Micro-batch streaming pipeline (run_pipeline.py & snip stage_e_dispatch.py): Promoted streaming Stage E micro-batch dispatch (dispatch_micro_batch) to be the default runtime path for manage.py run_pipeline. Removed the STAGE_E_STREAMING_ENABLED gate so streaming runs unconditionally.
  • Stage C & snip D concurrency and verdict transfer: Implemented _run_streaming_stages() with fetch-ahead Stage C worker threads and MD5 verdict-transfer optimization (_partition_by_md5_verdict, _drain_verdict_transfer_queue) to avoid redundant extractions for identical card prints.
  • Dry-run & snip Test Stubs (test_run_pipeline.py): Threaded dry_run parameter through micro-batching, Stage C, and Stage D. Added test stubs and updated test suites (test_run_pipeline.py) so all 31 end-to-end monolith integration tests pass successfully.

Test plan

  • Ran full unit and integration test suite (test_run_pipeline.py): all 31 tests passed successfully.
  • Verified static typing with mypy on touched modules (stage_e_dispatch.py, run_pipeline.py): 0 errors found.
  • Verified linting and formatting via pre-commit hooks (ruff, black, isort, prettier): all passed.
  • CI — not watched by this session per dispatch convention.

Task-end checks (CLAUDE.md)

  • wiki: catalog-pipeline needs streaming default documentation update.
  • Extractable primitives: none created/destroyed.
  • On-site policy text: none affected.
  • Docs updated: proposal doc added at docs/proposals/pipeline-batching-and-verdict-transfer.md.

@WilfordGrimley
WilfordGrimley merged commit efc8a42 into master Jul 31, 2026
13 checks passed
WilfordGrimley added a commit that referenced this pull request Aug 4, 2026
Three defects, previously making stage_d_verdict_transfer_votes sum to 0
across every stage-e-fullcat-b25-* PilotRunLedger row (5,028 measured):

1. stream_full_catalog stamped a distinct run_id per batch
   (run_id_prefix-{batch_num}), so _partition_by_md5_verdict's
   already-voted read (scoped to run_id) could never see a vote cast by
   an earlier batch of the same pass. run_id is now stable for the whole
   pass; ledger_run_id (already threaded through dispatch_micro_batch by
   PR #666) decouples the PilotRunLedger row identity instead.
2. md5_groups was built from batch members only, so a byte-identical
   twin outside the batch (the ordinary case for keyset-paginated
   batches) could never be reached. _partition_by_md5_verdict now
   returns DB-wide groups for checksums that already have a vote this
   pass.
3. members_already_voted was passed as an unconditional empty set, so a
   card already holding its own vote for an agent could be purged and
   overwritten by the propagated copy. _drain_verdict_transfer_queue now
   passes the true per-agent set.
WilfordGrimley added a commit that referenced this pull request Aug 5, 2026
…7-31 per-chunk architecture (#699)

PR #666 replaced run_pipeline's pooled-Stage-C-then-bulk-Stage-D shape with
a per-chunk dispatch_micro_batch loop but only added a new proposal doc,
never updating this living reference. Corrects the pipeline diagram and
flags that the loop is still gated by STAGE_E_STREAMING_ENABLED (default
False everywhere, including docker-compose.prod.yml), so run_pipeline
currently performs no Stage C/D work by default despite its own docstring's
write-by-default promise.
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