feat(lsp): implement functional LSP runtime #1044

Merged
hamza.khyari merged 1 commit from feature/lsp-functional-runtime into master 2026-03-24 13:17:44 +00:00
Member

Summary

Implement the functional LSP runtime, replacing local-mode stubs with real LSP protocol support.

New files

  • lsp/transport.pyStdioTransport for subprocess JSON-RPC over stdin/stdout
  • lsp/client.pyLspClient implementing LSP protocol (initialize/shutdown/diagnostics/completions)
  • lsp/lifecycle.pyLspLifecycleManager with reference-counted instances, health checks, crash restart
  • lsp/discovery.pyLanguageDiscovery with 4-layer detection (extension, shebang, UKO, project config)
  • features/lsp_functional_runtime.feature — 27 Behave BDD scenarios
  • robot/lsp_functional_runtime.robot — 6 Robot integration tests

Modified files

  • lsp/runtime.py — Replaced stubs with real LSP calls via lifecycle manager
  • lsp/tool_adapter.py — Runtime-delegating handlers with local-mode fallback
  • lsp/__init__.py — Updated exports
  • features/consolidated_misc.feature — Updated runtime test assertions
  • features/steps/lsp_registry_steps.py — Updated error handling for new runtime

Quality Gates

Session Result
nox -s lint PASS
nox -s typecheck PASS (0 errors)
nox -s unit_tests -- features/lsp_functional_runtime.feature PASS (27 scenarios)
nox -s unit_tests -- features/consolidated_misc.feature PASS (250 scenarios)
nox -s unit_tests -- features/lsp_cli_new_coverage.feature PASS (20 scenarios)

Closes #826

## Summary Implement the functional LSP runtime, replacing local-mode stubs with real LSP protocol support. ### New files - `lsp/transport.py` — `StdioTransport` for subprocess JSON-RPC over stdin/stdout - `lsp/client.py` — `LspClient` implementing LSP protocol (initialize/shutdown/diagnostics/completions) - `lsp/lifecycle.py` — `LspLifecycleManager` with reference-counted instances, health checks, crash restart - `lsp/discovery.py` — `LanguageDiscovery` with 4-layer detection (extension, shebang, UKO, project config) - `features/lsp_functional_runtime.feature` — 27 Behave BDD scenarios - `robot/lsp_functional_runtime.robot` — 6 Robot integration tests ### Modified files - `lsp/runtime.py` — Replaced stubs with real LSP calls via lifecycle manager - `lsp/tool_adapter.py` — Runtime-delegating handlers with local-mode fallback - `lsp/__init__.py` — Updated exports - `features/consolidated_misc.feature` — Updated runtime test assertions - `features/steps/lsp_registry_steps.py` — Updated error handling for new runtime ### Quality Gates | Session | Result | |---|---| | `nox -s lint` | PASS | | `nox -s typecheck` | PASS (0 errors) | | `nox -s unit_tests -- features/lsp_functional_runtime.feature` | PASS (27 scenarios) | | `nox -s unit_tests -- features/consolidated_misc.feature` | PASS (250 scenarios) | | `nox -s unit_tests -- features/lsp_cli_new_coverage.feature` | PASS (20 scenarios) | Closes #826
hamza.khyari added this to the v3.6.0 milestone 2026-03-18 11:44:03 +00:00
freemo approved these changes 2026-03-19 04:55:39 +00:00
Dismissed
freemo left a comment

Code Review — PR #1044 feat(lsp): implement functional LSP runtime

The largest of the three hamza.khyari PRs at +2,336 lines, but the architecture justifies the scope. Clean separation: StdioTransport (process I/O) → LspClient (protocol) → LspLifecycleManager (reference counting + health) → LspRuntime (orchestration). The LanguageDiscovery module with 4-layer detection (extension map, shebang, UKO, project config) and 70+ language mappings is thorough.

27 Behave BDD scenarios + 6 Robot integration tests provide strong coverage. The replacement of LspNotAvailableError stubs with real LSP calls is a significant capability upgrade.

Approved. No issues found.

## Code Review — PR #1044 `feat(lsp): implement functional LSP runtime` The largest of the three hamza.khyari PRs at +2,336 lines, but the architecture justifies the scope. Clean separation: `StdioTransport` (process I/O) → `LspClient` (protocol) → `LspLifecycleManager` (reference counting + health) → `LspRuntime` (orchestration). The `LanguageDiscovery` module with 4-layer detection (extension map, shebang, UKO, project config) and 70+ language mappings is thorough. 27 Behave BDD scenarios + 6 Robot integration tests provide strong coverage. The replacement of `LspNotAvailableError` stubs with real LSP calls is a significant capability upgrade. **Approved.** No issues found.
Owner

Day 43 Review — Rebase Required

This PR has merge conflicts with master and cannot be merged in its current state. This is one of 9 Hamza PRs in the resource/LSP domain (v3.5.0-v3.6.0) that all have conflicts. These PRs likely share a common dependency chain and should be rebased sequentially.

@hamza.khyari: Please rebase onto current master. If multiple PRs depend on each other, start with the base PR in the chain and work upward.

Rebase priority: HIGH — these PRs represent significant feature work that is blocked by merge conflicts. Every day they remain conflicted is a day they cannot be reviewed or merged.

**Day 43 Review — Rebase Required** This PR has merge conflicts with `master` and cannot be merged in its current state. This is one of 9 Hamza PRs in the resource/LSP domain (v3.5.0-v3.6.0) that all have conflicts. These PRs likely share a common dependency chain and should be rebased sequentially. @hamza.khyari: Please rebase onto current `master`. If multiple PRs depend on each other, start with the base PR in the chain and work upward. **Rebase priority**: HIGH — these PRs represent significant feature work that is blocked by merge conflicts. Every day they remain conflicted is a day they cannot be reviewed or merged.
hamza.khyari force-pushed feature/lsp-functional-runtime from 8b19d4a737
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 16s
CI / lint (pull_request) Successful in 23s
CI / quality (pull_request) Successful in 28s
CI / typecheck (pull_request) Successful in 45s
CI / security (pull_request) Successful in 1m2s
CI / unit_tests (pull_request) Successful in 2m59s
CI / e2e_tests (pull_request) Successful in 4m21s
CI / docker (pull_request) Successful in 56s
CI / integration_tests (pull_request) Failing after 5m41s
CI / coverage (pull_request) Failing after 7m6s
CI / benchmark-regression (pull_request) Successful in 38m22s
to 773815cf97
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 17s
CI / lint (pull_request) Successful in 3m19s
CI / quality (pull_request) Successful in 3m39s
CI / typecheck (pull_request) Successful in 3m54s
CI / security (pull_request) Successful in 4m0s
CI / integration_tests (pull_request) Failing after 5m32s
CI / unit_tests (pull_request) Successful in 5m39s
CI / docker (pull_request) Successful in 1m2s
CI / e2e_tests (pull_request) Successful in 7m48s
CI / coverage (pull_request) Successful in 11m2s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Has been cancelled
2026-03-24 12:26:56 +00:00
Compare
hamza.khyari dismissed freemo's review 2026-03-24 12:26:56 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

hamza.khyari force-pushed feature/lsp-functional-runtime from 773815cf97
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 17s
CI / lint (pull_request) Successful in 3m19s
CI / quality (pull_request) Successful in 3m39s
CI / typecheck (pull_request) Successful in 3m54s
CI / security (pull_request) Successful in 4m0s
CI / integration_tests (pull_request) Failing after 5m32s
CI / unit_tests (pull_request) Successful in 5m39s
CI / docker (pull_request) Successful in 1m2s
CI / e2e_tests (pull_request) Successful in 7m48s
CI / coverage (pull_request) Successful in 11m2s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Has been cancelled
to f185c74ea5
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 18s
CI / quality (pull_request) Successful in 32s
CI / integration_tests (pull_request) Failing after 2m40s
CI / lint (pull_request) Successful in 3m19s
CI / typecheck (pull_request) Successful in 3m49s
CI / security (pull_request) Successful in 4m0s
CI / unit_tests (pull_request) Has been cancelled
CI / coverage (pull_request) Has been cancelled
CI / e2e_tests (pull_request) Has been cancelled
CI / benchmark-regression (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
CI / status-check (pull_request) Has been cancelled
2026-03-24 12:53:57 +00:00
Compare
hamza.khyari force-pushed feature/lsp-functional-runtime from f185c74ea5
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 18s
CI / quality (pull_request) Successful in 32s
CI / integration_tests (pull_request) Failing after 2m40s
CI / lint (pull_request) Successful in 3m19s
CI / typecheck (pull_request) Successful in 3m49s
CI / security (pull_request) Successful in 4m0s
CI / unit_tests (pull_request) Has been cancelled
CI / coverage (pull_request) Has been cancelled
CI / e2e_tests (pull_request) Has been cancelled
CI / benchmark-regression (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
CI / status-check (pull_request) Has been cancelled
to 4ff075e0da
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 18s
CI / quality (pull_request) Successful in 32s
CI / typecheck (pull_request) Successful in 56s
CI / security (pull_request) Successful in 57s
CI / lint (pull_request) Successful in 3m19s
CI / integration_tests (pull_request) Successful in 3m44s
CI / unit_tests (pull_request) Successful in 6m39s
CI / docker (pull_request) Successful in 1m9s
CI / e2e_tests (pull_request) Successful in 9m38s
CI / coverage (pull_request) Successful in 11m19s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Failing after 1h13m38s
2026-03-24 13:01:23 +00:00
Compare
hamza.khyari deleted branch feature/lsp-functional-runtime 2026-03-24 13:17:54 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core!1044
No description provided.