Skip to content

feat(abi): resource-algebra as the grade kernel — one min-plus, one max-plus (PWL-01, PR A) - #271

Merged
hyperpolymath merged 4 commits into
claude/new-session-ywdrth-cifrom
claude/new-session-ywdrth
Oct 14, 2026
Merged

hyperpolymath merged 4 commits into
claude/new-session-ywdrth-cifrom
claude/new-session-ywdrth

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

PWL-01 step 1. This ports hyperpolymath/resource-algebra Core.agda and its three instances to Idris2 as the ABI's grade kernel. Tropical.idr and Echo.idr now draw their grades from it, and a grep gate enforces one definition of min-plus and one of max-plus in the tree.

Stacked on #270, the CI unblock. Without it, E2E Validation can't start. Pin: resource-algebra cf9235c532712a783a404c359a1055f40134794a, fetched by scripts/fetch-siblings.sh.

One correction to the issue text. Tropical.idr was never max-plus. Its TropCost is min-plus, the same algebra as Loss. Its bottleneck layer (tropMax) is min-max, which is neither min-plus nor max-plus. So both Tropical.TropCost and Echo.EchoGrade became the Loss carrier. MaxPlus is in the kernel, but no L11 obligation uses it yet. tests/reject/TropicalIsNotMaxPlus.idr is the checked statement.

Changes

  • src/abi/TypedWasm/ABI/ResourceAlgebra.idr: the ResourceAlgebra interface. IsOrdered, IsDioid and IsAnnihilating are separate interfaces, as in Agda. "Every dioid is ordered" is a proof: dioidMonoL/R and the named implementation dioidOrdered. A transcription map is in the header.
  • ResourceAlgebra/{Loss,MaxPlus,HWM}.idr: clause-for-clause transcriptions. Constructors are renamed fin/inf → Finite/Infinity and val/bot → Val/Bot; clause order is kept. Separation.idr has S-1..S-3. Nat.idr holds only the lemmas base lacks: base's Data.Nat.minimum/maximum/LTE are the Agda Prelude's min/max/≤, so the tree declares no Nat min/max at all.
  • Tropical.idr: TropCost = LossGrade. The 12 axioms and the order layer are derived from the kernel, and tropMin/natMax are deleted. Every public name is kept, so Epistemic/Proofs compile unchanged. Echo.idr: EchoGrade = LossGrade.
  • tools/check-grade-kernel.sh is the grep gate. Its --self-test is the negative control: 8 seeded duplicates are caught, 0 false positives. Run on main's Tropical.idr, it fails. tools/grade-kernel.allow holds the one exception (tropMax, MinMax) with its reason.
  • tools/check-kernel-proofs.sh runs the falsifiers. A missing toolchain fails the gate; it never skips:
    • upstream check-agda.sh at the pin;
    • a clean idris2 --build;
    • tests/reject/*.idr, each refused at its invalid line with its EXPECT message;
    • the transcription table tests/transcription/ops.tsv: 172 rows, Agda refl against the pinned sources and Idris2 Refl against the port, with wrong-rows.tsv refused by both.
  • CI: two new jobs in contract-gate.yml. They go there, not in a new workflow, because actions.lock is keyed by path. Idris2 0.8.0 is built from its tag because there are no binaries.
  • Docs: LEVEL-STATUS row 11, the inventory and a new "Grade kernel" section; CONTRACT Enforcement; the spec's L11 sentence; CHANGELOG. regression.mjs pins 31 kernel names.

Status rows (artefact for each)

Claim Status Artefact
Kernel laws (C-1–C-4, L-1, M-1, H-1 restated in Idris2) PROVEN (Idris2) ResourceAlgebra*.idr, idris2 --build
Port ≡ Agda source ASSUMED, TESTED on 172 rows / 244 equalities tools/check-kernel-proofs.sh step 4
S-1–S-3 separation TESTED (computed) ResourceAlgebra/Separation.idr
C-4 / H-3 (HWM has no annihilating zero) TESTED tests/reject/HWMAnnihilates.idr
L11 / L12 unchanged: draft none

RSR Quality Checklist

Required

  • Tests pass (see Testing)
  • Code is formatted
  • Linter is clean: the build has the same 24 warnings as main, none new
  • No banned language patterns
  • No unsafe blocks without // SAFETY: comments
  • No banned functions: zero believe_me/assert_total (checked by the gate)
  • SPDX license headers present on all new/modified source files
  • No secrets, credentials, or .env files included

As Applicable

  • .machine_readable/descriptiles/STATE.a2ml not updated: last updated 2026-05-27, and its completion figures are hand-written; left for the owner
  • Documentation updated
  • CHANGELOG updated
  • ABI changes validated. contract.abi.sha256 is unchanged: the I3 anchors cover section.rs's wire format, not src/abi/ (now stated in CONTRACT.adoc). Re-sealing without an abi_version bump would be wrong.

Testing

tools/check-contract.sh                 OK: contract gate — I1 + I3 hold
tools/check-grade-kernel.sh --self-test PASS 8/8 seeded duplicates; kernel shapes accepted; 0 false positives
tools/check-grade-kernel.sh             OK: one definition of min-plus (ResourceAlgebra/Loss.idr) and one of max-plus (ResourceAlgebra/MaxPlus.idr); no Nat min/max outside base
tools/check-kernel-proofs.sh            OK: kernel proofs — build, 4 rejection(s), table, and 3 negative control row(s)
node tests/proof/regression.mjs --strict  172 passed, 0 failed, 0 skipped

Mutation check: hand-corrupting one row of ops.tsv fails the gate three ways (explorer drift, Agda refusal, Idris2 refusal) and exits 1.

Decisions for the owner:

  1. MinMax (bottleneck) has no kernel instance. Should one be added upstream?
  2. This PR adopts the open question's checker-matches-explorer option.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t


Generated by Claude Code

src/abi/TypedWasm/ABI/ResourceAlgebra.idr transcribes
hyperpolymath/resource-algebra Core.agda @ cf9235c: the ResourceAlgebra
interface (alternatives an idempotent commutative monoid, sequence a
monoid), the induced order and its lemmas, and IsOrdered / IsDioid /
IsAnnihilating as separate interfaces, as in Agda, with "every dioid is
ordered" as dioidMonoL/R and the named implementation dioidOrdered.

ResourceAlgebra/{Loss,MaxPlus,HWM}.idr transcribe Instances/*.agda clause
for clause (constructors renamed fin/inf -> Finite/Infinity, val/bot ->
Val/Bot, hwm -> MkHWM; clause order kept, so both sides reduce alike).
Separation.idr carries the S-1..S-3 witnesses.  ResourceAlgebra/Nat.idr
holds only the Nat lemmas Idris2's base lacks: base's Data.Nat.minimum /
maximum / LTE are the Agda Prelude's min / max / ≤ clause for clause, so
they are used rather than declared again.

scripts/fetch-siblings.sh fetches resource-algebra at the pin into
_build/dependencies (the residual-evidence-types pattern).

All laws re-proved under %default total with no believe_me /
assert_total; the package builds clean under Idris2 0.8.0 (30 modules).
Correspondence to the Agda source: ASSUMED (transcription).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t
Tropical.TropCost is now the kernel's Loss carrier (TropCost = LossGrade;
tropAdd = lossAlt, tropMul = lossSeq).  The twelve semiring axioms and the
dioid-order layer are derived from the kernel's instance proofs instead of
re-proved over a private copy; the local tropMin and natMax are deleted
(base's minimum / maximum serve the bottleneck layer).  Every public name
and direction is kept, so Epistemic.idr and Proofs.idr compile unchanged.

The header no longer says max-plus tracks the bottleneck: TropCost is
min-plus and tropMax is min-max (choice min, sequence max, +inf
absorbing), which is neither min-plus nor max-plus.  tropMax stays local
because the kernel has no MinMax instance.

Echo.idr names its loss grade from the same kernel instance (EchoGrade,
echoKeep = oneG, echoCollapse = zeroG) and defines no grade operation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t
tools/check-grade-kernel.sh is the grep gate for "one definition of
min-plus and one of max-plus": no tracked .idr file may define a Nat
min/max (base's are the one definition), no file outside the kernel may
define a grade operation (op (C x) (C y) = C (min/max/+ ...)), and the
kernel must hold exactly the two in Loss.idr and the two in MaxPlus.idr.
--self-test is its negative control (8 seeded duplicates caught, kernel
shapes and near-misses not).  Run against main's Tropical.idr it fails on
tropMin / natMax / tropAdd / tropMul, as it should.  tools/grade-kernel.allow
lists the one exception, Tropical.tropMax (MinMax bottleneck), with why it
is neither algebra.

tools/check-kernel-proofs.sh runs, failing (never skipping) without
idris2 0.8.0 and agda:
  - resource-algebra's own check at the pin (Agda --safe --without-K
    --no-libraries --double-check, 3 rejects);
  - a clean idris2 --build of the ABI, exit 0 AND no Error line;
  - tests/reject/*.idr: each refused at its invalid declaration with its
    EXPECT message, not for a scope/parse/path reason;
  - tests/transcription: the port, evaluated by Explore.idr, reproduces
    ops.tsv (172 rows); Agda accepts every row by refl against the PINNED
    instances and Idris2 by Refl against the port (244 equalities each);
    every row of wrong-rows.tsv is refused by both.

Both run in contract-gate.yml (new jobs grade-kernel and kernel-proofs):
actions.lock is keyed by workflow path, so a new workflow file would be
rejected at startup; this one already holds the only action used.
Idris2 0.8.0 is built from its tag (no binaries are published).

tests/proof/regression.mjs pins 31 kernel names.

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

LEVEL-STATUS row 11 and the proof inventory say what the code now does
(TropCost = LossGrade; tropMin / natMax deleted); a new inventory row and
a "Grade kernel (PWL-01)" section give the kernel's statuses with their
artefacts: laws PROVEN in Idris2; correspondence to the Agda source
ASSUMED, TESTED on the 172-row table; separation TESTED.  It records the
correction that Tropical.idr was never max-plus.  No level changes status.

CONTRACT.adoc: the grade gates under Enforcement, and why
contract.abi.sha256 does not change (the I3 anchors cover section.rs's
wire format, not src/abi).  spec: the L11 sentence no longer claims
max-plus for throughput.  Also replaces one stray NBSP in LEVEL-STATUS.

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

coderabbitai Bot commented Oct 14, 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 56 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
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: cbe63408-f0ec-4975-837c-d02b03e8c9cd
📥 Commits

Reviewing files that changed from the base of the PR and between 145d84b and 6d39c32.

⛔ Files ignored due to path filters: 2
  • tests/transcription/ops.tsv is excluded by !**/*.tsv
  • tests/transcription/wrong-rows.tsv is excluded by !**/*.tsv
📒 Files selected for processing: 27
  • .github/workflows/contract-gate.yml
  • CHANGELOG.adoc
  • CONTRACT.adoc
  • LEVEL-STATUS.adoc
  • scripts/fetch-siblings.sh
  • spec/type-safety-levels-for-wasm.adoc
  • src/abi/TypedWasm/ABI/Echo.idr
  • src/abi/TypedWasm/ABI/ResourceAlgebra.idr
  • src/abi/TypedWasm/ABI/ResourceAlgebra/HWM.idr
  • src/abi/TypedWasm/ABI/ResourceAlgebra/Loss.idr
  • src/abi/TypedWasm/ABI/ResourceAlgebra/MaxPlus.idr
  • src/abi/TypedWasm/ABI/ResourceAlgebra/Nat.idr
  • src/abi/TypedWasm/ABI/ResourceAlgebra/Separation.idr
  • src/abi/TypedWasm/ABI/Tropical.idr
  • src/abi/typed-wasm.ipkg
  • tests/proof/regression.mjs
  • tests/reject/DriftExceedsPeak.idr
  • tests/reject/HWMAnnihilates.idr
  • tests/reject/LossWorstCase.idr
  • tests/reject/README.adoc
  • tests/reject/TropicalIsNotMaxPlus.idr
  • tests/transcription/Explore.idr
  • tests/transcription/README.adoc
  • tests/transcription/gen.sh
  • tools/check-grade-kernel.sh
  • tools/check-kernel-proofs.sh
  • tools/grade-kernel.allow
  • 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

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath marked this pull request as ready for review October 14, 2026 01:04
@hyperpolymath
hyperpolymath added this pull request to stack #272 October 14, 2026 01:05
@hyperpolymath
hyperpolymath merged commit 9403258 into main Oct 14, 2026
40 of 42 checks passed
@hyperpolymath
hyperpolymath deleted the claude/new-session-ywdrth branch October 14, 2026 01:05
hyperpolymath pushed a commit that referenced this pull request Oct 14, 2026
…uash merges)

#270 and #271 were squash-merged into main, so their commits on this
branch are not ancestors of main.  Merging main back in (rather than
force-pushing a rebased branch) keeps the branch's published history; the
trees agree except for the SPDX header commit, which is not yet on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t
hyperpolymath added a commit that referenced this pull request Oct 14, 2026
…-2 at a boundary (PWL-01, PR B) (#273)

## Summary

PWL-01 steps 2–3, on top of the kernel from #271
(merged). L11 and L12 obligations are restated against the grade kernel,
and L13 gets the occupancy reading: occupancy-types' reclamation law
(R-2), ported and re-proved, then bound to `private_memory` and
`boundary`. **No row moves to achieved**; L11/L12 stay draft.

One correction carried from PR A: the issue asks for
"`Level11BottleneckProof` as MaxPlus", but the bottleneck is MinMax, not
MaxPlus. Restating it as MaxPlus would change its meaning at an
unreachable (+∞) edge. So the bottleneck stays as it is, and MaxPlus
goes where max-plus is the right algebra: a worst case over branches.

Pins: resource-algebra `cf9235c`, occupancy-types
`af957280075699c659de0abd9a3b0defade77309` (both in
`scripts/fetch-siblings.sh`).

## Changes

- **L11** (`Tropical.idr`):
- `CostBounded c n` is proved to *be* the Loss order `Finite n ≼ c`
(`costBoundedIsLossOrder` / `lossOrderIsCostBounded`).
  - Path bounds compose by the kernel's `otimesMono` (`costBoundedSeq`).
- New `Level11WorstCaseProof` grades a branching `AccessPlan` in
MaxPlus, with `worstCaseThen` / `worstCaseOneOf` from `otimesMono` /
`oplusMono` and `worstCaseFinite` / `worstCaseWithin`. The obligation is
**DESIGNED**: no surface syntax or attestation uses it.
- **L12** (`Epistemic.idr`, additive): `stalenessGrade` is the reader's
lag as a Loss grade.
- Fresh = 𝟙 (`freshHasNoStaleness`), stale ≠ 𝟙 (`staleHasStaleness`),
never synced = 𝟘 (`neverSyncedIsCollapse`).
  - 𝟙 is the top (`freshIsTop`), and relayed lag = ⊗ (`stalenessRelay`).
  - `syncGrade` gets a note: it holds a version, not a loss.
- **L13** (new `Occupancy.idr`): occupancy-types R-1..R-5 ported and
re-proved over the kernel's HWM (`cutFactor`, `reclaimLaw`,
`occupancyAtCut`, `occupancyLeCost`, `noReclaim`, `reclaimed`,
`witness*`).
- Binding, **DESIGNED**: `OccupancyGradedMemory` (an HWM grade per
private memory, within its declared maximum) and `BoundaryCut` /
`boundaryFrees` = peak − drift / `boundaryOccupancy` /
`fitsAcrossBoundary` (the budget rule across a boundary).
  - `striated` occupancy stays OPEN: it's a surface-only construct.
- **Kernel additions**, typed-wasm's own and labelled (no operation
changes, so the transcription table is unchanged): each instance's order
read in ℕ (`lossLeOfLTE`, `maxPlusLeOfLTE` + inverses); `maxLub` and
min/max-vs-`LTE` lemmas in `ResourceAlgebra/Nat.idr`.
- **Rejects**: `CostIsOccupancy`, `DriftIsPeak` (occupancy-types R-6),
`WorstCaseIsCheapest`. `tools/check-kernel-proofs.sh` also runs
occupancy-types' own Agda check at its pin, against our resource-algebra
pin.
- `LEVEL-STATUS` rows 11–13 name the kernel artefacts; new inventory
row; `CHANGELOG`; 18 names pinned in `regression.mjs`.
- **CI repair, own commit** (`e080ef6`): `Cargo.lock` listed
`wasmparser` twice. Three concurrent Dependabot bumps (#231–#233) caused
it, and it was invisible while E2E was `startup_failure`. Once #270
landed, **E2E Validation / cargo-verify went red on `main`** with
`package wasmparser is specified twice in the lockfile`. The lock was
rewritten by cargo itself: one edge 0.255.0 → 0.256.0, the stale and
duplicate entries removed, nothing upgraded. `cargo build --workspace
--locked` and `cargo test --workspace --locked` pass.

Branch note: this is the designated branch after #271's squash merge.
`main` was merged back in (`bb2380b`) instead of force-pushing; the tree
equals a clean rebase on `main`.

## Status rows (artefact for each)

| Row | Claim | Status | Artefact |
|---|---|---|---|
| 11 | bound = Loss order; bounds compose | PROVEN |
`costBoundedIsLossOrder`, `costBoundedSeq` |
| 11 | worst-case obligation (MaxPlus) | PROVEN lemmas, obligation
DESIGNED | `Level11WorstCaseProof`, `worstCaseThen/OneOf`;
`tests/reject/WorstCaseIsCheapest.idr` |
| 12 | staleness as Loss | PROVEN | `freshHasNoStaleness`,
`staleHasStaleness`, `stalenessRelay` |
| 13 | R-1..R-5 (occupancy-types `Reclaim`/`Timeline`/`Witness`) |
PROVEN in Idris2; correspondence ASSUMED (port-and-reprove) |
`Occupancy.idr`; upstream check at `af95728` in the gate |
| 13 | R-6 | TESTED | `tests/reject/{CostIsOccupancy,DriftIsPeak}.idr` |
| 13 | binding to `private_memory` / `boundary` | DESIGNED |
`OccupancyGradedMemory`, `BoundaryCut` |
| 13 | `striated` occupancy | OPEN | none |

## RSR Quality Checklist

### Required

- [x] Tests pass (see Testing)
- [x] Code is formatted
- [x] Linter is clean (no new warnings)
- [x] No banned language patterns
- [x] No `unsafe` blocks without `// SAFETY:` comments
- [x] No banned functions (gate checks zero `believe_me` /
`assert_total` in the kernel)
- [x] SPDX license headers present on all new/modified source files
(incl. `CHANGELOG.adoc`, which had none)
- [x] No secrets, credentials, or `.env` files included

### As Applicable

- [ ] `.machine_readable/descriptiles/STATE.a2ml` not updated (stale
since 2026-05-27; hand-written figures; owner's call)
- [x] Documentation updated
- [x] `CHANGELOG` updated
- [x] ABI changes validated: `contract.abi.sha256` unchanged (I3 anchors
are the wire format only)

## Testing

```
tools/check-contract.sh                  OK: contract gate — I1 + I3 hold
tools/check-grade-kernel.sh              OK: one definition of min-plus (ResourceAlgebra/Loss.idr) and one of max-plus (ResourceAlgebra/MaxPlus.idr); no Nat min/max outside base
tools/check-kernel-proofs.sh             OK: kernel proofs — build, 7 rejection(s), table, and 3 negative control row(s)
  PASS: upstream: PASS: core proofs and all 3 expected rejections
  PASS: upstream occupancy-types: PASS: core proofs and all 2 expected rejections
  PASS: idris2 --build typed-wasm.ipkg: 31 module(s) built, 0 errors
node tests/proof/regression.mjs --strict  190 passed, 0 failed, 0 skipped
E2E_BUILD=0 bash tests/e2e.sh            47 passed, 0 failed, 7 skipped
cargo build/test --workspace --locked    ok (all test binaries)
```

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

https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
hyperpolymath added a commit that referenced this pull request Oct 14, 2026
## Summary

This answers decision 1 from #271 ("MinMax has
no kernel instance. Should one be added upstream?"). The owner said add
it, and it is now upstream as hyperpolymath/resource-algebra#4, merged
at `0b338c9`. This PR transcribes it into the Idris2 grade kernel.
`Tropical.tropMax` becomes the kernel's MinMax sequence, which empties
the grade-kernel allowlist.

**Blocked on hyperpolymath/occupancy-types#11.** The kernel-proofs gate
checks occupancy-types against this repo's resource-algebra pin. At
`0b338c9`, occupancy-types' `Order.agda` clashes with four lemmas the
new Prelude adds (`Multiple definitions of ≤-+ˡ`). occupancy-types#11
fixes it at source. Until it merges, CI's `kernel-proofs` job is
expected to fail on that step alone. After the merge I'll move the
occupancy-types pin here to the merge commit.

## Changes

- **`ResourceAlgebra/MinMax.idr` (new)**, clause-for-clause from
`Instances/MinMax.agda`:
- `minMaxSeq` (Agda `_⊔g_`) on Loss's carrier, with Loss's alternatives
(`lossAlt`).
  - Monoid, dioid and annihilation laws.
- The instance and its layers are **named implementations** (`[minMax]`,
`[minMaxDioid]`, `[minMaxOrdered]`, `[minMaxAnnihilating]`). Idris2
resolves an interface by its carrier, and `ResourceAlgebra LossGrade` is
already Loss. Upstream shares the carrier on purpose (its lax morphism
`loss-bottleneck` is the identity).
- **`Tropical.idr`:** `tropMax = minMaxSeq`. Its existing proofs
(`tropMaxComm`, `tropMaxUpperL/R`, `hubCeiling`,
`Level11BottleneckProof`) go through unchanged.
- **Grade-kernel gate:**
  - `tools/grade-kernel.allow` is now empty.
- `check-grade-kernel.sh` expects exactly one min-max definition, in
`MinMax.idr`, and requires the file to exist.
- Negative control: restoring the old local `tropMax` fails the gate
(R2).
- **`Nat.idr`:** `minOfLTE`, `maxDistribLMin` and `maxDistribRMin`
(upstream `min-≤`, `max-distribˡ-min`, `max-distribʳ-min`).
- **`Separation.idr`:** S-4 `bottleneckIsNotSum`.
- **New reject `tests/reject/MinMaxIsLoss.idr`**, mirroring upstream's.
It is refused with `Can't solve constraint between: plus m n and maximum
m n`.
- **Transcription table:**
- the MinMax sequence is tabled on the Loss domain: 197 rows (was 172)
and 269 equalities, accepted by Agda against the pin and by Idris2
against the port;
  - the alternatives are Loss's own and already tabled;
  - a fourth wrong row (bottleneck read as a sum) is refused by both.
- **resource-algebra pin `cf9235c` → `0b338c9`:**
- Core, Loss, MaxPlus and HWM are byte-identical between the two pins.
Their headers cite the new pin and say so.
- The upstream check now reports `core proofs, unit tests and all 8
expected rejections`.
- **Docs and pins:**
- `LEVEL-STATUS`: kernel inventory row, Tropical row, Grade kernel
section, and a *Resolved 2026-10-14* note;
- `CONTRACT`, `ipkg`, `contract-gate.yml` comments, the reject and
transcription READMEs, and `CHANGELOG`;
  - six new names pinned in `regression.mjs`.

**No status row moves.** L11 stays draft, and `Level11BottleneckProof`'s
laws were already proved; only where its sequence is defined changed.
Upstream's strict and lax morphisms (`Morphism.agda`) are **not** ported
here.

## RSR Quality Checklist

### Required

- [x] Tests pass (see Testing)
- [x] Code is formatted
- [x] Linter is clean: shellcheck clean on the changed scripts; no new
Idris2 build errors
- [x] No banned language patterns
- [x] No `unsafe` blocks without `// SAFETY:` comments
- [x] No banned functions (the gate checks zero `believe_me` /
`assert_total` in the kernel)
- [x] SPDX license headers present on all new/modified source files
- [x] No secrets, credentials, or `.env` files included

### As Applicable

- [x] Documentation updated
- [x] `CHANGELOG` updated
- [x] ABI changes validated: `tools/check-contract.sh` OK;
`contract.abi.sha256` unchanged (its anchors are the wire format)

## Testing

Run locally with occupancy-types at occupancy-types#11's head
(`6013483`):

```
tools/check-kernel-proofs.sh   OK: kernel proofs — build, 11 rejection(s), table, and 4 negative control row(s)
  PASS: upstream: PASS: core proofs, unit tests and all 8 expected rejections
  PASS: upstream occupancy-types: PASS: core proofs and all 2 expected rejections
  PASS: idris2 --build typed-wasm.ipkg: 33 module(s) built, 0 errors
  PASS: rejected MinMaxIsLoss at line 19 (Can.t solve constraint between: plus m n and maximum m n)
  PASS: explorer: the port reproduces ops.tsv (197 rows)
  PASS: Agda (pinned resource-algebra) accepts the table by refl: 269 equalities
  PASS: Idris2 (port) accepts the table by Refl: 269 equalities
  PASS: control: Agda refuses MinMax seq fin 2 fin 3 fin 5
  PASS: control: Idris2 refuses MinMax seq fin 2 fin 3 fin 5
tools/check-grade-kernel.sh    OK: one definition of min-plus (ResourceAlgebra/Loss.idr), one of max-plus (ResourceAlgebra/MaxPlus.idr) and one of min-max (ResourceAlgebra/MinMax.idr); no grade operation outside the kernel, no Nat min/max outside base
tools/check-grade-kernel.sh --self-test   8/8 seeded duplicates caught; 0 false positives
tools/check-contract.sh        OK: contract gate — I1 + I3 hold
node tests/proof/regression.mjs --strict   208 passed, 0 failed, 0 skipped
E2E_BUILD=0 bash tests/e2e.sh  E2E validation PASSED
```

With occupancy-types at its current pin (`af95728`), only one step
fails: `FAIL: upstream occupancy-types check failed at the pin`, caused
by the `Multiple definitions of ≤-+ˡ` clash above.

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

https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t

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

---------

Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.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.

2 participants