Skip to content

feat(review): read-only pre-commit.ci check-run admission (S-04) - #1226

Merged
hyperpolymath merged 10 commits into
feat/review-evidence-envelope-20261123from
feat/review-checkrun-admission-20261123
Nov 23, 2026
Merged

hyperpolymath merged 10 commits into
feat/review-evidence-envelope-20261123from
feat/review-checkrun-admission-20261123

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

S-04 — read-only external Check Runs intake

Stack: This is a draft based on draft #1220, itself stacked on #1216, not main. Programme #1217.

Implemented

  • Hypatia.ReviewCheckRunCollector.collect/3: authenticated GET-only GitHub API retrieval of one PR’s native Check Runs. Positive pre-commit.ci identity requires GitHub app ID 68672, slug pre-commit-ci, exact name pre-commit.ci - pr, and exact current-head SHA.
  • Bounded complete pagination with native total_count, duplicate/malformed ID rejection, repeated inventories and moving-head rejection. GitHub Checks are not atomically snapshotted by this.
  • All conclusions are native external assertions; finding_signal=unknown, qualification=unqualified, learning_eligible=false, merge_approval=false. Zero observed checks means NOT OBSERVED, not pass or proof of installation status. Failure, success, cancellation and skips do not automatically become independently verified hook findings.
  • mix hypatia.review_check_collect --repo OWNER/REPO --pr NUMBER prints source event IDs and provider conclusions, never raw hook output or an approval.
  • ExUnit negative controls and CI regression registration; S-04 design contract.

Verification at head a4f3e5f

  • 12/12 standalone ExUnit cases passed, following correction of a test that expected a malformed check ID to reach admission instead of correctly failing earlier in pagination.
  • Elixir formatter matched both collector and test files byte-for-byte; inspection task also format-clean.
  • Live authenticated GET-only CLI pilot on awesome-zig #20: 0 matching current-head pre-commit.ci checks, coverage_verdict=not_established; no false clean. Temporary WSL OTP JSON adapter required due to incompatible locally cached Jason beam. This does not validate the native Jason integration.
  • GitHub Docs/CodeQL/standards and other early workflows passing; integrated E2E Elixir test step still running at this checkpoint. Evidence in PR comment.

Remaining gates

No PR merge, bot dispatch, external provider trigger, ledger write, security exception, or E0 learning action is authorised by this work. Keep draft.

@gitnotebooks

gitnotebooks Bot commented Nov 23, 2026

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

Copy link
Copy Markdown
Owner Author

S-04 executable checkpoint — 2026-11-23

Branch: feat/review-checkrun-admission-20261123, stacked on draft #1220.

  • Isolated source-test runner: fetched the exact GitHub branch files and executed the new Hypatia.ReviewCheckRunCollectorTest in WSL Elixir 1.18.3. 12 tests, zero failures. Cases include native provider spoofing, check failures and skipped runs, missing/duplicate IDs, API errors, changed paginated inventories, moving PR heads and absence-is-not-pass semantics.
  • Formatting: all three new Elixir files (ReviewCheckRunCollector, its test module and Mix.Tasks.Hypatia.ReviewCheckCollect) returned FORMAT_OK from Code.format_string!/1 byte-for-byte comparison.
  • Live authenticated GET-only operational pilot: executed the actual task code on stuff-of-awe/awesome-zig#20, head 50a58cf134341b41b6e5b6a66f7b440c3ffe4e39. Result: Matching current-head PR checks: 0, Coverage verdict: not_established, and State: NOT OBSERVED; not proof of pass, absence, or installation. This is a negative-source pilot, not a successful provider-check-run test.
  • Environment qualification: WSL has an incompatible cached Jason beam; a temporary OTP :json.decode/1 adapter was injected in the isolated runner. The source collector/CLI task were unchanged; no repository file was edited locally or any pilot PR mutated. A full CI runner remains the authoritative compiler/Jason integration check.
  • GitHub App identity was grounded by gh api apps/pre-commit-ci, numeric app ID 68672; exact pre-commit.ci - pr run name, slug pre-commit-ci, native ID and SHA are all required. https://docs.github.com/en/rest/checks/runs defines the Check Runs API semantics.

Not yet demonstrated: a positive native pre-commit.ci check-run intake; the existing five checked PR heads had no matching check runs. Current-head GitHub CI was still running when this comment was prepared. This does not qualify any negative evidence, permit merger/learning, or retire any external checker. Parent #1216's separate RustSec blocker remains #1219.

Copy link
Copy Markdown
Owner Author

Integrated test confirmation and positive-event reconnaissance — 2026-11-23

At exact head a4f3e5ffe5ce5553bb3d7723f868add85a3bccb0, E2E workflow job 137619710539 recorded:

  • Run Elixir integration tests: success — 3,783 tests, 0 failures, 3 skipped (246 excluded).
  • Run CLI integration tests: success.
  • Source-level isolated S-04 tests: 12/12 passed. All three new source/test/task files format-clean.
  • Other CI workflows including Docs & Code Quality, CodeQL, Zig, Escript Soundness and Rust CI passed at this checkpoint. The enclosing E2E and Hypatia Security Scan workflows were still completing when checked; neither is being represented as fully successful before its final conclusion.

To find a genuine positive native pre-commit.ci check-run without triggering or paying for anything, I made GET-only requests against up to six currently open PR heads in each of four public repositories: pre-commit/pre-commit, psf/black, astral-sh/ruff, and pre-commit-ci/pre-commit.ci, filtering GitHub native check runs by verified app ID 68672. No matching check run was observed in that bounded sample. This does not establish that the app is uninstalled, that previous runs do not exist, or that any PR passes pre-commit; the positive-provider operational qualification remains OPEN.

The earlier live S-04 command on stuff-of-awe/awesome-zig#20 did return 0 matching events and NOT OBSERVED, which exercises the negative-source path as intended. No fixes/merge or provider rerun requested.

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 23, 2026 11:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T11:48:52.665113Z a4f3e5f Draft marked ready
🔒 Security Review ✅ Completed 2026-11-23T11:47:31.134212Z a4f3e5f Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Repository owner deleted a comment from coderabbitai Bot Nov 23, 2026
@hyperpolymath
hyperpolymath merged commit 61f969a into feat/review-evidence-envelope-20261123 Nov 23, 2026
56 of 57 checks passed
@hyperpolymath
hyperpolymath deleted the feat/review-checkrun-admission-20261123 branch November 23, 2026 11:45

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

Copy link
Copy Markdown

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: a4f3e5ffe5

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

Comment on lines +212 to +214
with {:ok, id} <- positive_id(run["id"]),
:ok <- matching_sha(run["head_sha"], head),
{:ok, status, conclusion} <- check_state(run["status"], run["conclusion"]),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Bind each check run to the requested pull request

When the same commit is the head of multiple PRs, this accepts every matching pre-commit.ci run for that SHA and then labels it with the requested PR number and URL. GitHub documents this endpoint as listing runs for a Git commit ref, and its response supplies a native pull_requests association, but that association is never checked here. Consequently, a run associated with PR A can be reported as evidence observed for PR B; require the requested PR and base repository in the run's native association (or leave it unobserved when no binding can be established).

Useful? React with 👍 / 👎.

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