Skip to content

feat(sdk): git-notes + orphan-branch state backends for .squad/ (Options A & B from blog Part 7b) #807

@tamirdresher

Description

@tamirdresher

Git-based State Backends

Problem

PR #797 implemented Option C (external directory). This issue covers the two git-native approaches from Tamir's blog Part 7b:

Option A: Git Notes (refs/notes/squad)

  • Squad state stored in git notes ref, not working tree
  • Survives branch switches (ref-based, not file-based)
  • Invisible in git status, git diff, PRs
  • Accessed via git notes --ref=squad

Option B: Orphan Branch (squad-state)

  • Dedicated branch with no common ancestor
  • State files live there, never merged into main
  • Read via git show squad-state:.squad/team.md

Implementation

  • Add StateBackend interface to squad-sdk resolution.ts
  • Implement GitNotesBackend and OrphanBranchBackend
  • Add --state-backend flag to CLI (values: worktree | external | git-notes | orphan)
  • Config in .squad/config.json: { \"stateBackend\": \"git-notes\" }
  • Fallback: if chosen backend fails, warn and fall back to worktree

Blog reference

https://tamirdresher.github.io - Part 7b of the Scaling AI series

Metadata

Metadata

Assignees

No one assigned

    Labels

    go:needs-researchNeeds investigationsquadSquad triage inbox — Lead will assign to a membersquad:flightAssigned to Flight (Lead)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions