Skip to content

fix: address review comments on suppress_comments guard detection (#1430)#1431

Merged
stranske merged 6 commits intomainfrom
codex/issue-1414-followup
Feb 10, 2026
Merged

fix: address review comments on suppress_comments guard detection (#1430)#1431
stranske merged 6 commits 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: 9cf48fb
Latest Runs: ✅ success — Gate
Required: gate: ✅ success

Workflow / Job Result Logs
Agents PR meta manager ❔ in progress View run
CI Autofix Loop ✅ 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
Maint 52 Validate Workflows ✅ success View run
PR 11 - Minimal invariant CI ✅ success View run
Selftest CI ✅ 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.
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.
Copilot AI review requested due to automatic review settings February 10, 2026 06:28
@stranske stranske temporarily deployed to agent-high-privilege February 10, 2026 06:28 — with GitHub Actions Inactive
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

This PR updates the suppression-guard detector to avoid treating inverted suppress_comments conditions as valid guards, and aligns the generated guidance text with the repository’s actual workflow filenames.

Changes:

  • Tighten guard detection to only accept negated suppress_comments patterns (so inputs.suppress_comments == true is flagged as unguarded).
  • Update build_comment() guidance text to reference the correct keepalive/autofix workflow filenames.
  • Add a regression test covering the inverted-guard case.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
scripts/generate_suppression_guard_comment.py Restricts suppress_comments guard detection to negation forms and updates the workflow guidance message.
tests/scripts/test_generate_suppression_guard_comment.py Adds a test ensuring inverted suppress_comments == true guards are flagged as unguarded.

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: 9b9c56aac1

ℹ️ 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".

@agents-workflows-bot
Copy link
Copy Markdown
Contributor

agents-workflows-bot bot commented Feb 10, 2026

Automated Status Summary

Head SHA: 48a1e9b
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

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.

@agents-workflows-bot
Copy link
Copy Markdown
Contributor

agents-workflows-bot bot commented Feb 10, 2026

🤖 Keepalive Loop Status

PR #1431 | 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). |

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.
@github-actions github-actions bot added the autofix Opt-in automated formatting & lint remediation label Feb 10, 2026
@stranske stranske merged commit 755146c into main Feb 10, 2026
392 checks passed
@stranske stranske deleted the codex/issue-1414-followup branch February 10, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autofix Opt-in automated formatting & lint remediation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants