Repository navigation
Test: reject declarations naming the kernel's _nested aux types - #105
Merged
Merged
Conversation
Scaled-down regression test for the kernel bug fixed in leanprover/lean4#14616. A declaration that names one of the kernel's _nested auxiliary types must be rejected by a correct kernel (the fix adds a reserved-prefix check in add_inductive, covering both Expr.const names and Expr.proj structure names). This is deliberately NOT a proof of False. The bug's axiom-free False relies on transient in-kernel state (the equiv_manager defeq cache) that is not reconstructed on a fresh replay of an export, so it cannot be captured as an export-based arena test: the same buggy official kernel that accepts the exploit in-memory rejects the exported form. Instead, this mirrors the upstream test tests/elab/kernelNestedAuxName.lean. tests/nested-aux-name.{lean,yaml} export a well-typed inductive KNAux whose constructor field names the ordinary Prop-valued def _nested.KNHost_1. Because KNAux is well-typed, an unguarded kernel accepts it; a guarded kernel rejects it for the reserved _nested prefix. Verified: official (v4.32.1, guard unreleased) accepts the exported KNAux -- reported incorrect, as expected; flips to correct once the fix ships. Uses metaprogramming (skipKernelTC), so a standalone test. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01N8V39PLAKbpoG7ctgCFhbp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scaled-down regression test for the kernel bug fixed in
leanprover/lean4#14616. A declaration that names one of the kernel's
_nested auxiliary types must be rejected by a correct kernel (the fix
adds a reserved-prefix check in add_inductive, covering both Expr.const
names and Expr.proj structure names).
This is deliberately NOT a proof of False. The bug's axiom-free False
relies on transient in-kernel state (the equiv_manager defeq cache) that
is not reconstructed on a fresh replay of an export, so it cannot be
captured as an export-based arena test: the same buggy official kernel
that accepts the exploit in-memory rejects the exported form. Instead,
this mirrors the upstream test tests/elab/kernelNestedAuxName.lean.
tests/nested-aux-name.{lean,yaml} export a well-typed inductive KNAux
whose constructor field names the ordinary Prop-valued def
_nested.KNHost_1. Because KNAux is well-typed, an unguarded kernel
accepts it; a guarded kernel rejects it for the reserved _nested prefix.
Verified: official (v4.32.1, guard unreleased) accepts the exported
KNAux -- reported incorrect, as expected; flips to correct once the fix
ships. Uses metaprogramming (skipKernelTC), so a standalone test.
Co-Authored-By: Claude Fable 5 [email protected]
Claude-Session: https://claude.ai/code/session_01N8V39PLAKbpoG7ctgCFhbp