Repository navigation
fix(ci): make the Hypatia status context satisfiable and guard the context contract (#17) - #52
Merged
Merged
Conversation
…xt contract (#17) `main`'s rules required the *bare* status context `Hypatia Neurosymbolic Analysis`. Nothing can publish that name: a job that calls a reusable workflow publishes `<caller> / <inner job name>`, so this repository published `scan / Hypatia Neurosymbolic Analysis`, and no check run ever carried the required string. Result: green board, permanently blocked merges (issue #17). Three changes, all mechanical and independently checkable: * `.github/workflows/hypatia-scan.yml` — caller job `scan` -> `hypatia`, so the published name is the estate-canonical `hypatia / Hypatia Neurosymbolic Analysis` (standards docs/audits/audit-hypatia-pin-orphan-2026-05-27.adoc). The wrapper header records the published string so the next reader does not have to rediscover the naming rule. * `.machine_readable/CI-CONTEXTS.a2ml` — machine-readable contract: the wrapper caller ids, the exact contexts they publish, what may be armed as a required check, and the strings that can never be satisfied (`bare-hypatia`). * `tools/check-ci-contexts.sh` + `.github/workflows/ci-contexts.yml` — the guard. Offline half: every contract entry must still describe the workflow as it is (caller job id present, contexts prefixed by it) — deterministic, fails the build, no token needed. Live half: every context required by this repository's branch rulesets (and legacy branch protection when readable) is checked for producibility, advisory by default and fatal under REQUIRED_CONTEXTS_STRICT=1, following the estate's "no manufactured red noise" rule. The bare legacy name, if required, is reported with its exact replacement. `actions.lock` regenerated with the official extension (`gh actions-lock`, v0.1.6) in the same commit, as the lockfile gate requires; the diff is the single new workflow entry. Verified before pushing: `lake build` 20/20; the guard passes and fails as designed when the caller job is renamed back; `check-actions-lock-gate.sh`, `check-docs-presence.sh`, `check-allowed-actions.sh`, `check-canonical-names.sh origin/main`, `check-licence-consistency.sh`, `check-trusted-base.sh` and `check-workflow-staleness.sh` all pass.
Contributor
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
| - name: Check the CI context contract | ||
| env: | ||
| GITHUB_REPOSITORY: ${{ github.repository }} | ||
| GH_TOKEN: ${{ secrets.HYPATIA_SCAN_PAT || secrets.GITHUB_TOKEN }} |
This was referenced Sep 20, 2026
hyperpolymath
added a commit
that referenced
this pull request
Sep 20, 2026
Follow-up to #52, which auto-merged on green before this correction could land in the same PR. ## Why The context-contract job added in #52 referenced the secrets context: ```yaml GH_TOKEN: ${{ secrets.HYPATIA_SCAN_PAT || secrets.GITHUB_TOKEN }} ``` That trips Hypatia's `research_extensions: RE001` rule ("job references `secrets.*` but does not install step-security/harden-runner — review outbound-egress monitoring"), which surfaced as a new code-scanning alert on the pull request (check run `Hypatia`, app `github-advanced-security`). `step-security/harden-runner` is **not** in the estate actions allowlist (`rhodium-standard-repositories/actions-allowlist/allowed-actions.json`, 89 patterns, no `step-security/*`), so adding it is not an option — it would fail `check-allowed-actions.sh` and the repository's selected-actions policy, which is the startup-failure class the preflight exists to prevent. ## What changed * `GH_TOKEN: ${{ github.token }}` — the same installation token, with no secret context referenced, so RE001 is clear. The job needs read access only. * The job now states what it could not read: legacy branch protection needs a credential with `Administration: read`, which the Actions token cannot have, so the guard reports "branch protection … unreadable … rulesets only" as a notice instead of guessing. It still checks every required context in the repository's rulesets; locally, `GH_TOKEN=… bash tools/check-ci-contexts.sh .` covers branch protection too. * `actions/[email protected]` → `@v7.0.1`, the pin the rest of the estate uses, which also clears the Node 20 deprecation warning this job was carrying. `actions.lock` regenerated with the official extension in the same commit. ## Verification * `check-actions-lock-gate.sh` — "Immutable direct and transitive lockfile coverage verified." * `check-allowed-actions.sh` — 6 `uses:` refs, 0 uncovered by the allowlist. * `tools/check-ci-contexts.sh .` — exit 0; still exit 1 when the caller job is renamed back.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What #17 actually is
main's rules required the bare status contextHypatia Neurosymbolic Analysis. Nothing can publish that string: a job that calls a reusable workflow publishesso this repository published
scan / Hypatia Neurosymbolic Analysis(and the aggregateHypatia). No check run ever carried the required name — the CI board showed green, the merge button stayed disabled, and the diagnosis had to be rediscovered by hand. The class is already catalogued upstream: standardsdocs/audits/audit-hypatia-pin-orphan-2026-05-27.adoc(sidebar §3, "wrapper-prefix BP mismatch").State verified against the API before changing anything (2026-09-20)
main:enforcement_level: "off",contexts: []Baseruleset carries no required checksGET /repos/…/rulesets/14936606→ rules arerequired_signatures,deletion,pull_request,non_fast_forwardscan / Hypatia Neurosymbolic Analysis,Hypatia, `secret-scan / gitleakshypatia-scan-reusablepin is 239 commits ahead of the known-bad-cache fixe9c8888;governance-reusable296 aheadSo nothing is blocked right now — but the latent defect is unchanged, and today's ruleset gives no protection at all. This PR fixes the name and, more importantly, stops the class recurring silently.
Changes
.github/workflows/hypatia-scan.yml— caller jobscan→hypatia, so the published context becomes the estate-canonicalhypatia / Hypatia Neurosymbolic Analysis. The header now records the string and why it is load-bearing..machine_readable/CI-CONTEXTS.a2ml— machine-readable contract: caller ids, the exact contexts they publish, what may be armed as a required check, and the strings that can never be satisfied (bare-hypatia). Placed at the root of.machine_readable/(not in the retired6a2/directory, whichcheck-canonical-names.shblocks for new files).tools/check-ci-contexts.sh— the guard.REQUIRED_CONTEXTS_STRICT=1turns it into a hard gate — advisory by default per the estate's "no manufactured red noise" rule..github/workflows/ci-contexts.yml— runs the guard on push and PR.actions.lock— regenerated with the official extension (gh actions-lockv0.1.6) in the same commit, as the lockfile gate requires. Diff is the single new workflow entry.docs/CI-CONTEXTS.adoc— the naming rule, the published names table, how to arm the gate, and the two honest remediations for a bare-name requirement.Verification (all run before pushing)
lake build— 20/20 targets, nosorry, noClassical.choice(axiom audit unchanged).tools/check-ci-contexts.sh .— exit 0; exit 1 when the caller job is renamed back toscan(sabotage-tested).check-actions-lock-gate.sh— "Immutable direct and transitive lockfile coverage verified."check-docs-presence.sh,check-allowed-actions.sh,check-canonical-names.sh origin/main,check-licence-consistency.sh,check-trusted-base.sh,check-workflow-duplicate-keys.sh,check-workflow-staleness.sh(withSTALENESS_EXPECTED_SHAset to standards HEAD) — all pass.What this PR deliberately does not do
hypatia / Hypatia Neurosymbolic Analysisas a required context is a governance decision and is now possible — the exact command is indocs/CI-CONTEXTS.adoc. Until then, no status check is required onmainat all.standardsPR.Closes #17.