Summary
Replace the per-guardrail listReviews + hasNonStaleApproval pattern with the unified hasHumanOverride helper from override.js. Update user-facing messages to mention both override options.
Files to modify
.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 (inline script)
.github/agent-workflow/scripts/orchestrator-check.js (messaging only)
Implementation steps
-
In each of the 4 guardrail scripts (scope, api-surface, test-ratio, dependencies):
- Replace
require('./lib/approval.js') with require('./lib/override.js')
- Replace the
listReviews + hasNonStaleApproval block with const hasValidApproval = await hasHumanOverride({ github, owner, repo, prNumber, headSha })
- Update override instruction messages: "approve the PR to override" → "approve the PR or comment LGTM to override"
- Update "approved by reviewer" titles to "overridden by human" or similar
-
In guardrail-commits.yml inline script:
- Replace
require('./lib/approval.js') with require('./lib/override.js')
- Replace review fetch + check with
hasHumanOverride call
- Update messaging
-
In orchestrator-check.js:
- Update the message on line 215 to mention LGTM as alternative
Acceptance criteria
Dependencies
Blocked by #43
Summary
Replace the per-guardrail
listReviews+hasNonStaleApprovalpattern with the unifiedhasHumanOverridehelper fromoverride.js. Update user-facing messages to mention both override options.Files to modify
.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(inline script).github/agent-workflow/scripts/orchestrator-check.js(messaging only)Implementation steps
In each of the 4 guardrail scripts (
scope,api-surface,test-ratio,dependencies):require('./lib/approval.js')withrequire('./lib/override.js')listReviews+hasNonStaleApprovalblock withconst hasValidApproval = await hasHumanOverride({ github, owner, repo, prNumber, headSha })In
guardrail-commits.ymlinline script:require('./lib/approval.js')withrequire('./lib/override.js')hasHumanOverridecallIn
orchestrator-check.js:Acceptance criteria
approval.jsdirectly (all useoverride.js)npm testpassesDependencies
Blocked by #43