Skip to content

Repoint the dead required context: the repair as a script, not a command to type - #1337

Merged
hyperpolymath merged 2 commits into
mainfrom
arena/a3689015-standards
Oct 24, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
arena/a3689015-standards

Conversation

@hyperpolymath

Copy link
Copy Markdown
Collaborator

What this is

#1336 landed the diagnosis. It did not fix the rule, and the rule is why every pull request in this repository merges through a bypass.

The required context is scan / Hypatia Neurosymbolic Analysis, published by hypatia-scan.yml on push to main/master/develop, schedule and workflow_dispatch — never on a pull request. The PR-time call site of the same reusable workflow publishes Hypatia verdict grid / Hypatia Neurosymbolic Analysis. A required check is matched by name, and those names differ, so the required one cannot be produced while a PR is open.

The measured consequence, on #1336 itself:

signal value
checks 65 pass, 0 fail
reviewDecision clear
mergeable MERGEABLE
mergeStateStatus BLOCKED
required contexts 20
required but absent from the head commit exactly one — the Hypatia scan

65 green checks and a clean review still could not merge. That is not a red gate, it is an undecidable one, and it merged via the always bypass — which discards the other nineteen required checks in the same action.

Why a script

scripts/apply-branch-gates.sh cannot do this and correctly declines:

hyperpolymath/standards  AMBIGUOUS  ... 6 active repo-level branch rulesets ... rulesets are additive, refusing to guess

Deriving contexts from checks that run is right in general; it just has no way to choose which ruleset to rewrite. A general-purpose protection rewriter aimed at six additive rulesets is how protection gets silently dropped. This is the narrow instrument instead: one named context in one named ruleset, with refusals.

What it refuses

  • ruleset not active (editing it would change nothing while looking like it did)
  • both names already present (needs a human decision, not a script)
  • neither name present (nothing to repoint — it will not invent a change)
  • the name occurs more than once
  • a payload that would change the rule count or the context count
  • a read-back that disagrees with what was sent

Report-only by default. --apply to write. Requires administration: write; this could not be executed from the agent session — installation tokens report repo admin: true and still return 403 for ruleset writes, so it needs an admin user token. That is reported, not worked around.

Verification

  • scripts/tests/fix-required-context-name-test.sh — 22 fixtures, fake gh injected via $GH, every refusal branch covered, no network.
  • Report-only against the live ruleset prints a single-line diff with 20 contexts before and after.

After it runs

gh pr view <n> --json mergeStateStatus should stop reading BLOCKED on an all-green pull request. Until then, the bypass remains the actual merge path and the nineteen other required checks remain decorative.

…command to type

main already carries the diagnosis and the prescribed edit; what was missing is
something safe to execute against live branch protection.

The dead required context is 'scan / Hypatia Neurosymbolic Analysis' -- the
push/schedule-only call site of the Hypatia scan. The PR-time call site of the
same reusable publishes 'Hypatia verdict grid / Hypatia Neurosymbolic Analysis'.
A required check matched by name cannot be satisfied by a differently-named
check, so #1336 merged through the always bypass with 65 checks green, and the
gate stayed broken.

scripts/apply-branch-gates.sh cannot fix this and says so: it derives contexts
from checks that run, then must choose a ruleset, and with six additive branch
rulesets it reports AMBIGUOUS rather than guess. A general rewriter is the wrong
instrument; a single named field in a single named ruleset is the right one.

fix-required-context-name.sh changes exactly that field, refuses on every state
it cannot justify (inactive ruleset, both names, neither name, duplicate,
anything that would alter the rule or context count), and verifies the read-back
instead of trusting the payload. Report-only by default.

Cannot be run from here: installation tokens report repo admin=true and still
return 403 for ruleset writes (administration:write), so requires an admin user
token. 22 offline fixtures cover every refusal branch via an injected gh.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 24, 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 31 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: f08fd980-ebb3-46e4-abb3-b87d496e2280
Commits

Reviewing files that changed from the base of the PR and between 7f75bfb and c1eb633.

Files selected for processing: 3
  • docs/audits/audit-ci-context-producibility-2026-09-20.adoc
  • scripts/fix-required-context-name.sh
  • scripts/tests/fix-required-context-name-test.sh
  • 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 24, 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-24T21:32:20.663765Z c1eb633 New commits
ℹ️ 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.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

DEED–K9 green

🟢 conformant · commit c1eb63318d49 · run 40134590038

Category Status Pass Fail Indeterminate N/A Since previous revision
DEED syntax 🟢 conformant 4 0 0 0 ↔ unchanged
K9 contract typecheck 🟢 conformant 1 0 0 0 ↔ unchanged
K9 validator self-test 🟢 conformant 49 0 0 0 ↔ unchanged
K9 positive/negative controls 🟢 conformant 27 0 0 0 ↔ unchanged
K9 live corpus (L0–L2) 🟢 conformant 12 0 0 2 ↔ unchanged
K9 live corpus (L0–L2): 2 finding(s) / scope notes
  • 2-protocols/k9-coordination/examples/minimal.k9 — not_applicable: Routed to another dialect; not validated as a K9 contract.
  • coordination.k9 — not_applicable: Routed to another dialect; not validated as a K9 contract.

Scope: DEED syntax and K9 contracts L0–L2. L3 signature verification and routed coordination dialects are not certified. Green is limited to this scope. Orange is missing evidence; grey is an explicit scope exclusion. Logs and report.json are in the dated conformance-evidence artifact on the linked run.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Fork governance

Lane Status Run
DEED syntax (repo deed) 🟢 conformant run 40134590196
K9-DEED conformance (L0–L2; L3 not verified) 🟢 conformant (job: success) same run
Hypatia verdict grid 🟢 conformant (job: success) · advisory: 🟢 green (0 critical, 0 high, not grading) same run

Scope: the three lanes below are static checks at the named commit. A
green row means every applicable check in its declared scope passed;
orange means evidence is missing, not that nothing was found. The
Hypatia verdict covers GATING rows only; advisory reporters are listed
in its grid and named beside the verdict, and cannot colour it. No row
is a security certification.

K9-DEED conformance

k9-deed L0–L2 green

🟢 conformant · commit c1eb63318d49 · run 40134590196 · validator hyperpolymath/standards@c1eb63318d49

Category Status Pass Fail Indeterminate N/A Since previous revision
K9 contract typecheck 🟢 conformant 1 0 0 0 — no comparable baseline
K9 validator self-test 🟢 conformant 49 0 0 0 — no comparable baseline
K9 live corpus (L0–L2) 🟢 conformant 12 0 0 2 — no comparable baseline
K9 live corpus (L0–L2): 2 finding(s) / scope notes
  • 2-protocols/k9-coordination/examples/minimal.k9 — not_applicable: Routed to another dialect; not validated as a K9 contract.
  • coordination.k9 — not_applicable: Routed to another dialect; not validated as a K9 contract.

Scope: K9 components L0–L2 against contract v1.0.0 at the named standards commit. L3 signature verification and routed coordination-dialect files are not certified. Green is limited to this scope. Orange is missing evidence; yellow is grandfathered debt or warnings; grey is an explicit scope exclusion. report.json, badge.json and the validator logs are in the k9-grid artifact on the linked run.

Hypatia verdict grid

Hypatia grid green

🟢 clean · commit c1eb63318d49 · run 40134590196 · scope: this change (3 file(s)) · excludes 9-archive/

Advisory: 2 row(s), worst 🟢 clean (0 critical, 0 high) — reported, never grading the change.

Reporter Gate Status Critical High Medium Minor Since previous revision
Hypatia scan gating 🟢 clean 0 0 0 0 ↔ unchanged
panic-attack assail advisory 🟢 clean 0 0 0 0 ↔ unchanged
pons asinorum advisory 🟢 clean 0 0 0 0 ↔ unchanged
Hypatia scan: 49 finding(s)
  • 28 further finding(s) in files this change does not touch: reported, not graded (2 critical, 2 high).
  • 21 finding(s) under a declared out-of-scope prefix: reported, never graded.
panic-attack assail: 41 finding(s)
  • 28 further finding(s) in files this change does not touch: reported, not graded (3 critical, 1 high).
  • 13 finding(s) under a declared out-of-scope prefix: reported, never graded.
pons asinorum: 22 finding(s)
  • 22 further finding(s) in files this change does not touch: reported, not graded (0 critical, 0 high).

Scope: static findings reported by each row's tool at the named commit. The table grades only findings in files this change touches, so the colour answers "does this change introduce anything?", not "what does the whole repository still carry?". Standing findings are counted in each accordion and in report.json; the baseline filter remains the place where acknowledged debt is recorded. The lane state is the worst GATING row; advisory rows are listed and counted but never set it. Purple, red, yellow and blue grade the worst GRADED finding present; orange is evidence missing, malformed or a scanner that did not run; grey is an explicit scope exclusion with its reason. No row is a security certification. report.json, badge.json and the raw findings are in the verdict-grid artifact on the linked run.

@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: c8e8861c9f

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

fi

# Verify against the server, not against the payload we sent.
"$GH" api "repos/$REPO/rulesets/$RULESET" >"$tmp/verify.json"

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 Fail closed when the verification request fails

If the read-back request fails after a successful PUT, such as during a network interruption, the script still reports success and exits zero without verifying the protection settings. With set -uo pipefail but no explicit status check here, an empty response leaves all three verification variables empty; the subsequent numeric comparisons produce integer expression expected errors and fall through to the OK message. This is reproducible with the injectable $GH returning exit 1 and no stdout on the final GET. Explicitly reject a failed request and an invalid or empty verification response before comparing the counts.

Useful? React with 👍 / 👎.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Add Carrot credits or activate Agent usage billing to use Autofix

@hyperpolymath
hyperpolymath enabled auto-merge (squash) October 24, 2026 21:29
Repo self-tests caught this in CI, not locally: inline Python is banned
(scripts/tests/check-inline-python-test.sh), and my fixture generator opened
that door. The fixtures are now built with jq -- same 22 cases, same fake gh,
no interpreter beyond jq.

check-inline-python.sh: 14 ledgered lines across 10 files, none new.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit 8e48b1c into main Oct 24, 2026
74 checks passed
@hyperpolymath
hyperpolymath deleted the arena/a3689015-standards branch October 24, 2026 21:38
hyperpolymath added a commit that referenced this pull request Oct 24, 2026
Codex found this on #1338 and it is a real bug, in the same family as everything
this session has been about: the verification step could report verification it
never performed.

    "$GH" api ".../rulesets/$id" >"$tmp/verify.json"
    v_bypass="$(jq -r '.bypass_actors|length' ...)"
    if [ "$v_bypass" -ne 0 ]; ...

If that GET fails, verify.json is empty, jq yields an empty string, and
`[ "" -ne 0 ]` is a *syntax* error that evaluates false. The mismatch branch is
skipped, and the script prints 'verified: 0 bypass actors' and exits 0 — after
writing to live branch protection and confirming nothing. A gate that reports a
check it never ran, in the one script whose entire job is to not do that.

Both scripts had it, including fix-required-context-name.sh, which shipped in
#1337. Both now require the GET to succeed, require the response to be a ruleset
payload, and require numeric counts before comparing.

Fixtures added that fail against the old code and pass against the new: a GET
that returns 521 for the read-back, and a GET that returns valid JSON of the
wrong shape. Verified non-vacuous by reverting the script: 4 failures, restored:
24/24.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
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.

1 participant