Skip to content

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

Merged
hyperpolymath merged 6 commits into
mainfrom
claude/new-session-th4e9w-capnp-id
Nov 18, 2026
Merged

hyperpolymath merged 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[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
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

Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 18, 2026
Repository owner deleted a comment from coderabbitai Bot Nov 18, 2026
@hyperpolymath
hyperpolymath merged commit 87054cc into main Nov 18, 2026
74 checks passed
@hyperpolymath
hyperpolymath deleted the claude/new-session-th4e9w-capnp-id branch November 18, 2026 18:37
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