feat: worktree awareness, Scribe auto-commit, and decision consolidation#1
Conversation
- Add Worktree Awareness section with two strategies (worktree-local, main-checkout) - Coordinator resolves team root and passes TEAM_ROOT to all spawn prompts - Scribe commits .ai-team/ changes with detailed conventional commit messages - Scribe deduplicates and consolidates overlapping decisions after merge - Add .gitattributes merge=union rules for append-only .ai-team/ files (docs + index.js) - Update charter.md and scribe-charter.md templates with worktree and commit guidance
- Add Ceremonies section to squad.agent.md with facilitator pattern - Ceremonies are configurable per squad via .ai-team/ceremonies.json - Support auto and manual triggers (before/after work batches) - Facilitator spawns participants as sub-tasks, synthesizes summary - Two default ceremonies: Design Review (before) and Retrospective (after) - Add ceremonies.json template and auto-copy in index.js - Add ceremony signals to routing table - Add ceremonies.json to Source of Truth hierarchy
- Instruct facilitator to keep ceremonies fast and focused - Participants provide domain-specific concerns, interface needs, and blockers only - Goal: minimize iterations by surfacing problems before independent work begins - Explicitly prohibit rehashing known context — ask for delta feedback only
Root cause: git -C with Windows paths and multiline git commit -m with backtick-n both fail silently in PowerShell. Fix: - Use cd into team root instead of git -C - Write commit message to temp file, commit with git commit -F - Add verification step: git log --oneline -1 after commit
After a ceremony completes, skip auto-triggered ceremony checks for the next step. Prevents back-to-back ceremonies (e.g., before-ceremony completing then immediately triggering an after-ceremony check). Cooldown resets after one batch of work completes without a ceremony.
Consistent with rest of .ai-team/ which is all markdown. No programmatic consumer needs structured JSON — the Coordinator parses ceremonies.md as natural language like every other config file.
|
thank you for the pull request @amolchanov! you're the first! i do have one question - and this is more a behavioral nitpick - I am currently working with Squad on two projects; one of them i've explicitly Aside from that, I'm eager to take the contribution - just curious if you'd mind testing that one odd edge case. Should Scribe be aggressive and force-unignore the files? I'd want us to be a little careful. At the same time, if users - or you - think I should lean in hard that "the squad is a part of your repo and grows with it," I could take it as constructive product owner feedback. ;) |
|
|
||
| ### Worktree Awareness | ||
|
|
||
| Squad and all spawned agents may be running inside a **git worktree** rather than the main checkout. All `.ai-team/` paths (charters, history, decisions, logs) MUST be resolved relative to a known **team root**, never assumed from CWD. |
There was a problem hiding this comment.
This is hot. Thank you! I'd been wondering how to bring worktrees to Squad. This is so great.
|
Never mind my concern - I see why this is an all-or-nothing and it is absolutely the right direction. Merged! |
|
Hi Brady,
I actually have a bug in my PR, the intent was to have scribe commit everything: all modified code and squad files. This is the direction that most agentic frameworks are moving so that the user can easily see changes in git and undo them for each iteration. I was just thinking that we might need to be even more aggressive and do multiple commits. I.e. create a worktree per turn, let all squad members commit their changes as they are done so that you can see exactly who was doing what.
Maybe even working tree per squad member as it would be in the real life.
I was experimenting yesterday with squad trying to build a simple Unity game and things went downhill fast. This is mostly due to complexity of Unity and every turn was breaking as many things as it was fixing, so it is absolutely a requirement to be able to see changes for each turn. I don't have experience with Unity, so that was probably a factor too.
The log the scribe was keeping could have been contributing to it because I didn't check what it was writing to it and it could have been causing the model to go haywire and keep reintroducing the same issue. I need to confirm this and delete those files to see if it fixes the issue that it introduced again. If you want to keep this idea we need to figure out how ground those files to be accurate (i.e. things that worked or not).
Happy to chat on Teams tomorrow if you would like to discuss this further.
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Brady Gaster ***@***.***>
Sent: Saturday, February 7, 2026 2:30:43 PM
To: bradygaster/squad ***@***.***>
Cc: amolchanov ***@***.***>; Mention ***@***.***>
Subject: Re: [bradygaster/squad] feat: worktree awareness, Scribe auto-commit, and decision consolidation (PR #1)
[https://avatars.githubusercontent.com/u/41929050?s=20&v=4]bradygaster left a comment (bradygaster/squad#1)<#1 (comment)>
thank you for the pull request @amolchanov<https://github.com/amolchanov>! you're the first! i do have one question - and this is more a behavioral nitpick - I am currently working with Squad on two projects; one of them i've explicitly .gitignored the Squad-related stuff for reasons but, the intent of the product is, obviously, for the team to be a part of the repo. So, in spirit i agree with you but i can imagine there are some scenarios in which a user might want to keep their code separate from their Squad and do the same sort of thing I've done. In that case, would your tweak be a no-op or would it try to "un-ignore" the files? If you could do a few tests of that scenario, I do think that would be a valid concern for some users. I'd suggest making Scribe (I guess it was a matter of time before someone referenced Scribe in first person) decide intelligently on that commit behavior if the user has explicitly added the team files to the ignore list. Scribe should probably just see that and presume that's a step they can avoid.
Aside from that, I'm eager to take the contribution - just curious if you'd mind testing that one odd edge case. Should Scribe be aggressive and force-unignore the files? I'd want us to be a little careful. At the same time, if users - or you - think I should lean in hard that "the team is a part of your repo and grows with it," I could take it as constructive product owner feedback. ;)
—
Reply to this email directly, view it on GitHub<#1 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAEMPUUKCDZJKXITSWYTA6D4KZRQ7AVCNFSM6AAAAACUKZ74S6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTQNRVGY2TQMZQGU>.
You are receiving this because you were mentioned.
|
* test: TDD contract tests for autonomous-pipeline core split Add 31 tests defining the behavioral contract for the planned autonomous-pipeline-core module (PRD Recommendation #1). Tests cover: - Task→tier assignment via selectResponseTier with DEMO_CONFIG - CostTracker per-agent accumulation across multiple agents/tasks - Agent state transitions (idle→working→idle→done lifecycle) - selectResponseTier routing properties (tier, modelTier, maxAgents, timeout) - Task queue creation, role coverage, and findNextTask assignment logic - simulateCost model contract (complexity→tokens→cost scaling) - Core pipeline wiring without telemetry/dashboard/OTel dependencies All 31 tests pass against current code. After the refactor splits core logic from telemetry+dashboard, these same assertions verify the extracted module preserves identical behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * samples: standardize READMEs, naming, and add template - Standardize all 9 package.json names to @squad-samples/* format (Rec #3) - Rewrite root samples/README.md as public-facing index with learning path (Rec #9) - Standardize all 9 per-sample READMEs to consistent template (Rec #8) - Apply Microsoft Writing Style Guide across all sample documentation - Add SAMPLE-README-TEMPLATE.md for future sample authors - Add 31 TDD tests for autonomous-pipeline core split (Rec #1 prep) 17 files modified, 1 new file. All markdownlint and cspell checks pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Merged 9 inbox decisions → decisions.md (personal squad impl plan, economy mode design/governance, persistent model preference, user directives, template sync, ESM fix) - Deleted inbox files (merge complete) - Updated agent histories: Flight (personal squad plan), EECOM (economy mode), Procedures (governance proposals) - Appended team updates to agent contexts Fleet Status: - Flight: Personal squad design validated, 19-task plan across 4 PRs (MVP = PR #1+3) - EECOM: Economy mode complete (34 tests), PR #504 open - Procedures: Economy + consult-mode governance drafted, PR #503 open - Directives: #464 rate limit UX (soft dep #500), #502 bug P1 next-up, triage includes discussions Ready for execution: EECOM Phase 1, Procedures Phase 3 (concurrent). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat: economy mode skill, governance proposals for #500 and #344 - Add .squad/skills/economy-mode/SKILL.md: Layer 3 cost modifier - Economy table shifts code tasks to gpt-4.1/gpt-5-mini, arch to sonnet - Activation: session phrase, config.json economyMode:true, or --economy flag - Layer 0/1/2 (user intent) always overrides economy mode - 💰 indicator in spawn acknowledgments - Confidence: low (first implementation) - Add .squad/decisions/inbox/procedures-economy-mode-governance.md - Draft additions to squad.agent.md for Flight review - Economy mode paragraph after Layer 0, updated table, 💰 convention - Valid models catalog audit findings (claude-sonnet-4.6 missing, etc.) - Add .squad/decisions/inbox/procedures-personal-squad-governance.md - Five gap analysis: Init Mode, consult mode detection, TEAM_ROOT semantics, charter templates, missing consult-mode skill - Proposed CONSULT_MODE spawn signal and 🧳 acknowledgment format - Proposed new consult-mode skill (post-governance-approval) - Update procedures history.md with learnings Closes #500 References #344 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat: economy mode for cost-conscious model selection (#500) Add economy mode that shifts model selection to cheaper alternatives at Layer 3 (task-aware auto) and Layer 4 (default). Explicit user preferences at Layers 0-2 are never overridden. SDK changes: - Add ECONOMY_MODEL_MAP and applyEconomyMode() to config/models.ts - Add readEconomyMode() / writeEconomyMode() for config.json persistence - Update resolveModel() in config/models.ts with economyMode option - Update resolveModel() in agents/model-selector.ts with economyMode option CLI changes: - Add 'squad economy [on|off]' command for persistent toggle - Add --economy global flag for session-level activation (SQUAD_ECONOMY_MODE=1) Tests: - 34 new tests in test/economy-mode.test.ts (all passing) Economy model table: claude-opus-4.6 -> claude-sonnet-4.5 (architecture/review) claude-sonnet-4.6 -> gpt-4.1 (code writing) claude-haiku-4.5 -> gpt-4.1 (docs/mechanical) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Scribe: Wave 1 decisions merged (#329/#344/#500) - Merged 9 inbox decisions → decisions.md (personal squad impl plan, economy mode design/governance, persistent model preference, user directives, template sync, ESM fix) - Deleted inbox files (merge complete) - Updated agent histories: Flight (personal squad plan), EECOM (economy mode), Procedures (governance proposals) - Appended team updates to agent contexts Fleet Status: - Flight: Personal squad design validated, 19-task plan across 4 PRs (MVP = PR #1+3) - EECOM: Economy mode complete (34 tests), PR #504 open - Procedures: Economy + consult-mode governance drafted, PR #503 open - Directives: #464 rate limit UX (soft dep #500), #502 bug P1 next-up, triage includes discussions Ready for execution: EECOM Phase 1, Procedures Phase 3 (concurrent). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: hard-fail on Node <22.5.0 with clear message (#502) node:sqlite (required by the Copilot SDK for session storage) was added in Node 22.5.0. Previously Squad only warned and continued, leading to cryptic ERR_UNKNOWN_BUILTIN_MODULE crashes later. Changes: - cli-entry.ts: replace soft warn+continue with hard process.exit(1) and a clear upgrade message when Node <22.5.0 is detected at startup. Remove now-redundant checkNodeSqlite() function and its call site. - doctor.ts: add checkNodeVersion() check to squad doctor diagnostics so users can detect the version gap proactively. - package.json (root, squad-cli, squad-sdk): correct engines field from >=20 to >=22.5.0, enabling npm/npx to warn at install time. - test/cli/doctor.test.ts: add 5 tests for checkNodeVersion pass/fail paths; update check-count assertion. Closes #502 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add 'squad personal init/list/add/remove' subcommands - Add 'squad cast' to show merged session cast - Add --team-root CLI flag for explicit team root override - Register commands in cli-entry.ts with help text PR #2 of #508 implementation plan. Depends on: squad/508-sdk-foundation (PR #1) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat(sdk): add personal squad resolution and ambient discovery (#508) - Add personalDir to ResolvedSquadPaths - Add resolvePersonalSquadDir() with SQUAD_NO_PERSONAL kill switch - Add PersonalAgentMeta/PersonalAgentManifest types - Add resolvePersonalAgents() for personal agent discovery - Add mergeSessionCast() to merge personal into project cast - Add ensureSquadPathTriple() for triple-root path validation - Export all new functions and types Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(cli): add personal squad commands and cast display (#508) - Add 'squad personal init/list/add/remove' subcommands - Add 'squad cast' to show merged session cast - Add --team-root CLI flag for explicit team root override - Register commands in cli-entry.ts with help text PR #2 of #508 implementation plan. Depends on: squad/508-sdk-foundation (PR #1) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add preflight job scanning all packages for file: references and validating semver versions before any publish work begins - Add npm pack --dry-run validation step to smoke-test job - Disable ghost publish-npm.yml workflow via GitHub API - Add purpose documentation to ci-rerun.yml - Fix YAML parse issue: quote step names containing 'file:' colon - Pipeline chain: preflight → smoke-test → publish-sdk → publish-cli This is the #1 gate that would have prevented the v0.9.1 incident. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Write orchestration log: 2026-03-22T17-30-gandalf.md (Teams watchdog decomposition outcome) - Write session log: 2026-03-22T17-30-teams-watchdog-decomp.md (brief session summary) - Merge 3 decision inbox files into decisions.md (copilot CLI directive, scripting philosophy, watchdog architecture) - Delete inbox files after merge - Update gandalf/history.md with Teams watchdog learnings Issues bradygaster#1-bradygaster#6 created on jbenami_microsoft/ms-pa for 6-step watchdog pipeline. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Elrond: Skills scan of tamirdresher/squad-skills (20 plugins) * Identified 3 directly relevant: teams-monitor, news-broadcasting, secrets-management * Documented full inventory with P0/P1 prioritization * Key insight: WorkIQ poll-based, well-suited for daily batch design - Bilbo: Comprehensive plugin catalog * Created docs/squad-skills-catalog.md (25.2 KB, 21 plugins) * Mapped to Teams watchdog Issues bradygaster#1-bradygaster#6 * Organized by skill domain, implementation order - Scribe: Decision management * Merged .squad/decisions/inbox → decisions.md * Wrote orchestration logs for Elrond, Bilbo * Wrote session log for skills scan Teams watchdog design constraints confirmed: rate-limit WorkIQ to 1 query/agent cycle. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds probe-messages.ps1 that fetches recent Teams messages using copilot -p with the workiq-ask_work_iq MCP tool. Configurable time window via -Hours parameter. Output is plain text to stdout. Key finding: copilot -p requires --allow-tool='workiq' for non-interactive MCP tool consent. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…lti-run support Implements foundational multi-run isolation architecture: NEW FILES: - packages/squad-sdk/src/mcp/run-context.ts: RunContext interface and RunContextManager for per-run state isolation (pulseCollector, intentGraph, pendingUserQuestions, activePipelines, waitResolvers) - packages/squad-sdk/src/mcp/dispatch-utils.ts: DispatchSemaphore (max 1 concurrent sendAndWait) and safeSendAndWait wrapper with Promise.race + settled flag - TODO-MULTI-RUN.md: Comprehensive implementation checklist and landmine documentation MODIFIED FILES: - packages/squad-sdk/src/server/agent-lifecycle.ts: * Added runId field to AgentSessionEntry and ActiveSessionInfo * Session keys now use format agentName::runId for isolation * Added makeSessionKey() helper function * Updated getOrCreateSession() to accept optional runId parameter * Updated dispatch() and sendFollowUp() to use safeSendAndWait + semaphore * Added closeRunSessions() for bulk session cleanup by runId * All session map operations now use composite keys - packages/squad-sdk/src/mcp/server.ts: * Added RunContextManager import and instantiation * Creates RunContext on squad_run (currently tracked but not fully wired) LANDMINES ADDRESSED: - Landmine bradygaster#2 (sendAndWait timeout unreliable): Fixed with safeSendAndWait using Promise.race (90s timeout) + settled flag to prevent duplicate message pushes - Landmine bradygaster#5 (concurrent sendAndWait stalls backend): Fixed with DispatchSemaphore limiting to 1 concurrent call - Landmine bradygaster#4 (SessionPool.findByAgent name collisions): Avoided by using explicit session keys, not pool lookup REMAINING WORK (Phase 2): - Complete server.ts tool handler refactoring (squad_ask, squad_respond, squad_wait, squad_cancel all need runId parameters) - Wire runId through waitForResponse and pipeline callbacks - Implement auto-close sessions on pipeline completion - Fix waitForDonePulse deadlock (landmine bradygaster#1) - Update dashboard for run grouping (Phase 3) Build: Passes Tests: Pending (Phase 2 completion)
…ntegration Completes multi-run isolation by fully wiring RunContext system through all tool handlers: TOOL HANDLERS UPDATED: - squad_ask: Now accepts optional runId parameter, uses RunContext for waitResolvers and pending questions - squad_respond: Accepts runId, uses per-run question tracking - squad_wait: Accepts runId, uses per-run pulse collector and wait resolvers - squad_cancel: Accepts runId and all:true flag, supports canceling specific run or all runs, calls closeRunSessions() - squad_run: Creates RunContext, passes runId through all dispatch calls, uses per-run pulse collectors PIPELINE REFACTORING: - waitForResponse: Updated to use runId for session lookups - pipelineDeps.dispatch: Passes runId to mgr.dispatch(), uses runContext.pulseCollector - implPipelineDeps.dispatch: CRITICAL FIX - Removed waitForDonePulse call (landmine bradygaster#1), emits done pulse immediately after dispatch - onPhaseStart/onPhaseComplete: Use runContext.pulseCollector instead of global - Intent graph updates: Use runContext.intentGraph with legacy sync - Pipeline tracking: Added to runContext.activePipelines with legacy sync - Auto-close sessions: Calls mgr.closeRunSessions(runId) on pipeline completion - Auto-Sage: Updated to use runContext pulse collector and filter sessions by runId HELPER FUNCTIONS: - resolveRunContext(): Helper to get RunContext with fallback to most recent run - Throws clear errors when run not found LANDMINES FIXED: - Landmine bradygaster#1 (waitForDonePulse deadlock): FIXED - removed waitForDonePulse call, emit done pulse immediately - Sessions properly keyed by agentName::runId throughout - All pulse collector usage now per-run (runContext.pulseCollector) - All question tracking now per-run (runContext.pendingUserQuestions) - All wait resolvers now per-run (runContext.waitResolvers) BACKWARD COMPATIBILITY: - Legacy singleton state (activeRunId, activeIntentGraph, etc.) maintained during migration - Legacy pulse collector still available for compatibility - Both legacy and RunContext state kept in sync Build: Passes Tests: Pending manual verification
Summary
Adds worktree support and Scribe improvements so that Squad works correctly in multi-worktree setups.
Changes
Worktree Awareness (squad.agent.md)
Scribe Auto-Commit (squad.agent.md, scribe-charter.md)
Decision Consolidation (squad.agent.md, scribe-charter.md)
Merge-safe append-only files (squad.agent.md, index.js)
px squad\ install
Template updates (charter.md, scribe-charter.md)
Files changed