Skip to content

fix(gh-aw): enforce independent Squad review and gate epic relay - #2096

Merged
bradygaster merged 2 commits into
devfrom
bradygaster-agentic-review-enforcement
Sep 29, 2026
Merged

bradygaster merged 2 commits into
devfrom
bradygaster-agentic-review-enforcement

Conversation

@bradygaster

@bradygaster bradygaster commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

What

Enforces independent logical Squad review with the literal required check Squad Review / review, and blocks epic continuation without a clearing verdict for the merged PR's reviewed head SHA. Working as agentic-workflows-dev (Agentic Workflows Engineer). Independent focused rereview: APPROVE after a separately owned CI-cardinality correction. Final CI conflict was also independently resolved by Release Engineer, respecting reviewer lockout.

Why

Closes #1734. Implements the accepted enforcement-surface decision from #1729/#1828 without distinct GitHub accounts or Apps per agent and without depending on #2074/#2069. #1828 remains open for rejected-author revision lockout beyond independent review.

How

  • Committed .squad-review.json binds accountable author/reviewer canonical IDs to the committed base casting registry; equal, aliased, missing, inactive, or malformed identities fail closed.
  • Trusted safe-output processing stamps repository, PR, exact head SHA, distinct IDs, logical verdict, timestamp, and PR workflow-run/attempt. Both logical outcomes use native COMMENT reviews because GitHub forbids same-account self-approval/self-rejection. The check enforces REQUEST_CHANGES; native human approval remains separate.
  • inlined-imports: true; the always-running final job has the exact PR-only check name. Manual runs publish Squad Review / manual, never clearing evidence. Output and final gates re-fetch the live head. Empty historical pull_requests run links use the fixed PR-number run title plus repository/path/event/head binding; supplied links must still match.
  • Relay repeats the guard before agent execution and before safe outputs, requiring a clearing verdict and successful PR-review job completed before merge for the PR head SHA, not the merge commit.
  • A new, unedited human-admin comment may override an actual rejection only for its exact SHA/review, with reason and timestamps. It cannot repair malformed/missing evidence or replace human approval.
  • Corrects the inherited expression-wrapped folded custom-job condition that emitted trailing characters and became truthy. Generated package copies are regenerated, never hand-edited.

Final restack: directly onto dev 7254141, after #2093 merged. Preserves the eight-workflow command-router topology, #2092 dependency CHANGELOG protection, #2095 genesis behavior, and #2094 repo-health shadow harness. Combined package: 8 workflows / 17 runtime resources / 1 skill / 26 ownership entries. Head: b2829873f9958b3c41eb5fd1f619f7a3f027ecde. Explicit lease-protected push; no Ralph heartbeat changes.

25-file scope justification:

Files Why required
workflows/squad-review.md, workflows/squad-implement-worker.md, workflows/shared/squad-review-guard.mjs Review producer, stable check, both relay boundaries, deterministic evidence/override validation
test/gh-aw-review-guard.test.ts, test/gh-aw-review-workflow.test.ts, test/gh-aw-implement-workflow.test.ts Behavioral identity/repo/PR/SHA/verdict/time/equality/override/relay mutations and real compiled-source mutations
workflows/shared/squad-install-verifier.mjs, workflows/aw.yml, workflows/squad-workflows.manifest.json, workflows/squad-bootstrap.md Shipped runtime, ownership cardinality, generated hashes and bootstrap pin
scripts/gh-aw-hosted-e2e.mjs, test/gh-aw-hosted-e2e.test.ts, .github/workflows/squad-ci.yml, test/gh-aw-quality.test.ts Combined 8/17/1 topology and CI regression coverage; CI revision independently owned
workflows/shared/squad.md Smallest inherited condition fix needed for emitted implement lock actionlint
workflows/package/squad.md, workflows/package/squad-bootstrap.md, workflows/package/squad-deps-worker.md, workflows/package/squad-implement-worker.md, workflows/package/squad-retro.md, workflows/package/squad-review.md Mechanically regenerated installable copies
.github/agents.md, docs/src/content/docs/guide/gh-aw.md, workflows/README.md, workflows/skills/gh-aw-enlistment/SKILL.md Enforcement, migration, overrides, ruleset/soak instructions, topology documentation

No SDK/CLI product source changed; no changeset required. This repository distributes rather than self-installs these workflows: emitted locks were compiled and inspected in isolated consumer layouts, not added as new repository workflows.

Final-restack validation:

  • Serial full gh-aw targeted run: 26 suites / 1,494 tests passed, including behavioral and compiled mutation tests, dependency protection, genesis, routing, and integrity. Preserved repo-health transport: 25 tests passed.
  • All 8/8 authoritative sources and 8/8 generated package workflows strict-compile with gh-aw v0.89.21.
  • Parsed emitted review/implementation locks in both layouts: exact PR-only name, always() final gate, [agent, safe_outputs] dependencies, awaited producer/final guards, and relay guards in both agent and safe-output jobs.
  • actionlint v1.7.12 passes review/implementation and all non-retro locks with existing configuration. Full eight-workflow lint identifies two unchanged squad-retro references to undeclared github.event.inputs.issue_number. Reproduced on exact dev 7254141; not introduced or suppressed here. Baseline also exhibits the multiline-if defect this PR fixes.
  • npm run build, npm run lint, changed-test ESLint, package integrity, prompt interpolation (25 files), whitespace/stat/deletion checks pass. Build-version side effects restored; exactly 25 changed files, no deletions.
  • Prior baseline disclosure superseded: the previously reported dependency-worker CHANGELOG-protection failure is resolved by merged Protect dependency worker CHANGELOG contract #2092; its full suite now passes. No assertion weakened. Tests ran serially to avoid shared-fixture cleanup races.

Compiler safe-update review: clean consumer compilation reports existing SQUAD_GITHUB_APP_PRIVATE_KEY, SQUAD_GITHUB_TOKEN, and bradygaster/squad/.github/actions/squad-init from the unchanged shared authentication/bootstrap contract. No new/removed secrets/actions or redirect changes are introduced by this PR. These remain the existing optional GitHub authentication and pinned Squad initialization surfaces, not new destinations. Fresh-layout approval warnings and absent-remote schedule warnings are disclosed; no production approval or credential configuration changed.

Brady-only rollout: no rulesets changed and no live soak claimed. Install/merge the complete bundle, observe the actual PR check and its App ID, then require literal Squad Review / review on dev only after the #1734 advisory-soak evidence gate; promote to main after soak. Keep native human approval independently required. Human/Copilot PRs also need committed logical attribution; forks are unsupported. Do not require the manual job or guess an App ID.


⚠️ Quick Check

  • If SDK/CLI source files changed: completed the applicable Changeset step below — N/A; no SDK/CLI source changed.

PR Readiness Checklist

Branch & Commit

Build & Test

  • npm run build passes
  • npm test passes (all tests green) — local full-repository suite not claimed; all 1,519 targeted tests pass and current-head CI is required before merge
  • npm run lint passes (type check clean)
  • npm run lint:eslint passes — changed-test ESLint passes; whole-repository ESLint not claimed
  • For migration PRs (>20 files): include test output summary in PR description

Changeset

  • Changeset added via npx changeset add — N/A; infrastructure only
  • Or direct CHANGELOG.md entry — N/A
  • Or skip-changelog label applied — not used

Docs

  • Related workflow README and install documentation updated
  • Existing gh-aw guide documents changed behavior, overrides, and rollout

Exports

  • package.json subpath exports updated — N/A; no package API changes

Breaking Changes

Installing the new bundle changes review/relay from advisory to fail-closed enforcement. Existing PRs need .squad-review.json with distinct canonical active IDs; manual review and legacy head-marker-only reviews do not satisfy the gate. Ruleset activation is a separate administrator step after soak.

Waivers

No test/build/security waiver granted or implied. The unchanged retro-only actionlint baseline is disclosed rather than hidden or relaxed. Changeset/export exemptions are structural (no product package source changes). Merge remains conditional on required current-head checks and GitHub protections.

Copilot AI lite review requested due to automatic review settings September 28, 2026 19:51
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🏗️ Architectural Review

Authoritative evidence: base-controlled pull_request_target reporter.

⚠️ Architectural review: 1 warning(s), 1 info.

Severity Category Finding Files
ℹ️ info template-sync Template files changed in .github/workflows/ but not in other template locations. If these templates should stay in sync, consider updating the others too. Changed: .github/workflows/, Unchanged: templates/, .squad-templates/, packages/squad-cli/templates/
🟡 warning sweeping-refactor This PR touches 25 files (25 modified/added, 0 deleted). Large PRs are harder to review — consider splitting if possible. —

Automated architectural review — informational only.

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

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

PR Scope: 🔧 Infrastructure

⚠️ 3 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 No Copilot review threads
❌ CI passing 1 check(s) failing: test

Files Changed (25 files, +1230 −148)

File +/−
.github/agents.md +3 −3
.github/workflows/squad-ci.yml +1 −1
docs/src/content/docs/guide/gh-aw.md +104 −27
scripts/gh-aw-hosted-e2e.mjs +4 −4
test/gh-aw-hosted-e2e.test.ts +1 −1
test/gh-aw-implement-workflow.test.ts +63 −5
test/gh-aw-quality.test.ts +13 −2
test/gh-aw-review-guard.test.ts +371 −0
test/gh-aw-review-workflow.test.ts +63 −10
workflows/README.md +1 −1
workflows/aw.yml +2 −0
workflows/package/squad-bootstrap.md +1 −1
workflows/package/squad-deps-worker.md +3 −11
workflows/package/squad-implement-worker.md +54 −11
workflows/package/squad-retro.md +3 −11
workflows/package/squad-review.md +102 −10
workflows/package/squad.md +3 −11
workflows/shared/squad-install-verifier.mjs +2 −1
workflows/shared/squad-review-guard.mjs +253 −0
workflows/shared/squad.md +9 −11
workflows/skills/gh-aw-enlistment/SKILL.md +2 −2
workflows/squad-bootstrap.md +1 −1
workflows/squad-implement-worker.md +52 −0
workflows/squad-review.md +102 −15
workflows/squad-workflows.manifest.json +17 −9

Total: +1230 −148


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

@github-actions

Copy link
Copy Markdown
Contributor

🟠 Impact Analysis — PR #2096

Risk tier: 🟠 HIGH

📊 Summary

Metric Count
Files changed 25
Files added 2
Files modified 23
Files deleted 0
Modules touched 5

🎯 Risk Factors

  • 25 files changed (21-50 → HIGH)
  • 5 modules touched (5-8 → HIGH)

📦 Modules Affected

ci-workflows (2 files)
  • .github/agents.md
  • .github/workflows/squad-ci.yml
docs (1 file)
  • docs/src/content/docs/guide/gh-aw.md
root (16 files)
  • workflows/README.md
  • workflows/aw.yml
  • workflows/package/squad-bootstrap.md
  • workflows/package/squad-deps-worker.md
  • workflows/package/squad-implement-worker.md
  • workflows/package/squad-retro.md
  • workflows/package/squad-review.md
  • workflows/package/squad.md
  • workflows/shared/squad-install-verifier.mjs
  • workflows/shared/squad-review-guard.mjs
  • workflows/shared/squad.md
  • workflows/skills/gh-aw-enlistment/SKILL.md
  • workflows/squad-bootstrap.md
  • workflows/squad-implement-worker.md
  • workflows/squad-review.md
  • workflows/squad-workflows.manifest.json
scripts (1 file)
  • scripts/gh-aw-hosted-e2e.mjs
tests (5 files)
  • test/gh-aw-hosted-e2e.test.ts
  • test/gh-aw-implement-workflow.test.ts
  • test/gh-aw-quality.test.ts
  • test/gh-aw-review-guard.test.ts
  • test/gh-aw-review-workflow.test.ts

This report is generated automatically for every PR. See #733 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

bradygaster and others added 2 commits September 28, 2026 16:58
Closes #1734

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Closes #1734

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@bradygaster
bradygaster force-pushed the bradygaster-agentic-review-enforcement branch from d7e498d to b282987 Compare September 29, 2026 00:02
@bradygaster
bradygaster merged commit da7861d into dev Sep 29, 2026
27 of 28 checks passed
@bradygaster
bradygaster deleted the bradygaster-agentic-review-enforcement branch October 3, 2026 00:10
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.

Phase 2: Enforce /squad review as a required check and gate epic relay on verdict

2 participants