# tools-debug

Decision: OMP-port-backlog, fail-closed locally. Real debugger behavior belongs to OMP DAP `debug`; the local Node subprocess wrapper is removed.

## Current Local State

- `extensions/tools-debug/index.ts` registers `debug`.
- `debug sessions` returns a report-only result.
- `debug launch`, `attach`, `set_breakpoint`, `continue`, `pause` and `terminate` return `isError=true` with `owner: "omp-debug-dap"` and `ported: false`.
- The extension no longer imports `spawn`, no longer calls `process.execPath`, no longer stores a module-level debug session and no longer emits `debug:*` dev events.
- `extensions/tools-debug/manifest.json` no longer claims filesystem or subprocess permissions.
- The extension is disabled by default through `package.json#pi.extensions`.

## OMP Source Evidence

- `/tmp/oh-my-pi-review/packages/coding-agent/src/tools/debug.ts` defines the OMP DAP `debug` tool, action schema, readonly vs exec actions, renderers and tool details.
- `/tmp/oh-my-pi-review/packages/coding-agent/src/prompts/tools/debug.md` documents the debugger user/model contract.
- `/tmp/oh-my-pi-review/packages/coding-agent/src/dap/session.ts` owns DAP session lifecycle, launch/attach, configurationDone, breakpoints, request dispatch, output and teardown.
- `/tmp/oh-my-pi-review/packages/coding-agent/src/dap/config.ts` owns adapter discovery and selection, including `debugpy`, `gdb`, `lldb-dap` and `dlv`.
- `/tmp/oh-my-pi-review/packages/coding-agent/test/debug/dap-launch-failures.test.ts` covers launch/attach failure handling and adapter diagnostics.

## Boundary

Do not re-enable local subprocess launch as a debug substitute. Future `miloc-pi` debug behavior must be a dedicated OMP-backed plugin or thin wrapper around OMP DAP semantics.

The future implementation must account for:

- adapter discovery and missing-adapter errors;
- launch and attach approval tiers;
- real breakpoint mutation;
- flow control and pause;
- stack, thread, scope and variable inspection;
- captured output and renderer behavior;
- cleanup of DAP adapter and debuggee processes.

## License And Attribution

No OMP code was copied into this extension in this slice. If a future plugin ports OMP DAP code, that subtask must record exact source files, symbols and license/attribution decisions.
