Skip to content

fix(ci): make the Hypatia status context satisfiable and guard the context contract (#17) - #52

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/ci-context-producibility
Sep 20, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
fix/ci-context-producibility

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What #17 actually is

main's rules required the bare status context Hypatia Neurosymbolic Analysis. Nothing can publish that string: a job that calls a reusable workflow publishes

<caller display name or job id> / <inner job display name or job id>

so this repository published scan / Hypatia Neurosymbolic Analysis (and the aggregate Hypatia). 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: standards docs/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)

Fact Evidence
The required-status-checks rule is not armed today legacy branch protection on main: enforcement_level: "off", contexts: []
The Base ruleset carries no required checks GET /repos/…/rulesets/14936606 → rules are required_signatures, deletion, pull_request, non_fast_forward
What this repository publishes scan / Hypatia Neurosymbolic Analysis, Hypatia, `secret-scan / gitleaks
The pins are healthy hypatia-scan-reusable pin is 239 commits ahead of the known-bad-cache fix e9c8888; governance-reusable 296 ahead

So 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 job scan → hypatia, so the published context becomes the estate-canonical hypatia / 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 retired 6a2/ directory, which check-canonical-names.sh blocks for new files).
  • tools/check-ci-contexts.sh — the guard.
    • offline half (fails the build): every contract entry must still describe the workflow as it is — caller id present, declared contexts prefixed by it. Deterministic, always satisfiable, no token needed.
    • live half (advisory): every context required by this repository's rulesets (and legacy branch protection when the token can read it) is compared against the set of names the workflows can publish; an unproducible required context is reported, and the bare legacy name is reported with its exact replacement. REQUIRED_CONTEXTS_STRICT=1 turns 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-lock v0.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, no sorry, no Classical.choice (axiom audit unchanged).
  • tools/check-ci-contexts.sh . — exit 0; exit 1 when the caller job is renamed back to scan (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 (with STALENESS_EXPECTED_SHA set to standards HEAD) — all pass.

What this PR deliberately does not do

  • It does not change enforcement. Arming hypatia / Hypatia Neurosymbolic Analysis as a required context is a governance decision and is now possible — the exact command is in docs/CI-CONTEXTS.adoc. Until then, no status check is required on main at all.
  • It does not touch the upstream reusable or the estate's other repositories; the estate-wide census and the upstream guard live in the companion standards PR.

Closes #17.

…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.
@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: f5e02079-f676-460c-9737-0f98f381f5f7

📥 Commits

Reviewing files that changed from the base of the PR and between 96ee025 and 34a33f4.

⛔ Files ignored due to path filters (1)
  • .github/workflows/actions.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .github/workflows/ci-contexts.yml
  • .github/workflows/hypatia-scan.yml
  • .machine_readable/CI-CONTEXTS.a2ml
  • docs/CI-CONTEXTS.adoc
  • tools/check-ci-contexts.sh
 _______________________________________________________________
< e/acc/def/det: Effective accelerationism of defect detection. >
 ---------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

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.

- name: Check the CI context contract
env:
GITHUB_REPOSITORY: ${{ github.repository }}
GH_TOKEN: ${{ secrets.HYPATIA_SCAN_PAT || secrets.GITHUB_TOKEN }}
@hyperpolymath
hyperpolymath merged commit 547ece5 into main Sep 20, 2026
24 of 26 checks passed
@hyperpolymath
hyperpolymath deleted the fix/ci-context-producibility branch September 20, 2026 21:45
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.
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.

Branch protection: required context "Hypatia Neurosymbolic Analysis" never matches (blocks all merges)

2 participants