Repository navigation
Description
The bridge between the t27 language server and T27 OS. T27 OS already runs a supervised tree of services (specs/t27os/kernel.t27), shows a status bar (specs/t27os/statusbar.t27), opens projects in 27 editors (specs/t27os/editors.t27) and reads host feeds as text lines (specs/t27os/lanes_view.t27). This module is the decisions that make t27c lsp a first-class citizen there: the server is a supervised service with a restart policy, its state and diagnostic counts reach the status bar from one feed line, and every editor in the editor table has a stated route to the server (generated config, extension, or parked with the reason). Part of the LSP epic, Refs #12209 (wave 5, T27 OS integration). Only .t27: no code in any other language, not even scratch probes or a loader; see skill only-t27.
The host stays thin plumbing (spawn the process, write the feed file, draw); every decision is a pure function here with tests, as in lanes_view.t27.
Depends on specs/lsp/status.t27 (server state and counts, #12251), specs/lsp/main.t27 (the command line, #12216) and specs/lsp/editors.t27 (generated editor configs, #12267). Read-only uses of specs/t27os/kernel.t27, specs/t27os/editors.t27, specs/t27os/statusbar.t27 (no edits to them in this issue).
Prior art:
- rust-analyzer's
serverStatusshown in the editor status bar: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html - Erlang/OTP supervisor restart intensity, the model
specs/queen/actors.t27already follows: https://www.erlang.org/doc/design_principles/sup_princ.html - Helix and Neovim read server commands from plain configuration, the same route the editor table takes: https://docs.helix-editor.com/languages.html
Boundary
- specs/t27os/lsp_bridge.t27
User Scenarios
- Given T27 OS starts and the user has
.t27files open, when the kernel decides the services, then the bridge says the LSP service is a permanent child of the SERVICES supervisor, started witht27c lspon stdio, and gives the argument list as data for the host to spawn without a shell. - Given the server exits with a crash, when the bridge is asked, then it restarts it at most 3 times in 5 minutes (the client policy of LSP: VS Code client generated from the client spec (specs/lsp/client.t27) #12266, used not copied), waits the kernel's backoff, and after that it reports
downwith the last stderr line instead of retrying. - Given the host job wrote the feed line
S|ready|3|2|14|88|indexing done, when the status bar asks for its LSP text, then the answer isLSP READY 3E 2W(at most 64 bytes, upper-cased like the other items); with no feed line the item is not present and takes no room; a field the host could not read is shown as-, never as0. - Given the editor table, when the user picks any of the 27 editors, then the bridge answers one of:
config(a generated snippet fromspecs/lsp/editors.t27exists),extension(the VS Code family,specs/lsp/client.t27), orparkedwith a reason word (needs a Kotlin or Rust plugin); no editor has no answer. - Given memory pressure (the kernel sheds lanes at low free memory), when the bridge is asked, then the LSP service is shed after the lanes and before the Queen's services, and resumes when
resume_okholds.
Requirements
- FR-001: The module MUST define the LSP service row (name, restart type permanent, argument list, stdio) using
t27os::kernel::service_decisionand the restart policy from the LSP client, and MUST NOT restate their numbers. - FR-002: The module MUST parse the feed line format
S|<state>|<errors>|<warnings>|<files>|<rss_mb>|<message>andE|<code>|<last stderr line>with total functions: a short, empty or malformed line yields the not-measured value, never a crash. - FR-003:
lsp_textMUST write the status item text into a caller buffer ofSB_SLOT(64) bytes and return its length; zero length means the item is absent. - FR-004:
editor_route(i)MUST be total overEDITOR_COUNTand eachparkedanswer MUST carry a reason id with a word table; a test walks every editor and asserts an answer. - FR-005: The shed order and the resume condition MUST come from the kernel's functions, with a test that the LSP service is shed after the last lane.
- FR-006: No hand-written non-t27 code; the spec is ASCII, English identifiers, no home paths.
Success Criteria
- At least 30 tests in
specs/t27os/lsp_bridge.t27pass, run on the lab witht27c test-report(exit 0), including one test per editor route class, the 27-editor walk, the restart-policy table and a malformed-feed table with at least 8 rows. - A mutated copy (one constant or comparison changed) fails at least 1 test.
git diff --name-only masterlists onlyspecs/t27os/lsp_bridge.t27(0 hand-written files in other languages); the wiring into the status bar and the window is the separate issue that depends on this one.
Activity
gHashTag commentedon Nov 17, 2026
LSP bridge spec created: specs/lsp/lsp_bridge.t27 (typecheck OK, 1 test passes).