Skip to content

Update guardrail scripts to use hasHumanOverride #44

@jdelfino

Description

@jdelfino

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

  1. 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
  2. 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
  3. In orchestrator-check.js:

    • Update the message on line 215 to mention LGTM as alternative

Acceptance criteria

  • No guardrail script imports approval.js directly (all use override.js)
  • All 5 guardrails + commit workflow check both PR approval and LGTM comments
  • User-facing messages mention both "approve" and "LGTM" options
  • npm test passes

Dependencies

Blocked by #43

Metadata

Metadata

Assignees

No one assigned

    Labels

    taskImplementation work item

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions