You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
code-intelligence: 研究按需加载的 Pi-native LSP 能力,而不是常驻第二套 IDE Runtime #163
I am taking a focused first pass on this issue: document a Pi-native, on-demand LSP capability contract with explicit loading, read/write boundaries, session ownership, and fail-closed behavior. This pass will be docs/design-only and will not add an LSP runtime or dependency.
I opened #259 (#259) for the focused first pass I claimed here. Scope: docs/design contract for explicit on-demand LSP loading, Session/workspace ownership, read/write boundaries, cancellation, cleanup, bounded output, trust, and fail-closed behavior. Validation passed: git diff --check, bun run lint, and bun run typecheck. This is intentionally docs-only and does not claim an LSP runtime is implemented or close this Issue automatically.
2026-09-09 dual-SHA absence check (source read only; no pi install, no language server, no model, no paid cell). Record: docs/research/EXPERIMENT_LSP_163_ABSENCE_2026-09-09.md. Does not change this Issue’s direction. No new Issue.
Pinned revisions
this checkout a9b40f0044ee59c360a6077c1c0bdbdbd30da10b (package 0.4.0)
published tag v0.8.1 → a3edee28fec813582db6b3b1341754cef4597f81
On all three, git grep -i -E 'lsp_diagnostics|lsp_goto|registerTool.*lsp' is empty (including docs/). OPENPI_CAPABILITY_GROUPS is still search | delegate | workflow | background | session — no codeIntel / lsp. CHILD_SAFE_PACKAGE_TOOL_NAMES is still fd / rg / git_show / git_diff / git_log (child-session.ts 25–31 on a9b40f0; 35–41 on 0d17f45). No extensions/lsp directory. Closed unmerged #259’s contract file is not in either tree. The Issue’s own baseline 2a69d3f is also empty for lsp_diagnostics.
So #163 is still an OPEN pilot ticket, not a live tool on this checkout or on origin / published 0.8.1.
Q2 cannot be scored on these SHAs. Arm A (preloaded fd/rg) can still collect locate / mis-edit baselines. B_lsp = A + OpenPI-owned lsp_diagnostics does not exist here. Starting A vs B_lsp now is infra_failed / campaign-blocked, not “LSP had no gain” and not “the model chose not to call it.” bash tsc is a different treatment. Do not pi install Lens / @narumitw/pi-lsp / pi-lsp-client to invent a tool: that bypasses the capability gate, brings mutation / resident schema / child leakage, and is not this package’s lsp_diagnostics. Formal candidate repos must strip docs/research/ or the notes leak the empty-grep gold.
Pilot shape if it lands later: OpenPI-owned, capability-gated, mutation-off, at most 1–3 read-only tools (lsp_diagnostics first). Classify at the child boundary the same revision it registers. Do not vendor Lens. Do not build a language-server OS (mux, auto-install, /lsp-setup).
Activity
627150795 commentedon Aug 28, 2026
I am taking a focused first pass on this issue: document a Pi-native, on-demand LSP capability contract with explicit loading, read/write boundaries, session ownership, and fail-closed behavior. This pass will be docs/design-only and will not add an LSP runtime or dependency.
627150795 commentedon Aug 29, 2026
I opened #259 (#259) for the focused first pass I claimed here. Scope: docs/design contract for explicit on-demand LSP loading, Session/workspace ownership, read/write boundaries, cancellation, cleanup, bounded output, trust, and fail-closed behavior. Validation passed:
git diff --check,bun run lint, andbun run typecheck. This is intentionally docs-only and does not claim an LSP runtime is implemented or close this Issue automatically.tt-a1i commentedon Sep 8, 2026
补充 2026-09-08 社区源码调研:这个 Issue 现在可以用更小的 Pi 原生包作为对照。OpenPI 本次基线为
ed9dbc1。以下只完成固定源码检查,没有安装插件、启动语言服务器或测量模型收益。优先考察
@narumitw/pi-lsp0.49.7 的单请求生命周期。 在09d0f4d,每个ctx.sessionManager有独立 scope 和 generation;Session 切换、关闭时先取消旧操作,再等待它们结束。LspSessionScope在通知取消前发布关闭状态,并拒绝取消后返回的结果。runner 为请求创建 client,在 finally 中 shutdown,清理失败会向调用方报错;client 等待进程退出,必要时从 SIGTERM 升级到 SIGKILL。它只有 diagnostics/fix 两个工具,fix 默认
write=false,不自动安装服务器。这使“现成服务器、只开放 diagnostics”的实验更具体。不过,两工具仍在加载时注册;每次冷启动可能昂贵;该包不提供 definition/references,不能作为完整导航方案。共享池的对照可选
code-yeongyu/pi-lsp-client。1c981df的 manager 区分 refCount 与初始化等待者,提供空闲回收和状态快照。但 factory 注册六工具及自动 post-edit diagnostics,并从 Session shutdown 释放默认全局 manager;OpenPI 同进程多 Session 的归属关系仍需验证。建议先比较两种生命周期的冷/热延迟、诊断有效性、取消后的迟到结果和进程清理,再评估工具调用及 token 收益;不要先建设共享 daemon。路径、Trust、服务器自身行为及 child 分类仍是独立验收项,上述源码机制不能代替兼容性证明。
研究记录:Pi 社区能力研究与候选清单(2026-09-08)。源码证据、运行验证与采用决策分别记录。
tt-a1i commentedon Sep 8, 2026
2026-09-08 插件目录补一条对照,不改 #163 的方向。
pi-lens(npm 4.1.4,2026-09-07,https://github.com/apmantza/pi-lens)链比@narumitw/pi-lsp(npm 0.49.7)完整(symbol / module report),但默认打开 autofix / format / tests。本轮未安装、未运行任一包。试点若做:mutation-off;不要把 Lens 默认值当 OpenPI 默认。更小的只读对照继续看已有评论里的
pi-lsp。不新开 Issue。目录记录:
docs/research/PI_COMMUNITY_PLUGIN_SURVEY_2026-09-08.md。tt-a1i commentedon Sep 8, 2026
2026-09-08 目录第二轮:AST rewrite 不并进本 Issue。
code-yeongyu/pi-ast-grep(git-only4a7d1be)是结构搜索/替换,不是按需 LSP。若讨论,走 #510。本 Issue 继续 mutation-off 的只读 LSP 试点对照(pi-lsp/pi-lens)。本轮未安装、未运行。
tt-a1i commentedon Sep 9, 2026
2026-09-09 源码实验(只读 clone,未
pi install、未启动语言服务器、未跑模型)。记录:docs/research/EXPERIMENT_CODE_INTEL_2026-09-09.md。不改本 Issue 方向。冻结身份: OpenPI
a9b40f0。官方 Piv0.85.1/ clone6160683——ToolName闭集无 LSP。pi-lensnpm 4.1.59981f9a(09-08 目录是 4.1.4)。@narumitw/pi-lsp0.49.7。pi-lsp-client仍是 git1c981df。pi-ast-grep仍是 git4a7d1be。构造上的 mutation-off(不是 prompt):
tool_result/agent_end钩子,默认开。--no-autoformat --no-autofix是 one-way CLI,高于项目配置;但.pi-lens.json能把全局关掉的 format/autofix 再打开。--no-tests才是 global-only。--no-lens可被/lens-toggle恢复。工具照样注册。lsp_fix.write默认 false、ast_grep_replace默认 dry-run、Lens rename 默认 preview,都还在 schema 里。模型传true就会写。lsp_fix/lsp_rename/ast_grep_replace。不要 hook 自动写盘。不要pi install整包。常驻税: OpenPI 默认仍是零 OpenPI 工具。Lens 加载后至少 8 个 always-active(
docs/agent-tools.md仍写 6;源码另有project_report/effective_config/ loader)+ 默认 context injection。pi-lsp2 个工具(含 fix)。pi-lsp-client6 个工具 + 进程级 singleton 池 + 每个 edit 追加 diagnostics 文本 +/lsp install。原样pi install会绕过 OpenPI capability 门,也会进 child(本包只过滤pi-intercom)。试点(最多 1–3 个 OpenPI 自有工具):
lsp_diagnostics,必要时再加lsp_goto_definition/lsp_find_references。生命周期对照pi-lsp的单请求 spawn/shutdown,不对照 Lens,不先建共享 daemon。AST 仍走 #510;fuzzy/semantic 仍走 #503;symbol_search/module_report不是 LSP。成功/失败证据见该研究记录:正确文件:行、误改率、残留进程、迟到诊断、普通 turn 工具面仍为空、child 看不到未分类名。无 paired evidence 不开实现。
tt-a1i commentedon Sep 9, 2026
2026-09-09 dual-SHA absence check (source read only; no
pi install, no language server, no model, no paid cell). Record:docs/research/EXPERIMENT_LSP_163_ABSENCE_2026-09-09.md. Does not change this Issue’s direction. No new Issue.Pinned revisions
a9b40f0044ee59c360a6077c1c0bdbdbd30da10b(package 0.4.0)origin/main0d17f4577fe31315fe6c95370d251bdb4e2413cf(package 0.8.1)v0.8.1→a3edee28fec813582db6b3b1341754cef4597f81On all three,
git grep -i -E 'lsp_diagnostics|lsp_goto|registerTool.*lsp'is empty (includingdocs/).OPENPI_CAPABILITY_GROUPSis stillsearch | delegate | workflow | background | session— nocodeIntel/lsp.CHILD_SAFE_PACKAGE_TOOL_NAMESis stillfd/rg/git_show/git_diff/git_log(child-session.ts25–31 ona9b40f0; 35–41 on0d17f45). Noextensions/lspdirectory. Closed unmerged #259’s contract file is not in either tree. The Issue’s own baseline2a69d3fis also empty forlsp_diagnostics.So
#163is still an OPEN pilot ticket, not a live tool on this checkout or on origin / published 0.8.1.Q2 cannot be scored on these SHAs. Arm A (preloaded
fd/rg) can still collect locate / mis-edit baselines. B_lsp = A + OpenPI-ownedlsp_diagnosticsdoes not exist here. Starting A vs B_lsp now isinfra_failed/ campaign-blocked, not “LSP had no gain” and not “the model chose not to call it.”bash tscis a different treatment. Do notpi installLens /@narumitw/pi-lsp/pi-lsp-clientto invent a tool: that bypasses the capability gate, brings mutation / resident schema / child leakage, and is not this package’slsp_diagnostics. Formal candidate repos must stripdocs/research/or the notes leak the empty-grep gold.Pilot shape if it lands later: OpenPI-owned, capability-gated, mutation-off, at most 1–3 read-only tools (
lsp_diagnosticsfirst). Classify at the child boundary the same revision it registers. Do not vendor Lens. Do not build a language-server OS (mux, auto-install,/lsp-setup).