# Source audit: tools-lsp

Decision: OMP-port-backlog, fail-closed locally. Real code intelligence belongs to OMP LSP stack; the old local regex/file-scan helper is removed because it was not a language-server surface.

Current local state:

- `extensions/tools-lsp/index.ts` registers OMP-shaped `lsp`.
- Every action returns `isError=true` until the OMP LSP backend is ported.
- The extension no longer reads project files, scans regex references, emits `lsp:*` dev events, or claims `language-server-allowlist` subprocess permission.
- The extension is disabled by default through `package.json#pi.extensions`.

OMP source evidence:

- `/tmp/oh-my-pi-review/packages/coding-agent/src/lsp/index.ts` owns `LspTool`, approval tier separation, warmup/status, diagnostics, definition, type_definition, implementation, references, hover, symbols, rename, rename_file, code_actions, reload, capabilities, and raw request routing.
- `/tmp/oh-my-pi-review/packages/coding-agent/src/lsp/types.ts` owns the OMP `lspSchema`, action list, params, `LspToolDetails`, LSP protocol types, diagnostics, workspace edits, code actions, and symbols.
- `/tmp/oh-my-pi-review/packages/coding-agent/src/lsp/client.ts` owns JSON-RPC client lifecycle, capabilities, diagnostics publication, file sync, server process handling, idle shutdown, and workspace edit notifications.
- `/tmp/oh-my-pi-review/packages/coding-agent/src/lsp/config.ts` owns default/user/plugin server config loading, local binary resolution, root marker detection, and runtime client defaults.
- `/tmp/oh-my-pi-review/packages/coding-agent/src/lsp/edits.ts` owns text edit and workspace edit application.
- `/tmp/oh-my-pi-review/packages/coding-agent/src/lsp/render.ts` and `/tmp/oh-my-pi-review/packages/coding-agent/src/lsp/utils.ts` own user-facing formatting, location context, symbol resolution, diagnostics formatting, code action formatting, and URI/path helpers.
- `/tmp/oh-my-pi-review/packages/coding-agent/src/prompts/tools/lsp.md` documents the expected user contract and warns that LSP should be preferred for symbol-aware rename/references/code actions when available.

Implementation boundary:

- Do not reintroduce regex diagnostics/references as `lsp`.
- Do not enable this extension until it uses real LSP clients or an OMP wrapper.
- Any future write-capable action must preserve OMP approval tier behavior and workspace edit safeguards.

License note: OMP files are source evidence for the future port. No OMP implementation code was copied in the fail-closed slice.
