Skip to content

ci: scan hypatia with its own main instead of a hand-bumped pin - #973

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/rolling-hypatia-ref
Oct 27, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
claude/rolling-hypatia-ref

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Step 2 of the stack that turns governance / Validate Hypatia Baseline green, after #966, #967 and #968.

Both of hypatia's scanner callers pinned hypatia-ref to 23dc74d. A rule fix merged to main therefore reached hypatia's own gate only after a hand bump. #966's risk-scoped RE001 is on main now, but the gate would still build the old rule.

This PR replaces the literal with:

hypatia-ref: ${{ github.event.pull_request.base.sha || github.sha }}
event scanner commit
pull_request the base-branch commit (main)
push, schedule, workflow_dispatch the commit being run
  • Never the PR head. A PR cannot weaken the rules that gate it, which is the property the fixed pin was protecting.
  • Always a 40-hex SHA, so the reusables' validation passes without change. HEAD canary mode is not used, and nothing calls git ls-remote.
  • Scope: only hypatia's own callers change. Every other estate repo keeps the reusable's vetted default, so a bad main can't turn the estate red. That was the 09-12..14 and 09-26..30 outage class the default exists for.
  • Escape hatch: if main ships a broken rule, the PR that fixes it can pin a known-good SHA here temporarily.

Only the with: input and its comment change. uses:, the allow-list and actions.lock are untouched.

How has this been verified?

  • actionlint 1.7.7 is clean on both files.
  • Differential self-scan: all 15 lib/rules modules with scan/1,2 were run over origin/main and this branch, keeping findings on the two files. Both give the same 10 findings (the ones already on main), with none added or removed.
  • Not yet verified: how GitHub evaluates the expression at run time. Governance still hits startup_failure on every PR until the Actions allow-list accepts metadatastician/standards, which is handled separately. Hypatia Security Scan can confirm the pull_request branch of the expression as soon as it runs here.

Beyond this repo

Moving the reusables' own hypatia-ref default past 51ab649, so other repos get #966 too, is a standards decision. This PR does not make it.


Generated by Claude Code

governance.yml and hypatia-scan.yml pinned hypatia-ref to 23dc74d, so a rule
fix merged to main (for example #966's risk-scoped RE001) reached hypatia's
own gate only after someone bumped the SHA by hand.

Pass `github.event.pull_request.base.sha || github.sha` instead. On a PR that
is the base-branch commit, and otherwise the commit being run. It is never the
PR head, so a PR still cannot weaken the rules that gate it, and the value is
always a 40-hex SHA as the reusable requires. Only hypatia's own callers
change; every other repo keeps the reusable's vetted default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDfStHgMdZGTeqaBgM1
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 55 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c8688727-5ea2-4dc6-ae6c-059e3b353ef6
Commits

Reviewing files that changed from the base of the PR and between be98f74 and ddf2742.

Files selected for processing: 2
  • .github/workflows/governance.yml
  • .github/workflows/hypatia-scan.yml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T03:26:42.507728Z ddf2742 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.

@hyperpolymath
hyperpolymath merged commit 91f1456 into main Oct 27, 2026
67 checks passed
@hyperpolymath
hyperpolymath deleted the claude/rolling-hypatia-ref branch October 27, 2026 03:25
hyperpolymath added a commit that referenced this pull request Oct 27, 2026
)

## Summary

Step 3 of the governance-gate stack, after #966, #967, #968 and #973.

Under RE001 as #964 (standards ADR-009) now ships it, every job that
reads a real secret is in scope. On main that is **9 `:warn` findings**.
Once #973 makes hypatia's gate run main's rules, they hold it red at the
`info` threshold. This PR clears them by the safety-triangle order:
**eliminate** the credential where we can, then **control** what
remains.

| job | secret | action |
|---|---|---|
| `security-policy` / `secret-gitleaks` | `GITLEAKS_LICENSE` |
**Eliminated.** gitleaks-action needs a licence only for an organization
owner. Run 40442141312 logs `[hyperpolymath] is an individual user. No
license key is required.` and shows the secret empty, so it was never
set. |
| `inbox-steward-intake` / `analyze-patterns` | `FARM_PAT` | Its
read-only checkout no longer takes the PAT and keeps no credential
(`persist-credentials: false`). The `gh api` read still uses the PAT, so
the job is **hardened** with GitHub + API. |
| `inbox-steward-intake` / `dispatch-to-farm` | `FARM_PAT` | Dropped a
checkout nothing read. **Hardened**, API only. |
| `inbox-steward-intake` / `record-report`, `update-ruleset` |
`FARM_PAT` | **Hardened**, GitHub + API (push, `gh pr create`). |
| `ci-health-sweep` / `sweep` | `HYPATIA_DISPATCH_PAT` | **Hardened**,
GitHub + API. Every call in `scripts/ci-health/*.sh` is `gh`. |
| `hypatia-remediation-sweep` / `sweep` | `HYPATIA_DISPATCH_PAT` |
**Hardened**, API plus the artifact service and its blob storage. |
| `roadmap-sync` / `sync` | App private key | **Hardened**, API only. It
already used an App token (substitution done before this PR). |
| `push-email-notify` / `notify` | `SMTP_*` | **Hardened**: the action's
release download, plus `${{ secrets.SMTP_HOST }}:${{ secrets.SMTP_PORT
\|\| '465' }}`. The mail host is itself a secret, so it stays masked. |

All hardening is `step-security/harden-runner@v2.22.2` with
`egress-policy: block`, the same pin #968 introduced. `actions.lock`
holds the tool's bytes from run 40443523409 (sha256 `74ebf8be…`,
`GATE_RC=0`); it was not hand-written.

## How has this been verified?

- **RE001, #964's version** (`653d09c`) on this tree: 9 → **0**. Main's
version: 0 → 0.
- **Differential self-scan**, all 15 rule modules over `origin/main` and
this branch, keeping findings on the six touched workflows:
- with #964's rules, only those 9 RE001 findings go and nothing is
added;
  - with main's rules, there is no change;
  - WH004 is 0 once the lock is in.
- **actionlint 1.7.7:** the same 85 issues as main, none new.
- **Not verified, and the real risk:** a `block` allow-list that misses
a host breaks its job at run time. These jobs run on schedule, dispatch
or push, so PR CI can't exercise them. I worked out each list from the
job's code (every `gh`/`git`/action call), not by observation. I propose
one `workflow_dispatch` per job with its own `dry_run`, before or just
after merge, and reading harden-runner's egress report.

## Not done here (needs the owner or another repo)

- **Substitution:** the four `FARM_PAT` jobs and the two
`HYPATIA_DISPATCH_PAT` sweeps could each move to a GitHub App
installation token scoped to the repos they touch, as roadmap-sync
already does. That means creating Apps, which this session can't do.
- **Attestation:** a `hypatia_chora.deed` with `(egress …)` entries
(`:enforcement harden-runner-block`), once #964 lands, agreed with the
#964 session.
- **Org move:** if the repo moves to an organization (as standards did),
gitleaks will need `GITLEAKS_LICENSE` again.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01J4QvDfStHgMdZGTeqaBgM1)_
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