Skip to content

fix: reject malformed inductive entries in Kernel.Environment.replay - #16717

Merged
nomeata merged 2 commits into
masterfrom
joachim/issue16698
Nov 24, 2026
Merged

nomeata merged 2 commits into
masterfrom
joachim/issue16698

Conversation

@nomeata

@nomeata nomeata commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

This PR makes Kernel.Environment.replay (and thus leanchecker) reject an inductive type whose all or ctors field names something other than a stored inductive type or constructor, or whose all field does not contain the type itself, with an error instead of a panic. It also rejects stored inductive type metadata (such as numIndices or isRec) that differs from what the kernel generates.

Previously, such entries either panicked via [n]! / inductiveVal!, or made replay skip the stored entry entirely, so a forged inductive could end up accepted by default-mode leanchecker.

Fixes #16698, fixes #16688.

🤖 Generated with Claude Code

This PR makes `Kernel.Environment.replay` (and thus `leanchecker`) reject an inductive type whose `all` or `ctors` field names something other than a stored inductive type or constructor, or whose `all` field does not contain the type itself, with an error instead of a panic. It also rejects stored inductive type metadata (such as `numIndices` or `isRec`) that differs from what the kernel generates.

Previously, such entries either panicked via `[n]!` / `inductiveVal!`, or made `replay` skip the stored entry entirely, so a forged inductive could end up accepted by default-mode `leanchecker`.

Fixes #16698, fixes #16688.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nomeata nomeata added release-ci Enable all CI checks for a PR, like is done for releases changelog-other labels Nov 24, 2026
@nomeata
nomeata enabled auto-merge November 24, 2026 16:16
@nomeata
nomeata added this pull request to the merge queue Nov 24, 2026
Merged via the queue into master with commit e6e2521 Nov 24, 2026
22 checks passed
nomeata added a commit to arthur-adjedj/lean4 that referenced this pull request Nov 24, 2026
Conflict resolutions:
* Lean/Replay.lean: keep leanprover#16717's validated `InductiveVal`s and pass their feature flags to the kernel.
* tests/elab/issue16698.lean: the forged `InductiveVal`s carry the feature flags instead of `isReflexive`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WD3k8hwfVBznY9FEMvR4xw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-other release-ci Enable all CI checks for a PR, like is done for releases

Projects

None yet

1 participant