ik session: the persistent evaluation protocol (ADR 0009 phase 6) - #93
Merged
Conversation
Phase 6 of ADR 0009: the session protocol is done; the debug adapter stays proposed, deliberately not built, in the sense of ADR 0008. ik session is a persistent evaluation session over the same framed JSON-RPC transport as ik lsp -- the framing layer moves to a shared Jsonrpc module instead of a second copy. eval returns what the human REPL never separated: the value (with an inert flag), everything the program printed (captured so it travels in the response instead of corrupting the channel), or a structured error with message, rendered diagnostic, and check-shaped spans. Definitions persist across evals; reset re-bootstraps; the capability profile is honored. The interrupt story is the client's timeout killing the process -- honest, and sufficient until the trampoline learns cancellation. Known leak: raw standard-output ports bypass the Console capture. The extension gains Eval Selection in Session (persistent state, results and captured output in the output channel) and Restart Session; changing the profile restarts both servers so displayed authority stays actual authority. The adapter remains unbuilt because the protocol was never its hard part: stepping needs cancellation and suspension points in the CPS trampoline, breakpoints need the CLocated span map wired to those points, and the coverage view phase 5 deferred wants the same instrumentation. One design, to be taken whole.
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.
What
Phase 6 of ADR 0009, closing the ADR's plan: the session protocol is built; the debug adapter is recorded as proposed, deliberately not built yet (ADR 0008 sense), with what it actually needs named.
ik sessionA persistent evaluation session over the same Content-Length framed JSON-RPC as
ik lsp— the framing/dispatch layer moves into a sharedJsonrpcmodule rather than existing twice. Requests:initialize→ name, version, and the honored capability profileeval {code}→ the phase-6 point, results and errors finally separated:showVal) with aninertflag,output— everything the program printed, captured so it travels in the response instead of corrupting the framed channel,error: message, rendered caret diagnostic, and spans in the same 1-based shape asik check --jsonreset→ fresh bootstrap; definitions otherwise persist across evalsThe interrupt story is explicitly the client's: a hung evaluation cannot be cancelled, so the request timeout kills the process and the next eval starts a fresh session. One known leak is recorded: raw standard-output ports write past the
Consolecapture.Extension
ik sessionprocess; results, captured output, and rendered errors land in the output channel. State survives between evals.ironkernel.session.timeoutMs(default 10s) with kill-and-restart on hang; changing the capability profile restarts both the language server and the session so displayed authority stays actual authority.session.ts) with an incremental frame decoder tested in vitest, including split-chunk and garbage-resync cases.Why the debug adapter stays proposed
The protocol was never its hard part. Stepping requires cancellation and suspension points in the CPS trampoline; breakpoints need the
CLocatedspan map wired to those suspension points; and the compiled-coverage view phase 5 deferred wants the same runtime instrumentation. Those are one design and should be taken whole — the ADR says so where the next reader will look.Verification
--no-incrementalrebuild: zero warnings. Full suite: 451/451 (4 new session tests: persistence + multi-form eval + structured error spans + reset; output capture with inert flag; the minimal profile refusingprint; method-not-found).print/showevaluator bug already filed as a separate task — the structured channel surfaces it clearly.)tsc --noEmitclean, vitest 26/26 (3 new framing tests),vsce packageproduces the VSIX.faulted (process aborted): 0.Jsonrpcextraction moves the LSP's private helpers verbatim.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.