Skip to content

test(orchestration): multi-round Phase 3 output-channel regression - #40

Merged
KodBena merged 1 commit into
mainfrom
test/multi-round-output-channel-regression
May 19, 2026
Merged

KodBena merged 1 commit into
mainfrom
test/multi-round-output-channel-regression

Conversation

@KodBena

@KodBena KodBena commented May 19, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a regression test that pins the post-v1.0.27 contract at the
adaptive_reevaluate multi-round Phase 3 path specifically.

Companion to the framework-level regression at
tests/test_orchestration_middleware.py::TestTrailingYieldAfterSpawnPrimitive::test_trailing_yield_after_parallel_reaches
(which pins the abstract trailing-yield contract via ctx.parallel).
This new test pins the adaptive_reevaluate-specific manifestation:
multi-round dispatch with max_rounds>=2 must deliver every round's
Stage 2 previews AND the Stage 3 finalization stage to the wire via
caps.send_response.

Discrimination confirmed end-to-end

Test was verified to FAIL on the actual pre-v1.0.27 substrate by
restoring middleware/orchestration.py from commit d918bf8 in a
git worktree (keeping the v1.0.27 test file + harness in place), then
running the test. Failure message:

AssertionError: Stage 3 stranding regression: expected one
authoritative per analyzed turn ([0, 1, 2, 3, 4, 5]); got []. 
Pre-v1.0.27 the drain race stranded these in ctx._output_queue 
with no future handle_response to drain them.

Passes on main (the v1.0.27 substrate).

Three assertions

  1. Exactly one is_during_search=False per analyzed turn — Stage 3
    finalization reaches the wire.
  2. Total preview count ≥ N_TURNS + sum(per-round spawn counts) —
    every round's Stage 2 previews reach, not just round 1's.
  3. Total emission count ≥ multi-round lower bound — not the
    single-round-only stranding shape.

Test plan

  • Test passes on current main substrate (486 pass, 0 fail).
  • Test fails on actual pre-v1.0.27 substrate via git worktree
    (verified manually; failure message names the stranding
    mechanism explicitly).
  • mypy --strict clean on the touched test file.
  • No production code change — test-only addition.

🤖 Generated with Claude Code

Adds TestPhase3FinalizationComposition::test_post_v1027_output_channel_regression_under_multi_round_phase3.

Pins the post-v1.0.27 contract at the adaptive_reevaluate level
specifically: under multi-round Phase 3 (max_rounds>=2), all rounds'
Stage 2 previews and the Stage 3 finalization stage reach the wire
via caps.send_response. The pre-v1.0.27 drain race stranded
trailing yields produced after the last sub-query response of any
round; the user-visible symptom was "8 rounds run on the proxy but
only ~1 round's worth of deepening data shows up in the SPA and
the query never reaps (no is_during_search=False packets per
turn)".

Discrimination confirmed end-to-end: the test PASSES on the v1.0.27
substrate and FAILS on the actual pre-v1.0.27 substrate (verified
via git worktree restored to d918bf8's middleware/orchestration.py)
with the assertion "Stage 3 stranding regression: expected one
authoritative per analyzed turn ([0, 1, 2, 3, 4, 5]); got []."

Three assertions capturing the multi-round-specific shape:

  (a) Exactly one is_during_search=False per analyzed turn (Stage 3
      reaches the wire).
  (b) Total preview count >= N_TURNS + sum(per-round spawn counts)
      (every round's Stage 2 previews reach, not just round 1's).
  (c) Total emission count >= the multi-round lower bound, not the
      single-round-only lower bound.

The framework-level regression at
tests/test_orchestration_middleware.py::TestTrailingYieldAfterSpawnPrimitive
::test_trailing_yield_after_parallel_reaches already pins the
substrate's abstract trailing-yield contract via ctx.parallel; this
test pins the adaptive_reevaluate-specific manifestation.

Suite: 486 pass, 0 fail. mypy --strict clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@KodBena
KodBena merged commit e68ac06 into main May 19, 2026
13 checks passed
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