audit: add CI sync checks for internalFunctionPrefix and special entrypoints#674
Merged
Conversation
…ypoints
check_selectors.py hardcodes _INTERNAL_FUNCTION_PREFIX ("internal_")
and _SPECIAL_ENTRYPOINTS ({"fallback", "receive"}) used in collision
and filtering checks. These were validated only by code comments
saying "Must match ContractSpec.lean" — no automated enforcement.
Add checks #10 and #11 that regex-extract the canonical Lean
definitions and validate both Python constants match, following
the same pattern as checks #7–9.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
check_internal_prefix_sync(): validates_INTERNAL_FUNCTION_PREFIXin check_selectors.py matchesContractSpec.internalFunctionPrefixin Leancheck_special_entrypoints_sync(): validates_SPECIAL_ENTRYPOINTSmatches the list inContractSpec.isInteropEntrypointNameWhy this matters
If someone adds a new special entrypoint to the Lean code (e.g., for a new interop feature) without updating the Python CI script, the collision check would use stale data — silently missing real Yul namespace collisions. Same for the internal function prefix.
What changed
scripts/check_selectors.pycheck_internal_prefix_sync()andcheck_special_entrypoints_sync()AUDIT.mdTest plan
check_selectors.pypasses locally (includes both new sync checks)🤖 Generated with Claude Code
Note
Low Risk
CI/documentation-only changes that add extra consistency checks; no production compiler logic is modified, with minimal risk aside from potential false negatives if the Lean parsing regex is too strict.
Overview
Strengthens the selector CI suite by adding two new validations in
scripts/check_selectors.pythat fail CI if the Python constants diverge from Lean.The script now checks that
_INTERNAL_FUNCTION_PREFIXmatchesContractSpec.internalFunctionPrefix, and that_SPECIAL_ENTRYPOINTSmatches the list used byContractSpec.isInteropEntrypointName(e.g.,fallback/receive).AUDIT.mdis updated to document these additional CI guarantees.Written by Cursor Bugbot for commit efdf8db. This will update automatically on new commits. Configure here.