Skip to content

feat(abi): model RSR capability-profile resolution in Idris2 - #1033

Merged
hyperpolymath merged 3 commits into
mainfrom
claude/gifted-thompson-vsrzhw-pr4
Nov 10, 2026
Merged

hyperpolymath merged 3 commits into
mainfrom
claude/gifted-thompson-vsrzhw-pr4

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Owner decision 2026-11-09: write the RSR capability-profile resolution rule as an Idris2 engineering property (estate PROOF-POLICY §1). It is not graded on the PWG ladder (§8.1), so statuses use the §5 tokens only.

What this adds

  • src/Hypatia/ABI/RsrProfile.idr (added to hypatia-abi.ipkg). It models declared_capabilities/1, deed_profile_capabilities/1, clause_capabilities/1, a2ml_capabilities/1, profile_present/0 (criterion 3.2.2) and the scorecard's profile_present (caps != :none) from lib/rules/rsr_conformance.ex. The module uses %default total and has no escape hatches.
  • Theorems:
    • Deed precedence: deedPrecedence, a2mlIgnoredUnlessAbsent.
    • Fail-closed: duplicateDeclaresNothing, listlessDeclaresNothing, duplicateFailsCriterion, listlessFailsCriterion.
    • Fallback: fallbackNoDeed, fallbackNoClause, fallbackCriterionNoClause.
    • Consistency: deedDecidedAgrees (the bffd76a fix), a2mlDecidedAgrees, disagreementIsExactly, residualDivergence.
  • tests/accept/RsrProfileResolution.idr restates the profile-reader ExUnit cases against the model.
  • Four expected rejections in tests/reject/: DuplicatedClauseIsAProfile, DuplicatedClausePassesProfileCriterion, ListlessClauseFallsBack, A2mlOverridesDeed.
  • scripts/check-verdicts.sh now also checks the new module for escape-hatch markers. Its accept/reject loops already pick up the new fixtures.
  • Updated verification/PROOF-STATUS.adoc, .claude/CLAUDE.md and src/abi/README.adoc.

Finding: 3.2.2 and profile_present can still disagree

The model shows that the two readers do not always agree. When the deed has no top-level (rsr-profile …) clause:

  • 3.2.2 uses present_mr("rsr-profile.a2ml"), which only checks that the file exists.
  • The scorecard's profile_present needs a2ml_capabilities/1 to return a list.

So an rsr-profile.a2ml that does not parse, or has no capabilities list, passes 3.2.2 while profile_present is false. disagreementIsExactly proves this is the only case where they disagree. residualDivergence shows that it happens. This PR does not change the Elixir. The row is recorded as OPEN.

What is not claimed

The Elixir is not extracted from this model. The correspondence comes from review plus ExUnit, so it is recorded as ASSUMED. The theorems are properties of the model, not verified code. No local Idris2 toolchain was available, so these rows only become PROVEN/TESTED once the Verify Proofs idris2 --check job passes.


Generated by Claude Code

Add src/Hypatia/ABI/RsrProfile.idr, an engineering model of how
lib/rules/rsr_conformance.ex resolves a repository's RSR capability
profile (declared_capabilities/1, deed_profile_capabilities/1,
clause_capabilities/1, a2ml_capabilities/1) and how criterion 3.2.2
(profile_present/0) and the scorecard's profile_present read it.

Theorems about the model: deed precedence, fail-closed duplicate and
list-less clauses, a2ml fallback, and agreement of 3.2.2 with
profile_present whenever the deed decides (the bffd76a fix). The model
also shows they still disagree in exactly one case: no deed clause and
an rsr-profile.a2ml that exists but yields no capabilities list
(3.2.2 checks presence only). That case is recorded OPEN.

The Elixir is not extracted from the model; correspondence is by review
and ExUnit cases (ASSUMED). Wired into scripts/check-verdicts.sh with
one positive control and four expected rejections; the ABI package and
PROOF-STATUS list the module.

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

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • 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

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 9, 2026 15:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 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-10T01:52:00.617891Z 8e1022b New commits
🔒 Security Review ❌ Failed 2026-11-10T01:47:19.946350Z
We couldn’t complete this review. Comment @codex security review to try again.
8e1022b 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.

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

@hyperpolymath
hyperpolymath enabled auto-merge (squash) November 9, 2026 22:53
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
@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.

@hyperpolymath
hyperpolymath merged commit 0ae8b22 into main Nov 10, 2026
84 checks passed
@hyperpolymath
hyperpolymath deleted the claude/gifted-thompson-vsrzhw-pr4 branch November 10, 2026 01:47
@sonarqubecloud

Copy link
Copy Markdown

@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: 8e1022b522

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

`+scorecardProfilePresent+` whenever the deed decides
(`+deedDecidedAgrees+`, the bffd76a fix) or the a2ml is not present-but-
declaring-nothing (`+a2mlDecidedAgrees+`); they disagree in exactly that
case (`+disagreementIsExactly+`) |PROVEN — Verify Proofs run 42634000625, idris2 --check job 129217248108, at commit 34c7bc7cff0cf54b1b5707a497d9f8abf826e844 (Idris2 v0.7.0, ABI package build)

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 Record the RSR obligations in the canonical ledger

These new proof and fixture statuses are recorded only in this hand-written table: verification/proof-ledger.jsonl contains no RsrProfile obligation, even though the generated ledger immediately above declares that JSONL file canonical. Consequently its published census remains 22/42 and omits the newly claimed proven/tested work, while the schema and currency checks cannot validate these claims. Add the corresponding engineering rows to the JSONL ledger and regenerate the status table.

Useful? React with 👍 / 👎.

Comment on lines +532 to +533
|API type safety |`+Types.idr+`, `+GraphQL.idr+`, `+REST.idr+`,
`+GRPC.idr+`, `+FFI.idr+` |Full

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 Add the missing opening delimiter to Coverage

The Coverage section starts emitting table cells without a table attribute or opening |===; the only delimiter is the one at line 559, so AsciiDoc interprets the coverage rows as ordinary text and may treat that final delimiter as the start of an unterminated table containing the following sections. Restore an opening delimiter and header before the first row, or retain the prose-only Coverage section from the parent.

Useful? React with 👍 / 👎.

|RSR capability-profile resolution |`+RsrProfile.idr+` |Model only;
correspondence to the Elixir ASSUMED

|VCL parser totality |`+ParserTotality.lean+` |Full (FROM-clause subset)

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 Point coverage entries at the current Idris2 proofs

This entry names ParserTotality.lean, but that artifact was removed before this commit and the current proof is verification/proofs/idris2/ParserTotality.idr; a repository-wide search finds only historical references to the Lean filename. The PageRank and ESN entries immediately below have the same stale .lean references, so this restored coverage map directs readers to nonexistent proof artifacts and should use the Idris2 paths.

Useful? React with 👍 / 👎.

Comment on lines +444 to +446
disagreementIsExactly : (src : ProfileSource)
-> Not (passes (criterion322 src) = scorecardProfilePresent (declaredCapabilities src))
-> (resolve (deed src) = Absent, a2ml src = A2mlDeclaresNothing)

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 Prove the converse before calling the characterization exact

disagreementIsExactly proves only the necessary direction: given a disagreement, it derives resolve (deed src) = Absent and a2ml src = A2mlDeclaresNothing. residualDivergence then demonstrates only one concrete source, rather than proving that every source satisfying those two conditions disagrees. Thus consumers cannot obtain the advertised exact characterization from these theorems; add the general converse (or an equivalence theorem) before claiming that this is exactly the disagreement case.

Useful? React with 👍 / 👎.

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