Skip to content

fix: align speculative elaboration with its input text - #316

Merged
ejgallego merged 2 commits into
mainfrom
codex/bt050-suggestion-positions
Oct 20, 2026
Merged

ejgallego merged 2 commits into
mainfrom
codex/bt050-suggestion-positions

Conversation

@ejgallego

@ejgallego ejgallego commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

This PR fixes suggestion-producing tactics such as exact? during speculative execution by giving elaboration the same source text and file name as the parser. Each tactic or command handle continuation receives a fresh input context, so Lean interprets suggestion offsets against that probe rather than an empty or unrelated file map.

  • Use the parsed probe command's start position for command elaboration. Lean's internal suggestion ranges remain relative to the speculative input while the real document stays unchanged.
  • Preserve all new command diagnostics after Lean resets its per-command message log. Command handle continuations retain their suggestions and errors, and failed continuations produce no successor handle.
  • Document the source-context and artifact-lifetime invariants beside the implementation, with links to their regression assertions in the testing guide.

Give parsed tactic and command probes their own matching source map and file name on every execution, including handle continuations. Preserve command continuation diagnostics after Lean resets its per-command message log.

Check typed suggestion ranges, UTF-8 boundaries, handle branches and unchanged document state for ASCII and multibyte input.
@ejgallego
ejgallego marked this pull request as ready for review October 20, 2026 14:24
Document probe source ownership, fresh continuation context, isolated state and artifact reset boundaries beside the implementation. Link the suggestion regression assertions from the testing guide.

[skip ci]
@ejgallego
ejgallego merged commit b886455 into main Oct 20, 2026
@ejgallego
ejgallego deleted the codex/bt050-suggestion-positions branch October 20, 2026 15:47
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