Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .squad/agents/eecom/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Learnings

📌 **Team update (2026-03-22T09-35Z — Wave 1):** Economy mode fully implemented: ECONOMY_MODEL_MAP + resolveModel() integration in SDK, `squad economy on|off` CLI command, `--economy` flag, 34 tests passing. PR #504 open for review. Soft dependency: #464 rate limit UX should offer economy mode as recovery. Next: Phase 1 of ambient personal squad (T1–T5, T19) — ready to start immediately after merging current work. Procedures wrote governance proposals for squad.agent.md — awaiting Flight review.

### CLI Entry Point Architecture
cli-entry.ts is the central router for ~30+ CLI commands using dynamic imports (lazy-loading). Commands are routed via if-else blocks. Has a recurring "unwired command" bug class — implementations exist in cli/commands/ but aren't routed in cli-entry.ts. The cli-command-wiring.test.ts regression test catches this by verifying every .ts file in cli/commands/ is imported.

Expand Down Expand Up @@ -103,3 +105,22 @@ CLI completeness audit (2026-03-08) confirmed: 26 primary commands routed in cli
Implemented Flight's privacy-first adoption monitoring strategy on PR #326 branch. Moved `.squad/adoption/` → `.github/adoption/` for better GitHub integration. Stripped tracking.md to aggregate-only metrics (removed all individual repo names/URLs). Updated GitHub Action workflow (adoption-report.yml) and monitoring script (scripts/adoption-monitor.mjs) to write reports to `.github/adoption/reports/`. Removed "Built with Squad" showcase link from README.md (deferred to Tier 2 opt-in feature). This honors the principle: collect aggregate metrics via public APIs, but never publish individual repo lists without explicit consent. Test discipline: verified npm run build passes; docs-build.test.ts passed structure tests (Astro build failure unrelated to changes). Committed with clear message explaining privacy rationale.

📌 **Team update (2026-03-10T12-55-49Z):** Adoption tracking Tier 1 complete and merged to decisions.md. Privacy-first architecture confirmed: aggregate metrics only, opt-in for individual repos, public showcase only when 5+ projects opt in. Append-only file governance enforced (no deletions in history.md or decisions.md). Microsoft ampersand style guide adopted for documentation.

### Economy Mode Implementation (#500) (2026-03-20)

**Context:** Issue #500 requested economy mode — a session-level and persistent modifier that shifts model selection to cheaper alternatives.

**Architecture decision:** Economy mode is a Layer 3/4 modifier only. Layers 0–2 (explicit user preferences: config.json, session directive, charter) are never downgraded. This preserves user intent while enabling cost savings on auto-selected tasks.

**Implementation:**
1. `ECONOMY_MODEL_MAP` + `applyEconomyMode()` in `config/models.ts` — pure mapping function for premium→standard and standard→fast downgrades
2. `readEconomyMode()` + `writeEconomyMode()` — config.json read/write functions (same merge-without-clobber pattern as `writeModelPreference()`)
3. `resolveModel()` in `config/models.ts` updated with `economyMode?: boolean` option; falls back to reading from `squadDir` if not provided
4. `resolveModel()` in `agents/model-selector.ts` updated with `economyMode?: boolean` — both SDK resolvers are economy-aware
5. `squad economy [on|off]` command in CLI for persistent toggle
6. `--economy` global flag in `cli-entry.ts` sets `SQUAD_ECONOMY_MODE=1` env var for session scope
7. 34 new tests in `test/economy-mode.test.ts` — all pass

**Key pattern:** Both resolveModel implementations follow identical principle: explicit overrides (user choice) are sacred; economy only affects computed auto-selection.

**PR:** #500 branch `squad/500-economy-mode`
21 changes: 21 additions & 0 deletions .squad/agents/flight/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

---

📌 **Team update (2026-03-22T09-35Z — Wave 1):** Ambient personal squad design validated and 19-task implementation plan authored across 4 PRs (Phase 1 SDK, Phase 2 CLI, Phase 3 governance, Phase 4 tests). MVP = PR #1 + PR #3. EECOM executing Phase 1–2 (SDK + CLI), Procedures executing Phase 3 (governance) concurrently. All design gaps resolved; dependency graph established. Procedures wrote governance proposals for personal squad + economy mode — awaiting your review. Sims to execute Phase 4 after Phase 1+2 merge. Directive captured: bug #502 (node:sqlite, P1) to be picked up after Wave 1. No blocking issues — ready for execution.

## Core Context

Three-branch model (main/dev/insiders). Apollo 13 team, 3931 tests. Boundary review heuristic: "Squad Ships It" — if Squad doesn't ship the code, it's IRL content. Proposal-first: meaningful changes need docs/proposals/ before code. Two-error lockout policy: agent locked out after 2 errors in a session. Test name-agnosticism: framework tests must never depend on dev team's agent names.
Expand Down Expand Up @@ -40,3 +42,22 @@ Approved PR #331 ("docs: scenario and feature guides from blog analysis") for me
Created `.squad/skills/content-triage/SKILL.md` to codify the boundary heuristic from PR #331. Defines repeatable workflow for triaging external content (blog posts, sample repos, videos, talks) to determine what belongs in Squad's public docs vs IRL tracking. Key components: (1) "Squad Ships It" litmus test — if Squad doesn't ship the code/config, it's IRL content; (2) triage workflow triggered by `content-triage` label or external content reference in issue body; (3) output format with boundary analysis, sub-issues for PAO (doc extraction), and IRL reference entry for Scribe; (4) label convention (`content:blog`, `content:sample`, `content:video`, `content:talk`); (5) Ralph integration for routing to Flight, creating sub-issues, and notifying Scribe. Examples include Tamir blog analysis (PR #331), sample repo with ops patterns, and conference talk. Pattern prevents infrastructure docs from polluting Squad's public docs while ensuring community content accelerates adoption through proper extraction and referencing.

📌 **Team update (2026-03-11T01:27:57Z):** Content triage skill finalized; "Squad Ships It" boundary heuristic codified into shared team decision (decisions.md). Remote Squad access phased rollout approved (Discussions bot → Copilot Extension → Chat bot). PR #331 boundary review pattern established as standard for all doc PRs. Triage workflow enables Flight to scale as community content accelerates.

### Ambient Personal Squad Architecture Review (#329 + #344)

**Design validated:** The `flight-ambient-personal-squad.md` proposal is structurally sound. Key finding: `multi-squad.ts` already stores personal squad paths as direct dirs (`squads/{name}/`) with no nested `.squad/` subfolder — the "each team IS the squad root" convention is already the implementation, not a change needed.

**Five gaps found in the design doc:**
1. No `resolvePersonalAgents()` function signature — added in implementation plan (T2).
2. Scenario 9 contradiction: personal agents wrote to project orchestration log, violating ghost protocol. Resolution: coordinator writes audit trail (project state), not the personal agent.
3. `--team-root` scope was undefined. Decision: additive CLI flag on `squad init`, backward compat with existing `config.json` teamRoot.
4. `squad personal init` was missing — bootstrapping path for first-time users. Added as T6 subcommand.
5. `SQUAD_NO_PERSONAL` env var was in Open Questions but absent from phases. Added to T1.

**Architecture decision:** Need `ensureSquadPathTriple` in `resolution.ts` (T4) — personal agents write to a third root (personal squad dir). Without it, ghost protocol is advisory-only and not enforced by path guards in SDK.

**Phasing:** Four PRs. MVP = PR #1 (SDK Foundation) + PR #3 (Governance). Users see ambient cast immediately; `squad personal` commands are quality-of-life on top.

**Implementation plan written to:** `.squad/decisions/inbox/flight-329-344-implementation-plan.md`

📌 **Team update (2026-03-24):** Ambient personal squad design reviewed and approved with 5 gaps identified and resolved. Implementation plan broken into 4 PRs across EECOM (SDK + CLI), Procedures (governance), and Sims (tests). MVP path = SDK foundation + governance updates. Phased to avoid one giant PR.
24 changes: 24 additions & 0 deletions .squad/agents/procedures/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Learnings

📌 **Team update (2026-03-22T09-35Z — Wave 1):** Economy mode governance proposal and personal squad consult-mode governance proposal authored for squad.agent.md — both DRAFT, awaiting Flight review before merging. Economy mode adds Layer 3 table + spawn convention (`💰 economy`) + model catalog audit. Personal squad adds consult mode detection, path reference table, spawn guidance. Persistent model preference (Layer 0) documented. Proposed new skill: `.squad/skills/consult-mode/SKILL.md` (post-approval). Deterministic skill pattern proven effective. PR #503 open with skills module. Next: Flight review → merge governance to squad.agent.md. No blocking issues.

### 2026-03-10: Deterministic skill pattern

**Problem:** Skills were too loose. The distributed-mesh skill was tested in a real project (mesh-demo), and agents generated 76 lines of validator code, 5 test files with 43 tests, regenerated sync scripts that should have been copied from templates, and left decision files empty. The skill document let agents interpret intent instead of following explicit steps.
Expand Down Expand Up @@ -80,3 +82,25 @@

**Pattern:** NEVER/ALWAYS sections in charters compress well — fold bullet lists into single-paragraph summaries. Essential workflow details (Scribe's commit steps) should stay verbose.

### 2026-03-22: Economy mode skill and personal squad governance (#500, #344)

**Task:** Two governance tasks — economy mode skill design and personal squad coordinator awareness.

**Economy mode (SKILL.md):**
- Created `.squad/skills/economy-mode/SKILL.md` as a Layer 3 modifier, not a new resolution layer
- Key design decision: economy mode ONLY affects Layer 3 auto-selection — Layer 0/1/2 (user intent) always wins
- `💰` indicator in spawn acknowledgments keeps it transparent
- Activation via session phrase, persistent config (`economyMode: true` in config.json), or CLI flag
- Architecture trips shift from opus → sonnet; code tasks shift from sonnet → gpt-4.1/gpt-5-mini
- Confidence: `low` — first implementation, not yet validated

**Personal squad governance (proposals):**
- Gap analysis: coordinator has no consult mode awareness despite full SDK implementation
- Five gaps identified: Init Mode missing personal squad resolution, no consult mode detection, TEAM_ROOT has no personal-squad semantics, charter templates lack consult-mode patterns, no consult-mode skill
- Proposed `CONSULT_MODE: true` as spawn prompt signal, `🧳 consult` in acknowledgments
- Proposed new consult-mode skill (after governance approval — skill after governance, not before)

**Governance workflow pattern:** When proposals touch squad.agent.md (governance territory), write to `decisions/inbox/` for Flight review. Don't directly edit squad.agent.md — Flight reviews governance changes.

**Catalog audit finding:** `claude-sonnet-4.6`, `gpt-5.4`, `gpt-5.3-codex` appear in model-selection SKILL.md fallback chains but are absent from squad.agent.md's "Valid models" catalog. Documented in economy-mode governance proposal for Flight to address.

139 changes: 139 additions & 0 deletions .squad/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5999,3 +5999,142 @@ Brady must create Automation token at https://www.npmjs.com/settings/{username}/
- `.github/workflows/squad-release.yml` — GitHub Release creation
- `.squad/agents/kobayashi/history.md` — Implementation details

---

## Wave 1 Decisions (#329/#344/#500) — 2026-03-22T09-35Z

### Implementation Plan: Ambient Personal Squad (#329 + #344)

**Author:** Flight (Lead)
**Date:** 2026-03-22
**Issues:** #329, #344

Personal squad implementation across 4 PRs with clear phase dependencies:

- **PR #1 — SDK Foundation** (EECOM): ResolvedSquadPaths.personalDir, resolvePersonalSquadDir(), PersonalAgentMeta type, resolvePersonalAgents(), mergeSessionCast(), ensureSquadPathTriple()
- **PR #2 — CLI Surface** (EECOM): squad personal {init,list,add,remove}, squad cast, --team-root flag, wiring + exports
- **PR #3 — Governance** (Procedures, concurrent): squad.agent.md updates for personal squad, Ghost Protocol in templates, personal-charter.md template
- **PR #4 — Tests** (Sims): E2E ambient discovery, Ghost Protocol, routing scenarios, unit tests for SDK functions

**MVP = PR #1 + PR #3.** Phase 1 unblocks Phase 2.

**Key Decisions:**
- Personal agents tagged with `origin: 'personal'` and Ghost Protocol applied
- Audit trail (personal agent participation) is coordinator-written in project orchestration log
- SQUAD_NO_PERSONAL env var gates ambient discovery at Phase 1, earliest point
- Dual-root path guard (ensureSquadPathDual) extended to triple-root (ensureSquadPathTriple) for personal squad dirs
- Personal squad paths resolved via platform detection (never hard-coded)

**Blocking:** None — design validated against codebase. Ready for EECOM Phase 1 start.

### Economy Mode Design — #500

**Author:** EECOM
**Date:** 2026-03-20

Economy mode implemented as Layer 3/4 modifier (never overrides explicit preferences Layers 0–2):

| Normal | Economy | Use Case |
|--------|---------|----------|
| claude-opus-4.6 | claude-sonnet-4.5 | Architecture, review |
| claude-sonnet-4.6 | gpt-4.1 | Code writing |
| claude-sonnet-4.5 | gpt-4.1 | Code writing |
| claude-haiku-4.5 | gpt-4.1 | Docs, planning, mechanical |

**Activation:**
- Persistent: `"economyMode": true` in `.squad/config.json`
- Session: `--economy` CLI flag (SQUAD_ECONOMY_MODE=1 env var)
- Toggle: `squad economy on|off` command

**Implementation:**
- ECONOMY_MODEL_MAP + applyEconomyMode() in packages/squad-sdk/src/config/models.ts
- readEconomyMode() + writeEconomyMode() in config/models.ts
- resolveModel() accepts economyMode option
- squad economy {on|off} command
- --economy global flag in cli-entry.ts
- 34 tests — PR #504 open

**Key Decision:** Economy mode respects user intent. If a user says "always use opus", economy mode defers to that choice.

### Economy Mode Governance — #500

**Author:** Procedures (Prompt Engineer)
**Date:** 2026-03-22

Governance additions needed in squad.agent.md:

1. **Economy Mode Section** — positioned as Layer 3 override, respects Layers 0–2
2. **Economy Model Selection Table** — per-task mapping (code, docs, architecture review, etc.)
3. **Spawn Acknowledgment Convention** — include `💰 economy` indicator when active
4. **Valid Models Catalog Audit** — added claude-sonnet-4.6, gpt-5.4, gpt-5.3-codex; confirmed gpt-4.1, gpt-5-mini already present

**Status:** DRAFT — awaiting Flight review before merging to squad.agent.md.

### Personal Squad Governance — Consult Mode Awareness (#344)

**Author:** Procedures (Prompt Engineer)
**Date:** 2026-03-22

Governance additions for squad.agent.md to close consult-mode coordinator awareness gap:

1. **Consult Mode Detection** — check config.json for `"consult": true` after resolving team root
2. **Personal Squad Path Reference** — platform-specific paths (Linux, macOS, Windows) resolved via resolveGlobalSquadPath(), never hard-coded
3. **Consult Mode Spawn Guidance** — pass CONSULT_MODE: true + PROJECT_NAME in spawn prompts so agents know decisions are project-isolated
4. **Consult Mode Acknowledgment Format** — `🧳 consult mode active — {Agent}` with extraction staging notes
5. **Charter Template Additions** — all agent charters gain "Consult Mode Awareness" note in "How I Work"

**Proposed Skill** (post-approval): `.squad/skills/consult-mode/SKILL.md` — coordinator behavior for consult mode (detection, spawn guidance, extraction workflow).

**Status:** DRAFT — awaiting Flight review before merging.

### Persistent Model Preference via config.json — #284

**Author:** Procedures (Prompt Engineer)
**Date:** 2026-03-17

Model selection uses 5-layer hierarchy with Layer 0 (Persistent Config) stored in .squad/config.json:

- `defaultModel` — global preference
- `agentModelOverrides` — per-agent overrides (keyed by agent name)

Coordinator reads these on session start. Persists new preferences when user says "always use X."

**Impact:** All agents respect Layer 0 when spawning. Model preferences travel with the repo (checked into git).

### User Directives (Captured 2026-03-22)

**Rate Limit Recovery UX (#464 soft dependency):**
When Squad detects a rate limit, offer actionable recovery: (1) switch to equivalent/alternative models, (2) offer economy mode (#500) as fallback. Rate limits should be a pivot point, not a dead end. *Status: Directive captured; soft dependency on #500.*

**Bug #502 — Next Priority:**
node:sqlite installer dependency bug is workshop blocker (P1). Pick up immediately after Wave 1 (#329/#344/#500) finishes. *Status: Queued for Wave 2.*

**GitHub Discussions in Triage:**
Include GitHub Discussions in triage workflow alongside issues and PRs. Scan and respond to open discussions as part of the workflow. *Status: Directive captured.*

### Template Directory Sync Enforcement — #461

**Author:** Fenster (Core Dev)
**Date:** 2026-07-16

Template files have 5 duplicate locations. Canonical source is `.squad-templates/`. All copies in `templates/`, `packages/squad-cli/templates/`, `packages/squad-sdk/templates/`, `.github/agents/` must match canonical.

**Enforcement:** `test/template-sync.test.ts` enforces byte-for-byte parity for casting-policy.json, universe count parity for squad.agent.md, cross-file count validation.

**Impact:** All team members editing template files must update all locations + pass sync tests.

### Dual-Layer ESM Fix for vscode-jsonrpc — #449

**Author:** GNC
**Date:** 2026-07-25

ESM module resolution uses dual-layer postinstall strategy:

1. **Layer 1 (canonical):** Inject `exports` field into vscode-jsonrpc@8.2.1/package.json
2. **Layer 2 (defense-in-depth):** Patch copilot-sdk/dist/session.js to add .js extension
3. **Layer 3 (runtime):** cli-entry.ts Module._resolveFilename intercept (handles npx cache hits)

`squad doctor` now detects both Layer 1 and Layer 2 issues. Matches vscode-jsonrpc v9.x forward-compatibility.

**Impact:** If users report ESM errors on Node 22/24, direct them to `squad doctor`.

21 changes: 0 additions & 21 deletions .squad/decisions/inbox/fenster-template-audit.md

This file was deleted.

Loading
Loading