@bradygaster/squad-cli 0.9.3-insider.1 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/README.md +33 -0
  2. package/dist/cli/commands/cast.d.ts.map +1 -1
  3. package/dist/cli/commands/cast.js +9 -2
  4. package/dist/cli/commands/cast.js.map +1 -1
  5. package/dist/cli/commands/externalize.d.ts +27 -0
  6. package/dist/cli/commands/externalize.d.ts.map +1 -0
  7. package/dist/cli/commands/externalize.js +209 -0
  8. package/dist/cli/commands/externalize.js.map +1 -0
  9. package/dist/cli/commands/loop.d.ts +6 -1
  10. package/dist/cli/commands/loop.d.ts.map +1 -1
  11. package/dist/cli/commands/loop.js +13 -13
  12. package/dist/cli/commands/loop.js.map +1 -1
  13. package/dist/cli/commands/migrate.js +2 -2
  14. package/dist/cli/commands/migrate.js.map +1 -1
  15. package/dist/cli/commands/plugin.d.ts.map +1 -1
  16. package/dist/cli/commands/plugin.js +2 -1
  17. package/dist/cli/commands/plugin.js.map +1 -1
  18. package/dist/cli/commands/rc.js +2 -2
  19. package/dist/cli/commands/rc.js.map +1 -1
  20. package/dist/cli/commands/skill.d.ts +31 -0
  21. package/dist/cli/commands/skill.d.ts.map +1 -0
  22. package/dist/cli/commands/skill.js +497 -0
  23. package/dist/cli/commands/skill.js.map +1 -0
  24. package/dist/cli/commands/start.d.ts.map +1 -1
  25. package/dist/cli/commands/start.js +31 -5
  26. package/dist/cli/commands/start.js.map +1 -1
  27. package/dist/cli/commands/watch/agent-spawn.d.ts +62 -0
  28. package/dist/cli/commands/watch/agent-spawn.d.ts.map +1 -0
  29. package/dist/cli/commands/watch/agent-spawn.js +127 -0
  30. package/dist/cli/commands/watch/agent-spawn.js.map +1 -0
  31. package/dist/cli/commands/watch/capabilities/decision-hygiene.js +3 -3
  32. package/dist/cli/commands/watch/capabilities/decision-hygiene.js.map +1 -1
  33. package/dist/cli/commands/watch/capabilities/execute.d.ts.map +1 -1
  34. package/dist/cli/commands/watch/capabilities/execute.js +15 -5
  35. package/dist/cli/commands/watch/capabilities/execute.js.map +1 -1
  36. package/dist/cli/commands/watch/capabilities/monitor-email.js +3 -3
  37. package/dist/cli/commands/watch/capabilities/monitor-email.js.map +1 -1
  38. package/dist/cli/commands/watch/capabilities/monitor-teams.js +3 -3
  39. package/dist/cli/commands/watch/capabilities/monitor-teams.js.map +1 -1
  40. package/dist/cli/commands/watch/capabilities/retro.js +3 -3
  41. package/dist/cli/commands/watch/capabilities/retro.js.map +1 -1
  42. package/dist/cli/commands/watch/capabilities/wave-dispatch.js +3 -3
  43. package/dist/cli/commands/watch/capabilities/wave-dispatch.js.map +1 -1
  44. package/dist/cli/commands/watch/config.d.ts +10 -8
  45. package/dist/cli/commands/watch/config.d.ts.map +1 -1
  46. package/dist/cli/commands/watch/config.js +27 -5
  47. package/dist/cli/commands/watch/config.js.map +1 -1
  48. package/dist/cli/commands/watch/external-loader.d.ts +14 -0
  49. package/dist/cli/commands/watch/external-loader.d.ts.map +1 -0
  50. package/dist/cli/commands/watch/external-loader.js +85 -0
  51. package/dist/cli/commands/watch/external-loader.js.map +1 -0
  52. package/dist/cli/commands/watch/health.js +10 -9
  53. package/dist/cli/commands/watch/health.js.map +1 -1
  54. package/dist/cli/commands/watch/index.d.ts +10 -0
  55. package/dist/cli/commands/watch/index.d.ts.map +1 -1
  56. package/dist/cli/commands/watch/index.js +53 -7
  57. package/dist/cli/commands/watch/index.js.map +1 -1
  58. package/dist/cli/commands/watch/pid-tracker.d.ts +35 -0
  59. package/dist/cli/commands/watch/pid-tracker.d.ts.map +1 -0
  60. package/dist/cli/commands/watch/pid-tracker.js +127 -0
  61. package/dist/cli/commands/watch/pid-tracker.js.map +1 -0
  62. package/dist/cli/commands/watch/types.d.ts +5 -0
  63. package/dist/cli/commands/watch/types.d.ts.map +1 -1
  64. package/dist/cli/core/email-scrub.js +2 -2
  65. package/dist/cli/core/email-scrub.js.map +1 -1
  66. package/dist/cli/core/gh-cli.d.ts +2 -1
  67. package/dist/cli/core/gh-cli.d.ts.map +1 -1
  68. package/dist/cli/core/gh-cli.js +3 -2
  69. package/dist/cli/core/gh-cli.js.map +1 -1
  70. package/dist/cli/core/init.d.ts.map +1 -1
  71. package/dist/cli/core/init.js +26 -31
  72. package/dist/cli/core/init.js.map +1 -1
  73. package/dist/cli/core/migrations.js +1 -1
  74. package/dist/cli/core/migrations.js.map +1 -1
  75. package/dist/cli/core/nap.js +2 -2
  76. package/dist/cli/core/nap.js.map +1 -1
  77. package/dist/cli/core/project-type.js +1 -1
  78. package/dist/cli/core/project-type.js.map +1 -1
  79. package/dist/cli/core/templates.d.ts.map +1 -1
  80. package/dist/cli/core/templates.js +48 -0
  81. package/dist/cli/core/templates.js.map +1 -1
  82. package/dist/cli/core/upgrade.d.ts +4 -2
  83. package/dist/cli/core/upgrade.d.ts.map +1 -1
  84. package/dist/cli/core/upgrade.js +46 -21
  85. package/dist/cli/core/upgrade.js.map +1 -1
  86. package/dist/cli/shell/index.d.ts.map +1 -1
  87. package/dist/cli/shell/index.js +22 -0
  88. package/dist/cli/shell/index.js.map +1 -1
  89. package/dist/cli/shell/session-store.js +2 -2
  90. package/dist/cli/shell/session-store.js.map +1 -1
  91. package/dist/cli-entry.js +101 -83
  92. package/dist/cli-entry.js.map +1 -1
  93. package/package.json +6 -2
  94. package/templates/casting-reference.md +104 -104
  95. package/templates/ceremonies.md +28 -28
  96. package/templates/fact-checker-charter.md +83 -0
  97. package/templates/mcp-config.md +0 -2
  98. package/templates/scribe-charter.md +1 -1
  99. package/templates/skills/external-comms/SKILL.md +329 -329
  100. package/templates/skills/gh-auth-isolation/SKILL.md +183 -183
  101. package/templates/skills/humanizer/SKILL.md +105 -105
  102. package/templates/skills/pr-review-response/SKILL.md +268 -0
  103. package/templates/skills/pr-screenshots/SKILL.md +149 -149
  104. package/templates/skills/versioning-policy/SKILL.md +119 -0
  105. package/templates/squad.agent.md.template +13 -6
  106. package/dist/cli/commands/watch/capabilities/budget-check.d.ts +0 -29
  107. package/dist/cli/commands/watch/capabilities/budget-check.d.ts.map +0 -1
  108. package/dist/cli/commands/watch/capabilities/budget-check.js +0 -38
  109. package/dist/cli/commands/watch/capabilities/budget-check.js.map +0 -1
  110. package/dist/cli/commands/watch/capabilities/circuit-breaker.d.ts +0 -52
  111. package/dist/cli/commands/watch/capabilities/circuit-breaker.d.ts.map +0 -1
  112. package/dist/cli/commands/watch/capabilities/circuit-breaker.js +0 -152
  113. package/dist/cli/commands/watch/capabilities/circuit-breaker.js.map +0 -1
  114. package/dist/cli/commands/watch/capabilities/health-check.d.ts +0 -29
  115. package/dist/cli/commands/watch/capabilities/health-check.d.ts.map +0 -1
  116. package/dist/cli/commands/watch/capabilities/health-check.js +0 -139
  117. package/dist/cli/commands/watch/capabilities/health-check.js.map +0 -1
  118. package/dist/cli/commands/watch/capabilities/heartbeat.d.ts +0 -48
  119. package/dist/cli/commands/watch/capabilities/heartbeat.d.ts.map +0 -1
  120. package/dist/cli/commands/watch/capabilities/heartbeat.js +0 -115
  121. package/dist/cli/commands/watch/capabilities/heartbeat.js.map +0 -1
  122. package/dist/cli/commands/watch/capabilities/lockfile.d.ts +0 -30
  123. package/dist/cli/commands/watch/capabilities/lockfile.d.ts.map +0 -1
  124. package/dist/cli/commands/watch/capabilities/lockfile.js +0 -100
  125. package/dist/cli/commands/watch/capabilities/lockfile.js.map +0 -1
  126. package/dist/cli/commands/watch/capabilities/machine-capabilities.d.ts +0 -30
  127. package/dist/cli/commands/watch/capabilities/machine-capabilities.d.ts.map +0 -1
  128. package/dist/cli/commands/watch/capabilities/machine-capabilities.js +0 -103
  129. package/dist/cli/commands/watch/capabilities/machine-capabilities.js.map +0 -1
  130. package/dist/cli/commands/watch/capabilities/post-failure.d.ts +0 -19
  131. package/dist/cli/commands/watch/capabilities/post-failure.d.ts.map +0 -1
  132. package/dist/cli/commands/watch/capabilities/post-failure.js +0 -58
  133. package/dist/cli/commands/watch/capabilities/post-failure.js.map +0 -1
  134. package/dist/cli/commands/watch/capabilities/priority.d.ts +0 -59
  135. package/dist/cli/commands/watch/capabilities/priority.d.ts.map +0 -1
  136. package/dist/cli/commands/watch/capabilities/priority.js +0 -101
  137. package/dist/cli/commands/watch/capabilities/priority.js.map +0 -1
  138. package/dist/cli/commands/watch/capabilities/rate-pool.d.ts +0 -67
  139. package/dist/cli/commands/watch/capabilities/rate-pool.d.ts.map +0 -1
  140. package/dist/cli/commands/watch/capabilities/rate-pool.js +0 -187
  141. package/dist/cli/commands/watch/capabilities/rate-pool.js.map +0 -1
  142. package/dist/cli/commands/watch/capabilities/stale-reclaim.d.ts +0 -23
  143. package/dist/cli/commands/watch/capabilities/stale-reclaim.d.ts.map +0 -1
  144. package/dist/cli/commands/watch/capabilities/stale-reclaim.js +0 -87
  145. package/dist/cli/commands/watch/capabilities/stale-reclaim.js.map +0 -1
  146. package/dist/cli/commands/watch/capabilities/webhook-alerts.d.ts +0 -29
  147. package/dist/cli/commands/watch/capabilities/webhook-alerts.d.ts.map +0 -1
  148. package/dist/cli/commands/watch/capabilities/webhook-alerts.js +0 -114
  149. package/dist/cli/commands/watch/capabilities/webhook-alerts.js.map +0 -1
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: "versioning-policy"
3
+ description: "Semver versioning rules for Squad SDK and CLI — prevents prerelease version incidents"
4
+ domain: "release, versioning, npm, CI"
5
+ confidence: "medium"
6
+ source: "earned (PR #640 workspace resolution incident, PR #116 prerelease leak, CI gate implementation)"
7
+ ---
8
+
9
+ ## Context
10
+
11
+ Squad is a monorepo with two publishable npm packages (`@bradygaster/squad-sdk` and `@bradygaster/squad-cli`) managed via npm workspaces. Version mismatches and prerelease leaks have caused production incidents — most notably PR #640, where a `-build.N` prerelease version silently broke workspace dependency resolution.
12
+
13
+ This skill codifies the versioning rules every agent must follow.
14
+
15
+ ## 1. Version Format
16
+
17
+ All packages use **strict semver**: `MAJOR.MINOR.PATCH`
18
+
19
+ - ✅ `0.9.1`, `1.0.0`, `0.10.0`
20
+ - ❌ `0.9.1-build.4`, `0.9.1-preview.1`, `0.8.6.1-preview`
21
+
22
+ No prerelease suffixes on `dev` or `main` branches — ever.
23
+
24
+ ## 2. Prerelease Versions Are Ephemeral
25
+
26
+ The `scripts/bump-build.mjs` script creates `-build.N` versions (e.g., `0.9.1-build.4`) for **local development testing only**.
27
+
28
+ Rules:
29
+ - `-build.N` versions are created automatically during local `npm run build`
30
+ - They are **never committed** to `dev` or `main`
31
+ - The script skips itself in CI (`CI=true` or `SKIP_BUILD_BUMP=1`)
32
+ - If you see a `-build.N` version in a PR diff, it is a bug — reject the PR
33
+
34
+ ## 3. SDK and CLI Version Sync
35
+
36
+ Both `@bradygaster/squad-sdk` and `@bradygaster/squad-cli` **MUST have the same version** at all times. The root `package.json` version must also match.
37
+
38
+ `bump-build.mjs` enforces this by updating all three `package.json` files in lockstep (root + `packages/squad-sdk` + `packages/squad-cli`).
39
+
40
+ If versions diverge, workspace resolution silently breaks (see §4).
41
+
42
+ ## 4. npm Workspace Semver Footgun
43
+
44
+ The CLI depends on the SDK via a workspace dependency with a semver range:
45
+
46
+ ```json
47
+ "@bradygaster/squad-sdk": ">=0.9.0"
48
+ ```
49
+
50
+ **Critical:** Per the semver specification, `>=0.9.0` does **NOT** match `0.9.1-build.4`.
51
+
52
+ Semver prerelease versions (anything with a `-` suffix) are only matched by ranges that explicitly reference the same `MAJOR.MINOR.PATCH` base with a prerelease comparator. A bare `>=0.9.0` range skips all prerelease versions.
53
+
54
+ **What happens:** When the local SDK has version `0.9.1-build.4`, npm's workspace resolution fails to match the `>=0.9.0` range. npm then **silently installs a stale published version** from the npm registry instead of using the local workspace link. The build succeeds but runs against old SDK code.
55
+
56
+ This is the root cause of the **PR #640 incident**, where workspace packages appeared linked but were actually running against stale registry versions.
57
+
58
+ ## 5. Who Bumps Versions
59
+
60
+ **Surgeon (Release Manager) owns all version bumps.**
61
+
62
+ | Agent | May modify `version` in package.json? |
63
+ |-------|---------------------------------------|
64
+ | Surgeon | ✅ Yes — sole owner of version bumps |
65
+ | Any other agent | ❌ No — unless explicitly fixing a prerelease leak |
66
+
67
+ If you discover a prerelease version committed to `dev` or `main`, you may fix it (revert to the clean release version) without Surgeon's approval. This is a safety escape hatch, not a license to manage versions.
68
+
69
+ ## 6. Version Bump Lifecycle
70
+
71
+ ```
72
+ ┌─────────────────────────────────────────────────────────┐
73
+ │ Development phase │
74
+ │ Versions stay at current release: 0.9.1 │
75
+ │ bump-build.mjs creates -build.N locally (not committed)│
76
+ ├─────────────────────────────────────────────────────────┤
77
+ │ Pre-release testing │
78
+ │ bump-build.mjs → 0.9.1-build.1, -build.2, ... │
79
+ │ Local only. Never committed. Never pushed. │
80
+ ├─────────────────────────────────────────────────────────┤
81
+ │ Release │
82
+ │ Surgeon bumps to next version (e.g., 0.9.2 or 0.10.0) │
83
+ │ Tags, publishes to npm registry │
84
+ ├─────────────────────────────────────────────────────────┤
85
+ │ Post-release │
86
+ │ Versions stay at the new release version (e.g., 0.9.2) │
87
+ │ Development continues on clean version │
88
+ └─────────────────────────────────────────────────────────┘
89
+ ```
90
+
91
+ ## 7. CI Enforcement
92
+
93
+ The **`prerelease-version-guard`** CI gate blocks any PR to `dev` or `main` that contains prerelease version strings in `package.json` files.
94
+
95
+ - The gate scans all three `package.json` files for `-` in the version field
96
+ - PRs with prerelease versions **cannot merge** until the version is cleaned
97
+ - The `skip-version-check` label bypasses the gate — use **only** for the bump-build script's own PR (if applicable), and only with Surgeon's approval
98
+
99
+ ## 8. Incident Reference — PR #640
100
+
101
+ **PR #640** is the cautionary tale for this entire policy.
102
+
103
+ **What happened:** Prerelease versions (`0.9.1-build.4`) were committed to a branch. The workspace dependency `>=0.9.0` failed to match the prerelease version per semver spec. npm silently installed a stale published SDK from the registry instead of linking the local workspace copy. Four PRs (#637–#640) attempted iterative patches before the root cause was identified.
104
+
105
+ **Root cause:** No versioning policy existed. Agents didn't know that prerelease versions break workspace resolution, or that only Surgeon should modify versions.
106
+
107
+ **Resolution:** This skill, the `prerelease-version-guard` CI gate, and the team decision to centralize version ownership under Surgeon.
108
+
109
+ ## Quick Reference
110
+
111
+ | Rule | Summary |
112
+ |------|---------|
113
+ | Format | `MAJOR.MINOR.PATCH` — no prerelease on dev/main |
114
+ | Prerelease | `-build.N` is local-only, never committed |
115
+ | Sync | SDK + CLI + root must have identical versions |
116
+ | Ownership | Surgeon bumps versions; others don't touch them |
117
+ | CI gate | `prerelease-version-guard` blocks prerelease PRs |
118
+ | Escape hatch | Any agent may revert a prerelease leak to clean version |
119
+ | Footgun | `>=0.9.0` does NOT match `0.9.1-build.4` per semver |
@@ -19,6 +19,7 @@ You are **Squad (Coordinator)** — the orchestrator for this project's AI team.
19
19
  - You may NOT generate domain artifacts (code, designs, analyses) — spawn an agent
20
20
  - You may NOT bypass reviewer approval on rejected work
21
21
  - You may NOT invent facts or assumptions — ask the user or spawn an agent who knows
22
+ - You may NOT do work yourself — ALWAYS delegate to a team member, even for small tasks. The only exception is Direct Mode (status checks, factual questions, and simple answers from context — see Response Mode Selection).
22
23
 
23
24
  Check: Does `.squad/team.md` exist? (fall back to `.ai-team/team.md` for repos migrating from older installs)
24
25
  - **No** → Init Mode
@@ -104,7 +105,7 @@ The `union` merge driver keeps all lines from both sides, which is correct for a
104
105
 
105
106
  **If you wrote code, generated artifacts, or produced domain work without dispatching to an agent, you violated this rule. The coordinator ROUTES — it does not BUILD. No exceptions.**
106
107
 
107
- **On every session start:** Run `git config user.name` to identify the current user, and **resolve the team root** (see Worktree Awareness). Store the team root — all `.squad/` paths must be resolved relative to it. Pass the team root into every spawn prompt as `TEAM_ROOT` and the current user's name into every agent spawn prompt and Scribe log so the team always knows who requested the work. Check `.squad/identity/now.md` if it exists — it tells you what the team was last focused on. Update it if the focus has shifted.
108
+ **On every session start:** Run `git config user.name` to identify the current user, and **resolve the team root** (see Worktree Awareness). Store the team root — all `.squad/` paths must be resolved relative to it. Pass the team root and the current datetime (from `<current_datetime>` in your system context) into every spawn prompt as `TEAM_ROOT` and `CURRENT_DATETIME` respectively. Pass the current user's name into every agent spawn prompt and Scribe log so the team always knows who requested the work. Check `.squad/identity/now.md` if it exists — it tells you what the team was last focused on. Update it if the focus has shifted.
108
109
 
109
110
  **⚡ Context caching:** After the first message in a session, `team.md`, `routing.md`, and `registry.json` are already in your context. Do NOT re-read them on subsequent messages — you already have the roster, routing rules, and cast names. Only re-read if the user explicitly modifies the team (adds/removes members, changes routing).
110
111
 
@@ -330,6 +331,7 @@ description: "{emoji} {Name}: {brief task summary}"
330
331
  prompt: |
331
332
  You are {Name}, the {Role} on this project.
332
333
  TEAM ROOT: {team_root}
334
+ CURRENT_DATETIME: {current_datetime}
333
335
  WORKTREE_PATH: {worktree_path}
334
336
  WORKTREE_MODE: {true|false}
335
337
  **Requested by:** {current user name}
@@ -348,7 +350,7 @@ prompt: |
348
350
  ⚠️ RESPONSE ORDER: After ALL tool calls, write a plain text summary as FINAL output.
349
351
  ```
350
352
 
351
- For read-only queries, use the explore agent: `agent_type: "explore"` with `"You are {Name}, the {Role}. {question} TEAM ROOT: {team_root}"`
353
+ For read-only queries, use the explore agent: `agent_type: "explore"` with `"You are {Name}, the {Role}. CURRENT_DATETIME: {current_datetime} — {question} TEAM ROOT: {team_root}"`
352
354
 
353
355
  ### Per-Agent Model Selection
354
356
 
@@ -499,7 +501,7 @@ The `sql` tool is **CLI-only**. It does not exist on VS Code, JetBrains, or GitH
499
501
 
500
502
  MCP (Model Context Protocol) servers extend Squad with tools for external services — Trello, Aspire dashboards, Azure, Notion, and more. The user configures MCP servers in their environment; Squad discovers and uses them.
501
503
 
502
- > **Full patterns:** Read `.squad/skills/mcp-tool-discovery/SKILL.md` for discovery patterns, domain-specific usage, graceful degradation. Read `.squad/templates/mcp-config.md` for config file locations, sample configs, and authentication notes.
504
+ > **Config details:** Read `.squad/templates/mcp-config.md` for config file locations, sample configs, and authentication notes.
503
505
 
504
506
  #### Detection
505
507
 
@@ -623,15 +625,17 @@ Squad and all spawned agents may be running inside a **git worktree** rather tha
623
625
 
624
626
  **How the Coordinator resolves the team root (on every session start):**
625
627
 
626
- 1. Run `git rev-parse --show-toplevel` to get the current worktree root.
627
- 2. Check if `.squad/` exists at that root (fall back to `.ai-team/` for repos that haven't migrated yet).
628
+ 1. **Check CWD first** does `.squad/` exist in the current working directory?
629
+ - **Yes** Team root = CWD. This handles monorepos where `.squad/` lives in a subfolder.
630
+ 2. If not, run `git rev-parse --show-toplevel` to get the current worktree root.
631
+ 3. Check if `.squad/` exists at that root (fall back to `.ai-team/` for repos that haven't migrated yet).
628
632
  - **Yes** → use **worktree-local** strategy. Team root = current worktree root.
629
633
  - **No** → use **main-checkout** strategy. Discover the main working tree:
630
634
  ```
631
635
  git worktree list --porcelain
632
636
  ```
633
637
  The first `worktree` line is the main working tree. Team root = that path.
634
- 3. The user may override the strategy at any time (e.g., *"use main checkout for team state"* or *"keep team state in this worktree"*).
638
+ 4. The user may override the strategy at any time (e.g., *"use main checkout for team state"* or *"keep team state in this worktree"*).
635
639
 
636
640
  **Passing the team root to agents:**
637
641
  - The Coordinator includes `TEAM_ROOT: {resolved_path}` in every spawn prompt.
@@ -769,6 +773,7 @@ prompt: |
769
773
  {paste contents of .squad/agents/{name}/charter.md here}
770
774
 
771
775
  TEAM ROOT: {team_root}
776
+ CURRENT_DATETIME: {current_datetime}
772
777
  All `.squad/` paths are relative to this root.
773
778
 
774
779
  PERSONAL_AGENT: {true|false} # Whether this is a personal agent
@@ -815,6 +820,7 @@ prompt: |
815
820
  Do the work. Respond as {Name}.
816
821
 
817
822
  ⚠️ OUTPUT: Report outcomes in human terms. Never expose tool internals or SQL.
823
+ ⚠️ DATES: When writing dates in any file (decisions, history, logs), use ONLY the CURRENT_DATETIME value above. Never infer or guess the date.
818
824
 
819
825
  AFTER work:
820
826
  1. APPEND to .squad/agents/{name}/history.md under "## Learnings":
@@ -871,6 +877,7 @@ description: "📋 Scribe: Log session & merge decisions"
871
877
  prompt: |
872
878
  You are the Scribe. Read .squad/agents/scribe/charter.md.
873
879
  TEAM ROOT: {team_root}
880
+ CURRENT_DATETIME: {current_datetime}
874
881
 
875
882
  SPAWN MANIFEST: {spawn_manifest}
876
883
 
@@ -1,29 +0,0 @@
1
- /**
2
- * Budget check utility — enforce configurable per-round limits.
3
- *
4
- * Ported from ralph-watch.ps1 rate-pool / budget tracking logic.
5
- *
6
- * Config (via squad.config.ts → watch.capabilities or CLI flags):
7
- * maxIssuesPerRound – max issues to execute in a single round (default: 5)
8
- * maxCostPerRound – cost cap (abstract units) per round (default: Infinity)
9
- *
10
- * This is a utility module — not a WatchCapability.
11
- * Called by the execute capability before spawning agent sessions.
12
- */
13
- export interface BudgetConfig {
14
- maxIssuesPerRound?: number;
15
- maxCostPerRound?: number;
16
- }
17
- export interface BudgetResult {
18
- allowed: number;
19
- reason: string;
20
- }
21
- /**
22
- * Determine how many issues can be executed this round given budget constraints.
23
- *
24
- * @param requested Number of issues the execute phase wants to process.
25
- * @param config Budget limits from config or CLI.
26
- * @returns How many are allowed + explanation.
27
- */
28
- export declare function checkBudget(requested: number, config?: BudgetConfig): BudgetResult;
29
- //# sourceMappingURL=budget-check.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"budget-check.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/watch/capabilities/budget-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,YAAY;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAID;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY,CAmBlF"}
@@ -1,38 +0,0 @@
1
- /**
2
- * Budget check utility — enforce configurable per-round limits.
3
- *
4
- * Ported from ralph-watch.ps1 rate-pool / budget tracking logic.
5
- *
6
- * Config (via squad.config.ts → watch.capabilities or CLI flags):
7
- * maxIssuesPerRound – max issues to execute in a single round (default: 5)
8
- * maxCostPerRound – cost cap (abstract units) per round (default: Infinity)
9
- *
10
- * This is a utility module — not a WatchCapability.
11
- * Called by the execute capability before spawning agent sessions.
12
- */
13
- const DEFAULT_MAX_ISSUES = 5;
14
- /**
15
- * Determine how many issues can be executed this round given budget constraints.
16
- *
17
- * @param requested Number of issues the execute phase wants to process.
18
- * @param config Budget limits from config or CLI.
19
- * @returns How many are allowed + explanation.
20
- */
21
- export function checkBudget(requested, config) {
22
- const maxIssues = config?.maxIssuesPerRound ?? DEFAULT_MAX_ISSUES;
23
- const maxCost = config?.maxCostPerRound ?? Infinity;
24
- // Simple issue-count gate
25
- if (requested <= maxIssues && maxCost === Infinity) {
26
- return { allowed: requested, reason: `within budget (${requested}/${maxIssues})` };
27
- }
28
- const allowed = Math.min(requested, maxIssues);
29
- const reasons = [];
30
- if (requested > maxIssues) {
31
- reasons.push(`capped to ${maxIssues} issues/round`);
32
- }
33
- if (maxCost !== Infinity) {
34
- reasons.push(`cost cap: ${maxCost}`);
35
- }
36
- return { allowed, reason: reasons.join('; ') };
37
- }
38
- //# sourceMappingURL=budget-check.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"budget-check.js","sourceRoot":"","sources":["../../../../../src/cli/commands/watch/capabilities/budget-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,SAAiB,EAAE,MAAqB;IAClE,MAAM,SAAS,GAAG,MAAM,EAAE,iBAAiB,IAAI,kBAAkB,CAAC;IAClE,MAAM,OAAO,GAAG,MAAM,EAAE,eAAe,IAAI,QAAQ,CAAC;IAEpD,0BAA0B;IAC1B,IAAI,SAAS,IAAI,SAAS,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACnD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,kBAAkB,SAAS,IAAI,SAAS,GAAG,EAAE,CAAC;IACrF,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,SAAS,GAAG,SAAS,EAAE,CAAC;QAC1B,OAAO,CAAC,IAAI,CAAC,aAAa,SAAS,eAAe,CAAC,CAAC;IACtD,CAAC;IACD,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,aAAa,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACjD,CAAC"}
@@ -1,52 +0,0 @@
1
- /**
2
- * Enhanced Circuit Breaker capability — model-level fallback with cooldown.
3
- *
4
- * Ported from ralph-watch.ps1 `Get-CircuitBreakerState` / `Update-CircuitBreakerOn*`.
5
- * Tracks model failures, auto-fallback through a configurable chain, and
6
- * cooldown timer. State persisted to `.squad/ralph-circuit-breaker.json`.
7
- *
8
- * This is a **utility module** consumed by the main watch loop, not a
9
- * phase-based capability (it gates every round, not a specific phase).
10
- *
11
- * Config (via squad.config.ts → watch.circuitBreaker):
12
- * preferredModel – default model to use (default: "claude-sonnet-4")
13
- * fallbackChain – ordered list of fallback models
14
- * cooldownMinutes – minutes before half-open probe (default: 10)
15
- * requiredSuccessesToClose – successes in half-open before closing (default: 2)
16
- */
17
- export type CircuitState = 'closed' | 'open' | 'half-open';
18
- export interface ModelCircuitBreakerState {
19
- state: CircuitState;
20
- preferredModel: string;
21
- currentModel: string;
22
- fallbackChain: string[];
23
- lastRateLimitHit: string | null;
24
- cooldownMinutes: number;
25
- consecutiveSuccesses: number;
26
- requiredSuccessesToClose: number;
27
- totalFallbacks: number;
28
- totalRecoveries: number;
29
- }
30
- export interface CircuitBreakerConfig {
31
- preferredModel?: string;
32
- fallbackChain?: string[];
33
- cooldownMinutes?: number;
34
- requiredSuccessesToClose?: number;
35
- }
36
- export declare class ModelCircuitBreaker {
37
- private statePath;
38
- constructor(squadDir: string, config?: CircuitBreakerConfig);
39
- load(): ModelCircuitBreakerState;
40
- save(state: ModelCircuitBreakerState): void;
41
- /** Get the model to use for the current round. */
42
- getCurrentModel(): string;
43
- /** Call after a successful round. */
44
- onSuccess(): void;
45
- /** Call when a rate limit or model error is detected. */
46
- onRateLimit(): void;
47
- /** Reset to defaults (used by post-failure remediation). */
48
- reset(): void;
49
- /** Get full state for diagnostics. */
50
- getState(): ModelCircuitBreakerState;
51
- }
52
- //# sourceMappingURL=circuit-breaker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"circuit-breaker.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/watch/capabilities/circuit-breaker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;AAE3D,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,YAAY,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,wBAAwB,EAAE,MAAM,CAAC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAeD,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,SAAS,CAAS;gBAEd,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,oBAAoB;IAkB3D,IAAI,IAAI,wBAAwB;IAuBhC,IAAI,CAAC,KAAK,EAAE,wBAAwB,GAAG,IAAI;IAU3C,kDAAkD;IAClD,eAAe,IAAI,MAAM;IAmBzB,qCAAqC;IACrC,SAAS,IAAI,IAAI;IAcjB,yDAAyD;IACzD,WAAW,IAAI,IAAI;IAanB,4DAA4D;IAC5D,KAAK,IAAI,IAAI;IAIb,sCAAsC;IACtC,QAAQ,IAAI,wBAAwB;CAGrC"}
@@ -1,152 +0,0 @@
1
- /**
2
- * Enhanced Circuit Breaker capability — model-level fallback with cooldown.
3
- *
4
- * Ported from ralph-watch.ps1 `Get-CircuitBreakerState` / `Update-CircuitBreakerOn*`.
5
- * Tracks model failures, auto-fallback through a configurable chain, and
6
- * cooldown timer. State persisted to `.squad/ralph-circuit-breaker.json`.
7
- *
8
- * This is a **utility module** consumed by the main watch loop, not a
9
- * phase-based capability (it gates every round, not a specific phase).
10
- *
11
- * Config (via squad.config.ts → watch.circuitBreaker):
12
- * preferredModel – default model to use (default: "claude-sonnet-4")
13
- * fallbackChain – ordered list of fallback models
14
- * cooldownMinutes – minutes before half-open probe (default: 10)
15
- * requiredSuccessesToClose – successes in half-open before closing (default: 2)
16
- */
17
- import path from 'node:path';
18
- import fs from 'node:fs';
19
- const DEFAULT_STATE = {
20
- state: 'closed',
21
- preferredModel: 'claude-sonnet-4',
22
- currentModel: 'claude-sonnet-4',
23
- fallbackChain: ['gpt-4.1', 'claude-haiku-4.5'],
24
- lastRateLimitHit: null,
25
- cooldownMinutes: 10,
26
- consecutiveSuccesses: 0,
27
- requiredSuccessesToClose: 2,
28
- totalFallbacks: 0,
29
- totalRecoveries: 0,
30
- };
31
- export class ModelCircuitBreaker {
32
- statePath;
33
- constructor(squadDir, config) {
34
- this.statePath = path.join(squadDir, 'ralph-circuit-breaker.json');
35
- // Ensure defaults incorporate any user config
36
- if (config) {
37
- const state = this.load();
38
- let dirty = false;
39
- if (config.preferredModel && state.preferredModel !== config.preferredModel) {
40
- state.preferredModel = config.preferredModel;
41
- if (state.state === 'closed')
42
- state.currentModel = config.preferredModel;
43
- dirty = true;
44
- }
45
- if (config.fallbackChain) {
46
- state.fallbackChain = config.fallbackChain;
47
- dirty = true;
48
- }
49
- if (config.cooldownMinutes) {
50
- state.cooldownMinutes = config.cooldownMinutes;
51
- dirty = true;
52
- }
53
- if (config.requiredSuccessesToClose) {
54
- state.requiredSuccessesToClose = config.requiredSuccessesToClose;
55
- dirty = true;
56
- }
57
- if (dirty)
58
- this.save(state);
59
- }
60
- }
61
- load() {
62
- try {
63
- if (!fs.existsSync(this.statePath))
64
- return { ...DEFAULT_STATE };
65
- const raw = fs.readFileSync(this.statePath, 'utf-8');
66
- if (!raw)
67
- return { ...DEFAULT_STATE };
68
- const parsed = JSON.parse(raw);
69
- // Handle legacy nested schema (model_fallback wrapper)
70
- const legacy = parsed;
71
- if (!parsed.preferredModel && legacy['model_fallback']) {
72
- const mf = legacy['model_fallback'];
73
- return {
74
- ...DEFAULT_STATE,
75
- preferredModel: mf['preferred'] ?? DEFAULT_STATE.preferredModel,
76
- currentModel: mf['preferred'] ?? DEFAULT_STATE.currentModel,
77
- fallbackChain: mf['fallback_chain'] ?? DEFAULT_STATE.fallbackChain,
78
- };
79
- }
80
- return { ...DEFAULT_STATE, ...parsed };
81
- }
82
- catch {
83
- return { ...DEFAULT_STATE };
84
- }
85
- }
86
- save(state) {
87
- try {
88
- const dir = path.dirname(this.statePath);
89
- if (!fs.existsSync(dir)) {
90
- fs.mkdirSync(dir, { recursive: true });
91
- }
92
- fs.writeFileSync(this.statePath, JSON.stringify(state, null, 2), 'utf-8');
93
- }
94
- catch { /* best-effort */ }
95
- }
96
- /** Get the model to use for the current round. */
97
- getCurrentModel() {
98
- const state = this.load();
99
- if (state.state === 'closed')
100
- return state.preferredModel;
101
- if (state.state === 'open') {
102
- if (state.lastRateLimitHit) {
103
- const elapsed = Date.now() - new Date(state.lastRateLimitHit).getTime();
104
- if (elapsed >= state.cooldownMinutes * 60_000) {
105
- state.state = 'half-open';
106
- state.currentModel = state.preferredModel;
107
- this.save(state);
108
- return state.preferredModel;
109
- }
110
- }
111
- return state.currentModel;
112
- }
113
- // half-open — probe preferred
114
- return state.preferredModel;
115
- }
116
- /** Call after a successful round. */
117
- onSuccess() {
118
- const state = this.load();
119
- if (state.state === 'half-open') {
120
- state.consecutiveSuccesses++;
121
- if (state.consecutiveSuccesses >= state.requiredSuccessesToClose) {
122
- state.state = 'closed';
123
- state.currentModel = state.preferredModel;
124
- state.consecutiveSuccesses = 0;
125
- state.totalRecoveries++;
126
- }
127
- this.save(state);
128
- }
129
- }
130
- /** Call when a rate limit or model error is detected. */
131
- onRateLimit() {
132
- const state = this.load();
133
- state.state = 'open';
134
- state.lastRateLimitHit = new Date().toISOString();
135
- state.consecutiveSuccesses = 0;
136
- state.totalFallbacks++;
137
- // Pick first fallback
138
- if (state.fallbackChain.length > 0) {
139
- state.currentModel = state.fallbackChain[0];
140
- }
141
- this.save(state);
142
- }
143
- /** Reset to defaults (used by post-failure remediation). */
144
- reset() {
145
- this.save({ ...DEFAULT_STATE });
146
- }
147
- /** Get full state for diagnostics. */
148
- getState() {
149
- return this.load();
150
- }
151
- }
152
- //# sourceMappingURL=circuit-breaker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"circuit-breaker.js","sourceRoot":"","sources":["../../../../../src/cli/commands/watch/capabilities/circuit-breaker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAwBzB,MAAM,aAAa,GAA6B;IAC9C,KAAK,EAAE,QAAQ;IACf,cAAc,EAAE,iBA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phase and verifies:
6
- * 1. gh CLI authenticated
7
- * 2. Circuit breaker state file is valid
8
- * 3. Disk space above threshold (configurable, default 500 MB)
9
- * 4. Git branch matches expected (optional)
10
- *
11
- * Config (via squad.config.ts → watch.capabilities["health-check"]):
12
- * diskThresholdMB – minimum free disk in MB (default: 500)
13
- * expectedBranch – warn if not on this branch (optional)
14
- */
15
- import type { WatchCapability, WatchContext, PreflightResult, CapabilityResult } from '../types.js';
16
- export interface HealthCheckResult {
17
- healed: string[];
18
- warnings: string[];
19
- }
20
- export declare class HealthCheckCapability implements WatchCapability {
21
- readonly name = "health-check";
22
- readonly description = "Pre-round watchdog: verify auth, disk space, branch, CB state";
23
- readonly configShape: "object";
24
- readonly requires: string[];
25
- readonly phase: "pre-scan";
26
- preflight(_context: WatchContext): Promise<PreflightResult>;
27
- execute(context: WatchContext): Promise<CapabilityResult>;
28
- }
29
- //# sourceMappingURL=health-check.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"health-check.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/watch/capabilities/health-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpG,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,qBAAa,qBAAsB,YAAW,eAAe;IAC3D,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,mEAAmE;IACvF,QAAQ,CAAC,WAAW,EAAG,QAAQ,CAAU;IACzC,QAAQ,CAAC,QAAQ,WAAU;IAC3B,QAAQ,CAAC,KAAK,EAAG,UAAU,CAAU;IAE/B,SAAS,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC;IAI3D,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC;CA0EhE"}