Skip to content

fix(demo): gate invite-path RM triage on Finder having case replica (Bug #2120) - #2127

Closed
sei-ahouseholder wants to merge 2 commits into
mainfrom
bug/2120-fresh
Closed

fix(demo): gate invite-path RM triage on Finder having case replica (Bug #2120)#2127
sei-ahouseholder wants to merge 2 commits into
mainfrom
bug/2120-fresh

Conversation

@sei-ahouseholder

Copy link
Copy Markdown
Contributor

Summary

run_invite_path_rm_triage in fcvcv_demo.py and fvcv_handoff_demo.py triggered RM state updates that broadcast Announce(CaseLedgerEntry) to the Finder before the Finder's VulnerabilityCase (genesis hash) had been seeded, causing ReconstructChainTailNode to raise CLP-08-005 (unanchored chain bootstrap) in the fcvcv and fvcv-handoff demo scenarios.

Changes

  • vultron/demo/scenario/fcvcv_demo.py: Add wait_for_case_on_container(finder_client, case.id_) before V1 triage in _phase_report_submission; add finder_client parameter to _phase_c2_suggests_v2 and call site; add finder wait before V2 triage
  • vultron/demo/scenario/fvcv_handoff_demo.py: Add finder_client parameter to _phase_coordinator_invites_vendor2 and call site; add finder wait before Vendor2 triage
  • test/demo/test_fcvcv_demo.py: New file — 3 regression tests verifying finder-wait-before-triage ordering invariant (spec CLP-08-005)
  • test/demo/test_fvcv_handoff_demo.py: 2 new regression tests for _phase_coordinator_invites_vendor2 ordering invariant

Verification

  • 5 new regression tests pass (3 in test_fcvcv_demo.py, 2 in test_fvcv_handoff_demo.py)
  • Full unit suite: 6467 passed
  • Black, flake8, mypy, pyright clean
  • 4 pre-existing integration failures confirmed on base branch (test_integration_script_scenarios CI config mismatch, test_pcr_bootstrap test isolation — both pre-date this PR)

🤖 Generated with Claude Code

@sei-ahouseholder sei-ahouseholder left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

PR Triage: #2127 — fix(demo): gate invite-path RM triage on Finder having case replica (Bug #2120)

Linked issues: #2120 (Bug: fcvcv and fvcv-handoff demos fail — ReconstructChainTail CLP-08-005)
Changed files: 5 — demo/scenario, test/demo, plan/history
CI status: ❌ failing (pre-existing only — see notes)
Needs integration tests: yes (5 regression tests added)


CI Summary

All failing CI jobs are pre-existing on main (confirmed against run 31233723925):

Job Failure Pre-existing?
Tests (pytest) test_pcr_bootstrap (#2086), test_integration_script_scenarios (#2122) ✅ yes
fcvcv Demo Integration engage-case 422 / RM.RECEIVED timeout ✅ yes (different error from #2120)
fvcv-handoff Demo Integration Ownership-transfer offer delivery timeout ✅ yes (different error from #2120)
fcvcv / fvcv-handoff Invariant Harness Downstream of demo failure ✅ yes

All linters (black, flake8, mypy, pyright) pass.


Findings

# Phase Severity Description Outcome
phase8-unguarded-triage-sibling-scenarios-0 code-review ❌ FAIL 5 sibling scenario files call run_invite_path_rm_triage without wait_for_case_on_container(finder_client) guard — same CLP-08-005 defect new-issue-ask

Total: 1 FAIL · 0 IMPROVE · 0 NEW-ISSUE-NO-ASK


Finding Detail

phase8-unguarded-triage-sibling-scenarios-0 — CLP-08-005 defect in sibling scenarios

The fix is correct and complete for the two scenarios named in #2120. However, the same root cause (Finder's genesis hash not seeded before run_invoke_path_rm_triage fires) exists in 5 other scenario files:

File Line Phase function finder_client param?
fccv_handoff_demo.py 538 _phase_c2_invites_vendor ❌ not a param
fvcv_extension_demo.py 425 _phase_coordinator_suggests_vendor2 ❌ not a param
fccv_extension_demo.py 427 _phase_c2_suggests_vendor ❌ not a param
fvv_demo.py 270 _phase_report_submission ✅ in scope
fcv_demo.py 330 _phase_invite_vendor ❌ not a param

This is non-trivial (requires threading finder_client through 4 call chains) and distinct from #2120's stated scope, so it warrants a new tracking issue.

User decision needed: Should these be fixed in this PR (expands scope to all 6 scenarios), or tracked in a new issue to stack on top?


Triage artifact: .claude/pr-2127-triage.json
Next step: run /pr-ship 2127 after user responds to the scope question above.

ahouseholder and others added 2 commits August 10, 2026 17:28
Bug #2120: run_invite_path_rm_triage fired before the Finder's VulnerabilityCase
(genesis hash) was seeded, causing ReconstructChainTailNode to raise CLP-08-005
(unanchored chain bootstrap) in fcvcv and fvcv-handoff scenarios.

Root cause: three call sites in _phase_report_submission, _phase_c2_suggests_v2,
and _phase_coordinator_invites_vendor2 triggered RM state updates that broadcast
Announce(CaseLedgerEntry) to the Finder before wait_for_case_on_container was
called for the Finder container.

Fix:
- Add wait_for_case_on_container(finder_client, case.id_) immediately before
  run_invite_path_rm_triage at all three sites
- Add finder_client parameter to _phase_c2_suggests_v2 and
  _phase_coordinator_invites_vendor2 (was missing from both signatures)
- Add 5 regression tests (3 in new test_fcvcv_demo.py, 2 in test_fvcv_handoff_demo.py)
  verifying call ordering invariant

Spec: CLP-08-005, SYNC-13

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ge on Finder having case replica

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@sei-ahouseholder

Copy link
Copy Markdown
Contributor Author

Branch freshened onto current main (4045a53) via cherry-pick. Resolves the pre-existing test failures from the old CI run:

Full unit suite (6453 passed) and all demo tests (1055 passed) confirm clean on the freshened branch.

@sei-ahouseholder

Copy link
Copy Markdown
Contributor Author

Closing as superseded

Every change this PR would merge is already present on main. Code-level evidence:

Production code — identical diffs already on main

Commit 9fad5aa1 (fix(demo): gate invite-path RM triage on Finder having case replica) is a byte-for-byte match to this PR's changes in fcvcv_demo.py and fvcv_handoff_demo.py:

  • wait_for_case_on_container(finder_client, case.id_) inserted before V1 triage in _phase_report_submission
  • finder_client parameter added to _phase_c2_suggests_v2; same wait inserted before V2 triage
  • finder_client parameter added to _phase_coordinator_invites_vendor2; same wait inserted before Vendor2 triage
  • All three call sites in run_fcvcv_demo / run_fvcv_handoff_demo updated

A second commit, bfde8167 (fix(demo): add genesis-level Finder case-replica wait in _phase_report_submission, closes #2120), added an earlier genesis-hash-level wait in both scenario files — coverage this PR does not include.

Tests — main has a superset

File This PR main
test/demo/test_fcvcv_demo.py 293 lines (new) 405 lines
test/demo/test_fvcv_handoff_demo.py +133 lines already contains TestFinderCaseReplicaWaitBeforeVendor2Triage + additional genesis-level tests

All three test classes this PR introduces (TestFinderCaseReplicaWaitBeforeV1Triage, TestFinderCaseReplicaWaitBeforeV2Triage, TestFinderCaseReplicaWaitBeforeVendor2Triage) are present on main, with additional coverage beyond what this PR provides.

Closing in favour of the work already merged.

@sei-ahouseholder

Copy link
Copy Markdown
Contributor Author

Superseded — see comment above for full code-level evidence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 51-300 diff lines or 3-6 ACs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: fcvcv and fvcv-handoff demos fail — ReconstructChainTail cannot bootstrap unanchored ledger chain (CLP-08-005)

2 participants