Skip to content

fix(abi): correct the Cap'n Proto schema id mirror and gate it against the schema - #508

Open
hyperpolymath wants to merge 6 commits into
mainfrom
claude/new-session-th4e9w-capnp-id
Open

hyperpolymath wants to merge 6 commits into
mainfrom
claude/new-session-th4e9w-capnp-id

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Why

#472 added EchidnaABI.CapnSchemas to echidnaabi.ipkg. Its echidnaSchemaId is wrong:

Source Value
schemas/echidna.capnp:12 0xd3b45f8ae1c79012 = 15254922887908790290
CapnSchemas.idr:37 15242516543891767314 = 0xd3884c09d1af0012

schemaIdNonZero still passes, because it only rules out 0. Review on #472 found this after the merge.

What

  • echidnaSchemaId is now the hex literal 0xd3b45f8ae1c79012, the same text the schema file declares.
  • idris2-abi-ci.yml gets a new step, "Cap'n Proto schema id matches its Idris mirror". It compares the two hex literals and fails if either is missing or they differ. It runs on every event, because it is cheap.
  • schemas/echidna.capnp is added to the workflow's push paths and to the PR detect pattern, so a schema-only change runs the full check.

Checks run

  • Simulated the comparison locally. It matches on this branch. On main it fails, because the constant there is a decimal literal that the check cannot read.
  • Searched the repository: there is no other copy of the wrong value.
  • idris2 is not available in this session, so the type-check is left to the Type-check Idris2 ABI definitions job. Idris 2 lexes 0x… integer literals, and fromInteger gives the same Nat as the decimal form.

Generated by Claude Code

…t the schema

EchidnaABI.CapnSchemas.echidnaSchemaId held 15242516543891767314
(0xd3884c09d1af0012). schemas/echidna.capnp declares 0xd3b45f8ae1c79012,
which is 15254922887908790290. The non-zero proof passed because it only
rules out 0.

The constant is now the same hex literal the schema file declares. The
idris2-abi-ci workflow gets a step that compares the two textually on every
event and fails if they differ. A change to schemas/echidna.capnp now also
triggers the workflow's full run.

Reported by review on #472 after merge.

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

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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 24 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: d6a7b2b2-17c0-4f55-86c5-b4f75ed181ae
Commits

Reviewing files that changed from the base of the PR and between 5f3d061 and ec787ef.

Files selected for processing: 3

  • .github/workflows/idris2-abi-ci.yml
  • docs/PROOF-STATUS.adoc
  • src/abi/EchidnaABI/CapnSchemas.idr

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Chores
    • Pull-request type-check gating now covers changes to the schema definition.
    • Automated checks now verify that the schema identifier matches its Idris mirror and report an error if either identifier is missing or they differ.
    • Updated the recorded schema identifier to match the current value.

The ABI workflow now includes schemas/echidna.capnp in its change filters and checks that its schema ID matches the Idris mirror. The Idris mirror’s schema ID is updated to the hexadecimal value.

Changes: Schema ID parity

Layer / File(s) Summary
Schema ID update and CI verification
src/abi/EchidnaABI/CapnSchemas.idr, .github/workflows/idris2-abi-ci.yml
echidnaSchemaId now uses the hexadecimal schema ID. The workflow includes the schema in its push and pull-request filters, then checks that both IDs exist and match after lowercasing.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · previous review 5f3d0

The change corrects the mirrored schema ID and adds a CI check that keeps it in sync with the Cap'n Proto schema. No material merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: correcting the Cap'n Proto schema ID mirror in the Idris ABI. It also names the new gate that compares the mirror with the schema. The changeset matches both parts, so…
Description check Passed The description explains the wrong value, the fix to the hex literal, the new CI comparison step, and the workflow path changes. It also reports local checks and states that the type-check is left to …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: correcting the Cap'n Proto schema ID mirror in the Idris ABI. It also names the new gate that compares the mirror with the schema. The changeset matches both parts, so the title is accurate and specific.

Full details: Description check

Explanation

The description explains the wrong value, the fix to the hex literal, the new CI comparison step, and the workflow path changes. It also reports local checks and states that the type-check is left to CI. It does not follow the repository template. The Summary and Changes sections are present, but the RSR Quality Checklist, Testing, and the related template items are missing or not marked. The Testing section is not a separate heading, although the 'Checks run' content covers it.

Resolution

Consider adding the RSR Quality Checklist with the applicable items marked, and moving the 'Checks run' content under a '## Testing' heading. Also state whether the CHANGELOG or ABI/FFI validation items apply. The core content is complete, so these are non-critical gaps.

  • 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

Recent review info

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: 4d593856-6106-4c98-a646-94cd07341128
Commits

Reviewing files that changed from the base of the PR and between 478b751 and 5f3d061.

Files selected for processing: 2

  • .github/workflows/idris2-abi-ci.yml
  • src/abi/EchidnaABI/CapnSchemas.idr

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details

Context from checks skipped due to timeout: 38

  • GitHub Check: scan / rust-secrets
  • GitHub Check: scan / shell-secrets
  • GitHub Check: CodeRabbit
  • GitHub Check: Dogfooding compliance summary
  • GitHub Check: rust-ci / Cargo check + clippy + fmt
  • GitHub Check: rust-ci / Cargo audit (security)
  • GitHub Check: rust-ci / llvm-cov line coverage
  • GitHub Check: governance / JS runtimes — deno
  • GitHub Check: governance / JS runtimes — pnpm
  • GitHub Check: governance / Licence consistency
  • GitHub Check: governance / JS runtimes — environment provisions Bun first
  • GitHub Check: governance / Well-Known (RFC 9116 + RSR)
  • GitHub Check: governance / Debt ratchet
  • GitHub Check: governance / JS runtimes — bun
  • GitHub Check: governance / Exemption ratchet
  • GitHub Check: governance / Trusted-base reduction policy
  • GitHub Check: governance / Workflow security linter
  • GitHub Check: governance / Check Workflow Staleness
  • GitHub Check: governance / UUID v7 conformance
  • GitHub Check: governance / Live Actions policy (credentialed advisory)
  • GitHub Check: governance / Guix packaging policy (Nix retired)
  • GitHub Check: governance / Actions lockfile verify
  • GitHub Check: governance / UUID v8 conformance
  • GitHub Check: governance / Allowlist Preflight
  • GitHub Check: governance / Language / package anti-pattern policy
  • GitHub Check: T1 / z3
  • GitHub Check: T1 / minizinc
  • GitHub Check: T1 / glpk
  • GitHub Check: T1 / chuffed
  • GitHub Check: T1 / alt-ergo
  • GitHub Check: T1 / eprover
  • GitHub Check: T1 / spass
  • GitHub Check: panic-attack assail
  • GitHub Check: MVP Smoke
  • GitHub Check: Proof safety regressions
  • GitHub Check: Type-check Idris2 ABI definitions
  • GitHub Check: PR (address)
  • GitHub Check: semgrep-cloud-platform/scan
Additional context used

Code guidelines: 2

CLAUDE.md — auto-discovered
.github/copilot-instructions.md — auto-discovered
Path-based instructions: 3

Source excerpt: CI enforces estate-wide governance through reusable workflows pinned in `.github/workflows/`: **Idris2 ABI type-check**: `idris2-abi-ci.yml` enforces zero `believe_me` / `assert_total` / `postulate` in `src/abi/`.

CodeRabbit inference engine (CLAUDE.md)

Files:

  • src/abi/EchidnaABI/CapnSchemas.idr
Source excerpt: ABI definitions in Idris2 (`src/abi/`, package `src/abi/echidnaabi.ipkg`).

CodeRabbit inference engine (.github/copilot-instructions.md)

Files:

  • src/abi/EchidnaABI/CapnSchemas.idr
Source excerpt: **Version + release history**: [`CHANGELOG.adoc`](CHANGELOG.adoc) (single source of truth; do not duplicate version strings elsewhere)

CodeRabbit inference engine (CLAUDE.md)

Files:

  • .github/workflows/idris2-abi-ci.yml
  • src/abi/EchidnaABI/CapnSchemas.idr
Additional comments: 4

src/abi/EchidnaABI/CapnSchemas.idr: 1

34-36: LGTM!

Also applies to: 39-39

.github/workflows/idris2-abi-ci.yml: 3

16-16: LGTM!

50-50: LGTM!

138-153: LGTM!

coderabbitai[bot]
coderabbitai Bot previously approved these changes Nov 16, 2026
@linear-code
linear-code Bot marked this pull request as ready for review November 16, 2026 18:17
@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 ❌ Failed 2026-11-16T18:17:23.596550Z
We couldn’t complete this review. Comment @codex review to try again.
5f3d061 Draft marked ready
ℹ️ 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 added a commit that referenced this pull request Nov 17, 2026
…ss (#519)

## Summary

The live `Branch-Floor` ruleset on `main` requires a status check named
`CI/gate`. No workflow in echidna produced that check, and `main` had
none. Since 2026-11-16 19:45Z, when the ruleset last changed, no pull
request has merged: #508–#511, #514 and #517 all show `blocked`, and
none of them has a failing check.

On 2026-11-17 the owner ruled to keep the requirement and give it a
producer. This PR does that.

## Changes

- `.github/workflows/rust-ci.yml`: new job `gate`, named `CI/gate`. That
name is the check context the ruleset requires.
  - It depends on `detect`, `check`, `test`, `audit` and `coverage`.
- It passes only when `Cargo.toml` was detected and all five jobs
succeeded.
- A skipped, cancelled or missing job fails it, so the gate cannot pass
on work that did not run.
  - Same pattern as hypatia's `ci.yml` `CI/gate`.
  - No action is used, so `actions.lock` does not change.

## RSR Quality Checklist

### Required

- [x] Tests pass: the gate script was run against fixtures (see
Testing).
- [x] Code is formatted: not applicable, YAML only.
- [ ] Linter is clean: actionlint was not available in this session. The
repo's Workflow Security Linter will lint the file on this PR.
- [x] No banned language patterns
- [x] No `unsafe` blocks without `// SAFETY:` comments: not applicable.
- [x] No banned functions: not applicable.
- [x] SPDX license headers present: the file keeps its existing header.
- [x] No secrets, credentials, or `.env` files included

## Testing

I extracted the step script with `yq` and ran it against five `needs`
fixtures:

| Case | Exit code |
|---|---|
| All five jobs succeed | 0 |
| `test` failed | 1 |
| `coverage` cancelled | 1 |
| `has_cargo=false`, `check` skipped | 1 |
| `audit` missing | 1 |

**Not tested:** that GitHub reports the check under the exact context
`CI/gate`. This PR's own run will show it.

**Other rules may still block these PRs once `CI/gate` passes.** The
live ruleset also requires:

- signed commits (agent commits here are unsigned)
- linear history
- resolved review threads
- an 80% `code_coverage` rule

Those are outside this change.

---
_Generated by [Claude
Code](https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3)_

Co-authored-by: Claude <noreply@anthropic.com>
The schema-id step runs under `set -euo pipefail`. When either grep
matched nothing, the pipeline failed and the step exited before it
printed the ::error line, so the failure carried no message. Both greps
are now wrapped in `{ … || true; }`, so an empty result reaches the -z
check and the error is printed. Checked both ways: the real tree passes,
and a schema with no `@0x…;` line prints the error and exits 1.

PROOF-STATUS R2 cited only the 2026-11-09 receipts on a2a8643, whose
src/abi/ tree matched 2ab7574. #511, #512 and this PR have changed
src/abi/ since then. R2 now says so and cites this PR's own
Type-check Idris2 ABI definitions run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3
…4e9w-capnp-id

# Conflicts:
#	.github/workflows/idris2-abi-ci.yml
…4e9w-capnp-id

# Conflicts:
#	.github/workflows/idris2-abi-ci.yml
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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