Skip to content

fix(storyboard-runner): branch-set any_of peers must not cascade-skip each other - #2306

Merged
bokelley merged 2 commits into
adcontextprotocol:mainfrom
fgranata:fix/branch-set-stateful-peer-cascade
Jun 30, 2026
Merged

bokelley merged 2 commits into
adcontextprotocol:mainfrom
fgranata:fix/branch-set-stateful-peer-cascade

Conversation

@fgranata

Copy link
Copy Markdown
Contributor

Problem

In a branch-set phase group (branch_set: { semantics: any_of }), the peers are
mutually-exclusive alternatives — a conformant agent satisfies exactly one,
and the schema tolerates the non-taken peer(s) failing. applyBranchSetGrading
already re-grades a failed peer as peer_branch_taken once a sibling contributes.

But when the peer steps are stateful: true, the stateful cascade defeats
this. A phase's default cascade dependency is "all prior phases"
(effectiveDependsOn = phase.depends_on ?? prior), so a peer implicitly depends
on its earlier-declared sibling peers. When the earlier peer fails (by design —
it's the branch the agent didn't take), it records a stateful-cascade trip, and
cascadeForPhase cascade-skips the later peer with prerequisite_failed
before it runs
. A skipped step can't pass the contribution gate
(!result.skipped && result.passed && step.contributes_to), so the any_of flag
is never contributed and the assert_contribution gate returns [] — even
though the agent behaved conformantly.

Concrete failure: media_buy_seller/refine_finalize_exclusivity

Its multi_finalize_handled branch set has two stateful peers, declared in this
order: multi_finalize_atomic_path (atomic-success) then
multi_finalize_unsupported_path (MULTI_FINALIZE_UNSUPPORTED / INVALID_REQUEST).
A seller that does not support atomic multi-finalize necessarily fails the
first peer and can only satisfy the second — but today the second is
cascade-skipped, so the gate fails:

get_products_multi_finalize_atomic        FAILED   (expected — branch not taken)
get_products_multi_finalize_unsupported   SKIPPED  prerequisite_failed
                                                    "Skipped: prior stateful step failed."
assert_multi_finalize                      FAILED   any_of -> []

Fix

Branch-set peers are alternatives, not a stateful dependency chain. Exclude
same-branch-set peers from a phase's stateful-cascade dependencies in
cascadeForPhase. branchSetsByPhaseId (already computed via resolveBranchSets
for the post-loop re-grade) is hoisted above the phase loop so the cascade can
consult it; within-phase and cross-phase (non-peer) cascade behavior are
unchanged. After the fix the passing peer runs and contributes, the failing peer
is re-graded peer_branch_taken (moot), and the gate passes.

Tests

  • New regression test in test/lib/storyboard-branch-set-grading.test.js
    (two stateful any_of peers, failing one declared first). Every pre-existing
    branch-set test used non-stateful peers — which is why this slipped through.
  • The full test/lib/storyboard-*.test.js suite stays green.

Fixes the refine_finalize contribution-drop half of #2305 (the
stale_response_advisory null-verdict half is separate). Full localization,
reproduction transcript, and diff in
#2305 (comment).

… each other

Branch-set peers (`branch_set: { semantics: any_of }`) are mutually-exclusive
alternatives — a conformant agent satisfies exactly one, and the schema
tolerates the non-taken peer(s) failing. `applyBranchSetGrading` already
re-grades a failed peer as `peer_branch_taken` once a sibling contributes.

But when peer steps are `stateful: true`, the stateful cascade defeats this. A
phase's default cascade dependency is "all prior phases", so a peer implicitly
depends on its earlier-declared sibling peers. When the earlier peer fails (by
design — the branch the agent didn't take), it records a stateful-cascade trip,
and the later peer is cascade-skipped with `prerequisite_failed` before it runs.
A skipped step can't pass the contribution gate, so the `any_of` flag is never
contributed and the gate fails — even though the agent behaved conformantly.

Concrete failure: media_buy_seller/refine_finalize_exclusivity. Its
`multi_finalize_handled` branch set has two stateful peers — atomic-success
(declared first) and MULTI_FINALIZE_UNSUPPORTED (declared second). A seller that
does not support atomic multi-finalize necessarily fails the first peer and can
only satisfy the second; today the second is cascade-skipped and the gate fails.

Fix: exclude same-branch-set peers from a phase's stateful-cascade dependencies
in `cascadeForPhase`. `branchSetsByPhaseId` (already computed for the post-loop
re-grade) is hoisted above the phase loop so the cascade can consult it.
Within-phase and cross-phase (non-peer) cascade behavior are unchanged.

Adds a regression test covering two stateful any_of peers with the failing one
declared first (every pre-existing branch-set test used non-stateful peers).

Refs adcontextprotocol#2305.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@aao-ipr-bot

aao-ipr-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

⚠️ Argus review could not complete

The automated review encountered an issue (possibly reached max turns, timed out, or failed to post the final gh pr review). A human reviewer should take this PR.

View workflow run

This is an automated message from the Argus AI review workflow.

@bokelley

Copy link
Copy Markdown
Contributor

Verified this independently: checked out the branch in a worktree, reverted just the cascadeForPhase exclusion, confirmed the build still succeeds, then ran test/lib/storyboard-branch-set-grading.test.js both ways. Without the fix, the new regression test fails with passing peer must not be cascade-skipped by its failing sibling peer; with it, all tests pass. Root-cause diagnosis and fix are correct — any_of branch-set peers are mutually-exclusive alternatives and shouldn't be treated as depends_on chain members of each other.

One blocker and one optional hardening note:

  • Missing changeset. This PR only touches runner.ts + the test file — no .changeset/*.md. Per this repo's CLAUDE.md, every src/lib/ change needs one before merge (npm run changeset), independent of CI status.
  • Forward-compat nit (non-blocking). BranchSetSpec.semantics is typed as string to allow future values like all_of/one_of (where peers legitimately should cascade on each other), but the new exclusion in cascadeForPhase matches on branch_set.id alone, not semantics. Harmless today since all_of is rejected at load time, but worth a && branchSetsByPhaseId.get(phase.id)?.semantics === 'any_of' guard (or a TODO) so it doesn't silently misfire if non-any_of semantics ship later.

(The automated Argus review above failed to complete, so treat this as a substitute pass.)


Verification by Claude Code triage agent. Session: https://claude.ai/code/session_0114L7fgcHsFmN38Ee4bAYti


Generated by Claude Code

@bokelley

Copy link
Copy Markdown
Contributor

Following up on the verification above: agreed on the blocker, but this session can't push a fixup commit here — the PR head (fgranata/adcp-client:fix/branch-set-stateful-peer-cascade) is a fork outside this triage session's repo scope (limited to adcontextprotocol/adcp-client).

@fgranata — could you add the missing changeset and push it to your branch?

npm run changeset
# patch, since this only fixes grading behavior for an existing storyboard feature
# summary: "Fix stateful any_of branch-set peers cascade-skipping each other in the storyboard runner"
git add .changeset/*.md && git commit -m "chore: add changeset" && git push

The forward-compat semantics === 'any_of' guard is explicitly non-blocking per the note above — fine to leave as a follow-up or a // TODO if you'd rather not scope-creep this PR.


Triaged by Claude Code. Session: https://claude.ai/code/${CLAUDE_CODE_REMOTE_SESSION_ID}


Generated by Claude Code

Addresses review on adcontextprotocol#2306:
- Add the required `.changeset/*.md` (patch bump for @adcp/sdk).
- Guard the `cascadeForPhase` branch-set-peer exclusion on
  `semantics === 'any_of'`. `BranchSetSpec.semantics` is typed `string` to
  leave room for future semantics (e.g. all_of/one_of) where peers legitimately
  depend on each other and must keep cascading; matching on branch_set.id alone
  would silently misfire if those ship. all_of is rejected at load today, so
  this is forward-compat hardening — no behavior change for any_of.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@fgranata

Copy link
Copy Markdown
Contributor Author

Thanks for the independent verification — both addressed in the latest push (f0a2d7b):

  • Changeset added — .changeset/branch-set-stateful-peer-cascade.md (patch bump for @adcp/sdk).
  • Forward-compat guard added — the cascadeForPhase exclusion now keys on semantics === 'any_of', not branch_set.id alone, so peers under future non-any_of semantics (all_of/one_of) keep cascading. No behavior change for any_of today; reproduction + the full storyboard-branch-set-grading / cascade-skip / contributes-shorthand suites stay green.

@aao-ipr-bot

aao-ipr-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

⚠️ Argus review could not complete

The automated review encountered an issue (possibly reached max turns, timed out, or failed to post the final gh pr review). A human reviewer should take this PR.

View workflow run

This is an automated message from the Argus AI review workflow.

@bokelley

Copy link
Copy Markdown
Contributor

Verified f0a2d7b against both points from the prior review:

  • Changeset: .changeset/branch-set-stateful-peer-cascade.md — patch for @adcp/sdk, summary accurately describes the fix.
  • Forward-compat guard: the cascadeForPhase exclusion now keys on ownSpec?.semantics === 'any_of' rather than branch_set.id alone, so non-any_of semantics keep cascading if/when they ship. No behavior change for any_of today.

CI is green (check, code_review, GitGuardian) and the new regression test passes. No outstanding blockers from this side — ready for @bokelley's final pass and merge.


Verified by Claude Code triage agent. Session: https://claude.ai/code/session_01Xh3fGdgoTTrD5HYYTDjyP3


Generated by Claude Code

@bokelley bokelley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the diff and reran the targeted branch-set/cascade tests locally after rebuilding dist:

@adcp/[email protected] build:lib
npm run sync-version && npm run schemas:ensure && tsx scripts/generate-wire-spec-fields.ts && tsc --project tsconfig.lib.json && tsx scripts/copy-schemas-to-dist.ts && tsx scripts/copy-v2-projection-catalog.ts && tsx scripts/generate-per-tool-types.ts

@adcp/[email protected] sync-version
tsx scripts/sync-version.ts

🔄 Syncing version with AdCP specification...
📋 Current state:
📦 Library version: 9.3.0
🏷️ Current AdCP version: 3.1.0
🎯 Target AdCP version: 3.1.0 (from ADCP_VERSION file)
✅ Already in sync with AdCP v3.1.0
✅ Version file is up to date: /Users/brianokelley/conductor/adcp-client-1/.conductor/milan-v22/src/lib/version.ts

@adcp/[email protected] schemas:ensure
tsx scripts/schemas-ensure.ts

[generate-wire-spec-fields] up to date: src/lib/server/wire-spec-fields.generated.ts
[copy-schemas-to-dist] copied /Users/brianokelley/conductor/adcp-client-1/.conductor/milan-v22/schemas/cache/3.0.12 → /Users/brianokelley/conductor/adcp-client-1/.conductor/milan-v22/dist/lib/schemas-data/3.0 (key collapsed from 3.0.12)
[copy-schemas-to-dist] copied /Users/brianokelley/conductor/adcp-client-1/.conductor/milan-v22/schemas/cache/3.1.0 → /Users/brianokelley/conductor/adcp-client-1/.conductor/milan-v22/dist/lib/schemas-data/3.1 (key collapsed from 3.1.0)
[copy-schemas-to-dist] copied /Users/brianokelley/conductor/adcp-client-1/.conductor/milan-v22/schemas/cache/v2.5 → /Users/brianokelley/conductor/adcp-client-1/.conductor/milan-v22/dist/lib/schemas-data/v2.5
[copy-v2-projection-catalog] copied /Users/brianokelley/conductor/adcp-client-1/.conductor/milan-v22/test/lib/v2-projection-fixtures/aao-reference-formats.json → /Users/brianokelley/conductor/adcp-client-1/.conductor/milan-v22/dist/lib/v2/projection/aao-reference-formats.json
[per-tool-types] reading .d.ts sources...
[per-tool-types] parsed 896 exports total
[per-tool-types] discovered 53 tools
[per-tool-types] emitted 53/53 slices
[per-tool-types] slice symbol counts (sample): activate_signal=23, build_creative=94, calibrate_content=19, check_governance=18, comply_test_controller=342...
[per-tool-types] wrote per-tool-index.json (53 entries)
[per-tool-types] OUT_DIR now contains 67 per-tool slices and TAP version 13

Subtest: branch_set any_of: peer_branch_taken grading

# Subtest: re-grades non-contributing peer failures as skipped with the schema-mandated detail string
ok 1 - re-grades non-contributing peer failures as skipped with the schema-mandated detail string
  ---
  duration_ms: 86.585
  type: 'test'
  ...
# Subtest: leaves failures as failed when NO peer contributes (assert_contribution must be the single failure signal)
ok 2 - leaves failures as failed when NO peer contributes (assert_contribution must be the single failure signal)
  ---
  duration_ms: 39.011041
  type: 'test'
  ...
# Subtest: wires through the parseStoryboard shorthand — `contributes: true` resolves and grades the same way
ok 3 - wires through the parseStoryboard shorthand — `contributes: true` resolves and grades the same way
  ---
  duration_ms: 30.226041
  type: 'test'
  ...
# Subtest: normalizes programmatic `contributes: true` storyboards before recording contributions
ok 4 - normalizes programmatic `contributes: true` storyboards before recording contributions
  ---
  duration_ms: 3.400792
  type: 'test'
  ...
# Subtest: threads contributions through stateless step-by-step runs for assert_contribution
ok 5 - threads contributions through stateless step-by-step runs for assert_contribution
  ---
  duration_ms: 2.748041
  type: 'test'
  ...
# Subtest: implicit detection: storyboard without branch_set declarations still re-grades peers
ok 6 - implicit detection: storyboard without branch_set declarations still re-grades peers
  ---
  duration_ms: 14.621334
  type: 'test'
  ...
# Subtest: three-peer branch set: one contributes, two fail — both moot peers cite the same contributor
ok 7 - three-peer branch set: one contributes, two fail — both moot peers cite the same contributor
  ---
  duration_ms: 15.013292
  type: 'test'
  ...
# Subtest: multiple branch sets in one storyboard do not bleed flags across each other
ok 8 - multiple branch sets in one storyboard do not bleed flags across each other
  ---
  duration_ms: 8.8275
  type: 'test'
  ...
# Subtest: runStoryboard rejects programmatic storyboards that violate branch_set invariants
ok 9 - runStoryboard rejects programmatic storyboards that violate branch_set invariants
  ---
  duration_ms: 1.948375
  type: 'test'
  ...
# Subtest: contributes_if that evaluates false suppresses contribution and leaves peer failures raw
ok 10 - contributes_if that evaluates false suppresses contribution and leaves peer failures raw
  ---
  duration_ms: 16.382542
  type: 'test'
  ...
# Subtest: stateful branch-set peers do not cascade-skip each other — the passing peer contributes even when a sibling peer failed first
ok 11 - stateful branch-set peers do not cascade-skip each other — the passing peer contributes even when a sibling peer failed first
  ---
  duration_ms: 7.670042
  type: 'test'
  ...
1..11

ok 1 - branch_set any_of: peer_branch_taken grading

duration_ms: 228.294291
type: 'suite'
...

Subtest: runStoryboard cascade-skip matrix (skip_reason × peer_shape × phase_topology)

# Subtest: [missing_tool × sole_stateful × same_phase] missing_tool on prior stateful step cascades to subsequent stateful step in same phase
ok 1 - [missing_tool × sole_stateful × same_phase] missing_tool on prior stateful step cascades to subsequent stateful step in same phase
  ---
  duration_ms: 35.008792
  type: 'test'
  ...
# Subtest: [missing_tool × sole_stateful × downstream_phase] sole stateful step missing_tool → no cascade (adcp-client-python\#550)
ok 2 - [missing_tool × sole_stateful × downstream_phase] sole stateful step missing_tool → no cascade (adcp-client-python\#550)
  ---
  duration_ms: 56.463
  type: 'test'
  ...
# Subtest: [missing_tool × peer_fails × downstream_phase] cross-phase cascade when both stateful peers miss with no rescue
ok 3 - [missing_tool × peer_fails × downstream_phase] cross-phase cascade when both stateful peers miss with no rescue
  ---
  duration_ms: 25.588875
  type: 'test'
  ...
# Subtest: [missing_tool × peer_substitute_declared × downstream_phase] missing_tool + declared substitute that PASSES → no cascade (rescue)
ok 4 - [missing_tool × peer_substitute_declared × downstream_phase] missing_tool + declared substitute that PASSES → no cascade (rescue)
  ---
  duration_ms: 31.800541
  type: 'test'
  ...
# Subtest: [missing_tool × peer_substitute_declared × same_phase] peer_substitutes_for accepts string[] — bulk substitute rescues multiple targets
ok 5 - [missing_tool × peer_substitute_declared × same_phase] peer_substitutes_for accepts string[] — bulk substitute rescues multiple targets
  ---
  duration_ms: 17.651042
  type: 'test'
  ...
# Subtest: [missing_tool × peer_substitute_missing × downstream_phase] mutual peer_substitutes_for declarations + both miss → cascade with substitution-chain detail
ok 6 - [missing_tool × peer_substitute_missing × downstream_phase] mutual peer_substitutes_for declarations + both miss → cascade with substitution-chain detail
  ---
  duration_ms: 0.665792
  type: 'test'
  ...
# Subtest: [missing_tool × peer_passes × same_phase] missing_tool + passing peer with no declaration: same-phase consumer still cascades
ok 7 - [missing_tool × peer_passes × same_phase] missing_tool + passing peer with no declaration: same-phase consumer still cascades
  ---
  duration_ms: 5.849167
  type: 'test'
  ...
# Subtest: [missing_tool × peer_passes × downstream_phase] missing_tool + passing peer with no declaration: downstream consumer still cascades
ok 8 - [missing_tool × peer_passes × downstream_phase] missing_tool + passing peer with no declaration: downstream consumer still cascades
  ---
  duration_ms: 12.85
  type: 'test'
  ...
# Subtest: [missing_tool × peer_fails × same_phase] missing_tool after earlier peer failure: same-phase consumer keeps real-failure diagnostic
ok 9 - [missing_tool × peer_fails × same_phase] missing_tool after earlier peer failure: same-phase consumer keeps real-failure diagnostic
  ---
  duration_ms: 11.508125
  type: 'test'
  ...
# Subtest: [missing_tool × sole_stateful × same_phase] missing_tool with NO declared substitute → cascade fires immediately (existing behavior)
ok 10 - [missing_tool × sole_stateful × same_phase] missing_tool with NO declared substitute → cascade fires immediately (existing behavior)
  ---
  duration_ms: 0.857791
  type: 'test'
  ...
# Subtest: [missing_tool × sole_stateful × same_phase] non-stateful step does NOT cascade-skip when stateful setup skipped
ok 11 - [missing_tool × sole_stateful × same_phase] non-stateful step does NOT cascade-skip when stateful setup skipped
  ---
  duration_ms: 2.918042
  type: 'test'
  ...
# Subtest: [missing_tool × sole_stateful × downstream_phase] depends_on: [] — independent phase runs even when prior phase tripped cascade
ok 12 - [missing_tool × sole_stateful × downstream_phase] depends_on: [] — independent phase runs even when prior phase tripped cascade
  ---
  duration_ms: 6.283542
  type: 'test'
  ...
# Subtest: [missing_tool × sole_stateful × downstream_phase] depends_on: ["specific_phase"] — cascades only when that phase tripped
ok 13 - [missing_tool × sole_stateful × downstream_phase] depends_on: ["specific_phase"] — cascades only when that phase tripped
  ---
  duration_ms: 75.096417
  type: 'test'
  ...
# Subtest: [missing_tool × peer_fails × downstream_phase] depends_on default (undefined) preserves all-prior-phases cascade — F6 round-2 still works
ok 14 - [missing_tool × peer_fails × downstream_phase] depends_on default (undefined) preserves all-prior-phases cascade — F6 round-2 still works
  ---
  duration_ms: 0.407375
  type: 'test'
  ...
# Subtest: [missing_tool × sole_stateful × downstream_phase] three-phase transitive: A trips, B independent, C depends_on:[B] runs
ok 15 - [missing_tool × sole_stateful × downstream_phase] three-phase transitive: A trips, B independent, C depends_on:[B] runs
  ---
  duration_ms: 19.060792
  type: 'test'
  ...
# Subtest: [missing_tool × peer_substitute_declared × downstream_phase] peer_substitutes_for × depends_on compose: substitute rescues within-phase
ok 16 - [missing_tool × peer_substitute_declared × downstream_phase] peer_substitutes_for × depends_on compose: substitute rescues within-phase
  ---
  duration_ms: 14.765167
  type: 'test'
  ...
# Subtest: [missing_tool × sole_stateful × same_phase] within-phase cascade still fires regardless of depends_on
ok 17 - [missing_tool × sole_stateful × same_phase] within-phase cascade still fires regardless of depends_on
  ---
  duration_ms: 0.840666
  type: 'test'
  ...
# Subtest: [not_applicable × sole_stateful × downstream_phase] sole stateful step not_applicable → no cascade (platform has no peer-substitute)
ok 18 - [not_applicable × sole_stateful × downstream_phase] sole stateful step not_applicable → no cascade (platform has no peer-substitute)
  ---
  duration_ms: 7.756333
  type: 'test'
  ...
# Subtest: [not_applicable × peer_fails × downstream_phase] not_applicable + peer stateful step fails hard → cascade fires
ok 19 - [not_applicable × peer_fails × downstream_phase] not_applicable + peer stateful step fails hard → cascade fires
  ---
  duration_ms: 5.8415
  type: 'test'
  ...
# Subtest: [not_applicable × peer_passes × downstream_phase] not_applicable + stateful peer passes in same phase → no cascade (substitute established state)
ok 20 - [not_applicable × peer_passes × downstream_phase] not_applicable + stateful peer passes in same phase → no cascade (substitute established state)
  ---
  duration_ms: 8.059625
  type: 'test'
  ...
# Subtest: [not_applicable × peer_passes × downstream_phase] not_applicable: peer passes BEFORE the not_applicable skip → no cascade (order-independent)
ok 21 - [not_applicable × peer_passes × downstream_phase] not_applicable: peer passes BEFORE the not_applicable skip → no cascade (order-independent)
  ---
  duration_ms: 5.291917
  type: 'test'
  ...
# Subtest: [not_applicable × sole_stateful × downstream_phase] not_applicable + non-stateful peer: downstream runs (sole-stateful-step rule)
ok 22 - [not_applicable × sole_stateful × downstream_phase] not_applicable + non-stateful peer: downstream runs (sole-stateful-step rule)
  ---
  duration_ms: 11.675
  type: 'test'
  ...
# Subtest: [not_applicable × peer_fails × downstream_phase] not_applicable + later real failure in same phase: real failure wins the diagnostic
ok 23 - [not_applicable × peer_fails × downstream_phase] not_applicable + later real failure in same phase: real failure wins the diagnostic
  ---
  duration_ms: 2.422792
  type: 'test'
  ...
# Subtest: [not_applicable × peer_substitute_declared × same_phase] not_applicable + declared substitute that passes: same-phase consumer runs
ok 24 - [not_applicable × peer_substitute_declared × same_phase] not_applicable + declared substitute that passes: same-phase consumer runs
  ---
  duration_ms: 6.247917
  type: 'test'
  ...
# Subtest: [not_applicable × peer_substitute_declared × downstream_phase] not_applicable + declared substitute that passes: downstream consumer runs
ok 25 - [not_applicable × peer_substitute_declared × downstream_phase] not_applicable + declared substitute that passes: downstream consumer runs
  ---
  duration_ms: 17.316541
  type: 'test'
  ...
# Subtest: [not_applicable × peer_substitute_missing × downstream_phase] not_applicable + mutual substitute declarations both skip: downstream consumer cascades
ok 26 - [not_applicable × peer_substitute_missing × downstream_phase] not_applicable + mutual substitute declarations both skip: downstream consumer cascades
  ---
  duration_ms: 0.490125
  type: 'test'
  ...
# Subtest: [not_applicable × peer_passes × same_phase] not_applicable + passing peer with no declaration: same-phase consumer runs
ok 27 - [not_applicable × peer_passes × same_phase] not_applicable + passing peer with no declaration: same-phase consumer runs
  ---
  duration_ms: 6.592084
  type: 'test'
  ...
# Subtest: [not_applicable × peer_fails × same_phase] not_applicable + peer failure: same-phase consumer keeps real-failure diagnostic
ok 28 - [not_applicable × peer_fails × same_phase] not_applicable + peer failure: same-phase consumer keeps real-failure diagnostic
  ---
  duration_ms: 2.97625
  type: 'test'
  ...
# Subtest: [real_failure × sole_stateful × same_phase] real failure cascade-detail says "failed" (not "skipped")
ok 29 - [real_failure × sole_stateful × same_phase] real failure cascade-detail says "failed" (not "skipped")
  ---
  duration_ms: 3.666417
  type: 'test'
  ...
# Subtest: [real_failure × sole_stateful × downstream_phase] cascade-skipped step with un-advertised task gets missing_tool (capability-aware)
ok 30 - [real_failure × sole_stateful × downstream_phase] cascade-skipped step with un-advertised task gets missing_tool (capability-aware)
  ---
  duration_ms: 2.849292
  type: 'test'
  ...
# Subtest: [real_failure × sole_stateful × downstream_phase] cascade-skipped step with advertised task still gets prerequisite_failed
ok 31 - [real_failure × sole_stateful × downstream_phase] cascade-skipped step with advertised task still gets prerequisite_failed
  ---
  duration_ms: 6.265542
  type: 'test'
  ...
# Subtest: [real_failure × sole_stateful × downstream_phase] $test_kit.* step: resolved task checked against agentTools, not template string
ok 32 - [real_failure × sole_stateful × downstream_phase] $test_kit.* step: resolved task checked against agentTools, not template string
  ---
  duration_ms: 2.917625
  type: 'test'
  ...
# Subtest: [real_failure × peer_passes × same_phase] real failure with passing peer earlier in same phase: cascade still fires (no rescue without peer_substitutes_for)
ok 33 - [real_failure × peer_passes × same_phase] real failure with passing peer earlier in same phase: cascade still fires (no rescue without peer_substitutes_for)
  ---
  duration_ms: 7.177375
  type: 'test'
  ...
# Subtest: [real_failure × peer_passes × downstream_phase] real failure with passing peer in setup phase: downstream phase still cascades
ok 34 - [real_failure × peer_passes × downstream_phase] real failure with passing peer in setup phase: downstream phase still cascades
  ---
  duration_ms: 7.827583
  type: 'test'
  ...
# Subtest: [real_failure × peer_fails × same_phase] real failure earlier in same phase + later peer also fails: consumer cascade-skips with failure detail
ok 35 - [real_failure × peer_fails × same_phase] real failure earlier in same phase + later peer also fails: consumer cascade-skips with failure detail
  ---
  duration_ms: 3.197916
  type: 'test'
  ...
# Subtest: [real_failure × peer_fails × downstream_phase] real failure in setup phase + peer also a real failure: downstream phase cascades with failure detail
ok 36 - [real_failure × peer_fails × downstream_phase] real failure in setup phase + peer also a real failure: downstream phase cascades with failure detail
  ---
  duration_ms: 4.714583
  type: 'test'
  ...
1..36

ok 2 - runStoryboard cascade-skip matrix (skip_reason × peer_shape × phase_topology)

duration_ms: 433.126875
type: 'suite'
...

Subtest: runStoryboard cascade-skip controls (no skip occurs)

# Subtest: stateful step that runs successfully does NOT trigger cascade-skip
ok 1 - stateful step that runs successfully does NOT trigger cascade-skip
  ---
  duration_ms: 6.558666
  type: 'test'
  ...
1..1

ok 3 - runStoryboard cascade-skip controls (no skip occurs)

duration_ms: 6.625542
type: 'suite'
...

Subtest: runStoryboard cascade-skip: parse-time validation

# Subtest: peer_substitutes_for: self-reference rejected at parse time
ok 1 - peer_substitutes_for: self-reference rejected at parse time
  ---
  duration_ms: 0.460625
  type: 'test'
  ...
# Subtest: peer_substitutes_for: empty-string entry in array rejected at parse time
ok 2 - peer_substitutes_for: empty-string entry in array rejected at parse time
  ---
  duration_ms: 0.156458
  type: 'test'
  ...
# Subtest: peer_substitutes_for: target step must be stateful
ok 3 - peer_substitutes_for: target step must be stateful
  ---
  duration_ms: 0.254042
  type: 'test'
  ...
# Subtest: peer_substitutes_for: substitute step must itself be stateful
ok 4 - peer_substitutes_for: substitute step must itself be stateful
  ---
  duration_ms: 0.477208
  type: 'test'
  ...
# Subtest: peer_substitutes_for is same-phase only — cross-phase reference rejected
ok 5 - peer_substitutes_for is same-phase only — cross-phase reference rejected
  ---
  duration_ms: 0.21425
  type: 'test'
  ...
# Subtest: depends_on rejects forward references at parse time
ok 6 - depends_on rejects forward references at parse time
  ---
  duration_ms: 0.133459
  type: 'test'
  ...
# Subtest: depends_on rejects self-reference at parse time
ok 7 - depends_on rejects self-reference at parse time
  ---
  duration_ms: 0.1255
  type: 'test'
  ...
# Subtest: depends_on rejects unknown phase ids at parse time
ok 8 - depends_on rejects unknown phase ids at parse time
  ---
  duration_ms: 0.127875
  type: 'test'
  ...
# Subtest: depends_on: <non-array> rejected at parse time (string instead of array)
ok 9 - depends_on: <non-array> rejected at parse time (string instead of array)
  ---
  duration_ms: 0.158125
  type: 'test'
  ...
1..9

ok 4 - runStoryboard cascade-skip: parse-time validation

duration_ms: 2.223375
type: 'suite'
...

Subtest: runStoryboard cascade-skip: sole-stateful-step exemption parity invariant

# Subtest: all exemption-family skip reasons produce identical cascade outcomes
ok 1 - all exemption-family skip reasons produce identical cascade outcomes
  ---
  duration_ms: 10.81625
  type: 'test'
  ...
1..1

ok 5 - runStoryboard cascade-skip: sole-stateful-step exemption parity invariant

duration_ms: 10.880084
type: 'suite'
...

Subtest: runStoryboard cascade-skip matrix: coverage report

# Subtest: every cell in (skip_reason × peer_shape × phase_topology) is covered, impossible, or tracked
ok 1 - every cell in (skip_reason × peer_shape × phase_topology) is covered, impossible, or tracked
  ---
  duration_ms: 0.264458
  type: 'test'
  ...
1..1

ok 6 - runStoryboard cascade-skip matrix: coverage report

duration_ms: 0.290875
type: 'suite'
...
1..6

tests 59

suites 6

pass 59

fail 0

cancelled 0

skipped 0

todo 0

duration_ms 1740.324125 pass (59/59). The changeset and any_of-only guard address the prior review points.

@bokelley
bokelley enabled auto-merge (squash) June 30, 2026 19:26
@bokelley
bokelley merged commit f87444b into adcontextprotocol:main Jun 30, 2026
4 checks passed
@bokelley bokelley mentioned this pull request Jun 30, 2026
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.

2 participants