Skip to content

fix(pr-quality): treat local CI checklist as author attestation - #1437

Merged
Wibias merged 2 commits into
devfrom
fix/local-ci-readiness-attestation
Aug 10, 2026
Merged

fix(pr-quality): treat local CI checklist as author attestation#1437
Wibias merged 2 commits into
devfrom
fix/local-ci-readiness-attestation

Conversation

@Wibias

@Wibias Wibias commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Stop enforce-target from verifying the readiness checklist local-CI box against GitHub's aggregate ci check.
  • Keep that box as a fork-author attestation of local testing; new commits still reset the whole checklist.
  • Continue bot-verifying latest-dev and Codex/CodeRabbit findings only.
  • Sync AGENTS/MAINTAINERS/docs and wire pr-quality-state / pr-quality-messages unit tests into the issue-quality test workflow.

Verification

  • bun test tests/ci-workflows.test.ts — pass (127 tests).
  • node --test .github/scripts/pr-quality.test.cjs .github/scripts/pr-quality-state.test.cjs .github/scripts/pr-quality-messages.test.cjs .github/scripts/enforce-pr-target.test.cjs — pass (158 tests).

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • Improvements

    • Pull request readiness no longer depends on GitHub CI status.
    • The local-CI checklist item is treated as an author attestation.
    • Readiness continues to verify branch freshness and resolution of review findings.
    • New pushes reset checklist items, while only applicable failed claims are cleared.
  • Documentation

    • Updated contributor guidance to reflect the revised readiness requirements.
  • Tests

    • Expanded coverage for readiness when CI checks are missing, pending, failed, stale, or unavailable.

Fork contributors cannot start repository CI, so enforce-target should not untick the local-CI box when GitHub's ci check is missing or red. Keep head-drift resets and latest-dev/findings verification.
@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9f0a9774-199c-4d16-91d6-40b054c381c9

📥 Commits

Reviewing files that changed from the base of the PR and between 5ce3198 and 0968412.

📒 Files selected for processing (3)
  • .github/scripts/pr-quality-state.test.cjs
  • .github/workflows/enforce-pr-target.yml
  • tests/ci-workflows.test.ts
💤 Files with no reviewable changes (1)
  • .github/workflows/enforce-pr-target.yml

📝 Walkthrough

Walkthrough

The PR changes readiness validation so local CI is an author attestation. The gate no longer queries GitHub Checks or produces ci_green violations. Branch freshness and review-finding validation remain active, with updated tests, workflow coverage, and documentation.

Changes

Readiness claim model

Layer / File(s) Summary
Claim validation and notices
.github/scripts/pr-quality-*.cjs
readinessClaimViolations and buildClaimCheckNotice now handle only latest_dev violations. Checklist tests use the updated claim indexes and thresholds.
Workflow readiness orchestration
.github/workflows/enforce-pr-target.yml, tests/ci-workflows.test.ts
The gate no longer calls the GitHub Checks API or requires checks: read. CI status no longer invalidates the local attestation, while branch freshness and review-finding checks remain active.
Validation coverage and policy documentation
.github/workflows/issue-quality-tests.yml, AGENTS.md, MAINTAINERS.md, docs-site/src/content/docs/contributing/pr-quality.md, tests/helpers/enforce-pr-target-harness.ts
The workflow runs the readiness-state tests. Policies and harness documentation describe local CI as an author attestation.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Workflow as enforce-pr-target.yml
  participant State as readinessClaimViolations
  participant Reviews as review-finding validation
  participant PR as Pull request
  Workflow->>State: pass branch freshness state
  State->>Reviews: validate review findings
  Reviews-->>State: finding results
  State-->>Workflow: latest_dev violations
  Workflow->>PR: reset claims or retain readiness
Loading

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: ingwannu, lidge-jun

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: treating the local CI checklist item as author attestation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/local-ci-readiness-attestation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/enforce-pr-target.yml (1)

805-826: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Remove the obsolete checks permission.

Lines 823-826 no longer read GitHub check runs. However, Line 105 still grants checks: read, and Lines 102-103 still state that the job reads aggregate check evidence. This gives the write-capable job unnecessary repository access.

Remove checks: read and update the job comment.

Proposed fix
-    # The write job also reads the current head's aggregate check evidence.
     # Job-scoped permissions replace, rather than extend, the workflow default.
     permissions:
-      checks: read
       contents: write
       pull-requests: write

As per path instructions, “Workflow changes, release automation, and dependency installation steps require explicit security review per MAINTAINERS.md.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/enforce-pr-target.yml around lines 805 - 826, Remove the
obsolete checks: read permission from the workflow job’s permissions block and
update the nearby job comment to no longer claim that it reads aggregate GitHub
check evidence. Keep the remaining permissions and readiness-claim logic
unchanged.

Sources: Coding guidelines, Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/scripts/pr-quality-state.test.cjs:
- Around line 237-239: Update the test named “never treats local CI as a
bot-verifiable claim” to pass ciGreen: false alongside behindBase: 0 when
calling readinessClaimViolations, explicitly verifying that the removed CI input
is ignored while preserving the empty-violations expectation.

---

Outside diff comments:
In @.github/workflows/enforce-pr-target.yml:
- Around line 805-826: Remove the obsolete checks: read permission from the
workflow job’s permissions block and update the nearby job comment to no longer
claim that it reads aggregate GitHub check evidence. Keep the remaining
permissions and readiness-claim logic unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ea822747-33bf-44c7-ac81-f5253fa7548c

📥 Commits

Reviewing files that changed from the base of the PR and between 08e7e0f and 5ce3198.

📒 Files selected for processing (13)
  • .github/scripts/pr-quality-messages.cjs
  • .github/scripts/pr-quality-messages.test.cjs
  • .github/scripts/pr-quality-state.cjs
  • .github/scripts/pr-quality-state.test.cjs
  • .github/scripts/pr-quality.cjs
  • .github/scripts/pr-quality.test.cjs
  • .github/workflows/enforce-pr-target.yml
  • .github/workflows/issue-quality-tests.yml
  • AGENTS.md
  • MAINTAINERS.md
  • docs-site/src/content/docs/contributing/pr-quality.md
  • tests/ci-workflows.test.ts
  • tests/helpers/enforce-pr-target-harness.ts

Comment thread .github/scripts/pr-quality-state.test.cjs Outdated
Drop the obsolete checks:read permission from enforce-target and assert that readinessClaimViolations ignores a stale ciGreen input.
@Wibias
Wibias merged commit dc56fb4 into dev Aug 10, 2026
27 checks passed
@Wibias
Wibias deleted the fix/local-ci-readiness-attestation branch August 10, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant