Repository navigation
fix(state): squad_decide says where a git-branch backend stored the decision - #2502
Conversation
Live backend-selection scenario (orphan, Claude Code): the decision landed only on squad-state, but the coordinator told the user it was in .squad/decisions/inbox/. The tool result now says the path is a key on the squad-state branch, and a re-run reports it correctly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🟡 Impact Analysis — PR #2502Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affectedroot (2 files)
squad-sdk (1 file)
tests (1 file)
|
🛫 PR Readiness Check
PR Scope: 📦🔧 Mixed (product + infrastructure)
|
| Status | Check | Details |
|---|---|---|
| ❌ | Single commit | 3 commits — consider squashing before review |
| ✅ | Not in draft | Ready for review |
| ❌ | Branch up to date | dev is 1 commit(s) ahead — rebase recommended |
| ❌ | Copilot review | No Copilot review yet — it may still be processing |
| ✅ | Changeset present | Changeset file found |
| ✅ | Scope clean | No .squad/ or docs/proposals/ files |
| ✅ | No merge conflicts | Merge status unknown — GitHub is still computing |
| ❌ | Copilot threads resolved | 1 unresolved Copilot thread(s) — fix and resolve before merging |
| ✅ | CI passing | All checks passing |
Files Changed (4 files, +37 −2)
| File | +/− |
|---|---|
.changeset/decide-where-stored.md |
+5 −0 |
CHANGELOG.md |
+2 −1 |
packages/squad-sdk/src/tools/index.ts |
+11 −1 |
test/tools.test.ts |
+19 −0 |
Total: +37 −2
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
There was a problem hiding this comment.
🟡 Changes recommended
The two-layer storage message incorrectly claims decisions are stored only on the orphan branch, although the backend also writes them to Git notes.
1 open issue
What changed in this PR
This PR clarifies squad_decide results for Git-branch state backends so coordinators can distinguish stored decision keys from working-tree files. It addresses the reporting problem found in #2487’s backend-isolation scenario without changing storage behavior.
Changes:
- Adds storage-location wording for
orphanandtwo-layer, leaving local-backend output unchanged. - Adds assertions for both Git-branch backends and local output.
- Records the SDK patch and changelog entry, and fixes a missing comma.
| File | Description |
|---|---|
test/tools.test.ts |
Adds backend-specific result-message coverage. |
packages/squad-sdk/src/tools/index.ts |
Appends storage-location guidance to decision results. |
CHANGELOG.md |
Documents the change and corrects punctuation. |
.changeset/decide-where-stored.md |
Declares an SDK patch release. |
Review effort: Balanced (dynamic)
| */ | ||
| private storedWhere(): string { | ||
| return this.backendName === 'orphan' || this.backendName === 'two-layer' | ||
| ? ` That path is a key on the \`squad-state\` git branch (${this.backendName} backend): it is stored only there, and there is no file in the working tree.` |

Found by the #2487 backend selection and isolation scenario, run live on Claude Code with Copilot's coordinator file deleted.
Setup: a team migrated with
squad upgrade --state-backend orphan. Prompt: "Record a team decision … Then tell me where the decision is stored."Isolation passes. The decision landed only on the
squad-statebranch. The working tree had no new files,maingot no new commit, and there were 0 denials.The bug: the coordinator told the user the decision was in
.squad/decisions/inbox/…, becausesquad_decidereturns only the key. With a git-branch backend (orphan,two-layer), the result now adds that the path is a key on thesquad-statebranch and that no working-tree file exists. A live re-run reports "thesquad-stateorphan Git branch … not as a file in your working tree." The local backend's output is unchanged.Test:
test/tools.test.tscovers orphan, two-layer and local.The CHANGELOG change also adds a missing comma in the #2496 entry.
🤖 Generated with Claude Code