fix: audit template dirs, sync package templates, expand tests (#461)#462
Conversation
|
Ready for review — conditional on your decision on #461 — squad obo dina What's in this PR
Depends on #461See the architecture recommendation on #461. This PR implements option 1 (single source + build copy + parity tests). If you prefer a different approach, let us know and we'll adjust. Reviewed by
|
…gaster#461) - Add Futurama (capacity 12) to all 4 casting-policy.json files - Fix universe count from 31 to 15 in all 5 squad.agent.md copies - Create test/template-sync.test.ts with 14 tests covering: - All 5 squad.agent.md locations (universe count parity) - All 4 casting-policy.json locations (content parity) - casting-reference.md consistency check - Cross-file validation (policy count matches agent md count) - Use import.meta.url-based root resolution (not process.cwd()) - Anchored regex for universe count extraction Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds scripts/sync-templates.mjs that copies .squad-templates/ to all target directories (templates/, packages/squad-cli/templates/, packages/squad-sdk/templates/, .github/agents/). Wired into prebuild so sync runs automatically before every build. Also syncs files that had drifted between template directories. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Dynamic enumeration: enumerate all 36 files in .squad-templates/ at runtime, assert byte-for-byte parity across all 3 mirror targets (+ .github/agents/ for squad.agent.md). Generates 109 test cases dynamically. - Script execution: run node scripts/sync-templates.mjs, verify exit code 0. - Negative guard: .github/agents/ contains only squad.agent.md. - Remove dead casting-reference.md tests (file does not exist in .squad-templates/). - Retain universe-count and casting-policy semantic checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
de68118 to
02cb888
Compare
…aster#451, bradygaster#453) (bradygaster#462) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closes #461 — squad obo dina
Working as Fenster (Core Dev)
What changed
Build-time template sync
Added \scripts/sync-templates.mjs\ that reads every file from .squad-templates/\ and copies them to:
The script is wired into the build pipeline via \prebuild\ — runs automatically before every
pm run build. Can also be run standalone:
pm run sync-templates.
Handles subdirectories recursively, creates missing parent dirs in targets, and logs each synced file. Initial run caught 6 files that had drifted between directories.
Template directory audit results
Test coverage