Handle malformed language-server messages without losing healthy documents
A malformed request resets the whole server and loses open buffers. Isolate parsing and protocol failures.
- Focused work estimate
- 2h 30m + prerequisites
- Priority in the scenario
- High
- Engineering practice
- Error isolation · Input security
Estimated field mix
- Compiler and language tooling60%
- Security40%
Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.
Review it, then add it to your workspace.
The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.
Project context
Fictional config editor Hazel speaks a bounded subset of the Language Server Protocol through a local transport adapter. Use a tiny declared configuration grammar and synthetic documents.
Setup prerequisites
- Define the supported protocol subset and configuration grammar.
- Create synthetic open/change/close messages and workspace fixtures.
Preceding work
Complete these dependencies, or supply their agreed outputs before taking this ticket.
- CLSP-101 · Reject configuration edits for unopened language-server documents
- CLSP-102 · Convert language-server positions using a declared encoding
- CLSP-103 · Apply configuration document edits in the supplied version order
- CLSP-104 · Publish configuration diagnostics for the checked document version
- CLSP-105 · Complete configuration keys only within valid assignment contexts
- CLSP-106 · Return configuration rename edits only for resolved local bindings
- CLSP-107 · Attach expected document versions to configuration code actions
- CLSP-108 · Cancel language-server requests without leaking pending work
Acceptance criteria
- Invalid message gets bounded error
- Healthy documents remain intact
- Transport stays usable when framing permits
Implementation constraints
- Never log full document contents on parse failure.
Verification to include
- Send valid request after malformed one
- Send oversized message
Deliverables
- Protocol error boundary and cases
Rollout and recovery
Close only the offending transport when framing is unrecoverable.
Value of the work
For the engineer: Practice protocol ordering and document-safe editing.
For the team: Inspect whether editor assistance preserves current user text and file boundaries.
Evidence boundaries
Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.
Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.