Repository navigation
Description
结论
OMP 的 DAP debugger 是 OpenPI 当前没有的高阶功能:模型可以 launch/attach、断点、step、读取 stack/scope/variables、evaluate,甚至使用 instruction/data breakpoint 和 memory 操作。
这对难以靠日志与测试定位的 runtime bug 可能有显著价值,但完整 DAP Runtime 的 adapter、进程树、暂停状态和权限面很重。OpenPI 应先按 failure class 做 paired benchmark,确定哪些问题真正需要 debugger,再决定它属于 Pi core、独立 package 还是按需 OpenPI capability。
这是 #45 的具体拆分。
对比证据
固定审查点:
OMP DAP 工具覆盖 launch/attach、source/function/instruction/data breakpoints、continue/step/pause、stack/scopes/variables/evaluate、memory/disassemble/modules/custom request 等操作。OMP debug surface
读状态与执行动作采用不同 approval;tool discoverable,debug setting 默认开启。OMP output/approval
Runtime 管理一个 root DAP tree,处理 adapter spawn/socket、child debug session、breakpoint 同步、stop event、timeout 与完整 tree terminate。OMP lifecycle
OMP 内置多种 adapter 定义并自动选择,但只使用当前可解析的命令。OMP adapters
OpenPI 当前普通路径依赖 Pi read/bash/edit/write 和项目测试,没有 debugger capability。OpenPI native path
需要回答的问题
- 哪些 failure class 用 debugger 明显优于日志、测试、临时 instrumentation?
- 模型能否稳定维护 stopped thread/frame/scope identity,还是容易对 stale id 操作?
- launch/attach、read state、evaluate、memory write、custom request 应如何分级权限?
- debuggee、adapter、child process tree 由哪个 Session/cwd 拥有?
- pause/step timeout 后,目标是 running、stopped 还是 uncertain,如何证明?
- Session switch、cancel、shutdown 时如何清理,不误杀用户已有进程?
- attach 到现有 PID 是否应完全排除首版?
- debugger 是否应是 Skill 驱动的临时外部工具,而非 OpenPI package-owned surface?
建议 benchmark
选择可复现的 failure classes:
- 并发竞态或事件顺序;
- 只在运行时状态出现的错误;
- 多层调用栈数据污染;
- child process 问题;
- 普通单元测试已能清楚定位的对照组。
比较:
- A:tests + logs + temporary instrumentation
- B:同模型 + 最小 read-oriented DAP
- C:同模型 + full stepping/evaluate
记录成功率、定位时间、tool calls、tokens、代码污染、stale-state 操作、adapter 启动失败、取消/清理和不同模型能力曲线。
最小原型边界
只有 B 对特定 failure class 有稳定收益后:
- 只接已安装 adapter;
- 明确 intent 后加载;
- 首版 launch only,不 attach 用户进程;
- 首版只开放 threads/stack/scopes/variables/output/continue/terminate;
- evaluate、memory write、custom request 后置;
- 单 Session 单 root tree;
- 所有状态带 session/generation/thread/frame identity;
- terminate 给出完整或 uncertain receipt。
验收标准
- failure-class paired benchmark
- 证明 debugger 不只是“看起来高级”
- read/exec/memory mutation 权限分层
- stale thread/frame/scope fail closed
- timeout/cancel/shutdown 后状态可证明
- 不误杀 pre-existing process
- 普通 turn 零 schema 与进程税
- 明确最终归属或不采用
Activity
627150795 commentedon Aug 29, 2026
I am taking a focused research slice: turn the proposed failure-class comparison of on-demand DAP versus logs/tests into a reproducible benchmark protocol. This pass will not add a debugger dependency, DAP runtime, or claim experimental results.
627150795 commentedon Aug 29, 2026
I opened #264 (#264) for the focused research slice. It defines a failure-class benchmark for logs/tests versus on-demand DAP, including fixed arms, diagnosis rubric, overhead, false leads, adapter failures, cleanup, and side-effect limits. The docs checks passed:
git diff --check,bun run lint, andbun run typecheck. It contains no DAP runtime or experimental result.tt-a1i commentedon Sep 8, 2026
补充 2026-09-08 社区源码调研:找到了可以承接本 Issue 实验的 Pi 原生 DAP 包,不必先运行整个 OMP。OpenPI 本次基线为
ed9dbc1。以下是源码检查,未安装插件、启动调试器或验证修复收益。候选为
trotsky1997/pi-lsp-extension的lsp-pi1.0.5,固定39d56f0。manifest 直接声明 Pi extensions,其中包含debug.ts;文件开头 明确说明移植 OMP DAP engine,并换成适合 Pi terminal/RPC 的纯文本呈现。它因此是可单独研究的 Pi package,而非把 OMP fork 当插件。可学习的是:一次 launch 后跨调用保留调试状态;stack/scopes/variables/output 给出可检查事实;每次请求 合并调用方取消信号和有上限的 timeout,结果包含状态快照。适配器需自行安装。
当前仍不能直接作为 OpenPI 推荐安装项。 manifest 依赖旧
@mariozechnerPi^0.66.0,兼容本次运行时尚未验证。一个debugschema 同时开放 attach、evaluate、变量/内存写入及 custom request;getDapSessionManager是全局 singleton,并被立即导出,debug.ts未绑定 Pi Session 生命周期。不能据此假定多个 parent/child Session 有独立调试目标和清理归属。manifest 声明 MIT,但仓库树未发现 LICENSE,复制前还需确认完整许可与归属声明。建议把这个候选加入原有 failure-class 实验:先固定兼容版本,仅 launch 自有 fixture,开放 stack/scopes/variables/output/continue/terminate;attach、evaluate、内存写入和 raw request 后置。先证明取消、Session 关闭和异常退出后的目标状态,再比较日志/测试基线。它降低了实验实现成本,尚未证明 debugger 值得进入 OpenPI 默认能力面。
研究记录:Pi 社区能力研究与候选清单(2026-09-08)。源码证据、运行验证与采用决策分别记录。
tt-a1i commentedon Sep 9, 2026
补充 2026-09-09 源码调研(未
pi install、未启动 adapter、未 attach/launch debuggee、未跑 failure-class)。本地记录:docs/research/EXPERIMENT_DAP_DEBUG_2026-09-09.md(尚未入库)。OpenPI 对照仍是a9b40f0。官方 Pi 没有 DAP。
v0.85.1/ clone6160683工具闭集仍是read|bash|powershell|edit|write|grep|find|ls。隐藏/debug只写pi-debug.log,不是 debugger。LSP(#163)也不是 DAP。09-08 只钉了
lsp-pigit。本轮 npm/GitHub 又钉到四个真 Pi-native DAP 包,外加 OMP 内建 28-action 面(Hard-OMP,不能pi install):@ian-pascoe/pi-dapee30b36session_start/session_shutdown、12 个 operation 的缝。V1 仍含evaluate。@piex-dev/dap5cd4467debug+ attach / evaluate /write_memory/custom_request;模块 singleton。pi-engineering-servicesa3832c8@devinat1/pi-debuggerdebug_*;port/PID attach;加载即 editor bridge。lsp-pi5590a3b不含debug.ts;git39d56f0有 35-actiondebugpi install npm:lsp-pi按已发布 manifest 没有 DAP。名叫 debug 但不是 DAP 的:
pi-debug-mode(探针工作流)、pi-flutter-run(Dart VM)、pi-browser-debug(Playwright)。不要并进本 Issue。当前仍不能推荐安装,也不该先自研 runtime。 第三方扩展会被本 checkout 的
createChildResources装进 child(只滤pi-intercom)。attach / evaluate / memory / custom request 是高特权;第一版按正文排除 attach。可学的形状停在 ian-pascoe:预装 adapter、launch-only、单 Session 单树、有界输出。#264 协议仍 CLOSED 未合并。先证明取消/shutdown 后的目标状态和 A vs B,再谈 OpenPI capability。tt-a1i commentedon Sep 9, 2026
补充 2026-09-09 单包深读(未
pi install、未npm install、未启动 adapter、未 launch/attach debuggee、未跑包测试)。不重开目录。本地记录:docs/research/EXPERIMENT_PI_DAP_LAUNCH_2026-09-09.md(尚未入库)。OpenPI 对照仍是a9b40f0。钉住
@ian-pascoe/pi-dap0.3.2:npm tarball shasum36053a2bf8b782c7cb775e50a3f01ad1f79af8de;gitpackages/pi-dapee30b36。src// README / LICENSE / skill 与 tarball 字节一致。测试、ADR、vscode-js-debugintegration 不进 npm(14 files)。文件级(相对 09-09 目录评论多出来的):
packages/pi-dap/src/**零"attach"字面量。模型面只有dap,12-op TypeBox 闭集,additionalProperties: false。dap-tool.test.ts把{ operation: "attach" }标成 schema 失败。协议启动只有request("launch", …)。pi-dap-extension.ts:加载即registerTool;session_start才new DapSession(仍不 spawn);session_shutdown先session.shutdown()再删pi-dap-*。每份 ExtensionAPI 一份 controller,不是globalThissingleton。evaluate发context: "repl";另有 step/pause/breakpoints。没有独立的 threads/scopes/output op。没有 generation 身份,只有 last-stopthreadId+ 模型回传的 frame/ref。runInTerminal会 spawn;startDebugging只放行 一条 js-debug 主目标且request: "launch"。其它拒绝。Launch Profilearguments是 opaque JSON——挡住的是 attach 工具/请求,不是受信任 settings 里的任意可执行文件。disconnect({ terminateDebuggee: true })+ Linux process group;非 Linux 只child.kill。README 的 V1 写的是 Linux。createChildResources只滤pi-intercom。CHILD_EXCLUDED_TOOL_NAMES没有dap。漂移守卫是双向的——今天把"dap"写进排除表会因为本包未注册该名而失败。用户自装则 Direct/Workflow child 会得到工具 和pi-dapskill(print-mode 不挂 Observer,但不挡execute)。要堵应做资源过滤,不要破坏守卫。仍不推荐安装,也不该整包 Adopt / 先自研 runtime。可学的是 Session 生命周期、launch-only 构造、Trust 门、有界 spill。OpenPI 若将来自有注册:不要用工具名
dap(撞用户自装包);一律 parent-only;evaluate/attach/runInTerminal 首版不注册。#264 协议仍 CLOSED。先臂 A,再谈 capability。tt-a1i commentedon Sep 9, 2026
补充 2026-09-09 发布身份复验(仍未
pi install、未当 live Pi package 运行、未启动 adapter)。不重开目录,不重述上一则文件级深读。本地记录仍是docs/research/EXPERIMENT_PI_DAP_LAUNCH_2026-09-09.md。钉住 0.3.2 @
52de485,不是把 HEAD 当成 gitHead。npm view @ian-pascoe/[email protected] gitHead为空。SLSA provenancedigest.gitCommit、Actions run34214804650、git tag@ian-pascoe/[email protected]三者都是52de485。tarball shasum 仍是36053a2bf8b782c7cb775e50a3f01ad1f79af8de。monorepo HEADee30b36更新,但packages/pi-dap相对52de485无 diff。#163 ≠ 本 Issue。
lsp_diagnostics在 OpenPIa9b40f0/origin/main0d17f45/v0.8.1都是空集(见EXPERIMENT_LSP_163_ABSENCE_2026-09-09.md)。那是语言服务器诊断,不是 debugger。本包不注册lsp_*。不要用 Lens 或@ian-pascoe/pi-dap替 #163 交差,也不要用「缺 LSP」当「该装 DAP」的理由。本则不评论 #163。用户自装仍会漏进 child(双 SHA)。
a9b40f0只滤pi-intercom路径;0d17f45的blockedPackageSources仍只认 intercom。不能把"dap"写入双向CHILD_EXCLUDED。泄漏/过滤留在 #169。仍不推荐安装,也不该整包 Adopt。可学件仍是 launch-only 生命周期(Session 身份、构造排除 attach、
session_shutdown清自己的树)。#264 协议仍 CLOSED。先臂 A。