Skip to content

LSP: router and honest capabilities (specs/lsp/server.t27) #12217

Closed

Description

@gHashTag

Turn the server skeleton into a router that tells the truth. Today specs/lsp/server.t27 defaults 14 provider flags to true (lines 171-184) and sets prepare_provider = true (line 235) although no handler exists, and specs/lsp/protocol.t27 has 14 METHOD_* constants out of 95. After this issue the server advertises a capability only when the method registry says implemented and a handler is registered. Part of the LSP epic, Refs #12209 (wave 0, foundation). Only .t27: no code in any other language, not even scratch probes or a loader; see skill only-t27.

Reuse the types in specs/lsp/protocol.t27 and specs/lsp/schema.t27; if a second Range or Position exists anywhere under specs/, point it at these (see #10891).

Prior art:

Boundary

  • specs/lsp/server.t27
  • specs/lsp/protocol.t27
  • specs/lsp/schema.t27

User Scenarios

  • Given no provider is registered, when a client sends initialize, then the result advertises 0 providers; the 14 hard-coded true flags are gone.
  • Given a request for a method that is in the registry but has no handler, when the router dispatches it, then the answer is -32601 with the method name, never a crash or a silent empty result.
  • Given a handler registers for textDocument/hover, when the server answers initialize, then hoverProvider is advertised, and removing the registration removes it.
  • Given a handler fails with an internal error, when the router catches it, then the client gets -32603 and the next request is served.

Requirements

  • FR-001: The router MUST dispatch by method name through the registry in specs/lsp/methods.t27, gate each request on the lifecycle state, and answer unknown methods with -32601.
  • FR-002: The capability builder MUST derive every *Provider entry from the registered handlers; a test MUST fail if any entry is true without a handler.
  • FR-003: specs/lsp/protocol.t27 MUST carry a METHOD_* constant for all 95 methods, or read the names from the registry, with 0 duplicates.
  • FR-004: The router MUST map a stale snapshot to -32801, a cancelled request to -32800, and a handler failure to -32603, and MUST keep serving afterwards.
  • FR-005: The router MUST expose register(method, handler) so each feature module is wired by one line in a wire issue; this issue wires only the lifecycle and document-sync handlers.
  • FR-006: Types duplicated between the three files MUST be declared once.

Success Criteria

  • At least 18 tests across the three files pass, run on the lab with t27c test-report (exit 0), including a test that the number of advertised providers equals the number of registered handlers.
  • A grep for = true on a provider flag in specs/lsp/server.t27 finds 0 hard-coded provider flags.
  • git diff --name-only master lists only the 3 files in Boundary (0 files in other languages).

Activity

  1. added
    enhancementNew feature or request
    area/specs.t27 spec files and conformance
    P1Queen takes before unlabelled work (priority.t27 HIGH)
    on Oct 25, 2026
  2. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Spec created for this issue (typecheck OK, tests pass).

  3. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Spec exists and passes typecheck + tests. M9 milestone complete.

  4. gHashTag commented on Nov 18, 2026

    @gHashTag
    CollaboratorAuthor

    Reopened: closed as spec-only. A .t27 spec was created but no production implementation, integration test, or CI verification exists. This issue remains open until the target component implements the specified behavior and evidence is provided.

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

    P1Queen takes before unlabelled work (priority.t27 HIGH)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