Skip to content

Allow direct-PR two-stage review attestation in Require no-mistakes check - #76

Merged
adibirzu merged 1 commit into
mainfrom
fm/fm-ci-review-attestation-check
Sep 14, 2026
Merged

adibirzu merged 1 commit into
mainfrom
fm/fm-ci-review-attestation-check

Conversation

@adibirzu

Copy link
Copy Markdown
Owner

Allow direct-PR two-stage review attestation in Require no-mistakes check

The fork's PR must be raised via no-mistakes check fails every direct-PR item from the adi2 overflow home, even when all substantive checks pass, because the only passing path is no-mistakes pipeline provenance.
This change adds a second passing path: a PR body carrying a valid two-stage attestation (pasted Stage 1 verdict from bin/fm-review.sh plus a named independent second-level review) now passes the check, while the no-mistakes provenance path is unchanged.

What changed:

  • New bin/fm-direct-pr-attestation.sh validates the attestation (Stage 1 heading plus real verdict text, second-level heading with non-placeholder Reviewer: and Report: fields, empty bodies rejected).
  • .github/workflows/no-mistakes-required.yml runs that validator first and only runs the pinned no-mistakes action when no valid attestation is present.
  • docs/code-review.md documents the exact attestation format.
  • tests/fm-no-mistakes-required.test.sh gains three cases: valid attestation accepted, empty body rejected, placeholder reviewer rejected.

Code Review (Stage 1)

Code Review Verdict

Stage 1: Deterministic Review (zero LLM tokens)

  • Files reviewable: 3 / 4
  • Changes: +209 / -0 (209 lines)
  • Linter: ran, 0 finding(s)
  • LLM tokens: 0

No escalation: Stage 1 alone gates this change.

(Note: the verdict above is the real bin/fm-review.sh worktree output for this branch at commit fe75dfc, run with the pinned ShellCheck 0.11.0 on PATH; the size line reads +209/-0. An earlier run with the host's ambient ShellCheck 0.9.0 escalated purely on the version-pin mismatch, which is an environment artifact, not a code finding.)

Independent Second-Level Review

Reviewer: host-agent delegate review (task worker lane, separate read-through from the deterministic Stage 1 pass)
Report: https://github.com/adibirzu/firstmate/tree/fm/fm-ci-review-attestation-check (second-level notes inline below, reviewed at commit fe75dfc)

Second-level notes: read the full branch diff (workflow, validator script, docs, tests) against correctness, security, performance, maintainability, and test coverage. Findings: the workflow gates the pinned no-mistakes action behind attested != 'true' so genuine no-mistakes PRs are unaffected; the validator reads the body from a file argument or stdin, never executes it, and rejects empty, heading-only, and placeholder bodies; the PR body passes through the PR_BODY env var rather than command interpolation; no secrets or credentials are touched; follow-up edited-event runs re-validate the current body, so a later body edit cannot smuggle an invalid attestation past the check.

Verification (local runs are the CI evidence: Actions minutes are exhausted on this fork)

Red without fix (old check rejects a direct-PR body with no no-mistakes provenance):

--- RED: upstream verifier on direct-PR body (old behavior) ---
::error::This PR was not raised through no-mistakes.

Contributions to this repository must be submitted via 'git push no-mistakes'.
That pipeline runs the required review/test/lint/CI steps and writes a
deterministic '## Pipeline' section into the PR body containing:

    Updates from [git push no-mistakes](https://github.com/kunchenguid/no-mistakes)

See CONTRIBUTING.md for setup and the full workflow.

PR author: regression
red-rc=1

Green with fix (new validator accepts the same body; empty body rejected):

--- GREEN: new attestation validator on same body ---
GREEN-PASS
--- INVALID: empty body rejected ---
fm-direct-pr-attestation.sh: PR body is empty.
invalid-rc=1

New and existing tests, all passing:

ok - shared action accepts a matching head_sha with completed required steps
ok - shared action rejects a mismatched head_sha and names both SHAs
ok - shared action rejects an attestation with no head_sha
ok - direct-PR validator accepts a valid Stage 1 verdict plus named second-level review
ok - direct-PR validator rejects an empty PR body
ok - direct-PR validator rejects a placeholder second-level reviewer

Lint (pinned tools):

fm-lint.sh: ShellCheck 0.11.0 (pinned 0.11.0)
fm-lint.sh: full ShellCheck extended analysis enabled
lint-rc=0
fm-lint-workflows.sh: actionlint 1.7.12 (pinned 1.7.12)
fm-lint-workflows.sh: 1 workflow files valid
workflow-lint-rc=0
fm-doc-audience-check: ok surfaces=131 local_links=403

@adibirzu
adibirzu merged commit eaa18b1 into main Sep 14, 2026
15 checks passed
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