Qualify pack admission ordering and stabilize failed-step replay fixture

Merged
SI
5d ago
+353-4

The scheduler's claim-failure fixture released its paused peer when the claim was logged, before the workflow necessarily observed rejection. That could admit another asset and fail the two-provider assertion. The driver now waits for a completed replay delivery that loaded the correlated failed-step event and for active deliveries to drain. It then checks two provider events, the failed claim at attempt one, the next asset still pending, and no settlement before releasing the peer. The actual scheduler, steps, retry settings and final assertions are unchanged.

The fixture-only observer covers the installed SDK's preloaded run_started events and paginated events.list fallback within a separate async context per delivery. The receipt retains run/event/correlation IDs, event source and successful delivery status. Negative tests reject unrelated/incomplete/outside-delivery evidence, failed handlers and cross-delivery event mixing.

Two additional tests exercise the actual dispatcher and strict foundation admission helper with mocked start/database boundaries: execution before the returned run ID fails closed, successful persistence admits the same run, lost persistence leaves dispatch uncertain, and modeled running approval does not start a second run. ADMISSION.md records the remaining contract. These tests qualify the ordering gap; they do not implement an admission wait or establish SQL atomicity. The original failed CI evidence is retained privately.

Validation: 55 focused tests passed; 14 fixture oracle/lifecycle tests and all four compiled scheduler restart/replay scenarios passed with zero network attempts and one settlement each. Scoped pack types, full lint and changed-file formatting passed. Independent source review passed; exact-head CI tracked separately.

Production remains sequential and the foundation factory unwired. No provider, real SQL/storage, authentication, hosted-workflow or manual deployment actions. No new lease, cap, retry, hold or funding policy. Advances existing app #2268/#2273 without closing them. Root owns merge.


Summary by cubic

Qualifies the pack admission ordering gap and stabilizes the scheduler claim-failure fixture so it no longer admits a second provider before rejection is observed.

Fixture barrier

  • The driver now holds the paused peer until a successful completed delivery loads the correlated failed-step event and all deliveries are idle, then asserts two providers, attempt one, and asset-3 still pending.
  • Adds an event observer covering both the SDK's preloaded run_started batch and paginated events.list fallback, with negative tests for unrelated, incomplete, or cross-delivery evidence.

Admission qualification

  • Adds tests exercising the actual dispatcher and strict foundation admission helper: early reads fail closed, successful persistence admits the same run, lost persistence leaves dispatch uncertain, and repeated approval does not re-dispatch a running job.
  • Records the remaining wait/continuation contract in ADMISSION.md; no production behavior changes.