Skip to content

Close six small review leftovers across TCP tests, law citation, and diagnostics - #810

Merged
jasisz merged 1 commit into
mainfrom
chore/review-leftovers-batch
Aug 8, 2026
Merged

Close six small review leftovers across TCP tests, law citation, and diagnostics#810
jasisz merged 1 commit into
mainfrom
chore/review-leftovers-batch

Conversation

@jasisz

@jasisz jasisz commented Aug 8, 2026

Copy link
Copy Markdown
Owner

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 from cross_file_consumer_proves_via_dep_law with Lib renamed to Type: before, Type'.lean carried no law theorem and Consumer.lean no citation; after, both match the Lib-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 test cross_file_reserved_module_name_dep_law_is_admitted_and_cited is red before the change.

Also:

  • New wasip2 regression wasip2_tcp_close_without_connect_keeps_the_close_helper: a function taking an existing Tcp.Connection that declares only ! [Tcp.close], with no Tcp.connect in the program, must compile with the close helper present. Red when the shared parse_id gate is narrowed to exclude TcpClose.
  • Comment refresh in the generated-Rust backend: the borrow-overlap branch cited value - highNibble(value) * 16, which no longer exists in the standard library. Now cites n * factorial(n - 1), confirmed by instrumenting the branch against examples/core/big_integers.av, examples/formal/recursive_monotone.av, and examples/games/eggcatch/core.av.
  • The Lean token-table guard test retries the probe once when it dies fetching the pinned toolchain. Any other probe failure, and every token-table mismatch, still fails on the first attempt.
  • Documented the stdlib-shadow suppression asymmetry (structured finding honours [[check.suppress]], loader stderr warning does not) in docs/diagnostics-slugs.md and at the warning site.
  • New test asserting the loader's stdlib-shadow warning is printed exactly once per command; without the dedup aver check --deps prints 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-targets and --features wasm,wasip2 clean on touched files.

🤖 Generated with Claude Code

…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>
@jasisz
jasisz merged commit 0ccede2 into main Aug 8, 2026
35 checks passed
@jasisz
jasisz deleted the chore/review-leftovers-batch branch August 8, 2026 12:57
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.

1 participant