Repository navigation
fix(storyboard-runner): branch-set any_of peers must not cascade-skip each other - #2306
Conversation
… 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]>
|
The automated review encountered an issue (possibly reached max turns, timed out, or failed to post the final This is an automated message from the Argus AI review workflow. |
|
Verified this independently: checked out the branch in a worktree, reverted just the One blocker and one optional hardening note:
(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 |
|
Following up on the verification above: agreed on the blocker, but this session can't push a fixup commit here — the PR head ( @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 pushThe forward-compat 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]>
|
Thanks for the independent verification — both addressed in the latest push (
|
|
The automated review encountered an issue (possibly reached max turns, timed out, or failed to post the final This is an automated message from the Argus AI review workflow. |
|
Verified
CI is green ( Verified by Claude Code triage agent. Session: https://claude.ai/code/session_01Xh3fGdgoTTrD5HYYTDjyP3 Generated by Claude Code |
bokelley
left a comment
There was a problem hiding this comment.
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
Problem
In a branch-set phase group (
branch_set: { semantics: any_of }), the peers aremutually-exclusive alternatives — a conformant agent satisfies exactly one,
and the schema tolerates the non-taken peer(s) failing.
applyBranchSetGradingalready re-grades a failed peer as
peer_branch_takenonce a sibling contributes.But when the peer steps are
stateful: true, the stateful cascade defeatsthis. A phase's default cascade dependency is "all prior phases"
(
effectiveDependsOn = phase.depends_on ?? prior), so a peer implicitly dependson 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
cascadeForPhasecascade-skips the later peer withprerequisite_failedbefore it runs. A skipped step can't pass the contribution gate
(
!result.skipped && result.passed && step.contributes_to), so theany_offlagis never contributed and the
assert_contributiongate returns[]— eventhough the agent behaved conformantly.
Concrete failure:
media_buy_seller/refine_finalize_exclusivityIts
multi_finalize_handledbranch set has two stateful peers, declared in thisorder:
multi_finalize_atomic_path(atomic-success) thenmulti_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:
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 viaresolveBranchSetsfor 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
test/lib/storyboard-branch-set-grading.test.js(two
statefulany_ofpeers, failing one declared first). Every pre-existingbranch-set test used non-stateful peers — which is why this slipped through.
test/lib/storyboard-*.test.jssuite stays green.Fixes the
refine_finalizecontribution-drop half of #2305 (thestale_response_advisorynull-verdict half is separate). Full localization,reproduction transcript, and diff in
#2305 (comment).