Summary
GitHub doesn't allow PR authors to approve their own PRs. In a solo-developer + agent workflow, the human is often the PR author, which breaks the "PR approval as universal override" mechanism. Add LGTM comments as an alternative override that works for solo devs, while keeping PR approval for multi-contributor repos.
Files to modify
.github/agent-workflow/scripts/lib/approval.js
.github/agent-workflow/scripts/lib/override.js (new)
.github/agent-workflow/scripts/guardrail-scope.js
.github/agent-workflow/scripts/guardrail-api-surface.js
.github/agent-workflow/scripts/guardrail-test-ratio.js
.github/agent-workflow/scripts/guardrail-dependencies.js
.github/workflows/guardrail-commits.yml
.github/agent-workflow/scripts/orchestrator-check.js
tests/lib/approval.test.js
tests/lib/override.test.js (new)
docs/design.md
README.md
CLAUDE.md
Implementation steps
- Add
hasNonStaleLgtm pure function to approval.js — checks if any PR comment starting with "LGTM" (case-insensitive) was posted after the head commit's committer.date
- Create
override.js async helper (hasHumanOverride) — fetches reviews, comments, and commit date in parallel, returns true if either PR approval or LGTM comment is valid and non-stale
- Update all 5 guardrail scripts + commit workflow to use
hasHumanOverride instead of direct hasNonStaleApproval calls
- Update user-facing messages to mention both override mechanisms ("approve the PR or comment LGTM to override")
- Add tests for
hasNonStaleLgtm and hasHumanOverride
- Update docs (design.md, README.md, CLAUDE.md) to reflect dual override mechanism
Acceptance criteria
Summary
GitHub doesn't allow PR authors to approve their own PRs. In a solo-developer + agent workflow, the human is often the PR author, which breaks the "PR approval as universal override" mechanism. Add LGTM comments as an alternative override that works for solo devs, while keeping PR approval for multi-contributor repos.
Files to modify
.github/agent-workflow/scripts/lib/approval.js.github/agent-workflow/scripts/lib/override.js(new).github/agent-workflow/scripts/guardrail-scope.js.github/agent-workflow/scripts/guardrail-api-surface.js.github/agent-workflow/scripts/guardrail-test-ratio.js.github/agent-workflow/scripts/guardrail-dependencies.js.github/workflows/guardrail-commits.yml.github/agent-workflow/scripts/orchestrator-check.jstests/lib/approval.test.jstests/lib/override.test.js(new)docs/design.mdREADME.mdCLAUDE.mdImplementation steps
hasNonStaleLgtmpure function toapproval.js— checks if any PR comment starting with "LGTM" (case-insensitive) was posted after the head commit'scommitter.dateoverride.jsasync helper (hasHumanOverride) — fetches reviews, comments, and commit date in parallel, returns true if either PR approval or LGTM comment is valid and non-stalehasHumanOverrideinstead of directhasNonStaleApprovalcallshasNonStaleLgtmandhasHumanOverrideAcceptance criteria
hasHumanOverridehelper