Skip to content

fix(state): squad_decide says where a git-branch backend stored the decision - #2502

Merged
bradygaster merged 3 commits into
devfrom
squad/decide-where
Nov 14, 2026
Merged

bradygaster merged 3 commits into
devfrom
squad/decide-where

Conversation

@bradygaster

Copy link
Copy Markdown
Collaborator

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-state branch. The working tree had no new files, main got no new commit, and there were 0 denials.

The bug: the coordinator told the user the decision was in .squad/decisions/inbox/…, because squad_decide returns only the key. With a git-branch backend (orphan, two-layer), the result now adds that the path is a key on the squad-state branch and that no working-tree file exists. A live re-run reports "the squad-state orphan Git branch … not as a file in your working tree." The local backend's output is unchanged.

Test: test/tools.test.ts covers orphan, two-layer and local.

The CHANGELOG change also adds a missing comma in the #2496 entry.

🤖 Generated with Claude Code

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>
Copilot AI dynamic review requested due to automatic review settings November 14, 2026 04:32
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #2502

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 4
Files added 1
Files modified 3
Files deleted 0
Modules touched 3
Critical files 1

🎯 Risk Factors

  • 4 files changed (≤5 → LOW)
  • 3 modules touched (2-4 → MEDIUM)
  • Critical files touched: packages/squad-sdk/src/tools/index.ts

📦 Modules Affected

root (2 files)
  • .changeset/decide-where-stored.md
  • CHANGELOG.md
squad-sdk (1 file)
  • packages/squad-sdk/src/tools/index.ts
tests (1 file)
  • test/tools.test.ts

⚠️ Critical Files

  • packages/squad-sdk/src/tools/index.ts

This report is generated automatically for every PR. See #733 for details.

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 3a4d22a

PR Scope: 📦🔧 Mixed (product + infrastructure)

⚠️ 4 item(s) to address before review

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.

Copilot AI 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.

🟡 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 orphan and two-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.`
@bradygaster
bradygaster merged commit 8c2c28b into dev Nov 14, 2026
31 checks passed
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