Skip to content

feat: add suppress_comments guard to autofix workflow#1430

Merged
stranske merged 1 commit intomainfrom
codex/issue-1414-followup
Feb 10, 2026
Merged

feat: add suppress_comments guard to autofix workflow#1430
stranske merged 1 commit intomainfrom
codex/issue-1414-followup

Conversation

@stranske
Copy link
Copy Markdown
Owner

@stranske stranske commented Feb 10, 2026

Source: Issue #1414

Automated Status Summary

Scope

PR #1413 addressed issue #1412, but verification identified remaining gaps (verdict: CONCERNS). This follow-up issue closes those gaps by (1) enforcing suppression at the workflow level so comment/review posting cannot run when suppressed, (2) implementing missing modules required for the core logic and tests, (3) fixing output semantics to avoid duplicate $GITHUB_OUTPUT entries, (4) bounding pagination to prevent excessive API calls, and (5) removing remaining TODO/skipped coverage so the full test suite can validate behavior end-to-end.

Context for Agent

Related Issues/PRs

Tasks

  • Update .github/workflows/keepalive.yml to add explicit if: guards on every step/job that posts a PR comment or PR review so they cannot run when the suppression output indicates posting is suppressed.
  • Update .github/workflows/autofix.yml to add explicit if: guards on every step/job that posts a PR comment so they cannot run when the suppression output indicates posting is suppressed.
  • Create scripts/keepalive_review_guard.js exporting functions to load the designated review result file and evaluate it, returning false when the file is missing, JSON parsing fails, or the parsed payload is an all-empty object.
  • Update scripts/should-post-review.js to call into scripts/keepalive_review_guard.js and ensure the final computed decision output is false when the guard returns false.
  • Fix scripts/should-post-review.js to write exactly one key=value line per run to the file path in process.env.GITHUB_OUTPUT (replace any appendFileSync-style duplication) while keeping the output key name unchanged.
  • Write/update test/keepalive_review_guard.test.js to cover evaluator edge cases: missing file, invalid JSON, and all-empty object payload returning false.
  • Write/update test/should-post-review.test.js with an integration-style test that runs scripts/should-post-review.js end-to-end using a temp GITHUB_OUTPUT file and asserts it outputs false when the guard encounters missing/invalid/all-empty payload.
  • Update scripts/bot-comment-handler.js to enforce a hard upper bound on pagination (constant/configurable N) when listing PR comments for deduplication.
  • Write/update test/bot-comment-handler.test.js to assert the mocked PR comment-list API call count is <= N even when mocked responses keep returning full pages.
  • Create scripts/bot-comment-dismiss.js exporting the API expected by test/bot-comment-dismiss.test.js, and wire deterministic mocks/fixtures as needed so the test runs without network calls.
  • Fix any remaining TODO-marked implementation gaps and remove/replace any it.skip/describe.skip or TODO placeholders in test/** that bypass assertions for the implemented features so the full test suite executes.

Acceptance criteria

  • In .github/workflows/keepalive.yml, every step/job that posts a PR comment or PR review includes an if: guard that evaluates to false when the suppression output indicates posting is suppressed.
  • In .github/workflows/autofix.yml, every step/job that posts a PR comment includes an if: guard that evaluates to false when the suppression output indicates posting is suppressed.
  • scripts/keepalive_review_guard.js exists and exports functions to load the designated review result file and evaluate it, and the evaluator returns false when: (a) the file does not exist, (b) file contents are not valid JSON, or (c) the parsed JSON payload is an all-empty object.
  • scripts/should-post-review.js calls into keepalive_review_guard such that when the designated review result file is missing, invalid JSON, or all-empty, the final computed decision output used by workflows is false.
  • Each execution of scripts/should-post-review.js writes exactly one line for the chosen output key to the file path specified by the GITHUB_OUTPUT environment variable (no duplicate keys/lines for the same output per run).
  • The output key written by scripts/should-post-review.js matches the key consumed in .github/workflows/keepalive.yml and .github/workflows/autofix.yml (workflows reference the exact same key name).
  • test/keepalive_review_guard.test.js includes explicit test cases asserting the evaluator returns false for: (1) missing review result file, (2) invalid JSON file contents, and (3) all-empty object payload.
  • test/should-post-review.test.js includes at least one integration-style test that executes scripts/should-post-review.js end-to-end and asserts the produced $GITHUB_OUTPUT value is false when the guard encounters (a) missing file, (b) invalid JSON, or (c) all-empty payload.
  • scripts/bot-comment-handler.js enforces a hard upper bound on pagination when listing PR comments for deduplication so it stops requesting further pages after N pages even if the API continues returning full pages.
  • test/bot-comment-handler.test.js verifies the maximum number of comment-list API calls does not exceed the configured page limit (<= N) via mock call-count assertions.
  • scripts/bot-comment-dismiss.js exists and can be imported by test/bot-comment-dismiss.test.js without module-not-found errors.
  • test/bot-comment-dismiss.test.js passes using deterministic mocks/fixtures (no network calls).
  • No tests in test/** are skipped (it.skip, describe.skip) and no TODO placeholders remain that bypass assertions for the implemented features.

Head SHA: c755c8f
Latest Runs: ✅ success — Gate
Required: gate: ✅ success

Workflow / Job Result Logs
Agents PR meta manager ❔ in progress View run
Auto-label Dependabot PRs ⏭️ skipped View run
CI Autofix Loop ✅ success View run
Copilot code review ✅ success View run
Gate ✅ success View run
Health 40 Sweep ✅ success View run
Health 44 Gate Branch Protection ✅ success View run
Health 45 Agents Guard ✅ success View run
Health 50 Security Scan ✅ success View run
Health 73 Template Completeness ✅ success View run
Maint 52 Validate Workflows ✅ success View run
PR 11 - Minimal invariant CI ✅ success View run
Selftest CI ✅ success View run
Validate Sync Manifest ✅ success View run

Add suppress_comments boolean input (default: false) to
reusable-18-autofix.yml, gating the three PR comment-posting steps:
- Upsert consolidated PR comment
- Upsert clean-mode file summary comment
- Upsert safe sweep file summary comment

Update generate_suppression_guard_comment.py to recognise
suppress_comments as a valid guard alongside should_post_review,
and fix DEFAULT_WORKFLOWS to match actual filenames.

Add test coverage for the new suppress_comments guard detection.

Closes remaining deferred tasks from issue #1414.
Copilot AI review requested due to automatic review settings February 10, 2026 06:10
@stranske stranske temporarily deployed to agent-high-privilege February 10, 2026 06:10 — with GitHub Actions Inactive
@stranske-keepalive
Copy link
Copy Markdown
Contributor

Automated Status Summary

Head SHA: ebb01c5
Latest Runs: ⏳ pending — Gate
Required contexts: Gate / gate, Health 45 Agents Guard / guard
Required: core tests (3.11): ⏳ pending, core tests (3.12): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

Workflow / Job Result Logs
(no jobs reported) ⏳ pending

Coverage Overview

  • Coverage history entries: 1

Coverage Trend

Metric Value
Current 93.12%
Baseline 85.00%
Delta +8.12%
Minimum 70.00%
Status ✅ Pass

Top Coverage Hotspots (lowest coverage)

File Coverage Missing
src/cli_parser.py 81.8% 4
src/percentile_calculator.py 95.0% 1
src/aggregator.py 95.0% 2
src/__init__.py 100.0% 0
src/ndjson_parser.py 100.0% 0

Updated automatically; will refresh on subsequent CI/Docker completions.


Keepalive checklist

Scope

No scope information available

Tasks

  • No tasks defined

Acceptance criteria

  • No acceptance criteria defined

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c755c8f7c6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@stranske-keepalive
Copy link
Copy Markdown
Contributor

🤖 Keepalive Loop Status

PR #1430 | Agent: Codex | Iteration 0/5

Current State

Metric Value
Iteration progress [----------] 0/5
Action wait (missing-agent-label)
Disposition skipped (transient)
Gate success
Tasks 0/24 complete
Timeout 45 min (default)
Timeout usage 3m elapsed (7%, 42m remaining)
Keepalive ❌ disabled
Autofix ❌ disabled

🔍 Failure Classification

| Error type | infrastructure |
| Error category | resource |
| Suggested recovery | Confirm the referenced resource exists (repo, PR, branch, workflow, or file). |

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a suppress_comments input to the reusable autofix workflow and extends the suppression-guard detection script/tests so PR comment posting steps can be explicitly gated when suppression is active.

Changes:

  • Added suppress_comments boolean input to reusable-18-autofix.yml and applied it as an extra if: guard on comment-upsert steps.
  • Updated generate_suppression_guard_comment.py to treat suppress_comments as a valid guard signal and corrected the default workflow file list.
  • Added a unit test validating suppress_comments-guarded steps are ignored by the detector.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/reusable-18-autofix.yml Introduces suppress_comments input and gates comment-posting steps with it.
scripts/generate_suppression_guard_comment.py Expands guard detection to include suppress_comments and updates default workflow targets.
tests/scripts/test_generate_suppression_guard_comment.py Adds coverage ensuring suppress_comments guards are recognized.

@stranske stranske merged commit 80aa3f6 into main Feb 10, 2026
339 checks passed
@stranske stranske deleted the codex/issue-1414-followup branch February 10, 2026 06:23
stranske added a commit that referenced this pull request Feb 10, 2026
) (#1431)

* feat: add suppress_comments guard to autofix workflow (#1414)

Add suppress_comments boolean input (default: false) to
reusable-18-autofix.yml, gating the three PR comment-posting steps:
- Upsert consolidated PR comment
- Upsert clean-mode file summary comment
- Upsert safe sweep file summary comment

Update generate_suppression_guard_comment.py to recognise
suppress_comments as a valid guard alongside should_post_review,
and fix DEFAULT_WORKFLOWS to match actual filenames.

Add test coverage for the new suppress_comments guard detection.

Closes remaining deferred tasks from issue #1414.

* fix: address review comments on suppress_comments guard detection

1. Parse suppress_comments guard semantics instead of just checking
   token presence. A regex now verifies the expression uses a negation
   An inverted guard like 'suppress_comments == true' is no longer
   falsely treated as properly guarded.

2. Update build_comment() message to reference the actual workflow
   filenames (agents-keepalive-loop.yml, reusable-18-autofix.yml)
   instead of the non-existent keepalive.yml.

3. Add test for inverted guard detection.

* fix: handle parenthesized negation in suppress_comments guard detection

Extend _SUPPRESS_NEGATION_RE to match !(inputs.suppress_comments) in
'needs-human' findings when the guard uses parenthesized negation.

Add test for the parenthesized form.

* chore(codex-autofix): apply updates (PR #1431)

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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