UAT Bug: LSP context enrichment (lsp_context_enrichment) defined in actor schema but never wired to ACMS hot context injection #2944

Open
opened 2026-04-05 02:54:00 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/lsp-context-enrichment-acms-wiring
  • Commit Message: fix(lsp): wire lsp_context_enrichment config to ACMS hot context injection
  • Milestone: v3.6.0
  • Parent Epic: #824

Background

During UAT testing of the LSP Integration feature area, it was discovered that the lsp_context_enrichment field on ActorConfigSchema is entirely dead code. The schema model (LspContextEnrichment) is defined and validated, but no runtime code ever reads it to inject LSP diagnostics or type annotation data into the ACMS "hot context" tier.

Per the specification, when an actor has lsp_context_enrichment configured (with diagnostics: true and/or type_annotations: true), the LSP runtime must automatically inject LSP diagnostics and type annotation data into the ACMS hot context tier, giving the actor passive semantic awareness of the code state without requiring an explicit tool call.

Affected locations:

  • Schema definition (exists, correct): src/cleveragents/actor/schema.pyLspContextEnrichment class and ActorConfigSchema.lsp_context_enrichment field
  • Missing integration: No file in src/cleveragents/application/services/ reads lsp_context_enrichment
  • Missing integration: No file in src/cleveragents/acms/ contains LSP data injection logic
  • Missing integration: src/cleveragents/lsp/runtime.py has no method to push diagnostics/type annotations to ACMS

Steps to reproduce:

  1. Create an actor YAML with lsp_context_enrichment: {diagnostics: true}
  2. Bind an LSP server and start it
  3. Observe that no diagnostic data appears in the ACMS context — enrichment never occurs

Subtasks

  • Write a failing Behave scenario (TDD) that reproduces the bug: actor with lsp_context_enrichment: {diagnostics: true} bound to a running LSP server does NOT produce diagnostic entries in the ACMS hot context tier
  • Write a failing Behave scenario for type_annotations: true enrichment path
  • Add a push_diagnostics_to_acms method (or equivalent) to LspRuntime in src/cleveragents/lsp/runtime.py that reads the actor's lsp_context_enrichment config and injects diagnostics into the ACMS hot context tier
  • Add a push_type_annotations_to_acms method (or equivalent) to LspRuntime for the type_annotations enrichment path
  • Wire the enrichment call into the ACMS pipeline (e.g., acms_pipeline.py or a new LSP enrichment plugin) so that LSP data is injected when the hot context tier is assembled
  • Respect max_diagnostics_per_file cap from LspContextEnrichment config when injecting diagnostics
  • Ensure lsp_context_enrichment: null (or field absent) results in no LSP injection (no regression)
  • Add mock LSP server and mock ACMS context in features/mocks/ as needed
  • Ensure all new code is fully statically typed and passes nox -e typecheck
  • Confirm all Behave scenarios pass via nox -e unit_tests
  • Confirm coverage remains ≥ 97% via nox -e coverage_report

Definition of Done

  • A failing Behave test reproducing the bug exists and is merged before the fix (TDD workflow)
  • LspRuntime exposes methods to push diagnostics and type annotations into ACMS
  • The ACMS pipeline (or a registered plugin) calls the LSP enrichment when lsp_context_enrichment is configured on the active actor
  • max_diagnostics_per_file is respected during injection
  • No LSP injection occurs when lsp_context_enrichment is null or absent
  • All new and modified code is fully statically typed with no # type: ignore suppressions
  • All nox stages pass (nox -e lint, nox -e typecheck, nox -e unit_tests, nox -e integration_tests, nox -e coverage_report)
  • Coverage >= 97%
  • Commit is created with message fix(lsp): wire lsp_context_enrichment config to ACMS hot context injection on branch fix/lsp-context-enrichment-acms-wiring with footer ISSUES CLOSED: #<this issue>
  • Corresponding Pull Request is merged

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/lsp-context-enrichment-acms-wiring` - **Commit Message**: `fix(lsp): wire lsp_context_enrichment config to ACMS hot context injection` - **Milestone**: v3.6.0 - **Parent Epic**: #824 ## Background During UAT testing of the LSP Integration feature area, it was discovered that the `lsp_context_enrichment` field on `ActorConfigSchema` is entirely dead code. The schema model (`LspContextEnrichment`) is defined and validated, but no runtime code ever reads it to inject LSP diagnostics or type annotation data into the ACMS "hot context" tier. Per the specification, when an actor has `lsp_context_enrichment` configured (with `diagnostics: true` and/or `type_annotations: true`), the LSP runtime must automatically inject LSP diagnostics and type annotation data into the ACMS hot context tier, giving the actor passive semantic awareness of the code state without requiring an explicit tool call. **Affected locations:** - Schema definition (exists, correct): `src/cleveragents/actor/schema.py` — `LspContextEnrichment` class and `ActorConfigSchema.lsp_context_enrichment` field - Missing integration: No file in `src/cleveragents/application/services/` reads `lsp_context_enrichment` - Missing integration: No file in `src/cleveragents/acms/` contains LSP data injection logic - Missing integration: `src/cleveragents/lsp/runtime.py` has no method to push diagnostics/type annotations to ACMS **Steps to reproduce:** 1. Create an actor YAML with `lsp_context_enrichment: {diagnostics: true}` 2. Bind an LSP server and start it 3. Observe that no diagnostic data appears in the ACMS context — enrichment never occurs ## Subtasks - [ ] Write a failing Behave scenario (TDD) that reproduces the bug: actor with `lsp_context_enrichment: {diagnostics: true}` bound to a running LSP server does NOT produce diagnostic entries in the ACMS hot context tier - [ ] Write a failing Behave scenario for `type_annotations: true` enrichment path - [ ] Add a `push_diagnostics_to_acms` method (or equivalent) to `LspRuntime` in `src/cleveragents/lsp/runtime.py` that reads the actor's `lsp_context_enrichment` config and injects diagnostics into the ACMS hot context tier - [ ] Add a `push_type_annotations_to_acms` method (or equivalent) to `LspRuntime` for the `type_annotations` enrichment path - [ ] Wire the enrichment call into the ACMS pipeline (e.g., `acms_pipeline.py` or a new LSP enrichment plugin) so that LSP data is injected when the hot context tier is assembled - [ ] Respect `max_diagnostics_per_file` cap from `LspContextEnrichment` config when injecting diagnostics - [ ] Ensure `lsp_context_enrichment: null` (or field absent) results in no LSP injection (no regression) - [ ] Add mock LSP server and mock ACMS context in `features/mocks/` as needed - [ ] Ensure all new code is fully statically typed and passes `nox -e typecheck` - [ ] Confirm all Behave scenarios pass via `nox -e unit_tests` - [ ] Confirm coverage remains ≥ 97% via `nox -e coverage_report` ## Definition of Done - [ ] A failing Behave test reproducing the bug exists and is merged before the fix (TDD workflow) - [ ] `LspRuntime` exposes methods to push diagnostics and type annotations into ACMS - [ ] The ACMS pipeline (or a registered plugin) calls the LSP enrichment when `lsp_context_enrichment` is configured on the active actor - [ ] `max_diagnostics_per_file` is respected during injection - [ ] No LSP injection occurs when `lsp_context_enrichment` is `null` or absent - [ ] All new and modified code is fully statically typed with no `# type: ignore` suppressions - [ ] All nox stages pass (`nox -e lint`, `nox -e typecheck`, `nox -e unit_tests`, `nox -e integration_tests`, `nox -e coverage_report`) - [ ] Coverage >= 97% - [ ] Commit is created with message `fix(lsp): wire lsp_context_enrichment config to ACMS hot context injection` on branch `fix/lsp-context-enrichment-acms-wiring` with footer `ISSUES CLOSED: #<this issue>` - [ ] Corresponding Pull Request is merged --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.6.0 milestone 2026-04-05 02:54:07 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Confirmed
  • MoSCoW: Should Have

Valid finding verified during batch triage.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Confirmed - **MoSCoW**: Should Have Valid finding verified during batch triage. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#824 Epic: LSP Functional Runtime
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#2944
No description provided.