Skip to content

chore(abi): delete the seven shadow copies of packaged ABI modules (A5, 1/3) - #511

Merged
hyperpolymath merged 6 commits into
mainfrom
claude/new-session-th4e9w-a5-shadows
Nov 17, 2026
Merged

hyperpolymath merged 6 commits into
mainfrom
claude/new-session-th4e9w-a5-shadows

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Why

Owner ruling on open question A5: "Delete stale, salvage rest". Seven .idr files at the src/abi/ root sat outside echidnaabi.ipkg, so nothing type-checked them. Each one shadows a packaged module.

What

I diffed each file against the module it shadows:

Deleted Packaged module Diff
BojForeign.idr Boj/Foreign.idr body identical
OverlayForeign.idr Overlay/Foreign.idr body identical
TentaclesForeign.idr Tentacles/Foreign.idr body identical
TypeLLForeign.idr TypeLL/Foreign.idr body identical
Types.idr EchidnaABI/Types.idr body identical
Layout.idr EchidnaABI/Layout.idr body identical
Foreign.idr EchidnaABI/Foreign.idr older: stale module name Echidna.ABI.Foreign, no Result type, AnyPtr callback

Comments that named a shadow now name the packaged module. These are:

  • the four generated/abi/*.h headers (the tree has no generator for them);
  • four Zig FFI sources;
  • the L1 Cap'n Proto handover note;
  • issue echidna-04.

Nothing imported the deleted files. src/rust/corpus/profile.rs only matches fixture paths under a temporary root, and reports/ are historical snapshots, so neither is changed. PROOF-STATUS R2 is updated.

Stack

  1. This PR: delete the shadows.
  2. Package Coprocessor.Foreign at its module path (base: this branch).
  3. Move NeSyAssistTesting.idr to tests/fixtures/non-proof/ (base: 2).

Generated by Claude Code

claude and others added 2 commits November 16, 2026 18:16
Owner ruling on open question A5: delete the stale copies, salvage the rest.
Each file sat at the src/abi/ root outside echidnaabi.ipkg, so nothing
type-checked it. Each one was diffed against the packaged module it shadows:

  BojForeign.idr        = Boj/Foreign.idr         (body identical)
  OverlayForeign.idr    = Overlay/Foreign.idr     (body identical)
  TentaclesForeign.idr  = Tentacles/Foreign.idr   (body identical)
  TypeLLForeign.idr     = TypeLL/Foreign.idr      (body identical)
  Types.idr             = EchidnaABI/Types.idr    (body identical)
  Layout.idr            = EchidnaABI/Layout.idr   (body identical)
  Foreign.idr           older EchidnaABI/Foreign.idr: stale module name
                        Echidna.ABI.Foreign, no Result type, AnyPtr callback

Comments that named a shadow now name the packaged module: the four
generated/abi headers (no generator for them exists in the tree), four Zig
FFI sources, the L1 Cap'n Proto handover note and issue echidna-04. Nothing
else imported these files. src/rust/corpus/profile.rs matches only on
fixture paths under a temporary root, and reports/ are historical
snapshots, so neither changes. PROOF-STATUS R2 is updated.

CoprocessorForeign and NeSyAssistTesting follow in the next two PRs of this
stack.

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

## Why

`src/abi/CoprocessorForeign.idr` declared `module Coprocessor.Foreign`.
Its module name did not match its path, so the package could not list
it, and nothing type-checked it. Owner ruling on A5: put it in the
package if it type-checks.

## What

- `git mv` to `src/abi/Coprocessor/Foreign.idr`. The contents are
unchanged. The module declares `%default total` and uses no
`believe_me`, `assert_total` or `postulate`.
- `echidnaabi.ipkg` lists `Coprocessor.Foreign`. **This PR's ABI
type-check job is the test.** If it fails, the module comes out again;
it is not forced through.
- `scripts/gates/w0.sh` check 07b now looks for
`Coprocessor/Foreign.idr`. At the old path the check would skip the
moved file and pass vacuously. The self-test is updated: `bash
scripts/gates/w0.selftest.sh` gives 68 cases, 0 failed.
- The SPARK spec comments (`coprocessor_safety.ads`) and PROOF-STATUS R2
name the new path.

`idris2` is not available in this session, so the type-check is left to
CI.

Stacked on the A5 PR 1/3 branch
(`claude/new-session-th4e9w-a5-shadows`).

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

Co-authored-by: Claude <noreply@anthropic.com>
Repository owner deleted a comment from coderabbitai Bot Nov 16, 2026
@hyperpolymath
hyperpolymath marked this pull request as ready for review November 16, 2026 19:41
@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-17T00:18:20.994074Z d0959df New commits
🔒 Security Review ❌ Failed 2026-11-17T00:15:00.593514Z
We couldn’t complete this review. Comment @codex security review to try again.
d0959df 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.

Repository owner deleted a comment from coderabbitai Bot Nov 16, 2026
Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 16, 2026
@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 17 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: 2f6012ae-5b2c-4b94-b3a3-49f1c17419d1
Commits

Reviewing files that changed from the base of the PR and between 712d2bb and d0959df.

Files ignored due to path filters: 4

  • generated/abi/echidna_boj.h is excluded by !**/generated/**
  • generated/abi/echidna_overlay.h is excluded by !**/generated/**
  • generated/abi/echidna_tentacles.h is excluded by !**/generated/**
  • generated/abi/echidna_typell.h is excluded by !**/generated/**
Files selected for processing: 19

  • docs/PROOF-STATUS.adoc
  • docs/handover/L1-CAPNPROTO-PROMPT.adoc
  • ffi/zig/src/boj.zig
  • ffi/zig/src/main.zig
  • ffi/zig/src/tentacles.zig
  • ffi/zig/src/typell.zig
  • issues/echidna-04-ffi-abi-bridge.md
  • scripts/gates/w0.selftest.sh
  • scripts/gates/w0.sh
  • src/abi/BojForeign.idr
  • src/abi/Coprocessor/Foreign.idr
  • src/abi/Foreign.idr
  • src/abi/Layout.idr
  • src/abi/OverlayForeign.idr
  • src/abi/TentaclesForeign.idr
  • src/abi/TypeLLForeign.idr
  • src/abi/Types.idr
  • src/abi/echidnaabi.ipkg
  • src/ada/spark/coprocessor_safety.ads

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Added support for identifying five additional coprocessor backends. Their health is reported as unhealthy until runtime probing is available.
  • Documentation
    • Updated ABI references and package records to reflect the reorganised module locations.
  • Changes
    • Removed the previous top-level ABI modules for BoJ, Echidna, Overlay, Tentacles, TypeLL, shared types and layout definitions. Integrations relying on those module paths or declarations may need updating.

Changes

The Idris ABI changes add five Coprocessor kinds and update package coverage for Coprocessor.Foreign. The changes also delete seven legacy ABI files and update documentation and comments to refer to relocated ABI paths.

Idris ABI consolidation

Layer / File(s) Summary
Extend Coprocessor kind mappings
src/abi/Coprocessor/Foreign.idr
Adds PariGp, Maxima, Singular, Gap and Macaulay2 with tags 11–15. Adds matching decoding and proof cases, and marks these kinds Unhealthy.
Package and validate Coprocessor.Foreign
src/abi/echidnaabi.ipkg, scripts/gates/w0.sh, scripts/gates/w0.selftest.sh, docs/PROOF-STATUS.adoc, src/ada/spark/coprocessor_safety.ads
Adds the module to the package and updates the package-coverage check, fixtures, proof-status evidence and Ada mirror references.
Remove legacy ABI files and update references
src/abi/{BojForeign,Foreign,Layout,OverlayForeign,TentaclesForeign,TypeLLForeign,Types}.idr, docs/handover/L1-CAPNPROTO-PROMPT.adoc, ffi/zig/src/{boj,main,tentacles,typell}.zig, issues/echidna-04-ffi-abi-bridge.md
Deletes seven legacy ABI files. Updates documentation and comments to refer to the relocated ABI modules.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Possibly related PRs

Merge Risk: Minimal · previous review 712d2

This change removes unchecked duplicate ABI files, packages the relocated Coprocessor module, and adds five coprocessor kinds. The changes are limited to the ABI definitions, gate scripts, and comments. No merge-blocking issue was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: deleting seven shadow copies of packaged ABI modules under src/abi/. The raw summary and PR description confirm the deletions of BojForeign.idr, OverlayForeign.idr, Te…
Description check Passed The description follows the template's main sections. It has a Why section (owner ruling A5), a What section with a per-file table and the list of comment updates, and a stack note. It does not fill i…
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: deleting seven shadow copies of packaged ABI modules under src/abi/. The raw summary and PR description confirm the deletions of BojForeign.idr, OverlayForeign.idr, TentaclesForeign.idr, TypeLLForeign.idr, Types.idr, Layout.idr and Foreign.idr. The title's 'chore(abi)' prefix and the '(A5, 1/3)' stack marker are acceptable. The title is 76 characters, within a typical length limit.

Full details: Description check

Explanation

The description follows the template's main sections. It has a Why section (owner ruling A5), a What section with a per-file table and the list of comment updates, and a stack note. It does not fill in the Summary, Changes, or Testing headings as the template lays them out. The RSR Quality Checklist is absent, and the description states no test results. The PR objectives say the commits report 68 passing cases for w0.selftest.sh, but the description itself does not record any test run. The author also says PROOF-STATUS R2 was updated, which the description does not explain in detail. Most required content is present, but the testing section and the checklist are missing.

Resolution

Add a Testing section that states how the deletions were verified. For example, state whether the packaged modules still type-check, and whether bash scripts/gates/w0.selftest.sh was run. Add the RSR Quality Checklist or mark its items that apply.

  • 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: 7d104bc4-96c3-4e96-9931-6d3a03da3a81
Commits

Reviewing files that changed from the base of the PR and between 81f40a6 and 712d2bb.

Files ignored due to path filters: 4

  • generated/abi/echidna_boj.h is excluded by !**/generated/**
  • generated/abi/echidna_overlay.h is excluded by !**/generated/**
  • generated/abi/echidna_tentacles.h is excluded by !**/generated/**
  • generated/abi/echidna_typell.h is excluded by !**/generated/**
Files selected for processing: 19

  • docs/PROOF-STATUS.adoc
  • docs/handover/L1-CAPNPROTO-PROMPT.adoc
  • ffi/zig/src/boj.zig
  • ffi/zig/src/main.zig
  • ffi/zig/src/tentacles.zig
  • ffi/zig/src/typell.zig
  • issues/echidna-04-ffi-abi-bridge.md
  • scripts/gates/w0.selftest.sh
  • scripts/gates/w0.sh
  • src/abi/BojForeign.idr
  • src/abi/Coprocessor/Foreign.idr
  • src/abi/Foreign.idr
  • src/abi/Layout.idr
  • src/abi/OverlayForeign.idr
  • src/abi/TentaclesForeign.idr
  • src/abi/TypeLLForeign.idr
  • src/abi/Types.idr
  • src/abi/echidnaabi.ipkg
  • src/ada/spark/coprocessor_safety.ads
Files with no reviewable changes: 7

  • src/abi/BojForeign.idr
  • src/abi/Foreign.idr
  • src/abi/Layout.idr
  • src/abi/OverlayForeign.idr
  • src/abi/TentaclesForeign.idr
  • src/abi/TypeLLForeign.idr
  • src/abi/Types.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: 36

  • GitHub Check: rust-ci / Cargo check + clippy + fmt
  • GitHub Check: rust-ci / llvm-cov line coverage
  • GitHub Check: CodeRabbit
  • GitHub Check: governance / JS runtimes — deno
  • GitHub Check: governance / JS runtimes — pnpm
  • GitHub Check: governance / Live Actions policy (credentialed advisory)
  • GitHub Check: governance / UUID v8 conformance
  • GitHub Check: governance / Allowlist Preflight
  • GitHub Check: governance / Licence consistency
  • GitHub Check: governance / JS runtimes — bun
  • GitHub Check: governance / Code quality + docs
  • GitHub Check: governance / Check Workflow Staleness
  • GitHub Check: governance / JS runtimes — environment provisions Bun first
  • GitHub Check: governance / Workflow security linter
  • GitHub Check: governance / Security policy checks
  • GitHub Check: governance / Debt ratchet
  • GitHub Check: governance / Well-Known (RFC 9116 + RSR)
  • GitHub Check: governance / Actions lockfile verify
  • GitHub Check: governance / Exemption ratchet
  • GitHub Check: governance / Language / package anti-pattern policy
  • GitHub Check: governance / Trusted-base reduction policy
  • GitHub Check: governance / Guix packaging policy (Nix retired)
  • GitHub Check: hypatia / Hypatia Neurosymbolic Analysis
  • GitHub Check: T1 / glpk
  • GitHub Check: MVP Smoke
  • GitHub Check: analyze (javascript-typescript, none)
  • GitHub Check: Validate DEED manifests
  • GitHub Check: Groove manifest check
  • GitHub Check: T1 / cvc5
  • GitHub Check: T1 / minizinc
  • GitHub Check: T1 / chuffed
  • GitHub Check: T1 / alt-ergo
  • GitHub Check: Type-check Idris2 ABI definitions
  • GitHub Check: panic-attack assail
  • GitHub Check: PR (address)
  • GitHub Check: Proof safety regressions
Additional context used

Code guidelines: 2

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

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/Coprocessor/Foreign.idr
  • src/abi/echidnaabi.ipkg
Source excerpt: FFI implementations in Zig (`ffi/zig/`, `src/zig_ffi/`).

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

Files:

  • ffi/zig/src/boj.zig
  • ffi/zig/src/main.zig
  • ffi/zig/src/tentacles.zig
  • ffi/zig/src/typell.zig
Source excerpt: ABI definitions in Idris2 (`src/abi/`, package `src/abi/echidnaabi.ipkg`).

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

Files:

  • src/abi/Coprocessor/Foreign.idr
  • src/abi/echidnaabi.ipkg
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:

  • docs/PROOF-STATUS.adoc
  • docs/handover/L1-CAPNPROTO-PROMPT.adoc
  • ffi/zig/src/boj.zig
  • ffi/zig/src/main.zig
  • ffi/zig/src/tentacles.zig
  • ffi/zig/src/typell.zig
  • issues/echidna-04-ffi-abi-bridge.md
  • scripts/gates/w0.selftest.sh
  • scripts/gates/w0.sh
  • src/abi/Coprocessor/Foreign.idr
  • src/abi/echidnaabi.ipkg
  • src/ada/spark/coprocessor_safety.ads
LanguageTool

issues/echidna-04-ffi-abi-bridge.md

[typographical] ~17-~17: Two consecutive commas
Context: ...holds the Idris2 ABI (echidnaabi.ipkg, EchidnaABI/, and per-subsystem `/Foreign....

(DOUBLE_PUNCTUATION)

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

ℹ️ 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 docs/PROOF-STATUS.adoc Resolved
Comment thread src/abi/echidnaabi.ipkg Resolved
Packaging Coprocessor.Foreign (#512) made it the checked coprocessor ABI,
but its CoprocessorKind stopped at Fpga = 10. The Rust enum in
src/rust/coprocessor/types.rs also declares the live Phase 2b subprocess
backends PariGp, Maxima, Singular, Gap and Macaulay2 (constructed by
CoprocessorFactory in coprocessor/mod.rs), with implicit discriminants
11 to 15. Add them in that order: constructors, the u8 encoding and
decoding, the round-trip lemma kindEncodeDecodeId, and
coprocessorHealthOf (Unhealthy, as for the other subprocess kind, Fpga).
Found by Codex on #511.

PROOF-STATUS R2 named "that job's first green run after the move" as the
receipt, which identified no run (also Codex on #511). It now links the
ABI job's green run on dc36ee9 for the eleven-kind module, and says the
extended module has no receipt until that job is recorded for this
commit.

Idris 2 is not available in this session; the ABI job on this PR's head
is the check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3
@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.

….Foreign

The ABI type-check job passed on ff1eef2, the commit that extended
CoprocessorKind to the Rust enum. Link that run in R2 in place of the
"no receipt yet" note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3
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>
@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 4779be0 into main Nov 17, 2026
73 checks passed
@hyperpolymath
hyperpolymath deleted the claude/new-session-th4e9w-a5-shadows branch November 17, 2026 00:33
hyperpolymath pushed a commit that referenced this pull request Nov 17, 2026
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
hyperpolymath added a commit that referenced this pull request Nov 17, 2026
… in CI (#521)

## Summary

This follows up on #512 (and the #511 batch). `Coprocessor.Foreign` maps
each `CoprocessorKind` to a u8 tag from 0 to 15. The Rust enum in
`src/rust/coprocessor/types.rs` had no discriminants. The tags therefore
matched Rust only by declaration order, and reordering or inserting a
Rust variant would have shifted the Rust side without any error.

## Changes

- **Rust `CoprocessorKind`:** now `#[repr(u8)]` with explicit
discriminants 0 to 15. Nothing in Rust casts the kind today, so
behaviour does not change.
- **New `scripts/ci/check-coprocessor-tags.sh`:** compares the Rust and
Idris lists as `Name=tag` pairs. It fails on any difference, on a Rust
variant with no explicit discriminant, or when either list is empty.
- **`idris2-abi-ci.yml`:** runs that check on every event. On pushes to
`main`, it also runs when `types.rs` or the script changes.
- **`Coprocessor/Foreign.idr`:**
- The header said "Phase 0 declares the Math kind only". It now says the
module declares all sixteen kinds.
  - The tag doc comment no longer says Rust has no discriminants.

## RSR Quality Checklist

### Required

- [x] Tests pass: the check passes on the tree and fails on both broken
copies (see Testing).
- [x] Code is formatted: `cargo fmt --all -- --check` passes.
- [ ] Linter is clean: `cargo check --locked --lib` passes. Clippy and
actionlint were not run in this session; CI runs both.
- [x] No banned language patterns
- [x] No `unsafe` blocks without `// SAFETY:` comments
- [x] No banned functions
- [x] SPDX license headers present on all new files
- [x] No secrets, credentials, or `.env` files included

### As Applicable

- [x] ABI/FFI changes validated: the Rust and Idris tags agree, and the
check enforces it.

## Testing

- `bash scripts/ci/check-coprocessor-tags.sh` on the tree prints
`coprocessor tags agree: 16 kinds` and exits 0.
- Copy with the Idris tag for `Gap` changed to 13: the script prints
`::error … disagrees`, shows the diff `rust Gap=14` / `idris Gap=13`,
and exits 1.
- Copy with the Rust variant `Gap` left without a discriminant: the
script prints `::error … variants without an explicit discriminant` and
exits 1.

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

---------

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