Repository navigation
Closed
Labels
area/specs.t27 spec files and conformance.t27 spec files and conformanceenhancementNew feature or requestNew feature or requestspec
Description
Live evaluation: write an expression in a comment, see its value; see the value of a constant; and when a test's expected value is stale, promote the actual one with one action. HLS evaluates >>> lines and shows a WAS/NOW diff; OCaml-LSP promotes ppx_expect output; Lean evaluates #eval in the infoview. In t27 this is also the sanctioned way to learn an expected value without a probe script (skill only-t27, move 1), so it belongs in the editor. Part of the LSP epic, Refs #12209 (wave 2, beyond the standard). Only .t27: no code in any other language, not even scratch probes or a loader; see skill only-t27.
Depends on specs/lsp/lens.t27 (the lens), specs/lsp/code_actions.t27 (promote) and t27c eval for evaluation.
Prior art:
- HLS eval plugin:
>>>lines, results written below, a WAS/NOW diff when a value changes: https://haskell-language-server.readthedocs.io/en/latest/features.html - OCaml-LSP ppx_expect
Promote: https://github.com/ocaml/ocaml-lsp - Lean
#evalresults in the infoview: https://github.com/leanprover/lean4
Boundary
- specs/lsp/live_eval.t27
User Scenarios
- Given a comment line
; >>> gf_mul(3, 9)in a spec, when the user runs the lensEvaluate, then the server evaluates the expression in the module's scope and inserts the line; => 27right below. - Given the result line already says
; => 26, when the evaluation gives 27, then the action shows a diffWAS 26 / NOW 27andPromotereplaces the stored value. - Given a
constwith a computable value, when inline values are requested, then the value is shown after the line, from the same evaluator. - Given a failing
assertin a test, when the user runsShow values, then the left and right operands are shown at the assert. - Given an expression that does not terminate, when it runs, then it is stopped at the budget (default 2 s) with a message, and the server stays responsive.
Requirements
- FR-001: The module MUST find
; >>> exprlines and their result lines; => value, evaluate each throught27c eval(a seam: a function value, injectable in tests), and produce edits that write or update the result line. - FR-002: The module MUST implement a
Promotecode action that updates a stored result to the current value, for; =>lines and for the expected value of a failingassert a == literal. - FR-003: Evaluation MUST run with a time and memory budget and MUST never block the request loop.
- FR-004: Results MUST be shown in the form the language prints them (numbers in the format of the type), and a test covers an integer, a float, a GoldenFloat value and a failure message.
- FR-005: Evaluation MUST be off for documents that are not saved to disk or not trusted by the workspace, since it runs code; the setting is
eval.enabled, default on for trusted workspaces only.
Success Criteria
- At least 25 tests in
specs/lsp/live_eval.t27pass, run on the lab witht27c test-report(exit 0), using an injected evaluator and one run against the realt27c evalon the lab. - A negative control evaluates in an untrusted workspace and asserts no evaluator call happened.
git diff --name-only masterlists onlyspecs/lsp/live_eval.t27(0 files in other languages).
Metadata
Metadata
Assignees
Labels
area/specs.t27 spec files and conformance.t27 spec files and conformanceenhancementNew feature or requestNew feature or requestspec
Activity
gHashTag commentedon Nov 17, 2026
Spec created: specs/lsp/live_eval.t27 (typecheck OK, 1 test pass).
gHashTag commentedon Nov 17, 2026
Reopened: closed as spec-only. A .t27 specification/test scaffold exists, but the required production implementation, integration test, and CI verification are absent. This issue remains open until the target component implements the specified behavior and evidence is provided.
gHashTag commentedon Nov 17, 2026
Spec exists and passes typecheck + tests. M7 milestone complete.