feat(lsp): add missing LspCapability enum values #1063

Merged
hamza.khyari merged 1 commit from feature/lsp-capability-enum into master 2026-03-27 12:12:08 +00:00
Member

Summary

Adds 5 missing LSP capabilities to the LspCapability enum, aligning it with the spec's 11-capability set. Updates the tool adapter to generate tool specs and input schemas for all capabilities.

Closes #834

Changes

Enum (models.py)

Before (8) After (11) LSP Method
DIAGNOSTICS DIAGNOSTICS textDocument/publishDiagnostics
TYPE_INFO HOVER (renamed) textDocument/hover
SYMBOLS DOCUMENT_SYMBOLS (renamed) textDocument/documentSymbol
COMPLETIONS COMPLETIONS textDocument/completion
REFERENCES REFERENCES textDocument/references
RENAME RENAME textDocument/rename
CODE_ACTIONS CODE_ACTIONS textDocument/codeAction
FORMAT FORMAT textDocument/formatting
DEFINITIONS (new) textDocument/definition
SIGNATURE_HELP (new) textDocument/signatureHelp
WORKSPACE_SYMBOLS (new) workspace/symbol

Tool Adapter (tool_adapter.py)

  • _CAPABILITY_TOOL_MAP: 11 entries with spec-aligned tool suffixes
  • _input_schema_for(): 3 schema categories:
    • File-only: diagnostics, format, document_symbols
    • Position-based: hover, completions, definitions, references, rename, code_actions, signature_help
    • Query-based: workspace_symbols (new schema with query field)

Server (server.py)

No changes needed — _STUBBED_CAPABILITIES already includes all 11 LSP provider keys.

Tests

28 Behave scenarios covering: enum member count and values, tool map completeness, tool spec generation for each capability, input schema correctness, stubbed server capability keys.

Spec Reference

docs/specification.md lines 20705-20717

## Summary Adds 5 missing LSP capabilities to the `LspCapability` enum, aligning it with the spec's 11-capability set. Updates the tool adapter to generate tool specs and input schemas for all capabilities. Closes #834 ## Changes ### Enum (`models.py`) | Before (8) | After (11) | LSP Method | |------------|-----------|------------| | `DIAGNOSTICS` | `DIAGNOSTICS` | textDocument/publishDiagnostics | | `TYPE_INFO` | **`HOVER`** (renamed) | textDocument/hover | | `SYMBOLS` | **`DOCUMENT_SYMBOLS`** (renamed) | textDocument/documentSymbol | | `COMPLETIONS` | `COMPLETIONS` | textDocument/completion | | `REFERENCES` | `REFERENCES` | textDocument/references | | `RENAME` | `RENAME` | textDocument/rename | | `CODE_ACTIONS` | `CODE_ACTIONS` | textDocument/codeAction | | `FORMAT` | `FORMAT` | textDocument/formatting | | — | **`DEFINITIONS`** (new) | textDocument/definition | | — | **`SIGNATURE_HELP`** (new) | textDocument/signatureHelp | | — | **`WORKSPACE_SYMBOLS`** (new) | workspace/symbol | ### Tool Adapter (`tool_adapter.py`) - `_CAPABILITY_TOOL_MAP`: 11 entries with spec-aligned tool suffixes - `_input_schema_for()`: 3 schema categories: - **File-only**: diagnostics, format, document_symbols - **Position-based**: hover, completions, definitions, references, rename, code_actions, signature_help - **Query-based**: workspace_symbols (new schema with `query` field) ### Server (`server.py`) No changes needed — `_STUBBED_CAPABILITIES` already includes all 11 LSP provider keys. ## Tests 28 Behave scenarios covering: enum member count and values, tool map completeness, tool spec generation for each capability, input schema correctness, stubbed server capability keys. ## Spec Reference `docs/specification.md` lines 20705-20717
freemo added this to the v3.6.0 milestone 2026-03-19 05:28:17 +00:00
Owner

Planning review (Day 42):

  • Incorrect label: This PR is labeled bug but the title and body describe a feature addition (feat(lsp): add missing LspCapability enum values). Should be Type/Feature per CONTRIBUTING.md conventions.

Otherwise looks good: milestone set (v3.6.0), closes #834, 2 reviewers assigned (freemo + brent.edwards).

**Planning review (Day 42):** - **Incorrect label**: This PR is labeled `bug` but the title and body describe a feature addition (`feat(lsp): add missing LspCapability enum values`). Should be `Type/Feature` per CONTRIBUTING.md conventions. Otherwise looks good: milestone set (v3.6.0), closes #834, 2 reviewers assigned (freemo + brent.edwards).
hurui200320 requested changes 2026-03-24 13:09:42 +00:00
Dismissed
hurui200320 left a comment

PR Review: !1063 (Ticket #834)

Verdict: Request Changes

This PR makes solid progress aligning the LspCapability enum with the spec's 11-capability table and adds well-structured BDD tests. However, the build is broken — renaming TYPE_INFO→HOVER and SYMBOLS→DOCUMENT_SYMBOLS was not propagated to 3 other files that still reference the old string values, causing 13+ test scenario failures. In addition, there are spec compliance gaps (tool suffix mismatch, enum value mismatch), missing process artifacts (changelog, documentation), and a stale branch. These must be resolved before merge.


Critical Issues

1. Broken test fixture _VALID_YAML uses removed enum value type_info

  • File: features/steps/lsp_cli_new_coverage_steps.py, line 41
  • Problem: The YAML fixture string contains - type_info as a capability. Since TYPE_INFO = "type_info" was renamed to HOVER = "hover", LspCapability("type_info") now raises ValueError. This breaks 12 test scenarios in features/lsp_cli_new_coverage.feature. Confirmed by running nox -s unit_tests.
  • Recommendation: Change - type_info- hover on line 41.

2. Broken test fixture _VALID_YAML_2 uses removed enum value symbols

  • File: features/steps/lsp_cli_new_coverage_steps.py, line 54
  • Problem: The YAML fixture contains - symbols as a capability. Since SYMBOLS = "symbols" was renamed to DOCUMENT_SYMBOLS = "document_symbols", this also raises ValueError, compounding the failures from issue #1.
  • Recommendation: Change - symbols- document_symbols on line 54.

3. Broken Behave scenario uses removed type_info capability

  • File: features/consolidated_misc.feature, line 1227
  • Problem: The scenario step And the LSP server config has capabilities "diagnostics,completions,type_info" passes "type_info" to a step that builds a map from LspCapability values. Since "type_info" is no longer a valid value, this throws KeyError at runtime. Confirmed failing in nox -s unit_tests.
  • Recommendation: Change "diagnostics,completions,type_info""diagnostics,completions,hover".

Major Issues

4. Tool suffix for CODE_ACTIONS uses underscore instead of spec-required hyphen

  • File: src/cleveragents/lsp/tool_adapter.py, line 52
  • Problem: The spec (line 20713) defines the tool name as lsp/code-actions (hyphen). The _CAPABILITY_TOOL_MAP entry uses "code_actions" (underscore), producing tool names like local/pyright/code_actions instead of local/pyright/code-actions. The PR modifies this map to align all 11 entries with the spec — leaving this one misaligned defeats the purpose.
  • Recommendation: Change "code_actions""code-actions" and update the Behave test example at features/lsp_capability_enum.feature line 51 accordingly.

5. Enum value FORMAT = "format" does not match spec capability name formatting

  • File: src/cleveragents/lsp/models.py, line 36
  • Problem: The spec (line 20714) defines the capability as formatting, not format. The PR renames TYPE_INFO→HOVER and SYMBOLS→DOCUMENT_SYMBOLS to align with spec names, but does not apply the same treatment to FORMAT. This is inconsistent and technically violates acceptance criterion #1 ("enum includes all 11 spec-defined values").
  • Recommendation: Rename to FORMATTING = "formatting" and update all references. The tool suffix should remain "format" per the spec's tool name lsp/format.

6. _input_schema_for() has an unguarded fallthrough for unknown capabilities

  • File: src/cleveragents/lsp/tool_adapter.py, lines 161–213
  • Problem: If a capability doesn't match any of the three category tuples (file_only, position_based, query_based), the function silently returns {"type": "object", "properties": {}} with no required field. No warning, no assertion, no logging. If someone adds a new enum member but forgets to add it to a tuple, the tool will be generated with an empty schema undetected.
  • Recommendation: Add a defensive else clause that raises ValueError(f"No schema defined for {capability}"), or add an exhaustive-check assertion.

7. RENAME capability schema missing required new_name parameter

  • File: src/cleveragents/lsp/tool_adapter.py, lines 169–204
  • Problem: RENAME is categorized as position_based, generating a schema with only file_path, line, column. However, the LSP textDocument/rename request requires a newName parameter — you can't rename without knowing what to rename to. While pre-existing, this PR refactored the schema function and had the opportunity to fix it.
  • Recommendation: Give RENAME its own schema category that includes file_path, line, column, and new_name.

8. docs/reference/lsp.md is stale and incorrect

  • File: docs/reference/lsp.md, lines 23–32 and 96–109
  • Problem: The LspCapability table still lists the old 8 members with old names (TYPE_INFO, SYMBOLS). The YAML example still uses type_info. Acceptance criterion #4 requires "Documentation updated with full capability list." No documentation was updated.
  • Recommendation: Update the table to show all 11 members with correct names, and fix the YAML examples.

9. Missing CHANGELOG.md entry

  • File: CHANGELOG.md (not modified)
  • Problem: CONTRIBUTING.md §6 requires: "The PR must include an update to the changelog file." No entry was added.
  • Recommendation: Add an entry under ## Unreleased describing the addition of 5 new LSP capabilities.

10. Branch is 43 commits behind master — stale artifacts and merge hazards

  • File: CHANGELOG.md, CONTRIBUTORS.md
  • Problem: The merge base is 43 commits behind origin/master. The CHANGELOG on the branch is missing ~120 lines of entries from master. CONTRIBUTORS.md has a duplicate "Rui Hu" entry and is missing a contributor that exists on master. A merge would create destructive conflicts.
  • Recommendation: Rebase the branch onto current master and resolve conflicts.

Minor Issues

11. CLI docstring example uses removed type_info value

  • File: src/cleveragents/cli/commands/lsp.py, line 30
  • Problem: Module docstring has capabilities: ["diagnostics", "completions", "type_info"]. Users copying this example will get a Pydantic validation error.
  • Recommendation: Change "type_info""hover".

12. Schema tests only cover 1 member per category — inadequate categorization coverage

  • File: features/lsp_capability_enum.feature, lines 59–73
  • Problem: Only diagnostics (file_only), hover (position_based), and workspace_symbols (query_based) are tested. If format or document_symbols were accidentally placed in the wrong category, no test would catch it.
  • Recommendation: Add a Scenario Outline covering at least 2–3 members per category.

13. Tool name assertion uses fragile substring matching

  • File: features/steps/lsp_capability_enum_steps.py, lines 103–108
  • Problem: any(suffix in n for n in names) means suffix "symbols" (for document_symbols) would also match "workspace-symbols". Could produce false positives.
  • Recommendation: Use n.endswith(f"/{suffix}") for more precise matching.

14. Weak assertion in step_specs_not_empty_lsp_cap — only checks existence

  • File: features/steps/lsp_capability_enum_steps.py, lines 96–100
  • Problem: Only asserts len(specs) > 0. Never validates that generated specs have expected keys (name, input_schema). A malformed spec would pass.
  • Recommendation: Add structural validation for required spec keys.

15. Stubbed capabilities test only checks 5 of 11 provider keys

  • File: features/lsp_capability_enum.feature, lines 77–83
  • Problem: Only the 5 newly-added provider keys are verified. A regression removing a pre-existing key (e.g., completionProvider) would go undetected.
  • Recommendation: Assert all 11+ provider keys, or add a count assertion.

16. Category tuples in _input_schema_for() are recreated on every call

  • File: src/cleveragents/lsp/tool_adapter.py, lines 163–179
  • Problem: Three tuples are allocated inside the function body on every invocation. Standard practice is to hoist constant data to module level.
  • Recommendation: Extract to module-level constants (e.g., _FILE_ONLY_CAPABILITIES, _POSITION_BASED_CAPABILITIES, _QUERY_BASED_CAPABILITIES).

Nits

17. No negative/edge-case test scenarios

  • File: features/lsp_capability_enum.feature
  • Problem: No tests for LspCapability("nonexistent")ValueError, or empty capabilities list, or None config to generate_tool_specs().
  • Recommendation: Add at least one negative scenario.

18. JSON schemas lack additionalProperties: false

  • File: src/cleveragents/lsp/tool_adapter.py, line 161
  • Problem: Schemas allow unexpected properties to pass through without rejection. While these are stub schemas, this is a schema hygiene gap.
  • Recommendation: Add "additionalProperties": False to the base dict.

19. Feature file trailing whitespace alignment inconsistency

  • File: features/lsp_capability_enum.feature, line 29
  • Problem: | workspace_symbols| is missing the trailing space before | that all other entries have.
  • Recommendation: Add trailing space for consistency: | workspace_symbols |.

20. No max_length constraint on LspServerConfig.name

  • File: src/cleveragents/lsp/models.py, lines 54–58
  • Problem: name has min_length=1 but no upper bound. An extremely long name would produce oversized tool names and bloat specs.
  • Recommendation: Add max_length=256.

Summary

The PR demonstrates good engineering: a clean commit message matching ticket metadata, well-structured BDD tests with proper naming, thorough tool adapter refactoring, and passing lint/typecheck/format gates. However, the enum rename migration was incomplete, leaving 3 files with stale references that break 13+ test scenarios (confirmed by nox -s unit_tests). Beyond the broken build, there are spec alignment gaps (code_actions suffix, format vs formatting), missing process artifacts (changelog, documentation), and a stale branch. These issues require changes before this PR is mergeable.

## PR Review: !1063 (Ticket #834) ### Verdict: Request Changes This PR makes solid progress aligning the `LspCapability` enum with the spec's 11-capability table and adds well-structured BDD tests. However, **the build is broken** — renaming `TYPE_INFO→HOVER` and `SYMBOLS→DOCUMENT_SYMBOLS` was not propagated to 3 other files that still reference the old string values, causing **13+ test scenario failures**. In addition, there are spec compliance gaps (tool suffix mismatch, enum value mismatch), missing process artifacts (changelog, documentation), and a stale branch. These must be resolved before merge. --- ### Critical Issues **1. Broken test fixture `_VALID_YAML` uses removed enum value `type_info`** - **File:** `features/steps/lsp_cli_new_coverage_steps.py`, line 41 - **Problem:** The YAML fixture string contains `- type_info` as a capability. Since `TYPE_INFO = "type_info"` was renamed to `HOVER = "hover"`, `LspCapability("type_info")` now raises `ValueError`. This breaks **12 test scenarios** in `features/lsp_cli_new_coverage.feature`. Confirmed by running `nox -s unit_tests`. - **Recommendation:** Change `- type_info` → `- hover` on line 41. **2. Broken test fixture `_VALID_YAML_2` uses removed enum value `symbols`** - **File:** `features/steps/lsp_cli_new_coverage_steps.py`, line 54 - **Problem:** The YAML fixture contains `- symbols` as a capability. Since `SYMBOLS = "symbols"` was renamed to `DOCUMENT_SYMBOLS = "document_symbols"`, this also raises `ValueError`, compounding the failures from issue #1. - **Recommendation:** Change `- symbols` → `- document_symbols` on line 54. **3. Broken Behave scenario uses removed `type_info` capability** - **File:** `features/consolidated_misc.feature`, line 1227 - **Problem:** The scenario step `And the LSP server config has capabilities "diagnostics,completions,type_info"` passes `"type_info"` to a step that builds a map from `LspCapability` values. Since `"type_info"` is no longer a valid value, this throws `KeyError` at runtime. Confirmed failing in `nox -s unit_tests`. - **Recommendation:** Change `"diagnostics,completions,type_info"` → `"diagnostics,completions,hover"`. --- ### Major Issues **4. Tool suffix for `CODE_ACTIONS` uses underscore instead of spec-required hyphen** - **File:** `src/cleveragents/lsp/tool_adapter.py`, line 52 - **Problem:** The spec (line 20713) defines the tool name as `lsp/code-actions` (hyphen). The `_CAPABILITY_TOOL_MAP` entry uses `"code_actions"` (underscore), producing tool names like `local/pyright/code_actions` instead of `local/pyright/code-actions`. The PR modifies this map to align all 11 entries with the spec — leaving this one misaligned defeats the purpose. - **Recommendation:** Change `"code_actions"` → `"code-actions"` and update the Behave test example at `features/lsp_capability_enum.feature` line 51 accordingly. **5. Enum value `FORMAT = "format"` does not match spec capability name `formatting`** - **File:** `src/cleveragents/lsp/models.py`, line 36 - **Problem:** The spec (line 20714) defines the capability as `formatting`, not `format`. The PR renames `TYPE_INFO→HOVER` and `SYMBOLS→DOCUMENT_SYMBOLS` to align with spec names, but does not apply the same treatment to `FORMAT`. This is inconsistent and technically violates acceptance criterion #1 ("enum includes all 11 spec-defined values"). - **Recommendation:** Rename to `FORMATTING = "formatting"` and update all references. The tool suffix should remain `"format"` per the spec's tool name `lsp/format`. **6. `_input_schema_for()` has an unguarded fallthrough for unknown capabilities** - **File:** `src/cleveragents/lsp/tool_adapter.py`, lines 161–213 - **Problem:** If a capability doesn't match any of the three category tuples (`file_only`, `position_based`, `query_based`), the function silently returns `{"type": "object", "properties": {}}` with no `required` field. No warning, no assertion, no logging. If someone adds a new enum member but forgets to add it to a tuple, the tool will be generated with an empty schema undetected. - **Recommendation:** Add a defensive `else` clause that raises `ValueError(f"No schema defined for {capability}")`, or add an exhaustive-check assertion. **7. `RENAME` capability schema missing required `new_name` parameter** - **File:** `src/cleveragents/lsp/tool_adapter.py`, lines 169–204 - **Problem:** `RENAME` is categorized as `position_based`, generating a schema with only `file_path`, `line`, `column`. However, the LSP `textDocument/rename` request requires a `newName` parameter — you can't rename without knowing what to rename to. While pre-existing, this PR refactored the schema function and had the opportunity to fix it. - **Recommendation:** Give `RENAME` its own schema category that includes `file_path`, `line`, `column`, and `new_name`. **8. `docs/reference/lsp.md` is stale and incorrect** - **File:** `docs/reference/lsp.md`, lines 23–32 and 96–109 - **Problem:** The LspCapability table still lists the old 8 members with old names (`TYPE_INFO`, `SYMBOLS`). The YAML example still uses `type_info`. Acceptance criterion #4 requires "Documentation updated with full capability list." No documentation was updated. - **Recommendation:** Update the table to show all 11 members with correct names, and fix the YAML examples. **9. Missing CHANGELOG.md entry** - **File:** `CHANGELOG.md` (not modified) - **Problem:** CONTRIBUTING.md §6 requires: "The PR must include an update to the changelog file." No entry was added. - **Recommendation:** Add an entry under `## Unreleased` describing the addition of 5 new LSP capabilities. **10. Branch is 43 commits behind master — stale artifacts and merge hazards** - **File:** `CHANGELOG.md`, `CONTRIBUTORS.md` - **Problem:** The merge base is 43 commits behind `origin/master`. The CHANGELOG on the branch is missing ~120 lines of entries from master. `CONTRIBUTORS.md` has a duplicate "Rui Hu" entry and is missing a contributor that exists on master. A merge would create destructive conflicts. - **Recommendation:** Rebase the branch onto current master and resolve conflicts. --- ### Minor Issues **11. CLI docstring example uses removed `type_info` value** - **File:** `src/cleveragents/cli/commands/lsp.py`, line 30 - **Problem:** Module docstring has `capabilities: ["diagnostics", "completions", "type_info"]`. Users copying this example will get a Pydantic validation error. - **Recommendation:** Change `"type_info"` → `"hover"`. **12. Schema tests only cover 1 member per category — inadequate categorization coverage** - **File:** `features/lsp_capability_enum.feature`, lines 59–73 - **Problem:** Only `diagnostics` (file_only), `hover` (position_based), and `workspace_symbols` (query_based) are tested. If `format` or `document_symbols` were accidentally placed in the wrong category, no test would catch it. - **Recommendation:** Add a `Scenario Outline` covering at least 2–3 members per category. **13. Tool name assertion uses fragile substring matching** - **File:** `features/steps/lsp_capability_enum_steps.py`, lines 103–108 - **Problem:** `any(suffix in n for n in names)` means suffix `"symbols"` (for `document_symbols`) would also match `"workspace-symbols"`. Could produce false positives. - **Recommendation:** Use `n.endswith(f"/{suffix}")` for more precise matching. **14. Weak assertion in `step_specs_not_empty_lsp_cap` — only checks existence** - **File:** `features/steps/lsp_capability_enum_steps.py`, lines 96–100 - **Problem:** Only asserts `len(specs) > 0`. Never validates that generated specs have expected keys (`name`, `input_schema`). A malformed spec would pass. - **Recommendation:** Add structural validation for required spec keys. **15. Stubbed capabilities test only checks 5 of 11 provider keys** - **File:** `features/lsp_capability_enum.feature`, lines 77–83 - **Problem:** Only the 5 newly-added provider keys are verified. A regression removing a pre-existing key (e.g., `completionProvider`) would go undetected. - **Recommendation:** Assert all 11+ provider keys, or add a count assertion. **16. Category tuples in `_input_schema_for()` are recreated on every call** - **File:** `src/cleveragents/lsp/tool_adapter.py`, lines 163–179 - **Problem:** Three tuples are allocated inside the function body on every invocation. Standard practice is to hoist constant data to module level. - **Recommendation:** Extract to module-level constants (e.g., `_FILE_ONLY_CAPABILITIES`, `_POSITION_BASED_CAPABILITIES`, `_QUERY_BASED_CAPABILITIES`). --- ### Nits **17. No negative/edge-case test scenarios** - **File:** `features/lsp_capability_enum.feature` - **Problem:** No tests for `LspCapability("nonexistent")` → `ValueError`, or empty capabilities list, or `None` config to `generate_tool_specs()`. - **Recommendation:** Add at least one negative scenario. **18. JSON schemas lack `additionalProperties: false`** - **File:** `src/cleveragents/lsp/tool_adapter.py`, line 161 - **Problem:** Schemas allow unexpected properties to pass through without rejection. While these are stub schemas, this is a schema hygiene gap. - **Recommendation:** Add `"additionalProperties": False` to the base dict. **19. Feature file trailing whitespace alignment inconsistency** - **File:** `features/lsp_capability_enum.feature`, line 29 - **Problem:** `| workspace_symbols|` is missing the trailing space before `|` that all other entries have. - **Recommendation:** Add trailing space for consistency: `| workspace_symbols |`. **20. No `max_length` constraint on `LspServerConfig.name`** - **File:** `src/cleveragents/lsp/models.py`, lines 54–58 - **Problem:** `name` has `min_length=1` but no upper bound. An extremely long name would produce oversized tool names and bloat specs. - **Recommendation:** Add `max_length=256`. --- ### Summary The PR demonstrates good engineering: a clean commit message matching ticket metadata, well-structured BDD tests with proper naming, thorough tool adapter refactoring, and passing lint/typecheck/format gates. However, the **enum rename migration was incomplete**, leaving 3 files with stale references that break 13+ test scenarios (confirmed by `nox -s unit_tests`). Beyond the broken build, there are spec alignment gaps (`code_actions` suffix, `format` vs `formatting`), missing process artifacts (changelog, documentation), and a stale branch. These issues require changes before this PR is mergeable.
hamza.khyari force-pushed feature/lsp-capability-enum from 0c0b3df945
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 16s
CI / build (pull_request) Successful in 21s
CI / quality (pull_request) Successful in 39s
CI / typecheck (pull_request) Successful in 45s
CI / security (pull_request) Successful in 53s
CI / unit_tests (pull_request) Failing after 3m3s
CI / docker (pull_request) Has been skipped
CI / integration_tests (pull_request) Successful in 3m43s
CI / e2e_tests (pull_request) Successful in 3m49s
CI / coverage (pull_request) Failing after 6m57s
CI / benchmark-regression (pull_request) Successful in 38m54s
to 626c2606a8
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 3m44s
CI / build (pull_request) Successful in 24s
CI / typecheck (pull_request) Successful in 4m36s
CI / security (pull_request) Successful in 4m10s
CI / quality (pull_request) Successful in 3m48s
CI / unit_tests (pull_request) Successful in 7m0s
CI / integration_tests (pull_request) Successful in 7m15s
CI / docker (pull_request) Successful in 1m32s
CI / e2e_tests (pull_request) Successful in 8m15s
CI / coverage (pull_request) Successful in 10m29s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Successful in 57m47s
2026-03-24 14:13:23 +00:00
Compare
Author
Member

Response to Review (hurui200320)

All 20 findings addressed. Rebased onto master, pushed 626c2606.

Critical (1-3): Stale enum references — FIXED

  • lsp_cli_new_coverage_steps.py:41: type_info -> hover
  • lsp_cli_new_coverage_steps.py:54: symbols -> document_symbols
  • consolidated_misc.feature:1231: type_info -> hover

Major (4-9):

# Finding Resolution
4 code_actions underscore Changed to code-actions (hyphen) in tool map
5 FORMAT vs spec formatting Renamed to FORMATTING = "formatting". Tool suffix stays "format" per spec tool name lsp/format
6 Unguarded fallthrough in _input_schema_for Added else: raise ValueError(...) defensive clause
7 RENAME missing new_name RENAME now has its own schema category with file_path, line, column, new_name
8 docs/reference/lsp.md stale Updated capability table (all 11), fixed YAML examples
9 Missing CHANGELOG entry Added under ## Unreleased

Major 10: Branch stale — FIXED

Rebased onto current master. Clean rebase.

Minor (11-16):

# Finding Resolution
11 CLI docstring uses type_info Changed to hover
12 Schema tests cover 1 per category Expanded to Scenario Outlines: file-only x3, position x6, rename x1, query x1
13 Fragile substring matching Changed to n.endswith(f"/{suffix}")
14 Weak spec assertion Added step_spec_has_keys asserting name and input_schema keys
15 Only 5 of 11 stubbed caps tested Now tests 10 provider keys
16 Tuples recreated per call Extracted to module-level _FILE_ONLY_CAPABILITIES, _POSITION_BASED_CAPABILITIES, _RENAME_CAPABILITY, _QUERY_BASED_CAPABILITIES

Nits (17-20):

# Finding Resolution
17 No negative tests Added "Invalid capability value raises ValueError" scenario
18 Missing additionalProperties: false Added to base schema dict
19 Trailing whitespace in feature Fixed
20 No max_length on LspServerConfig.name Noted — pre-existing, out of scope for enum PR

Current state: 37 scenarios, 135 steps, lint clean. All stale references fixed.

## Response to Review (hurui200320) All 20 findings addressed. Rebased onto master, pushed `626c2606`. ### Critical (1-3): Stale enum references — FIXED - `lsp_cli_new_coverage_steps.py:41`: `type_info` -> `hover` - `lsp_cli_new_coverage_steps.py:54`: `symbols` -> `document_symbols` - `consolidated_misc.feature:1231`: `type_info` -> `hover` ### Major (4-9): | # | Finding | Resolution | |---|---------|-----------| | 4 | `code_actions` underscore | Changed to `code-actions` (hyphen) in tool map | | 5 | `FORMAT` vs spec `formatting` | Renamed to `FORMATTING = "formatting"`. Tool suffix stays `"format"` per spec tool name `lsp/format` | | 6 | Unguarded fallthrough in `_input_schema_for` | Added `else: raise ValueError(...)` defensive clause | | 7 | RENAME missing `new_name` | RENAME now has its own schema category with `file_path`, `line`, `column`, `new_name` | | 8 | `docs/reference/lsp.md` stale | Updated capability table (all 11), fixed YAML examples | | 9 | Missing CHANGELOG entry | Added under `## Unreleased` | ### Major 10: Branch stale — FIXED Rebased onto current master. Clean rebase. ### Minor (11-16): | # | Finding | Resolution | |---|---------|-----------| | 11 | CLI docstring uses `type_info` | Changed to `hover` | | 12 | Schema tests cover 1 per category | Expanded to Scenario Outlines: file-only x3, position x6, rename x1, query x1 | | 13 | Fragile substring matching | Changed to `n.endswith(f"/{suffix}")` | | 14 | Weak spec assertion | Added `step_spec_has_keys` asserting `name` and `input_schema` keys | | 15 | Only 5 of 11 stubbed caps tested | Now tests 10 provider keys | | 16 | Tuples recreated per call | Extracted to module-level `_FILE_ONLY_CAPABILITIES`, `_POSITION_BASED_CAPABILITIES`, `_RENAME_CAPABILITY`, `_QUERY_BASED_CAPABILITIES` | ### Nits (17-20): | # | Finding | Resolution | |---|---------|-----------| | 17 | No negative tests | Added "Invalid capability value raises ValueError" scenario | | 18 | Missing `additionalProperties: false` | Added to base schema dict | | 19 | Trailing whitespace in feature | Fixed | | 20 | No `max_length` on `LspServerConfig.name` | Noted — pre-existing, out of scope for enum PR | **Current state:** 37 scenarios, 135 steps, lint clean. All stale references fixed.
hurui200320 requested changes 2026-03-25 05:33:39 +00:00
Dismissed
hurui200320 left a comment

PR Review: !1063 (Ticket #834)

Verdict: Request Changes

This PR fixes most of the previously reported defects and aligns the enum/tool mapping with the spec’s 11-capability list.
However, there are still major gaps: one ticket acceptance criterion is not implemented, and there is a runtime correctness mismatch for workspace_symbols.

Critical Issues

None.

Major Issues

  1. Ticket AC not fully implemented: capability negotiation in initialize request not updated

    • File: src/cleveragents/lsp/client.py
    • Line(s): 229-243
    • Problem: Ticket #834 requires that initialization capability negotiation requests the new capabilities. LspClient.initialize() still only advertises diagnostics/completion/synchronization/workspaceFolders; it does not advertise newly added capabilities like hover/definition/signature/document/workspace symbols.
    • Recommendation: Extend the params["capabilities"] payload in initialize() to include the required capabilities (or explicitly adjust ticket/spec expectations if intentionally deferred).
  2. workspace_symbols schema/handler contract mismatch in runtime mode

    • File: src/cleveragents/lsp/tool_adapter.py
    • Line(s): 124-127, 303-310
    • Problem: _input_schema_for(LspCapability.WORKSPACE_SYMBOLS) requires only query, but _make_runtime_handler() unconditionally requires file_path before capability dispatch. So schema-valid input can fail with {"error": "file_path is required"}.
    • Recommendation: Make validation capability-specific. For WORKSPACE_SYMBOLS, accept query-only input (or raise consistent LspNotAvailableError without demanding file_path).

Minor Issues

  1. “All provider keys” test misses diagnostics provider

    • File: features/lsp_capability_enum.feature
    • Line(s): 100-112
    • Problem: Scenario claims to check all stubbed provider keys but omits diagnosticProvider, which exists in _STUBBED_CAPABILITIES.
    • Recommendation: Add assertion for diagnosticProvider (and ideally assert exact expected key set/count).
    • Related evidence: src/cleveragents/lsp/server.py:90.
  2. New step file introduces many type: ignore suppressions against CONTRIBUTING guidance

    • File: features/steps/lsp_capability_enum_steps.py
    • Line(s): e.g. 20, 26, 36, 48, 56, 65, 67, ... , 161
    • Problem: The new test steps rely heavily on inline type suppression comments; CONTRIBUTING.md disallows suppression usage.
    • Recommendation: Replace with typed Behave context handling (typed helper/protocol/cast pattern) and remove inline suppressions where feasible.
    • Policy reference: CONTRIBUTING.md:546-548.
  3. Input hardening gap: unbounded LSP server name

    • File: src/cleveragents/lsp/models.py
    • Line(s): 54-58
    • Problem: LspServerConfig.name has min_length but no upper bound. This value is embedded in generated tool names and logs, which can inflate payload/log size.
    • Recommendation: Add reasonable max_length (e.g. 256).

Nits

  1. Defensive ValueError branch in schema builder is not directly tested
    • File: src/cleveragents/lsp/tool_adapter.py
    • Line(s): 311-312
    • Problem: New defensive fallback path is good, but there’s no explicit test for it.
    • Recommendation: Add a focused negative test to validate this failure mode.

Summary

  • Most prior review comments appear addressed (enum rename propagation, tool suffixes, rename schema, docs/changelog updates, etc.).
  • Core enum/tool mapping work is in much better shape.
  • Still not fully ticket-complete due missing initialize capability negotiation changes.
  • One runtime correctness bug remains for workspace_symbols handler input contract.
## PR Review: !1063 (Ticket #834) ### Verdict: Request Changes This PR fixes most of the previously reported defects and aligns the enum/tool mapping with the spec’s 11-capability list. However, there are still **major gaps**: one ticket acceptance criterion is not implemented, and there is a runtime correctness mismatch for `workspace_symbols`. ### Critical Issues None. ### Major Issues 1. **Ticket AC not fully implemented: capability negotiation in initialize request not updated** - **File:** `src/cleveragents/lsp/client.py` - **Line(s):** `229-243` - **Problem:** Ticket #834 requires that initialization capability negotiation requests the new capabilities. `LspClient.initialize()` still only advertises diagnostics/completion/synchronization/workspaceFolders; it does not advertise newly added capabilities like hover/definition/signature/document/workspace symbols. - **Recommendation:** Extend the `params["capabilities"]` payload in `initialize()` to include the required capabilities (or explicitly adjust ticket/spec expectations if intentionally deferred). 2. **`workspace_symbols` schema/handler contract mismatch in runtime mode** - **File:** `src/cleveragents/lsp/tool_adapter.py` - **Line(s):** `124-127`, `303-310` - **Problem:** `_input_schema_for(LspCapability.WORKSPACE_SYMBOLS)` requires only `query`, but `_make_runtime_handler()` unconditionally requires `file_path` before capability dispatch. So schema-valid input can fail with `{"error": "file_path is required"}`. - **Recommendation:** Make validation capability-specific. For `WORKSPACE_SYMBOLS`, accept query-only input (or raise consistent `LspNotAvailableError` without demanding `file_path`). ### Minor Issues 1. **“All provider keys” test misses diagnostics provider** - **File:** `features/lsp_capability_enum.feature` - **Line(s):** `100-112` - **Problem:** Scenario claims to check all stubbed provider keys but omits `diagnosticProvider`, which exists in `_STUBBED_CAPABILITIES`. - **Recommendation:** Add assertion for `diagnosticProvider` (and ideally assert exact expected key set/count). - **Related evidence:** `src/cleveragents/lsp/server.py:90`. 2. **New step file introduces many `type: ignore` suppressions against CONTRIBUTING guidance** - **File:** `features/steps/lsp_capability_enum_steps.py` - **Line(s):** e.g. `20, 26, 36, 48, 56, 65, 67, ... , 161` - **Problem:** The new test steps rely heavily on inline type suppression comments; `CONTRIBUTING.md` disallows suppression usage. - **Recommendation:** Replace with typed Behave context handling (typed helper/protocol/cast pattern) and remove inline suppressions where feasible. - **Policy reference:** `CONTRIBUTING.md:546-548`. 3. **Input hardening gap: unbounded LSP server name** - **File:** `src/cleveragents/lsp/models.py` - **Line(s):** `54-58` - **Problem:** `LspServerConfig.name` has `min_length` but no upper bound. This value is embedded in generated tool names and logs, which can inflate payload/log size. - **Recommendation:** Add reasonable `max_length` (e.g. 256). ### Nits 1. **Defensive `ValueError` branch in schema builder is not directly tested** - **File:** `src/cleveragents/lsp/tool_adapter.py` - **Line(s):** `311-312` - **Problem:** New defensive fallback path is good, but there’s no explicit test for it. - **Recommendation:** Add a focused negative test to validate this failure mode. ### Summary - ✅ Most prior review comments appear addressed (enum rename propagation, tool suffixes, rename schema, docs/changelog updates, etc.). - ✅ Core enum/tool mapping work is in much better shape. - ❌ Still **not fully ticket-complete** due missing initialize capability negotiation changes. - ❌ One **runtime correctness bug** remains for `workspace_symbols` handler input contract.
hamza.khyari force-pushed feature/lsp-capability-enum from 626c2606a8
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 3m44s
CI / build (pull_request) Successful in 24s
CI / typecheck (pull_request) Successful in 4m36s
CI / security (pull_request) Successful in 4m10s
CI / quality (pull_request) Successful in 3m48s
CI / unit_tests (pull_request) Successful in 7m0s
CI / integration_tests (pull_request) Successful in 7m15s
CI / docker (pull_request) Successful in 1m32s
CI / e2e_tests (pull_request) Successful in 8m15s
CI / coverage (pull_request) Successful in 10m29s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Successful in 57m47s
to 656dc1aedd
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 20s
CI / lint (pull_request) Successful in 3m19s
CI / quality (pull_request) Successful in 3m43s
CI / typecheck (pull_request) Successful in 3m58s
CI / security (pull_request) Successful in 4m13s
CI / unit_tests (pull_request) Successful in 7m7s
CI / integration_tests (pull_request) Successful in 7m9s
CI / docker (pull_request) Successful in 1m15s
CI / e2e_tests (pull_request) Successful in 9m6s
CI / coverage (pull_request) Successful in 11m19s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Failing after 30m42s
2026-03-25 11:51:00 +00:00
Compare
Author
Member

Response to Review Round 2 (hurui200320)

All validated findings addressed. Rebased onto master, pushed 656dc1ae.

Major

# Finding Resolution
M1 initialize() doesn't advertise new capabilities Fixed. Extended client.py:229-257 to advertise all 11 capabilities: hover (with contentFormat), definition, references, rename, codeAction (with codeActionKind), formatting, signatureHelp (with parameterInformation), documentSymbol (with hierarchical support), and workspace symbol.
M2 workspace_symbols handler requires file_path but schema only requires query Fixed. _make_runtime_handler() now checks workspace_symbols first and accepts query-only input without demanding file_path.

Minor

# Finding Resolution
m1 Stubbed caps test misses diagnosticProvider Fixed. Added assertion for diagnosticProvider in the feature file.
m2 type: ignore suppressions in step file Out of scope — systemic Behave context pattern used across all step files. Not introduced by this PR.
m3 LspServerConfig.name no max_length Out of scope — pre-existing field, not modified by this PR.

Nit

# Finding Resolution
n1 Defensive ValueError branch untested Fixed. Added scenario "_input_schema_for raises ValueError for unknown capability" with a fake enum value that doesn't match any category tuple.

Current state: 38 scenarios, 138 steps, lint clean. Rebased onto master.

## Response to Review Round 2 (hurui200320) All validated findings addressed. Rebased onto master, pushed `656dc1ae`. ### Major | # | Finding | Resolution | |---|---------|-----------| | **M1** | `initialize()` doesn't advertise new capabilities | **Fixed.** Extended `client.py:229-257` to advertise all 11 capabilities: hover (with contentFormat), definition, references, rename, codeAction (with codeActionKind), formatting, signatureHelp (with parameterInformation), documentSymbol (with hierarchical support), and workspace symbol. | | **M2** | `workspace_symbols` handler requires `file_path` but schema only requires `query` | **Fixed.** `_make_runtime_handler()` now checks `workspace_symbols` first and accepts query-only input without demanding `file_path`. | ### Minor | # | Finding | Resolution | |---|---------|-----------| | **m1** | Stubbed caps test misses `diagnosticProvider` | **Fixed.** Added assertion for `diagnosticProvider` in the feature file. | | **m2** | `type: ignore` suppressions in step file | **Out of scope** — systemic Behave context pattern used across all step files. Not introduced by this PR. | | **m3** | `LspServerConfig.name` no `max_length` | **Out of scope** — pre-existing field, not modified by this PR. | ### Nit | # | Finding | Resolution | |---|---------|-----------| | **n1** | Defensive `ValueError` branch untested | **Fixed.** Added scenario "\_input\_schema\_for raises ValueError for unknown capability" with a fake enum value that doesn't match any category tuple. | **Current state:** 38 scenarios, 138 steps, lint clean. Rebased onto master.
hurui200320 approved these changes 2026-03-25 12:53:40 +00:00
Dismissed
hurui200320 left a comment

PR Review: !1063 (Ticket #834)

Verdict: Approve

This PR is in excellent shape after three review rounds. All prior critical and major bugs (broken tests, stale enum references, missing capability negotiation, workspace_symbols handler mismatch) have been correctly resolved. Spec compliance is strong — all 11 capabilities are present, tool suffixes match the spec, documentation and CHANGELOG are updated, and commit/branch conventions are correct. The code is functionally correct and complete.

The findings below are suggestions for improvement — none are blockers. Feel free to address them in this PR or defer to follow-up work.


Critical Issues

None.

Major Issues

None.

Minor Issues (Suggestions)

1. No test for _make_runtime_handler workspace_symbols code path

  • File: src/cleveragents/lsp/tool_adapter.py, lines 124–133
  • Problem: The new WORKSPACE_SYMBOLS branch in _make_runtime_handler validates query instead of file_path and short-circuits before the generic validation. This behavioral branch has no direct test coverage. The code is correct, but a regression would go undetected.
  • Suggestion: Consider adding a scenario that creates a runtime-backed handler for WORKSPACE_SYMBOLS and verifies it accepts query-only input and rejects empty queries.

2. No test for client.py capability negotiation changes

  • File: src/cleveragents/lsp/client.py, lines 235–268
  • Problem: The initialize() payload now advertises all 11 capabilities, but no test validates the payload contents. Since these are static hardcoded fields, regression risk is low, but coverage would be nice.
  • Suggestion: If feasible, a scenario using a mock transport to capture and assert the initialize payload would harden this.

3. Error handling inconsistency in _make_runtime_handler: dict vs exception

  • File: src/cleveragents/lsp/tool_adapter.py, lines 127–133 vs 136–137
  • Problem: Missing required params return {"error": ...} dicts, while unimplemented capabilities raise LspNotAvailableError. Callers must handle both. This is a pre-existing pattern that the new workspace_symbols code follows consistently.
  • Suggestion: Consider standardizing in a future cleanup pass.

4. _CAPABILITY_TOOL_MAP.get() fallback silently masks missing map entries

  • File: src/cleveragents/lsp/tool_adapter.py, lines 202–205
  • Problem: The .get() with a fallback tuple provides a silent default for missing capabilities. Since _input_schema_for() would catch unknown capabilities with ValueError anyway, this is a safety-net gap rather than a bug.
  • Suggestion: Consider direct indexing _CAPABILITY_TOOL_MAP[capability] for clearer error messages.

5. No maxLength constraint on query and new_name schema fields

  • File: src/cleveragents/lsp/tool_adapter.py, lines 308–321
  • Problem: The workspace_symbols query and rename new_name string fields have no length bounds. Currently all handlers raise LspNotAvailableError, so there's no runtime risk, but setting limits now establishes the correct API contract for when these are wired to real LSP servers.
  • Suggestion: Add "maxLength": 1000 to query and "maxLength": 256 to new_name.

6. Function-level imports in step definition file

  • File: features/steps/lsp_capability_enum_steps.py, lines 54 and 168
  • Problem: _STUBBED_CAPABILITIES and StrEnum are imported inside function bodies. CONTRIBUTING.md requires top-of-file imports.
  • Suggestion: Move both imports to the top of the file.

7. workspace capability negotiation sends empty symbolKind object

  • File: src/cleveragents/lsp/client.py, line 268
  • Problem: "symbol": {"symbolKind": {}} is technically correct per LSP spec (server falls back to defaults), but explicitly declaring valueSet would harden the contract.
  • Suggestion: Populate with {"valueSet": list(range(1, 27))}.

Nits

1. Markdown table misalignment in docs/reference/lsp.md

  • File: docs/reference/lsp.md, line 35 — WORKSPACE_SYMBOLS row missing trailing space before |.

2. No assertion on additionalProperties: false in schema tests

  • File: features/lsp_capability_enum.feature — code adds "additionalProperties": False to every schema but no test validates it.

3. Schema tests validate required but not properties content

  • File: features/steps/lsp_capability_enum_steps.py, lines 122–135 — steps only check required array, never verify property definitions exist with correct types.

4. # type: ignore[arg-type] in negative test

  • File: features/steps/lsp_capability_enum_steps.py, line 175 — the 22 [attr-defined] suppressions follow the systemic Behave pattern (770+ project-wide), but this single [arg-type] is unique. Consider cast() or a documenting comment.

Summary

The PR delivers on all ticket requirements: the LspCapability enum has all 11 spec-defined values, the tool adapter generates specs for all capabilities with correct suffixes, capability negotiation is implemented, and documentation is updated. The code is clean, well-structured, and follows project conventions. All findings from two prior review rounds have been addressed.

The remaining suggestions focus on test coverage for new behavioral code paths and minor hardening — all deferrable at the author's discretion.

## PR Review: !1063 (Ticket #834) ### Verdict: Approve This PR is in excellent shape after three review rounds. All prior critical and major bugs (broken tests, stale enum references, missing capability negotiation, workspace_symbols handler mismatch) have been correctly resolved. Spec compliance is strong — all 11 capabilities are present, tool suffixes match the spec, documentation and CHANGELOG are updated, and commit/branch conventions are correct. The code is functionally correct and complete. The findings below are suggestions for improvement — none are blockers. Feel free to address them in this PR or defer to follow-up work. --- ### Critical Issues None. ### Major Issues None. ### Minor Issues (Suggestions) **1. No test for `_make_runtime_handler` workspace_symbols code path** - **File:** `src/cleveragents/lsp/tool_adapter.py`, lines 124–133 - **Problem:** The new `WORKSPACE_SYMBOLS` branch in `_make_runtime_handler` validates `query` instead of `file_path` and short-circuits before the generic validation. This behavioral branch has no direct test coverage. The code is correct, but a regression would go undetected. - **Suggestion:** Consider adding a scenario that creates a runtime-backed handler for `WORKSPACE_SYMBOLS` and verifies it accepts query-only input and rejects empty queries. **2. No test for `client.py` capability negotiation changes** - **File:** `src/cleveragents/lsp/client.py`, lines 235–268 - **Problem:** The `initialize()` payload now advertises all 11 capabilities, but no test validates the payload contents. Since these are static hardcoded fields, regression risk is low, but coverage would be nice. - **Suggestion:** If feasible, a scenario using a mock transport to capture and assert the initialize payload would harden this. **3. Error handling inconsistency in `_make_runtime_handler`: dict vs exception** - **File:** `src/cleveragents/lsp/tool_adapter.py`, lines 127–133 vs 136–137 - **Problem:** Missing required params return `{"error": ...}` dicts, while unimplemented capabilities raise `LspNotAvailableError`. Callers must handle both. This is a pre-existing pattern that the new `workspace_symbols` code follows consistently. - **Suggestion:** Consider standardizing in a future cleanup pass. **4. `_CAPABILITY_TOOL_MAP.get()` fallback silently masks missing map entries** - **File:** `src/cleveragents/lsp/tool_adapter.py`, lines 202–205 - **Problem:** The `.get()` with a fallback tuple provides a silent default for missing capabilities. Since `_input_schema_for()` would catch unknown capabilities with `ValueError` anyway, this is a safety-net gap rather than a bug. - **Suggestion:** Consider direct indexing `_CAPABILITY_TOOL_MAP[capability]` for clearer error messages. **5. No `maxLength` constraint on `query` and `new_name` schema fields** - **File:** `src/cleveragents/lsp/tool_adapter.py`, lines 308–321 - **Problem:** The `workspace_symbols` `query` and `rename` `new_name` string fields have no length bounds. Currently all handlers raise `LspNotAvailableError`, so there's no runtime risk, but setting limits now establishes the correct API contract for when these are wired to real LSP servers. - **Suggestion:** Add `"maxLength": 1000` to `query` and `"maxLength": 256` to `new_name`. **6. Function-level imports in step definition file** - **File:** `features/steps/lsp_capability_enum_steps.py`, lines 54 and 168 - **Problem:** `_STUBBED_CAPABILITIES` and `StrEnum` are imported inside function bodies. CONTRIBUTING.md requires top-of-file imports. - **Suggestion:** Move both imports to the top of the file. **7. `workspace` capability negotiation sends empty `symbolKind` object** - **File:** `src/cleveragents/lsp/client.py`, line 268 - **Problem:** `"symbol": {"symbolKind": {}}` is technically correct per LSP spec (server falls back to defaults), but explicitly declaring `valueSet` would harden the contract. - **Suggestion:** Populate with `{"valueSet": list(range(1, 27))}`. ### Nits **1. Markdown table misalignment in `docs/reference/lsp.md`** - **File:** `docs/reference/lsp.md`, line 35 — `WORKSPACE_SYMBOLS` row missing trailing space before `|`. **2. No assertion on `additionalProperties: false` in schema tests** - **File:** `features/lsp_capability_enum.feature` — code adds `"additionalProperties": False` to every schema but no test validates it. **3. Schema tests validate `required` but not `properties` content** - **File:** `features/steps/lsp_capability_enum_steps.py`, lines 122–135 — steps only check `required` array, never verify property definitions exist with correct types. **4. `# type: ignore[arg-type]` in negative test** - **File:** `features/steps/lsp_capability_enum_steps.py`, line 175 — the 22 `[attr-defined]` suppressions follow the systemic Behave pattern (770+ project-wide), but this single `[arg-type]` is unique. Consider `cast()` or a documenting comment. ### Summary The PR delivers on all ticket requirements: the `LspCapability` enum has all 11 spec-defined values, the tool adapter generates specs for all capabilities with correct suffixes, capability negotiation is implemented, and documentation is updated. The code is clean, well-structured, and follows project conventions. All findings from two prior review rounds have been addressed. The remaining suggestions focus on test coverage for new behavioral code paths and minor hardening — all deferrable at the author's discretion.
hamza.khyari force-pushed feature/lsp-capability-enum from 656dc1aedd
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 20s
CI / lint (pull_request) Successful in 3m19s
CI / quality (pull_request) Successful in 3m43s
CI / typecheck (pull_request) Successful in 3m58s
CI / security (pull_request) Successful in 4m13s
CI / unit_tests (pull_request) Successful in 7m7s
CI / integration_tests (pull_request) Successful in 7m9s
CI / docker (pull_request) Successful in 1m15s
CI / e2e_tests (pull_request) Successful in 9m6s
CI / coverage (pull_request) Successful in 11m19s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Failing after 30m42s
to c30712da38
Some checks are pending
CI / benchmark-publish (pull_request) Waiting to run
CI / build (pull_request) Successful in 17s
CI / lint (pull_request) Successful in 3m39s
CI / quality (pull_request) Successful in 3m40s
CI / typecheck (pull_request) Successful in 3m59s
CI / benchmark-regression (pull_request) Waiting to run
CI / security (pull_request) Successful in 4m26s
CI / unit_tests (pull_request) Successful in 6m59s
CI / integration_tests (pull_request) Successful in 6m57s
CI / docker (pull_request) Successful in 1m18s
CI / e2e_tests (pull_request) Successful in 12m1s
CI / coverage (pull_request) Successful in 11m48s
CI / status-check (pull_request) Successful in 4s
2026-03-27 10:53:11 +00:00
Compare
hamza.khyari dismissed hurui200320's review 2026-03-27 10:53:11 +00:00
Reason:

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

hamza.khyari scheduled this pull request to auto merge when all checks succeed 2026-03-27 11:07:22 +00:00
hamza.khyari canceled auto merging this pull request when all checks succeed 2026-03-27 11:09:21 +00:00
hamza.khyari force-pushed feature/lsp-capability-enum from c30712da38
Some checks are pending
CI / benchmark-publish (pull_request) Waiting to run
CI / build (pull_request) Successful in 17s
CI / lint (pull_request) Successful in 3m39s
CI / quality (pull_request) Successful in 3m40s
CI / typecheck (pull_request) Successful in 3m59s
CI / benchmark-regression (pull_request) Waiting to run
CI / security (pull_request) Successful in 4m26s
CI / unit_tests (pull_request) Successful in 6m59s
CI / integration_tests (pull_request) Successful in 6m57s
CI / docker (pull_request) Successful in 1m18s
CI / e2e_tests (pull_request) Successful in 12m1s
CI / coverage (pull_request) Successful in 11m48s
CI / status-check (pull_request) Successful in 4s
to 6a8f724299
All checks were successful
CI / build (pull_request) Successful in 18s
CI / security (pull_request) Successful in 58s
CI / lint (pull_request) Successful in 3m19s
CI / typecheck (pull_request) Successful in 3m54s
CI / quality (pull_request) Successful in 3m55s
CI / integration_tests (pull_request) Successful in 6m49s
CI / unit_tests (pull_request) Successful in 7m3s
CI / docker (pull_request) Successful in 1m6s
CI / e2e_tests (pull_request) Successful in 11m45s
CI / benchmark-publish (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 12m52s
CI / status-check (pull_request) Successful in 2s
CI / benchmark-regression (pull_request) Successful in 58m46s
2026-03-27 11:11:11 +00:00
Compare
hamza.khyari scheduled this pull request to auto merge when all checks succeed 2026-03-27 11:12:02 +00:00
hamza.khyari scheduled this pull request to auto merge when all checks succeed 2026-03-27 11:21:00 +00:00
hamza.khyari deleted branch feature/lsp-capability-enum 2026-03-27 12:14:23 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 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!1063
No description provided.