NS5 slice: Implement LSP process lifecycle and document sync #29

Closed
opened 2026-06-20 23:28:18 +00:00 by tmk241 · 1 comment
Owner

OBJECTIVE: Spawn existing language servers, initialize, open/change/save documents, and surface missing-server errors clearly.

AUTHORITY: Parent #5 NS5: Syntax and LSP coding intelligence; PRODUCT.md; REQUIREMENTS.md (PRODUCT.md; req: coding/002-003; req: ui/002; req: governance/002).

AGENT AUTHORITY:

  • Delivery authority: local-commit
  • Tracker authority: this issue may be commented and closed when acceptance passes.
  • Handoff state: committed clean, tracker commented/closed.

PARENT: #5 via explicit issue link and parent checklist.

SCOPE: The smallest source/docs/tests needed to make this behavior real and verified.

BOUNDARIES: No auto-installers.

ACCEPTANCE: A fake/fixture LSP server observes initialize/open/change/save and missing server produces a clear diagnostic.

VERIFICATION: Run the cheapest command that proves acceptance. Include regular tests for the intended payoff and adversarial tests for realistic failure, boundary, or regression cases. If no implementation test command exists yet, create/record the canonical command in AGENTS.md as part of the slice.

BLOCKERS: none

GOAL: Implement this vertical slice to the ACCEPTANCE above, keep the repo clean, cite relevant req: anchors in code/tests where applicable, and close only after verification passes.

OBJECTIVE: Spawn existing language servers, initialize, open/change/save documents, and surface missing-server errors clearly. AUTHORITY: Parent #5 `NS5: Syntax and LSP coding intelligence`; PRODUCT.md; REQUIREMENTS.md (PRODUCT.md; req: coding/002-003; req: ui/002; req: governance/002). AGENT AUTHORITY: - Delivery authority: local-commit - Tracker authority: this issue may be commented and closed when acceptance passes. - Handoff state: committed clean, tracker commented/closed. PARENT: #5 via explicit issue link and parent checklist. SCOPE: The smallest source/docs/tests needed to make this behavior real and verified. BOUNDARIES: No auto-installers. ACCEPTANCE: A fake/fixture LSP server observes initialize/open/change/save and missing server produces a clear diagnostic. VERIFICATION: Run the cheapest command that proves acceptance. Include regular tests for the intended payoff and adversarial tests for realistic failure, boundary, or regression cases. If no implementation test command exists yet, create/record the canonical command in AGENTS.md as part of the slice. BLOCKERS: none GOAL: Implement this vertical slice to the ACCEPTANCE above, keep the repo clean, cite relevant `req:` anchors in code/tests where applicable, and close only after verification passes.
tmk241 added this to the v1 milestone 2026-06-20 23:28:18 +00:00
tmk241 added the sliceready-for-agentgoal labels 2026-06-20 23:28:18 +00:00
Author
Owner

Implemented in commit c90160f90d (Add LSP document sync transport).

Verification:

  • zig fmt src/main.zig src/lsp.zig src/tui.zig: pass
  • zig build test: pass
  • zig build: pass
  • zig build run -- --help: pass
  • redgate lint / health: pass

Regular tests: LSP JSON-RPC framing emits initialize, textDocument/didOpen, textDocument/didChange, and textDocument/didSave messages. A real spawned fake server (sh -c cat>observed.lsp) receives the framed transcript on stdin. TUI lsp_sync <cwd> <uri> <language> <server...> sends the current editor buffer and renders lifecycle rows in the shared panel (lsp:sent:*, lsp:status:exit_0).
Adversarial tests: invalid argv, cwd, and document URI/language are rejected; spawn failures become explicit lsp:status:spawn_error_... rows; malformed TUI sync commands do not corrupt the current buffer.

Boundary: explicit process lifecycle + document sync only. No server installer/discovery, diagnostics rendering, hover/signature/jump UX, semantic tokens, background server manager, or multi-language registry added.

Implemented in commit c90160f90d36 (Add LSP document sync transport). Verification: - zig fmt src/main.zig src/lsp.zig src/tui.zig: pass - zig build test: pass - zig build: pass - zig build run -- --help: pass - redgate lint / health: pass Regular tests: LSP JSON-RPC framing emits initialize, textDocument/didOpen, textDocument/didChange, and textDocument/didSave messages. A real spawned fake server (`sh -c cat>observed.lsp`) receives the framed transcript on stdin. TUI `lsp_sync <cwd> <uri> <language> <server...>` sends the current editor buffer and renders lifecycle rows in the shared panel (`lsp:sent:*`, `lsp:status:exit_0`). Adversarial tests: invalid argv, cwd, and document URI/language are rejected; spawn failures become explicit `lsp:status:spawn_error_...` rows; malformed TUI sync commands do not corrupt the current buffer. Boundary: explicit process lifecycle + document sync only. No server installer/discovery, diagnostics rendering, hover/signature/jump UX, semantic tokens, background server manager, or multi-language registry added.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tmk241/mim#29