Skip to content

LSP: T27 OS bridge - supervised service, status bar feed, editor routes (specs/t27os/lsp_bridge.t27) #12271

Closed

Description

@gHashTag

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:

Boundary

  • specs/t27os/lsp_bridge.t27

User Scenarios

  • Given T27 OS starts and the user has .t27 files open, when the kernel decides the services, then the bridge says the LSP service is a permanent child of the SERVICES supervisor, started with t27c lsp on 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 down with 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 is LSP 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 as 0.
  • Given the editor table, when the user picks any of the 27 editors, then the bridge answers one of: config (a generated snippet from specs/lsp/editors.t27 exists), extension (the VS Code family, specs/lsp/client.t27), or parked with 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_ok holds.

Requirements

  • FR-001: The module MUST define the LSP service row (name, restart type permanent, argument list, stdio) using t27os::kernel::service_decision and 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> and E|<code>|<last stderr line> with total functions: a short, empty or malformed line yields the not-measured value, never a crash.
  • FR-003: lsp_text MUST write the status item text into a caller buffer of SB_SLOT (64) bytes and return its length; zero length means the item is absent.
  • FR-004: editor_route(i) MUST be total over EDITOR_COUNT and each parked answer 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.t27 pass, run on the lab with t27c 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 master lists only specs/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

  1. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    LSP bridge spec created: specs/lsp/lsp_bridge.t27 (typecheck OK, 1 test passes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/specs.t27 spec files and conformanceenhancementNew feature or requestspec

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions