fix: auto-scaffold Fact Checker agent during init and cast (#1222)#1223
Conversation
…er#1222) The Fact Checker role landed in v0.10.0 (bradygaster#789) with catalog entry, charter template, skill, AGENT_TEMPLATES map entry, and template manifest entry — but was never wired into the user-facing onboarding flow. Users running 'squad init' got Scribe/Ralph/Rai but never saw Fact Checker as a default or cast option. This mirrors how Rai was wired: - init.ts: adds 'fact-checker' to the default agents: array passed to sdkInitSquad() - cast.ts: adds factCheckerMember(), factCheckerCharter(), hasFactChecker branches in castTeam(), and the roster banner line Smoke-tested locally: 'squad init' in a clean repo now produces .squad/agents/fact-checker/charter.md alongside scribe/ralph/Rai. Closes bradygaster#1222 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🛫 PR Readiness Check
PR Scope: 📦🔧 Mixed (product + infrastructure)
|
| Status | Check | Details |
|---|---|---|
| ❌ | Single commit | 2 commits — consider squashing before review |
| ✅ | Not in draft | Ready for review |
| ✅ | Branch up to date | Up to date with dev |
| ❌ | 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 | No merge conflicts |
| ❌ | Copilot threads resolved | 3 unresolved Copilot thread(s) — fix and resolve before merging |
| ❌ | CI passing | 7 check(s) still running |
Files Changed (4 files, +185 −0)
| File | +/− |
|---|---|
.changeset/fix-fact-checker-auto-scaffold.md |
+16 −0 |
packages/squad-cli/src/cli/core/cast.ts |
+86 −0 |
packages/squad-cli/src/cli/core/init.ts |
+5 −0 |
packages/squad-cli/src/cli/core/upgrade.ts |
+78 −0 |
Total: +185 −0
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
🟡 Impact Analysis — PR #1223Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affectedroot (1 file)
squad-cli (3 files)
This report is generated automatically for every PR. See #733 for details. |
🏗️ Architectural Review
Automated architectural review — informational only. |
There was a problem hiding this comment.
Pull request overview
This PR fixes a gap in the CLI onboarding flow by ensuring the built-in Fact Checker agent is scaffolded by default during squad init and automatically added during squad cast, aligning user-visible behavior with the existing SDK role/catalog + template support.
Changes:
- Adds
fact-checkerto the defaultagents:list passed tosdkInitSquad()sosquad initscaffolds the agent automatically. - Extends
squad castteam generation to auto-add a Fact Checker when absent, include a built-in charter path, and show it in the cast summary banner. - Adds a changeset for a patch release of
@bradygaster/squad-cli.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/squad-cli/src/cli/core/init.ts | Adds Fact Checker to default init scaffolding agent list. |
| packages/squad-cli/src/cli/core/cast.ts | Adds Fact Checker built-in member/charter wiring and default inclusion + summary banner. |
| .changeset/fix-fact-checker-auto-scaffold.md | Patch changeset documenting the CLI onboarding fix. |
| function factCheckerMember(): CastMember { | ||
| return { name: 'Fact Checker', role: 'Fact Checker', scope: 'Claim verification, hallucination detection, counter-hypothesis analysis, source validation', emoji: '🔍' }; | ||
| } |
| charter = ralphCharter(); | ||
| } else if (member.name === 'Rai' && !hasRai) { | ||
| charter = RaiCharter(); | ||
| } else if (member.name === 'Fact Checker' && !hasFactChecker) { | ||
| charter = factCheckerCharter(); | ||
| } else { | ||
| charter = generateCharter(member); |
| const hasRai = proposal.members.some(m => /Rai/i.test(m.name)); | ||
| if (!hasRai) allMembers.push(RaiMember()); | ||
|
|
||
| const hasFactChecker = proposal.members.some(m => /fact.?checker/i.test(m.name)); | ||
| if (!hasFactChecker) allMembers.push(factCheckerMember()); | ||
|
|
|
@bradygaster — heads-up, this is the fix for #1222 (fact-checker not auto-scaffolded by init/cast). Patch-bump only, all v0.10.0-shipped fact-checker pieces stay; just wires them into the user-facing onboarding flow. CHANGELOG gate should pass cleanly now that #1220 added me to (Teams was down again when I tried — posting here.) |
…ygaster#1222) Extends the bradygaster#1222 fix to the third code path. \squad upgrade\ was intentionally silent on agents (preserves user state). For users upgrading from v0.9.x or earlier (no Rai) or v0.10.0 (no fact-checker), this means they'd never get the built-in agents unless they re-ran \squad init\ (which would overwrite other state). Adds \�nsureBuiltinAgents()\ to \ unEnsureChecks()\. Idempotent — only scaffolds when the agent directory is absent. Never overwrites existing charters or history files. Sources content from the shipped \ emplates/{Rai,fact-checker}-charter.md\ templates (already present via TEMPLATE_MANIFEST). Scribe and Ralph are intentionally NOT scaffolded by upgrade — they predate this fix in every squad, and their charters are inlined in cast.ts (no shipped template file). Smoke tested locally: - Set up a simulated v0.9.4 squad (scribe + ralph only) - Ran \squad upgrade\ → 'scaffolded 2 built-in agent(s): Rai, fact-checker' - Ran upgrade again → no re-scaffold (idempotent) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Extended this PR to cover the third code path —
He's right — without it, anyone on v0.10.0 upgrading to v0.10.1 (this fix) would never get What this commit adds (
|
Fix #1222: Auto-scaffold Fact Checker agent during
squad initandsquad castCloses #1222.
Root cause
The Fact Checker role landed in v0.10.0 (#789) with:
packages/squad-sdk/src/roles/catalog-engineering.ts:552(id:fact-checker, emoji: 🔍)packages/squad-cli/templates/fact-checker-charter.mdtemplates/skills/fact-checking/SKILL.mdAGENT_TEMPLATESmap entry —packages/squad-sdk/src/config/init.ts:209packages/squad-cli/src/cli/core/templates.ts:151…but was never wired into the user-facing onboarding flow. The default
agents:array passed tosdkInitSquad()only hardcodedscribe,ralph, andRai.cast.tshad zero references tofact-checker.Users running
squad init(orsquad init+squad cast) got Scribe/Ralph/Rai always-on but never saw Fact Checker.Fix
Mirrors how Rai was wired in v0.10.0:
init.ts:218-237— addsfact-checkerto the defaultagents:array passed tosdkInitSquad(). Nowsquad initproduces.squad/agents/fact-checker/charter.mdalongside the existing always-on agents.cast.ts:497-501— addsfactCheckerMember()andfactCheckerCharter()functions.cast.ts:618-619— addshasFactCheckerdetection and pushesfactCheckerMember()if absent.cast.ts:632-633— addsfactCheckerCharter()branch in the charter-selection switch.cast.ts:803-805— adds the🔍 Fact Checker — (advisory)banner line.Smoke test (local build)
Verified — init output shows
✓ .squad\agents\fact-checker\charter.mdand the charter file exists.Changeset
Patch bump for
@bradygaster/squad-cli(no SDK change — bug was purely in CLI wiring).Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com