Summary
When wave-status init persists a plan with cross-repo issue refs (e.g. Wave-Engineering/mcp-server-sdlc#362), the state.json issues dict keys get constructed as Wave-Engineering/<orchestrator-repo>#<number> instead of preserving the original ref. phases-waves.json retains correct refs; only state.json is wrong.
Implementation Steps
- Locate
_issue_repo() function in wave-status source (wave_status/state.py, approximately line 500+). It currently returns _plan_default_repo(plan_data) for cross-repo issues when only per-issue repo is absent.
- Modify
_issue_repo() to extract and return the repo component from the issue's existing ref field (e.g. parse Wave-Engineering/mcp-server-sdlc#362 to get Wave-Engineering/mcp-server-sdlc) when a per-issue repo override is not present but the issue already has a qualified ref in phases-waves.json.
- Update
_compose_issue_key() call site at line ~596 in the extend_init() function to use the qualified repo extracted from the issue's ref field, preserving the original owner/repo#N shape verbatim.
- Document the schema change: state.json v3 now guarantees that qualified issue keys match the original phases-waves.json
ref values (for issues with a resolvable repo).
Test Procedures
Unit Test: Add test_init_preserves_cross_repo_refs() to the wave-status test suite:
- Construct a phases-waves.json with multiple phases and waves containing cross-repo issue refs: e.g.
{"ref": "Wave-Engineering/mcp-server-sdlc#362", "number": 362}, {"ref": "Wave-Engineering/mcp-server-sdlc#367", "number": 367}.
- Call
wave-status init --force <plan.json> from a different orchestrator repo (e.g. claudecode-workflow).
- Assert that state.json's
issues dict keys match the original ref fields exactly: Wave-Engineering/mcp-server-sdlc#362, Wave-Engineering/mcp-server-sdlc#367, etc.
- Verify no keys contain the orchestrator's repo slug (e.g. no
Wave-Engineering/claudecode-workflow#362).
Manual Verification:
- Create a test phases-waves.json with cross-repo refs (template provided in issue body).
- Run
wave-status init --force <test-plan.json> from cc-workflow project root.
- Inspect
.claude/status/state.json → issues dict keys.
- Confirm all qualified keys preserve the original
owner/repo#N shape (not orchestrator-substituted).
Acceptance Criteria
Not In Scope
- Any change to phases-waves.json shape
- Any change to how
/nextwave reads state.json (consumer-side read is correct; producer-side write is wrong)
Dependencies
Metadata
— rules-lawyer 📜 (cc-workflow)
Summary
When
wave-status initpersists a plan with cross-repo issue refs (e.g.Wave-Engineering/mcp-server-sdlc#362), thestate.jsonissuesdict keys get constructed asWave-Engineering/<orchestrator-repo>#<number>instead of preserving the original ref. phases-waves.json retains correct refs; only state.json is wrong.Implementation Steps
_issue_repo()function in wave-status source (wave_status/state.py, approximately line 500+). It currently returns_plan_default_repo(plan_data)for cross-repo issues when only per-issuerepois absent._issue_repo()to extract and return the repo component from the issue's existingreffield (e.g. parseWave-Engineering/mcp-server-sdlc#362to getWave-Engineering/mcp-server-sdlc) when a per-issue repo override is not present but the issue already has a qualifiedrefin phases-waves.json._compose_issue_key()call site at line ~596 in theextend_init()function to use the qualified repo extracted from the issue'sreffield, preserving the originalowner/repo#Nshape verbatim.refvalues (for issues with a resolvable repo).Test Procedures
Unit Test: Add
test_init_preserves_cross_repo_refs()to the wave-status test suite:{"ref": "Wave-Engineering/mcp-server-sdlc#362", "number": 362},{"ref": "Wave-Engineering/mcp-server-sdlc#367", "number": 367}.wave-status init --force <plan.json>from a different orchestrator repo (e.g. claudecode-workflow).issuesdict keys match the originalreffields exactly:Wave-Engineering/mcp-server-sdlc#362,Wave-Engineering/mcp-server-sdlc#367, etc.Wave-Engineering/claudecode-workflow#362).Manual Verification:
wave-status init --force <test-plan.json>from cc-workflow project root..claude/status/state.json→issuesdict keys.owner/repo#Nshape (not orchestrator-substituted).Acceptance Criteria
state.jsonissuesdict keys matchreffields from phases-waves.json verbatimNot In Scope
/nextwavereads state.json (consumer-side read is correct; producer-side write is wrong)Dependencies
Metadata
— rules-lawyer 📜 (cc-workflow)