Close six small review leftovers across TCP tests, law citation, and diagnostics - #810
Merged
Conversation
…diagnostics Admit dependency-module laws when the module name is a reserved Lean token. The admissibility gate reads a dep law's mentions off the emitted statement, where every path segment carries the reserved-token guard (`Type'.qrev`), but the membership index, the simp-orientation program-fn set, and the citation name were all built from the raw module prefix (`Type.qrev`). Nothing matched, so the mention set came back empty and the law silently degraded to not-admitted: no theorem emitted, no citation in the consumer. Canonicalize all three on the emitted spelling via a single helper, reusing the existing per-segment escaper; the raw prefix stays the identity currency of the cone gate and the emit keys. Output for ordinary module names is byte-identical. Also: - Pin the wasip2 graduated-close scenario with a regression test: a function that takes an existing `Tcp.Connection` and declares only `! [Tcp.close]`, with no `Tcp.connect` in the program, must still compile with the close helper present. This depends on the shared `parse_id` helper gating on the union of the pool-consuming effects; a connect-shaped gate makes the program fail to compile. - Refresh the borrow-overlap comment in the generated-Rust backend to cite a shape that still exists in the corpus (`n * factorial(n - 1)`); the old example was removed from the standard library. - Retry the Lean token-table probe once when it dies fetching the pinned toolchain, so a transient network failure does not fail the proof workflow. Any other probe failure, and every token-table mismatch, still fails on the first attempt. - Document that the structured stdlib-shadow finding honours `[[check.suppress]]` while the loader's stderr warning deliberately does not, and note the same at the warning site. - Assert the loader's stdlib-shadow warning is printed exactly once per command across every resolution phase. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Six independent review leftovers, one commit.
Fix — dependency-module laws are never admitted when the module name is a reserved Lean token. The admissibility gate reads a dep law's mentions off the emitted statement, where every path segment carries the reserved-token guard (
Type'.qrev), but the membership index, the simp-orientation program-fn set, and the citation name were all built from the raw module prefix (Type.qrev). Nothing matched, the mention set came back empty, and the law silently degraded to not-admitted — no theorem emitted, no citation in the consumer. Measured on the split probe fromcross_file_consumer_proves_via_dep_lawwithLibrenamed toType: before,Type'.leancarried no law theorem andConsumer.leanno citation; after, both match theLib-named fixture and the consumer keeps its universal credit. Output for ordinary module names is byte-identical (verified by diffing the whole emitted project). New testcross_file_reserved_module_name_dep_law_is_admitted_and_citedis red before the change.Also:
wasip2_tcp_close_without_connect_keeps_the_close_helper: a function taking an existingTcp.Connectionthat declares only! [Tcp.close], with noTcp.connectin the program, must compile with the close helper present. Red when the sharedparse_idgate is narrowed to excludeTcpClose.value - highNibble(value) * 16, which no longer exists in the standard library. Now citesn * factorial(n - 1), confirmed by instrumenting the branch againstexamples/core/big_integers.av,examples/formal/recursive_monotone.av, andexamples/games/eggcatch/core.av.[[check.suppress]], loader stderr warning does not) indocs/diagnostics-slugs.mdand at the warning site.aver check --depsprints it four times.Tests:
proof_spec(232),wasip2_codegen_regression --features wasip2(7),stdlib_spec(4),--lib(976),rust_codegen_regression,eval_spec,compile_spec— all green.cargo fmt;cargo clippy --all-targetsand--features wasm,wasip2clean on touched files.🤖 Generated with Claude Code