Skip to content

S1: scaffold squad-deps-worker (fail-closed dependency-manifest worker) - #1882

Merged
bradygaster merged 2 commits into
devfrom
bradygaster-1748-deps-worker-s1
Aug 25, 2026
Merged

S1: scaffold squad-deps-worker (fail-closed dependency-manifest worker)#1882
bradygaster merged 2 commits into
devfrom
bradygaster-1748-deps-worker-s1

Conversation

@bradygaster

Copy link
Copy Markdown
Owner

This is Slice S1 of #1748

Part of #1748

Scaffolds a dedicated squad-deps-worker agentic workflow with narrow, fail-closed dependency-manifest/lockfile authority, per Flight's APPROVED — IMPLEMENTATION-READY decision comment on #1748. This slice is deliberately inert: it adds structure and tests only, with no new PR-producing capability beyond what squad-implement-worker already has today.

What this PR does

  • workflows/squad-deps-worker.md (new) — a standalone workflow_dispatch-only worker, not yet wired into squad.md's dispatch-workflow list (that's S3).
    • allowed-files is narrowly scoped to Wave 1 (npm/yarn/pnpm, NuGet CPM, Go) manifest/lockfile basenames only: package.json, package-lock.json, npm-shrinkwrap.json, yarn.lock, pnpm-lock.yaml, Directory.Packages.props, go.mod, go.sum. No broad source-file globs — this worker's entire reason to exist is that it can touch nothing else.
    • protected-files.policy: fallback-to-issue with no exclude list — every manifest write still falls back to a review issue today, identical to squad-implement-worker, which is completely unchanged by this PR.
    • excluded-files structurally strips vendored/generated content (node_modules/**, vendor/**, build output dirs) and the standard governance paths (.github/workflows/**, .github/agents/**, .github/aw/**, .squad/**) from any patch this worker could ever produce.
    • Registry/install config (NuGet.Config, bunfig.toml, .npmrc, .yarnrc.yml), SDK/tool pins (global.json), and governance docs (CODEOWNERS, SECURITY.md, CONTRIBUTING.md, CHANGELOG.md, CODE_OF_CONDUCT.md, DESIGN.md, AGENTS.md) are never in allowed-files at all, and remain in gh-aw's compiled default protected-files catalog.
  • test/gh-aw-deps-worker-workflow.test.ts (new) — 8 structural/compiled/fail-closed tests:
    • Wave 1 extensionless basenames (go.mod, go.sum, yarn.lock) appear in allowed-files.
    • Narrow-authority guard: no broad source-file globs, no registry/governance basenames in allowed-files.
    • No protected-files.exclude entries yet (S2 has not landed).
    • Vendored/generated content is structurally stripped via excluded-files.
    • squad-implement-worker.md retains its unchanged exclude: [README.md]-only contract (regression guard against the general path silently gaining manifest authority).
    • Compiled (gh aw compile --strict) contract: Wave 1 manifest basenames and always-protected registry/governance basenames both still resolve to fallback-to-issue in the generated .lock.yml.
    • A mutation test (adding a manifest exclusion to squad-implement-worker.md) was run manually during development and confirmed both regression tests fail as expected, then reverted — proving these tests are not vacuous.

Explicitly deferred to follow-up slices (NOT in this PR)

  • S2 — Wave 1 protected-files.exclude entries (the actual manifest-unprotect step) on squad-deps-worker.md.
  • S3 — dispatcher/config routing: wiring squad-deps-worker into squad.md's dispatch-workflow list and the squadDeps opt-out key in .squad/config.json.
  • S4 — dependency-change PR presentation rules: deps: title prefix, dependency-change label + provisioning, PR body evidence requirements (new-vs-update classification, frozen-install evidence, no-vendored-content confirmation).
  • S5 — adoption guide / docs / setup reporting updates.

Validation

  • gh aw compile squad-deps-worker --strict --no-check-update — succeeds (gh-aw v0.86.2), only the pre-existing shared-bootstrap secret warning common to every workflow importing shared/squad.md (verified identical for squad-implement-worker too).
  • gh aw compile squad-implement-worker --strict --no-check-update — succeeds, unchanged.
  • npx vitest run test/gh-aw-deps-worker-workflow.test.ts test/gh-aw-implement-workflow.test.ts test/gh-aw-review-workflow.test.ts — 32/32 pass (node v24.16.0, npm v11.13.0, vitest v4.1.11).
  • npx tsc --noEmit for both packages/squad-sdk and packages/squad-cli (after npm run build -w packages/squad-sdk) — clean.
  • git diff --check — clean.
  • Confirmed pre-existing, unrelated failure in test/gh-aw-quality.test.ts ("preserves a committed cast rather than re-running init") reproduces identically with this PR's files removed — not caused by this change.

Environment note: the corporate npm proxy (packagefeedproxy.microsoft.io) does not yet mirror vite@8.2.2 pinned in package-lock.json (npm ci/npm install 404 on that exact tarball). Test validation above was completed in an earlier pass using a temporary, non-committed lockfile bypass that was fully reverted (git diff showed zero changes to package.json/package-lock.json before committing); the final commit does not touch either file. This is a pre-existing environment gap, unrelated to this change.

No merge requested — please review.

Part of #1748

Adds a dedicated squad-deps-worker.md workflow_dispatch worker with narrow
Wave 1 (npm/yarn/pnpm, NuGet CPM, Go) manifest/lockfile-only allowed-files
authority. No protected-files exclusions are added yet -- every manifest
write still falls back to a review issue, identical to
squad-implement-worker, which remains unchanged. Adds structural, compiled,
and fail-closed tests for this scaffold.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 25, 2026 20:16
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #1882

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 2
Files added 2
Files modified 0
Files deleted 0
Modules touched 2

🎯 Risk Factors

  • 2 files changed (≤5 → LOW)
  • 2 modules touched (2-4 → MEDIUM)

📦 Modules Affected

root (1 file)
  • workflows/squad-deps-worker.md
tests (1 file)
  • test/gh-aw-deps-worker-workflow.test.ts

This report is generated automatically for every PR. See #733 for details.

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit db1f0a2

PR Scope: 🔧 Infrastructure

⚠️ 2 item(s) to address before review

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 No source files changed — changeset not required
Scope clean No .squad/ or docs/proposals/ files
No merge conflicts No merge conflicts
Copilot threads resolved 0 active Copilot thread(s) resolved (1 outdated skipped)
CI passing All checks passing

Files Changed (2 files, +508 −0)

File +/−
test/gh-aw-deps-worker-workflow.test.ts +336 −0
workflows/squad-deps-worker.md +172 −0

Total: +508 −0


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

One of the new contract tests uses a non-null assertion during lockfile heredoc parsing, which can produce a runtime throw instead of a diagnostic assertion on format changes.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Scaffolds a new, narrowly-scoped squad-deps-worker agentic workflow intended for dependency manifest/lockfile work (Wave 1) while remaining fail-closed (no protected-files.exclude yet), and adds structural + compiled-contract tests to ensure the worker stays inert and the general implement worker doesn’t accidentally gain manifest authority.

Changes:

  • Add workflows/squad-deps-worker.md as a standalone workflow_dispatch worker with a strict manifest/lockfile-only allowed-files list and structural excluded-files guardrails.
  • Add test/gh-aw-deps-worker-workflow.test.ts to assert the worker remains unreachable from the dispatcher (until S3), stays fail-closed (until S2), and that compilation bakes in the expected protected/allowed/excluded contract.
File summaries
File Description
workflows/squad-deps-worker.md New dependency-focused worker scaffold with narrow allowed-files, fail-closed protected-files, and structural excluded-files guardrails.
test/gh-aw-deps-worker-workflow.test.ts New tests covering scaffold invariants and compiled safe-output contract for fail-closed behavior and regression protection.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/gh-aw-deps-worker-workflow.test.ts
…worker test

Replace the non-null-asserted delimiter/configEnd extraction in 'does not
change squad-implement-worker.md at all' with the same guarded
delimiter/configEnd lookup and explicit diagnostic expect() messages already
used by compileDepsWorker() in this file, so a missing/changed heredoc marker
fails with a useful assertion instead of a runtime TypeError.

Addresses PR #1882 review comment 3856969140.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@bradygaster
bradygaster merged commit 3d7357c into dev Aug 25, 2026
17 checks passed
@bradygaster
bradygaster deleted the bradygaster-1748-deps-worker-s1 branch September 9, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants