Skip to content

fix(rsr): criterion 3.2.2 is the verdict of the capability reader - #1188

Merged
hyperpolymath merged 6 commits into
mainfrom
claude/gifted-thompson-vsrzhw-322
Nov 16, 2026
Merged

hyperpolymath merged 6 commits into
mainfrom
claude/gifted-thompson-vsrzhw-322

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Why

The Idris2 model added in #1033 found one case where RSR criterion 3.2.2 (profile present) and the scorecard's profile_present disagree:

  • the repo has no deed (rsr-profile …) clause, and
  • its rsr-profile.a2ml exists but does not parse or carries no capabilities list.

In that case 3.2.2 passed on the file's presence, while the scorecard reported no profile. The model proved this was the only disagreement (disagreementIsExactly, residualDivergence). The owner chose the elegant fix on 2026-11-16: 3.2.2 uses the reader.

What

  • lib/rules/rsr_conformance.ex: profile_present/0 is now declared_capabilities(repo) == :none → :fail, so 3.2.2 and profile_present read the same capability set and agree by construction.
  • src/Hypatia/ABI/RsrProfile.idr: the model follows the code, with criterion322 = verdictOf ∘ declaredCapabilities.
    • New: verdictAgrees and profilePresentAgrees prove agreement for every source. emptyA2mlFails covers the formerly divergent case, which now fails.
    • Re-proved over the reader lemmas: duplicateFailsCriterion, listlessFailsCriterion and fallbackCriterionNoClause. deedDecidedAgrees, the bffd76a fix, is now an instance of profilePresentAgrees.
    • Removed: check322, a2mlFileVerdict, a2mlDecidedAgrees, disagreementIsExactly and residualDivergence, because they described behaviour that no longer exists.
  • tests/reject/EmptyA2mlPassesProfileCriterion.idr (new): a regression guard. It claims the old behaviour and must be refused at invalid.
  • tests/accept/RsrProfileResolution.idr: the residual cases are replaced by emptyA2mlFailsHere, emptyA2mlNotPresent, emptyA2mlAgrees and a2mlListPasses.
  • test/rules/rsr_conformance_test.exs: a new ExUnit case checks 3.2.2 and profile_present over four a2ml files: one with a list, one without, one with the wrong section, and one that does not parse.
  • Docs: PROOF-STATUS.adoc, the ABI table in .claude/CLAUDE.md, and CHANGELOG.adoc.

Effect on scores: a repo with no deed clause and an rsr-profile.a2ml that declares no capabilities now fails 3.2.2. The scorecard already treated it as having no profile, so its gated criteria were already :na.

Evidence

CI on 99a40d6: 91 checks passed, 8 were skipped and 1 was neutral. None failed.

Verify Proofs (run 43939522672, idris2 --check job 133552988403, Idris 2 v0.7.0) logged:

PASS: no escape-hatch marker in src/Hypatia/ABI/RsrProfile.idr
PASS: accepted positive control RsrProfileResolution
PASS: rejected EmptyA2mlPassesProfileCriterion at invalid: Mismatch between: Pass and Fail.
PASS: ABI package, 11 positive control(s), 22 expected rejection(s)

Elixir:

  • The Test job (133552989377) reported 3555 tests, 0 failures, 3 skipped (246 excluded). The log does not name test files, so I am inferring that the new case ran rather than reading it there.
  • Elixir Format and Elixir Compile (dogfood toolchain) passed.

Receipt commit: c9e8ce4 records that run in PROOF-STATUS.adoc.

  • The model row is now PROVEN.
  • The accept fixture and the new rejection are TESTED.
  • The correspondence between the Elixir and the model stays ASSUMED: it is argued by review and ExUnit, with no extraction.

Merge: the branch has main merged in (39a1b9f), so the new head reruns CI.

Not run locally:

  • Idris2: not available here.
  • mix test: hex.pm is blocked by the session's network policy.

Out of scope, and not new to this PR: the Verify Proofs log warns proof-ledger: src/Hypatia/ABI/RsrProfile.idr checks in lane idris2 and no ledger row names it. That warning dates from #1033: the machine ledger has no row for RsrProfile.idr yet.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E294yTkKk127qgKEXFFDBE

Owner decision 2026-11-16 (the elegant option of the two-reader finding
from #1033): 3.2.2 now passes exactly when declared_capabilities/1 finds
a profile, the reader behind the scorecard's profile_present.

Before, with no deed (rsr-profile ...) clause, 3.2.2 passed whenever
<machine tree>/rsr-profile.a2ml existed, even if it did not parse or
carried no capabilities list, while the scorecard reported no profile.
The RsrProfile model proved that this was the only disagreement
(disagreementIsExactly, residualDivergence).

The model follows the code: criterion322 = verdictOf . declaredCapabilities.
Agreement becomes a theorem for every source (verdictAgrees,
profilePresentAgrees); deedDecidedAgrees is now an instance of it; the
fail-closed and fallback criterion theorems are re-proved over the reader
lemmas; the old divergence becomes emptyA2mlFails, with
tests/reject/EmptyA2mlPassesProfileCriterion.idr as its regression guard.

ExUnit: a new case runs 3.2.2 and profile_present over an a2ml with a
list, without a list, with the wrong section and unparseable.

PROOF-STATUS rows for the changed model are OPEN until this commit's
Verify Proofs idris2 --check job runs; the earlier PROVEN receipt
covered the previous model. Not run locally: no Idris2 here, and
hex.pm is blocked, so mix could not fetch deps. check-proof-status.sh,
proof-ledger.sh check/claims and check-trusted-base.sh pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E294yTkKk127qgKEXFFDBE
@hyperpolymath
hyperpolymath marked this pull request as ready for review November 16, 2026 19:30
Repository owner deleted a comment from coderabbitai Bot Nov 16, 2026
@coderabbitai

coderabbitai Bot commented Nov 16, 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 30 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: 8397e670-231d-4130-8dbf-c5790e906b63
Commits

Reviewing files that changed from the base of the PR and between 58daef8 and 1a15635.

Files selected for processing: 8

  • .claude/CLAUDE.md
  • CHANGELOG.adoc
  • lib/rules/rsr_conformance.ex
  • src/Hypatia/ABI/RsrProfile.idr
  • test/rules/rsr_conformance_test.exs
  • tests/accept/RsrProfileResolution.idr
  • tests/reject/EmptyA2mlPassesProfileCriterion.idr
  • verification/PROOF-STATUS.adoc
  • 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

@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T20:53:41.714001Z 1a15635 New commits
🔒 Security Review ❌ Failed 2026-11-16T20:51:22.432598Z
We couldn’t complete this review. Comment @codex security review to try again.
1a15635 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.

@hyperpolymath
hyperpolymath enabled auto-merge (squash) November 16, 2026 19:30
@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

…ESTED

Verify Proofs run 43939522672, idris2 --check job 133552988403, at
99a40d6 (Idris 2 v0.7.0, ABI package build) checked the changed
RsrProfile model:

  PASS: no escape-hatch marker in src/Hypatia/ABI/RsrProfile.idr
  PASS: accepted positive control RsrProfileResolution
  PASS: rejected EmptyA2mlPassesProfileCriterion at invalid:
        Mismatch between: Pass and Fail.
  PASS: ABI package, 11 positive control(s), 22 expected rejection(s)

The model row is PROVEN on that receipt; the accept and the new reject
fixture are TESTED. The Elixir correspondence stays ASSUMED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E294yTkKk127qgKEXFFDBE
@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

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

ℹ️ 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 thread lib/rules/rsr_conformance.ex Resolved
Codex review on #1188: 3.2.2 called declared_capabilities/1 a second
time instead of using the `caps` score/2 had already read. A profile
rewritten mid-scan (the delegated scan runs between the two reads) could
then leave profile_present and the gated applicability on the old
reading while 3.2.2 judged the new one, breaking the agreement the
RsrProfile model proves, which assumes a single read.

evaluate/4 now passes `caps` to a detector of arity 2, and 3.2.2 is
such a detector: it judges exactly the value the scorecard reports.
The other detectors are unchanged (arity 1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E294yTkKk127qgKEXFFDBE
@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit 2f56a01 into main Nov 16, 2026
106 checks passed
@hyperpolymath
hyperpolymath deleted the claude/gifted-thompson-vsrzhw-322 branch November 16, 2026 20:55
hyperpolymath added a commit to hyperpolymath/echo-types that referenced this pull request Nov 17, 2026
## Change
`HYPATIA_SHA` in `.github/workflows/hypatia-scan.yml` moves from
`7c10e5d` to `6d8ab66`, hypatia's `main` head on 2026-11-16.

The new scanner includes:
- secret-scanning findings that name the secret's file and line, and are
never hidden by path exclusions (hyperpolymath/hypatia#1184);
- the RSR 3.2.2 verdict from the capability reader
(hyperpolymath/hypatia#1188);
- the parsed workflow model for WH013 (hyperpolymath/hypatia#1192);
- the actions-lock proof ledger (hyperpolymath/hypatia#1187).

The workflow's interface to the scanner is unchanged at that commit:
`hypatia-cli.sh` is still there, and the build is still `mix
escript.build`.

## Findings at the new pin
From [run
43967735672](https://github.com/hyperpolymath/echo-types/actions/runs/43967735672)
on `29278de`:
- **Build.** The cache missed, so the scanner was built fresh from
`6d8ab66` ("Generated escript hypatia").
- **Hypatia.** Both the JSON and SARIF scans report `0 findings >=
medium (critical=0, high=0, medium=0, warn=0, low=0, info=0)`, and the
counts step reports critical 0, high 0, total 0. The gating row is 🟢
clean.
- **Alert-backed rules.** These read 0 observations. The job token can
read code-scanning and Dependabot alerts but not secret-scanning alerts,
which need an App or PAT. That limit is unchanged by this PR.

The 🔴 rows in the rendered grid come from **advisory** fleet reporters
at the pinned `gitbot-fleet` revision, not from Hypatia, and this PR
does not change them:
- **rhodibot (RSR):** 11 high. Most expect `.a2ml` descriptiles
(`ANCHOR.a2ml`, `STATE.a2ml`, `0-AI-MANIFEST.a2ml`,
`.machine_readable/descriptiles/` and others). A2ML is retired
estate-wide, so these rules are stale. They are not answered by creating
`.a2ml` files here; rhodibot's criteria need updating to deeds in
gitbot-fleet.
- **finishingbot:** 2 high and 174 medium, mostly docs that name files
which no longer exist (`All.agda`, `Smoke.agda`, `EchoVsQuotient.agda`,
…). This is a docs clean-up for its own PR.
- **glambot:** 1 medium and 136 minor (line length, heading levels).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01P4yFkxW5Heb8p2YW7ZYs9F

Co-authored-by: Claude <noreply@anthropic.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.

3 participants