S3: route dependency tasks to squad-deps-worker (#1748) - #1888
Conversation
Refs #1748 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
🟡 Impact Analysis — PR #1888Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affectedci-workflows (1 file)
docs (1 file)
root (4 files)
tests (5 files)
This report is generated automatically for every PR. See #733 for details. |
🛫 PR Readiness Check
PR Scope: 🔧 Infrastructure
|
| Status | Check | Details |
|---|---|---|
| ❌ | Single commit | 3 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 | No source files changed — changeset not required |
| ✅ | Scope clean | No .squad/ or docs/proposals/ files |
| ✅ | No merge conflicts | No merge conflicts |
| ✅ | Copilot threads resolved | No Copilot review threads |
| ✅ | CI passing | All checks passing |
Files Changed (11 files, +412 −39)
| File | +/− |
|---|---|
.github/agents.md |
+2 −1 |
README.md |
+1 −0 |
docs/src/content/docs/guide/gh-aw.md |
+7 −3 |
test/fixtures/gh-aw-deps-routing.json |
+50 −0 |
test/gh-aw-deps-routing.test.ts |
+250 −0 |
test/gh-aw-deps-worker-workflow.test.ts |
+2 −2 |
test/gh-aw-implement-workflow.test.ts |
+4 −2 |
test/gh-aw-review-workflow.test.ts |
+5 −1 |
workflows/shared/squad.md |
+1 −0 |
workflows/squad-deps-worker.md |
+26 −10 |
workflows/squad.md |
+64 −20 |
Total: +412 −39
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
There was a problem hiding this comment.
🟢 Approval recommended
The dispatcher allowlist and dependency routing/guard behavior are implemented conservatively and backed by fixture-driven and strict-compilation contract tests that should catch regressions in dispatch targets and file-boundary protections.
Pull request overview
This PR extends Squad’s dispatcher/implement flow to conservatively route explicit, dependency-only “Wave 1” tasks to a dedicated squad-deps-worker, while keeping all mixed/ambiguous/unsupported work on the existing general squad-implement-worker path. It also adds end-to-end contract-style tests to ensure the dispatcher allowlist, routing rules, and safe-output file boundaries remain fail-closed.
Changes:
- Adds
squad-deps-workerto the dispatcher safe-outputdispatch-workflowtarget allowlist and documents a fail-closed dependency routing decision procedure. - Enforces the same strict
squadDepsconfig guard in both the dispatcher procedure and inside the dependency worker instructions to prevent bypass via directworkflow_dispatch. - Adds a routing fixture plus tests that compile workflows and assert dispatch targets and dependency/general worker allowed/excluded/protected file boundaries.
File summaries
| File | Description |
|---|---|
| workflows/squad.md | Adds squad-deps-worker to the dispatcher allowlist; documents dependency routing decision + squadDeps guard; counts squad/deps-* PRs as active work. |
| workflows/squad-deps-worker.md | Adds in-worker squadDeps guard steps to prevent direct-dispatch bypass and aligns narrative with dispatcher routing intent. |
| test/gh-aw-deps-worker-workflow.test.ts | Updates assertions to require squad-deps-worker be included in the dispatcher’s dispatch-workflow allowlist. |
| test/gh-aw-deps-routing.test.ts | New end-to-end routing/contract test: validates routing fixtures, fail-closed config behavior, and compiled safe-output boundaries. |
| test/fixtures/gh-aw-deps-routing.json | Adds routing scenarios covering dependency-only, mixed-scope, unsupported ecosystem, and config-denied/malformed cases. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Refs #1748 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Part of #1748
Summary
squad-deps-workerin the dispatcher safe-output target list.squad_deps_worker; mixed, ambiguous, unsupported, and non-dependency work remains onsquad_implement_worker.squadDepsconfig schema before dispatch and repeats it inside the dependency worker so directworkflow_dispatchcannot bypass the policy.squad/implement-*andsquad/deps-*pull requests as active work for the three-slot dispatcher budget.Validation
npx vitest run test/gh-aw-deps-routing.test.ts test/gh-aw-deps-worker-workflow.test.ts test/gh-aw-implement-workflow.test.ts— 43/43 passed.npx eslint test/gh-aw-deps-routing.test.ts test/gh-aw-deps-worker-workflow.test.ts— passed.gh aw compile --strict --no-check-updatein an isolated install workspace — 4/4 workflows compiled successfully.npm run build— passed for bothsquad-sdkandsquad-cli.Security review
The dispatcher and workers retain read-only GitHub permissions; writes still flow only through existing safe outputs. No action, network, permission, or secret references were added. Strict compilation reported the existing
SQUAD_GITHUB_APP_PRIVATE_KEYandSQUAD_GITHUB_TOKENreferences imported fromshared/squad.mdas unapproved restricted secrets in the fresh compile workspace; both are pre-existing Squad bootstrap inputs and this change does not expose, log, or broaden access to them. The general worker's compiledfallback-to-issueprotection still includespackage.jsonandgo.mod; only the already-scoped dependency worker excludes Wave 1 manifests.Residual concern
Dependency-intent classification and the
squadDepsruntime guard are prompt-enforced because gh-aw resolves protected-file exclusions at compile time. Structural containment remains fail-closed: ambiguous or mixed tasks route to the unchanged general worker, and the dependency worker's compiled allowed/excluded boundaries limit any produced patch. S4 PR labeling/evidence and S5 adoption documentation remain separate follow-up slices, so this PR intentionally does not close #1748.No package source changed, so no changeset is required.