better-dsh 0.0.0 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +294 -4
  3. package/control-prompt.md +37 -0
  4. package/cordis.patch.yml +53 -0
  5. package/docs/00_adr/0001-bridge-tool-layer-not-service-layer.md +14 -0
  6. package/docs/00_adr/0002-masking-is-presentation-only.md +15 -0
  7. package/docs/10_plans/A2A-messaging-channel-test-archive.md +256 -0
  8. package/docs/10_plans/code-mode-vs-rlm-ipython-comparison.md +137 -0
  9. package/docs/10_plans/dashr-blueprint-review.md +201 -0
  10. package/docs/10_plans/dashr-blueprint.md +561 -0
  11. package/docs/10_plans/dashr-compaction-window-and-archive.md +307 -0
  12. package/docs/10_plans/dashr-profile-layer-feasibility.md +367 -0
  13. package/docs/10_plans/dashr-sandbox-escalation-semantics-gap.md +171 -0
  14. package/docs/10_plans/dashr-security-sandbox-analysis.md +187 -0
  15. package/docs/10_plans/dashr-surface-invariant-and-omp-imports.md +97 -0
  16. package/docs/10_plans/ipython-kernel-interactive-interface-test-report.md +152 -0
  17. package/docs/10_plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft.md +146 -0
  18. package/docs/10_plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft_v3.md +50 -0
  19. package/docs/10_plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft_v4.md +79 -0
  20. package/docs/10_plans/kernel-refactoring/Dash-vs-PrimeAgent-systemprompt-toolcatalog-comparison.md +138 -0
  21. package/docs/10_plans/kernel-refactoring/RLM-system-prompt-injection-gap-report.md +161 -0
  22. package/docs/10_plans/kernel-refactoring/V0.1.5-development-plan.md +109 -0
  23. package/docs/10_plans/kernel-refactoring/actinoable-surface-to-llm-in-agent-runtime_dsh.md +50 -0
  24. package/docs/10_plans/kernel-refactoring/actinoable-surface-to-llm-in-agent-runtime_prime.md +113 -0
  25. package/docs/10_plans/recallable-compaction.md +147 -0
  26. package/docs/10_plans/spike-tag-repro.mjs +102 -0
  27. package/docs/10_plans/upstream-analysis.md +128 -0
  28. package/docs/50_test-reports/REPL-/345/267/245/345/205/267/350/260/203/347/224/250-/346/210/252/346/226/255/350/257/212/346/226/255.md +110 -0
  29. package/docs/50_test-reports/kernel-provisioning.md +44 -0
  30. package/docs/50_test-reports/repl-kernel-provisioning-test-report.md +87 -0
  31. package/docs/50_test-reports/upstream-dsh-0.1.2-alpha.5-local-test-report.md +81 -0
  32. package/docs/50_test-reports/upstream-dsh-0.1.2-alpha.5-report.md +93 -0
  33. package/docs/50_test-reports/v0.1.8-improved-/345/256/236/346/265/213/346/212/245/345/221/212.md +142 -0
  34. package/docs/50_test-reports/v0.1.8-/345/256/236/346/265/213/346/212/245/345/221/212.md +193 -0
  35. package/docs/50_test-reports/v0.1.8b-/345/256/236/346/265/213/346/212/245/345/221/212.md +96 -0
  36. package/docs/50_test-reports/v0.1.8c-/345/256/236/346/265/213/346/212/245/345/221/212.md +127 -0
  37. package/docs/50_test-reports/v0.1.8d-/345/256/236/346/265/213/346/212/245/345/221/212.md +150 -0
  38. package/docs/50_test-reports/v0.1.8d_artifacts/README.md +138 -0
  39. package/docs/50_test-reports/v0.1.8d_artifacts/code-mode-repl-only.observation.md +74 -0
  40. package/docs/50_test-reports/v0.1.8d_artifacts/dsh-session-session-4a293388-9ae1-474b-87a0-9e17bb556d94.jsonl +3890 -0
  41. package/docs/50_test-reports/v0.1.8d_artifacts/dsh-session-session-4a293388-9ae1-474b-87a0-9e17bb556d94.w-sample-0435.jsonl +544 -0
  42. package/docs/50_test-reports/v0.1.8d_artifacts/functions.json +592 -0
  43. package/docs/50_test-reports/v0.1.8d_artifacts/skills-catalog.snapshot.md +30 -0
  44. package/docs/50_test-reports/v0.1.8d_artifacts/tools-sdk.output-schemas.json +1236 -0
  45. package/docs/50_test-reports/v0.1.8d_artifacts/tools-sdk.python.txt +592 -0
  46. package/docs/50_test-reports/v0.1.8d_artifacts/tools-sdk.typescript.txt +516 -0
  47. package/docs/50_test-reports/v0.1.8d_artifacts/wire-vs-transcription.diff.md +54 -0
  48. package/docs/50_test-reports/v0.1.8e-/345/256/236/346/265/213/346/212/245/345/221/212.md +224 -0
  49. package/docs/50_test-reports/v0.1.9a-/345/256/236/346/265/213/346/212/245/345/221/212.md +168 -0
  50. package/docs/50_test-reports/v0.2.0b-/345/256/236/346/265/213/346/212/245/345/221/212.md +123 -0
  51. package/docs/50_test-reports/v0.2.0b_artifacts/f2probe/Cargo.lock +7 -0
  52. package/docs/50_test-reports/v0.2.0b_artifacts/f2probe/Cargo.toml +6 -0
  53. package/docs/50_test-reports/v0.2.0b_artifacts/f2probe/src/bin/messy.rs +8 -0
  54. package/docs/50_test-reports/v0.2.0b_artifacts/f2probe/src/main.rs +4 -0
  55. package/docs/50_test-reports/v0.2.0b_artifacts/hashline-probe.md +5 -0
  56. package/docs/50_test-reports/v0.2.0b_artifacts/slowprobe/Cargo.lock +7 -0
  57. package/docs/50_test-reports/v0.2.0b_artifacts/slowprobe/Cargo.toml +7 -0
  58. package/docs/50_test-reports/v0.2.0b_artifacts/slowprobe/build.rs +4 -0
  59. package/docs/50_test-reports/v0.2.0b_artifacts/slowprobe/src/main.rs +13 -0
  60. package/docs/50_test-reports/v0.2.1-/345/256/236/346/265/213/346/212/245/345/221/212.md +110 -0
  61. package/docs/50_test-reports/v0.2.1b-/345/256/236/346/265/213/346/212/245/345/221/212.md +86 -0
  62. package/docs/50_test-reports/v0.2.1c-/345/256/236/346/265/213/346/212/245/345/221/212.md +66 -0
  63. package/docs/50_test-reports/v0.2.1d-/345/256/236/346/265/213/346/212/245/345/221/212.md +67 -0
  64. package/docs/50_test-reports/v0.2.1e-P1-/345/256/236/346/265/213/346/212/245/345/221/212.md +136 -0
  65. package/docs/50_test-reports/v0.2.1ef-dev-audit-report.md +73 -0
  66. package/docs/50_test-reports/v0.2.1f-plugin-shipped-ui-patches/345/256/236/346/265/213/346/212/245/345/221/212.md +102 -0
  67. package/docs/60_exploration-and-research/cordis-research.md +350 -0
  68. package/docs/60_exploration-and-research/dsh-web-profile-package-map.md +186 -0
  69. package/docs/60_exploration-and-research/dsh-web-ui-slot-system-research.md +310 -0
  70. package/docs/60_exploration-and-research/dsh-webui-strip-boundary-research.md +300 -0
  71. package/docs/60_exploration-and-research/ios-chat-app-bridge-research.md +324 -0
  72. package/docs/60_exploration-and-research/web-frontend-composability-research.md +191 -0
  73. package/docs/REPL-/345/267/245/345/205/267/350/260/203/347/224/250-/346/210/252/346/226/255/350/257/212/346/226/255.md +110 -0
  74. package/docs/adr/0001-bridge-tool-layer-not-service-layer.md +14 -0
  75. package/docs/adr/0002-masking-is-presentation-only.md +15 -0
  76. package/docs/distro-blueprint.md +81 -0
  77. package/docs/dsh-webUI-with-rlm-mode.png +0 -0
  78. package/docs/plans/A2A-messaging-channel-test-archive.md +256 -0
  79. package/docs/plans/code-mode-vs-rlm-ipython-comparison.md +137 -0
  80. package/docs/plans/dashr-blueprint-review.md +201 -0
  81. package/docs/plans/dashr-blueprint.md +561 -0
  82. package/docs/plans/dashr-compaction-window-and-archive.md +307 -0
  83. package/docs/plans/dashr-profile-layer-feasibility.md +367 -0
  84. package/docs/plans/dashr-sandbox-escalation-semantics-gap.md +171 -0
  85. package/docs/plans/dashr-security-sandbox-analysis.md +187 -0
  86. package/docs/plans/dashr-surface-invariant-and-omp-imports.md +97 -0
  87. package/docs/plans/ipython-kernel-interactive-interface-test-report.md +152 -0
  88. package/docs/plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft.md +146 -0
  89. package/docs/plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft_v3.md +50 -0
  90. package/docs/plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft_v4.md +79 -0
  91. package/docs/plans/kernel-refactoring/Dash-vs-PrimeAgent-systemprompt-toolcatalog-comparison.md +138 -0
  92. package/docs/plans/kernel-refactoring/RLM-system-prompt-injection-gap-report.md +161 -0
  93. package/docs/plans/kernel-refactoring/V0.1.5-development-plan.md +109 -0
  94. package/docs/plans/kernel-refactoring/actinoable-surface-to-llm-in-agent-runtime_dsh.md +50 -0
  95. package/docs/plans/kernel-refactoring/actinoable-surface-to-llm-in-agent-runtime_prime.md +113 -0
  96. package/docs/plans/recallable-compaction.md +147 -0
  97. package/docs/plans/spike-tag-repro.mjs +102 -0
  98. package/docs/plans/upstream-analysis.md +128 -0
  99. package/docs/repositioning-and-rebranding.md +102 -0
  100. package/docs/v0.1.8-improved-/345/256/236/346/265/213/346/212/245/345/221/212.md +142 -0
  101. package/docs/v0.1.8-/345/256/236/346/265/213/346/212/245/345/221/212.md +193 -0
  102. package/docs/v0.1.8b-/345/256/236/346/265/213/346/212/245/345/221/212.md +96 -0
  103. package/docs/v0.1.8c-/345/256/236/346/265/213/346/212/245/345/221/212.md +127 -0
  104. package/docs/v0.1.8d-/345/256/236/346/265/213/346/212/245/345/221/212.md +150 -0
  105. package/docs/v0.1.8d_artifacts/README.md +138 -0
  106. package/docs/v0.1.8d_artifacts/code-mode-repl-only.observation.md +74 -0
  107. package/docs/v0.1.8d_artifacts/dsh-session-session-4a293388-9ae1-474b-87a0-9e17bb556d94.jsonl +3890 -0
  108. package/docs/v0.1.8d_artifacts/dsh-session-session-4a293388-9ae1-474b-87a0-9e17bb556d94.w-sample-0435.jsonl +544 -0
  109. package/docs/v0.1.8d_artifacts/functions.json +592 -0
  110. package/docs/v0.1.8d_artifacts/skills-catalog.snapshot.md +30 -0
  111. package/docs/v0.1.8d_artifacts/tools-sdk.output-schemas.json +1236 -0
  112. package/docs/v0.1.8d_artifacts/tools-sdk.python.txt +592 -0
  113. package/docs/v0.1.8d_artifacts/tools-sdk.typescript.txt +516 -0
  114. package/docs/v0.1.8d_artifacts/wire-vs-transcription.diff.md +54 -0
  115. package/docs/v0.1.8e-/345/256/236/346/265/213/346/212/245/345/221/212.md +224 -0
  116. package/docs/v0.1.9a-/345/256/236/346/265/213/346/212/245/345/221/212.md +168 -0
  117. package/docs/v0.2.0b-/345/256/236/346/265/213/346/212/245/345/221/212.md +123 -0
  118. package/docs/v0.2.0b_artifacts/f2probe/Cargo.lock +7 -0
  119. package/docs/v0.2.0b_artifacts/f2probe/Cargo.toml +6 -0
  120. package/docs/v0.2.0b_artifacts/f2probe/src/bin/messy.rs +8 -0
  121. package/docs/v0.2.0b_artifacts/f2probe/src/main.rs +4 -0
  122. package/docs/v0.2.0b_artifacts/hashline-probe.md +5 -0
  123. package/docs/v0.2.0b_artifacts/slowprobe/Cargo.lock +7 -0
  124. package/docs/v0.2.0b_artifacts/slowprobe/Cargo.toml +7 -0
  125. package/docs/v0.2.0b_artifacts/slowprobe/build.rs +4 -0
  126. package/docs/v0.2.0b_artifacts/slowprobe/src/main.rs +13 -0
  127. package/docs/v0.2.1-/345/256/236/346/265/213/346/212/245/345/221/212.md +110 -0
  128. package/docs/v0.2.1b-/345/256/236/346/265/213/346/212/245/345/221/212.md +86 -0
  129. package/docs/v0.2.1c-/345/256/236/346/265/213/346/212/245/345/221/212.md +66 -0
  130. package/lib/client/index.js +473 -0
  131. package/lib/index.d.ts +736 -0
  132. package/lib/index.js +11518 -0
  133. package/lib/kernel-env-hxaihi9C.js +195 -0
  134. package/lib/kernel-env.d.ts +80 -0
  135. package/lib/kernel-env.js +3 -0
  136. package/lib/py-sdk-BCaOGYz7.d.ts +125 -0
  137. package/lib/py-sdk-CbgYiX8O.js +691 -0
  138. package/lib/py-sdk.d.ts +2 -0
  139. package/lib/py-sdk.js +3 -0
  140. package/package.json +325 -4
  141. package/scripts/kernel-provision.mjs +35 -0
  142. package/index.js +0 -3
@@ -0,0 +1,142 @@
1
+ # DASHR v0.1.8 改进版复测报告(第一人称实测)
2
+
3
+ > 复测方式:仍以 DASHR 运行时自身为被测对象(本会话,dsh Web GUI)。运行时已按上版报告调整并重启,本次对**上版全部问题逐条复测**,并重跑测试套件。
4
+ > 复测日期:2026-08-24(同日晚,更新 commit `7ec46ac`)
5
+
6
+ ---
7
+
8
+ ## 0. 结论摘要
9
+
10
+ | 结论 | 结果 |
11
+ |---|---|
12
+ | 上版 **P0(snapshot 失效)** | ✅ **已修复** |
13
+ | 上版 **P1(docstring 回归)** | ✅ **已修复** |
14
+ | 上版 P2/P3(命名漂移、masking 张力、fgm→pgmi) | ✅ **全部修复/重新设计** |
15
+ | 测试套件 | ✅ **156/156 全绿**(上版 155/163) |
16
+ | 遗留问题 | 🟡 README 中后段 + 根 README 仍残留旧架构文档;`compact` 引擎本部署仍未挂载 |
17
+
18
+ **一句话结论**:改进版把上版报告里的**功能性问题全部清零**——内核环境自管(Python 3.11 + dill)让 snapshot 复活,delegation 工具从「桥接包装」改为「直接暴露」消除了 masking 与 dual-exposure 的张力;但**文档层还有两处 README 残留旧架构描述**需要清理。
19
+
20
+ ---
21
+
22
+ ## 1. 本次变更(commit `7ec46ac`)
23
+
24
+ ```
25
+ dashr: runtime-owned kernel environment + native delegation exposure
26
+ ```
27
+
28
+ 1. **内核环境自管**(新增 `src/kernel-env.ts`,210 行):运行时自己 provision 一个托管 CPython 3.11 venv(`ipykernel` + `dill`),落在**包内 `.venv-kernel`**(不再 `/tmp` 悬空 symlink)。显式解释器被校验:缺 `dill` = 响亮告警(禁用快照),缺 `ipykernel` = 硬错误。
29
+ 2. **原生 delegation 直接暴露**:masking 从 8 名收敛到**仅 2 名**(`send_message` + `report`);`subagent`/`subagent_fork`/`list_agents`/`interrupt_agent`/`workflow`/`ralph` 直接暴露为 `tool.*` 成员;**`rlm`/`agent_list`/`rlm_workflow`/`rlm_ralph` 桥接全部删除**。
30
+ 3. **Rebrand**:`@fgm-builds/dashr` → `@pgmi-builds/dashr`;RLM 术语在 CONTEXT/ADR 去强调。
31
+
32
+ ---
33
+
34
+ ## 2. 上版问题逐条复测
35
+
36
+ | 上版问题 | 严重度 | 本次实测证据 | 状态 |
37
+ |---|---|---|---|
38
+ | snapshot 失效(dill 缺 + Python 3.14) | 🔴 P0 | 实测内核 `Python 3.11.15` + `dill 0.4.1` + `ipykernel 7.3.0`;`.venv-kernel` 指向 uv 托管 3.11;快照测试全绿 | ✅ 修复 |
39
+ | docstring 回归 | 🟠 P1 | 实测 `helper.__doc__ == 'First summary line.\n Details follow.'`;`runtime.spec.ts` 绿 | ✅ 修复 |
40
+ | `agent_message` vs `send_message` | 🟡 P2 | 实测 `tool.agent_message` → `unknown binding`;`tool.send_message` 为双向桥接;CONTEXT/ADR 已改 | ✅ 修复 |
41
+ | flat-global vs `tool.*` | 🟡 P2 | CONTEXT.md「Binding」已改「`tool.*` member」 | ✅ 修复 |
42
+ | `fgm` vs `pgmi` | 🟡 P2 | `package.json` name / `cordis.patch.yml` 均 `@pgmi-builds/dashr` | ✅ 修复 |
43
+ | masking 7 vs 8 | 🟡 P2 | 重新设计为 2 名,ADR-0002 已同步 | ✅ 修复 |
44
+ | masking 对直接面无效(结构性张力) | 🟡 P3 | 决策落地:delegation 直接暴露、`rlm` 删除,张力消除 | ✅ 修复 |
45
+ | 桥接错误风格不一致 | 🟡 P3 | `rlm_workflow` 等已删,仅剩 `send_message`(结构化 error 值) | ✅ 消除 |
46
+
47
+ ---
48
+
49
+ ## 3. 新功能面实测(第一人称逐项)
50
+
51
+ ### ✅ 3.1 内核环境自管 —— 通过
52
+
53
+ ```
54
+ kernel python: 3.11.15
55
+ dill: 0.4.1
56
+ ipykernel: 7.3.0
57
+ ```
58
+
59
+ `.venv-kernel/bin/python` 现指向 `/home/u1/.local/share/uv/python/cpython-3.11-linux-x86_64-gnu/bin/python3.11`(真实存在,非悬空)。
60
+
61
+ ### ✅ 3.2 原生 delegation 直接暴露 —— 通过
62
+
63
+ `tool.subagent` / `tool.subagent_fork` / `tool.list_agents` / `tool.interrupt_agent` / `tool.workflow` / `tool.ralph` 现在**全部直接绑定**(call-through 返回的是真实工具的参数校验错误,而非 `unknown binding`):
64
+
65
+ ```
66
+ tool.subagent -> REJECTED (invalid arguments: missing required property "description")
67
+ tool.list_agents -> bound+callable(返回子代理列表)
68
+ tool.workflow -> REJECTED (missing required property "script")
69
+ tool.ralph -> REJECTED (missing required property "objective")
70
+ ```
71
+
72
+ ### ✅ 3.3 桥接收敛(仅 send_message + refine + compact)—— 通过
73
+
74
+ ```
75
+ tool.send_message -> bound+callable (双向桥接)
76
+ tool.refine -> bound+callable
77
+ tool.compact -> bound+callable
78
+ tool.rlm -> REJECTED (unknown binding "tool.rlm")
79
+ tool.agent_list -> REJECTED (unknown binding)
80
+ tool.rlm_workflow -> REJECTED (unknown binding)
81
+ tool.rlm_ralph -> REJECTED (unknown binding)
82
+ tool.agent_message -> REJECTED (unknown binding)
83
+ ```
84
+
85
+ `rlm` 家族彻底移除,递归改走 `tool.subagent` / `tool.subagent_fork` 直连。
86
+
87
+ ### ✅ 3.4 递归 + A2A 全链路(新形态)—— 通过
88
+
89
+ ```
90
+ tool.subagent spawn → {'kind':'continuable','subagentId':'3e8f3609-...'} (8*9)
91
+ child 完成上报
92
+ tool.send_message(receiver='child') 下行追问 9*9 → 上报 "81"
93
+ tool.send_message(receiver='parent') from root → 结构化 UNAUTHORIZED(guard 仍在)
94
+ ```
95
+
96
+ ### ✅ 3.5 无回归项 —— 通过
97
+
98
+ `tool.*` 绑定、跨 cell 持久化、`ToolCallError(.toolName)`、`asyncio.gather`、顶层 `return` → SyntaxError 均与上版一致,无回归。
99
+
100
+ ### ✅ 3.6 测试套件 —— 全绿
101
+
102
+ ```
103
+ Test Files 18 passed (18)
104
+ Tests 156 passed (156)
105
+ ```
106
+
107
+ 上版失败的 `snapshot-revive` / `snapshot-restore` / `lifecycle` / `session-keys` / `runtime`(docstring) 全部转绿;新增 `bindings.spec.ts`(7)、`parallel.spec.ts`(2)。
108
+
109
+ ---
110
+
111
+ ## 4. 遗留问题(新发现)
112
+
113
+ ### 🟡 4.1 包内 `dashr/README.md` 中后段仍描述旧架构
114
+
115
+ header 段已更新(`dsh-rlm-mode`→`dashr`、`RLMRuntime`→`ReplRuntime`、`ipython`→`eval`、kernel 自管),但**中后段未同步**,仍残留:
116
+
117
+ - 「**`ipython`** — the only tool the model may call directly」(应为 `eval`)
118
+ - 「FLAT top-level callables — `await name({...})`」(应为 `tool.*` member)
119
+ - 「bridge callables `rlm`, `send_message`, `agent_list`, `rlm_workflow`, `rlm_ralph`」(已删)
120
+ - 「Delegation and messaging (rlm, send_message, agent_list, rlm_workflow, rlm_ralph)」整段 `rlm()` API 文档(已删)
121
+ - install 段仍指 `dsh-rlm-mode` + `rlm-mode` preset(preset 已删)
122
+ - `dashr-kernel` group `isolate: { rlmRuntime: true }`(旧 realm 架构,现为 host-plane `dashr-repl`)
123
+
124
+ ### 🟡 4.2 根 `README.md` 完全未 rebrand
125
+
126
+ 根 `README.md` 仍是「# Dashr: RLM Plugin for `dsh`」+ `dsh-rlm-mode` npm badge + 完整 RLM 定位 + `rlm()` API 示例——本次 commit **未触碰根 README**。
127
+
128
+ ### 🟡 4.3 `compact` 引擎本部署未挂载
129
+
130
+ `tool.compact` 返回 `{'context_tokens': 137635, 'error': 'compact() is unavailable: no ctx.compaction engine is mounted in this composition'}`——桥接存在,但本 composition 无宿主压缩引擎(与上版一致,非本 commit 引入)。
131
+
132
+ ### ⚪ 4.4 观察项:会话续接时工具目录未随插件升级刷新
133
+
134
+ 本会话(`session-5037d6a6`)跨过了插件更新 + 运行时重启,但**本会话的 system prompt(Tool Catalog)仍是旧版**——仍在声明 `rlm`/`agent_list`/`rlm_workflow`/`rlm_ralph` 可用,而实测运行时已 `unknown binding`。新开会话应得到正确目录,但「持久会话热升级插件后目录不刷新」值得留意。
135
+
136
+ ---
137
+
138
+ ## 5. 建议
139
+
140
+ 1. **清理 README 残留**:把 `dashr/README.md` 中后段(ipython/flat/rlm 家族/install/preset/isolate realm)+ 根 `README.md`(RLM 定位、`dsh-rlm-mode` badge、`rlm()` API)对齐 v0.1.8 实际形态(`eval`、`tool.*`、直接 delegation、`@pgmi-builds/dashr`)。
141
+ 2. **验证 compact 部署**:在目标部署形态下挂载宿主压缩引擎,复验 `compact` 与 Global Context Recency Window。
142
+ 3. **会话续接目录刷新**(可选):考虑在插件升级/重启后让持久会话的 Tool Catalog 失效或重算,避免模型看到过期工具面。
@@ -0,0 +1,193 @@
1
+ # DASHR v0.1.8 实测报告
2
+
3
+ > 实测方式:以 DASHR agent 运行时自身(本会话,运行于 dsh Web GUI)作为被测对象,直接调用 `eval` 持久内核与 `tool.*` 绑定逐一实测,并运行仓库 `npm test` 测试套件交叉验证。
4
+ > 实测日期:2026-08-24
5
+
6
+ ---
7
+
8
+ ## 0. 摘要(TL;DR)
9
+
10
+ | 结论 | 结果 |
11
+ |---|---|
12
+ | 核心 REPL 能力(`eval` 持久内核、`tool.*` 绑定、masking、`rlm` 递归、A2A) | ✅ **全部实测可用** |
13
+ | 测试套件 | ⚠️ **155/163 通过,8 个失败** |
14
+ | 失败根因 | 🔴 **snapshot 快照/恢复功能失效**(`dill` 缺失 + 内核运行在 Python 3.14.4 而非文档要求的 3.11) |
15
+ | 文档/命名漂移 | 🟡 若干(`agent_message` vs `send_message`、flat-global vs `tool.*`、`fgm` vs `pgmi` 等) |
16
+
17
+ **一句话结论**:v0.1.8 的「eval 持久内核 + 统一 `tool.*` 桥接」这条主线功能是**成立且可用的**,递归子代理(RLM)与 A2A 通信全链路走通;但 **snapshot 快照/恢复(README 标注的 `dill` 全命名空间快照)在当前环境是坏的**,且存在多处文档与代码的命名/架构漂移。
18
+
19
+ ---
20
+
21
+ ## 1. 被测对象与版本
22
+
23
+ | 项 | 值 |
24
+ |---|---|
25
+ | 插件包名 / 版本 | `@fgm-builds/dashr`(`dashr/package.json` `version: 0.1.8`) |
26
+ | 工作区 git 状态 | 工作区未提交改动;`git describe` = `v0.1.6-1-gec7b844`(v0.1.7/v0.1.8 均为未提交的开发产出) |
27
+ | 宿主运行时 | `dsh 0.1.1-rc.2`(`dsh --version`) |
28
+ | Node | v22.22.1 |
29
+ | 内核 Python(实测) | **3.14.4**(系统 `/usr/bin/python3`) |
30
+ | ipykernel | 7.3.0 |
31
+ | `dill` | ❌ **未安装**(`ModuleNotFoundError: No module named 'dill'`) |
32
+ | 内核 venv | `.venv-kernel/bin/python` → `/tmp/dashr-py311/bin/python3.11` **悬空**(目标已删) |
33
+
34
+ ---
35
+
36
+ ## 2. v0.1.8 相对 v0.1.6 的关键变化(读代码 + 文档得出)
37
+
38
+ 1. **Rebrand**:`dsh-rlm-mode` → `@fgm-builds/dashr`,定位从「RLM 插件」转向「Better Dash 完整 App(distro)」(`docs/repositioning-and-rebranding.md`、`docs/distro-blueprint.md`)。
39
+ 2. **架构升级(最大改动)**:`cordis.patch.yml` 从 `[]`(空壳)改为在 **HOST 平面** 挂载 `dashr-repl`(`eval` 工具 + 持久 kernel REPL 运行时落到全局作用域层,对所有 preset 可见)。旧的 `preset/rlm-mode/agent.cordis.yml`、`preset.yml` **删除**——这是 v0.1.5「DashrDaemon 空壳」的正式落地。
40
+ 3. **传输工具改名**:`run_cell` → **`eval`**(`EVAL_NAME = 'eval'`)。
41
+ 4. **绑定形态切换**:从 v0.1.5 的「平级 top-level global」切到 **统一 `tool.*` namespace**(每工具 = `await tool.name({...})` 成员 async callable),对应 distro-blueprint §2.2 的「dual exposure / both 模式」。
42
+ 5. **Masking 名单扩充**:`MASKED_TOOL_NAMES` 含 **8 个名**(ADR-0002 只写 7 个,实际多了 `report`):`subagent, subagent_fork, send_message, list_agents, interrupt_agent, workflow, ralph, report`。
43
+ 6. **桥接工具**(bridge tools,`BRIDGE_TOOL_SCHEMAS`):`rlm` / `send_message` / `agent_list` / `rlm_workflow` / `rlm_ralph`。
44
+
45
+ ---
46
+
47
+ ## 3. 实测结果 — 功能面(逐项亲测)
48
+
49
+ ### ✅ 3.1 `eval` 持久内核 —— 通过
50
+
51
+ `eval` cell 正常执行,内核为真实 IPython 持久内核,`await` / 顶层表达式 / 变量跨 cell 存续均正常。
52
+
53
+ ### ✅ 3.2 状态跨 cell 持久化 —— 通过
54
+
55
+ Cell 1 定义 `persist_probe`,Cell 4 仍可读:`persist_probe still alive: {'made_in': 'cell-1', 'answer': 42}`。
56
+
57
+ ### ✅ 3.3 `tool.*` 统一绑定 —— 通过
58
+
59
+ `tool.read` / `tool.bash` / `tool.grep` / `tool.glob` / `tool.write` / `tool.edit` / `tool.web_search` / `tool.skill` / `tool.memory_*` / `tool.refine` / `tool.todo_write` / `tool.get_goal` 均可用(实测调用返回正确 JSON)。
60
+
61
+ ### ✅ 3.4 `ToolCallError` 类型化拒绝 —— 通过
62
+
63
+ 真实工具调用失败(文件不存在)抛 `ToolCallError`,`.toolName` 正确携带绑定名:
64
+
65
+ ```
66
+ caught ToolCallError: ToolCallError | toolName = read
67
+ ```
68
+
69
+ ### ✅ 3.5 `asyncio.gather` fan-out —— 通过
70
+
71
+ 并发 `tool.read` + `tool.bash` 同 cell 完成。
72
+
73
+ ### ✅ 3.6 Masking(呈现层排除,host 端拒绝)—— 通过(REPL 内)
74
+
75
+ `tool.subagent` / `tool.list_agents` / `tool.interrupt_agent` / `tool.workflow` / `tool.ralph` / `tool.subagent_fork` / `tool.send_message`(上游工具名) → 全部返回 `ToolCallError: unknown binding`。
76
+ legacy 传输名 `tool.run_cell` / `tool.run_code` / `tool.ipython` / `tool.eval`(嵌套)→ 同样 `unknown binding`(`eval` 自身不可重入)。
77
+
78
+ > 关键机制:`_DashrBindingHolder.__getattr__` 对**任意**名字都返回 proxy(`getattr` 永不抛 AttributeError),真实「是否绑定」由 host 在**调用时**判定拒绝。因此 `dir(tool)` 为 0 成员、`getattr` 恒真——需要**调用**才能区分 masked 与否。
79
+
80
+ ### ✅ 3.7 桥接工具 —— 通过
81
+
82
+ | 桥接名 | 实测 |
83
+ |---|---|
84
+ | `tool.rlm` | `rlm({"mode":"bogus"})` → 结构化错误值 `{'error': 'rlm() requires ...'}`(非异常) |
85
+ | `tool.agent_list` | 返回子代理列表 |
86
+ | `tool.send_message` | 上行/下行均走通(见 3.9/3.10) |
87
+ | `tool.rlm_workflow` | 校验失败抛 `ToolCallError`(missing meta.name) |
88
+ | `tool.rlm_ralph` | 实际触发一次 Ralph 循环(`status: blocked`) |
89
+
90
+ ### ✅ 3.8 RLM 递归子代理全链路 —— 通过
91
+
92
+ ```
93
+ rlm spawn → {'kind':'continuable','subagentId':'26e2842e-...'}
94
+ child 完成上报: "42"(6*7)
95
+ send_message 下行追问 7*8 → child 再上报: "56"
96
+ ```
97
+
98
+ spawn → child 执行 → wakeup 上报 → parent 下行追问 → 再上报,**完整闭环走通**。
99
+
100
+ ### ✅ 3.9 `agent_list` 状态流转 —— 通过
101
+
102
+ `running → ready`(`ready` = 空闲可续聊,非终结态)。
103
+
104
+ ### ✅ 3.10 A2A 上行 guard —— 通过
105
+
106
+ root 调 `tool.send_message(receiver='parent')` → 结构化错误:`only a live continuable child agent can report to its parent`(`authorizeReporter` 的 `UNAUTHORIZED` 路径,root 不具上行资格)。
107
+
108
+ ### ✅ 3.11 REPL 语义 —— 通过
109
+
110
+ 顶层 `return` → `SyntaxError: 'return' outside function`(parse 期即拒绝,符合原生 IPython cell 语义)。
111
+
112
+ ### ⚠️ 3.12 `compact` 压缩 —— 本环境不可用
113
+
114
+ `tool.compact` 返回 `{'context_tokens': 88407, 'error': 'compact() is unavailable: no ctx.compaction engine is ...'}`——宿主 `ctx.compaction` 引擎未在本部署加载,压缩能力无实际效果。
115
+
116
+ ### 🔴 3.13 snapshot 快照/恢复 —— 失效
117
+
118
+ 见 §5/§6,根因是 `dill` 缺失。
119
+
120
+ ---
121
+
122
+ ## 4. 测试套件结果(`npm test` = `vitest --run`)
123
+
124
+ ```
125
+ Test Files 5 failed | 13 passed (18)
126
+ Tests 8 failed | 155 passed (163)
127
+ ```
128
+
129
+ 失败分布(8 个失败,7 个集中在 snapshot):
130
+
131
+ | 文件 | 失败数 | 失败用例 |
132
+ |---|---|---|
133
+ | `test/snapshot-revive.spec.ts` | 4 | 全部(revive/降级/超限快照/over-cap) |
134
+ | `test/lifecycle.spec.ts` | 1 | dispose 时写快照 |
135
+ | `test/session-keys.spec.ts` | 1 | 每 principal 快照独立子目录 |
136
+ | `test/snapshot-restore.spec.ts` | 1 | eval 快照路径 + 恢复纯用户态 |
137
+ | `test/runtime.spec.ts` | 1 | **keep function docstrings intact**(非快照,单独问题) |
138
+
139
+ > 注:`npm test` 进程退出码为 0(vitest 失败但外层 bash 收 0),CI 若直接依赖退出码会**漏报失败**——建议核对 vitest 的 exit-code 配置。
140
+
141
+ ---
142
+
143
+ ## 5. 根因分析
144
+
145
+ ### 5.1 snapshot 失效(7 个失败)—— 环境链式断裂
146
+
147
+ ```
148
+ .venv-kernel/bin/python → /tmp/dashr-py311/bin/python3.11 (悬空,目标已删)
149
+ ↓ 测试 helper: existsSync(悬空 symlink)=false → 回退 'python3'
150
+ ↓ 内核运行在 Python 3.14.4(系统解释器)
151
+ 系统 python3.14 已装 ipykernel 7.3.0,但 ❌ 无 dill
152
+ ↓ snapshot/restore 依赖 dill.dump/dill.load(src/python.ts:163,242)
153
+ ↓ dump 失败 → manifest.json 从未写出 → 测试 ENOENT / assertion 失败
154
+ ```
155
+
156
+ 即:**文档承诺的「Python 3.11 内核(uv venv)+ dill」部署前提在本机已失效**,运行时静默回退到 3.14.4 且缺 dill,导致快照功能整体不可用。
157
+
158
+ ### 5.2 docstring 失败(1 个)—— 疑似 Python 3.14 行为变化
159
+
160
+ `runtime.spec.ts`「keeps function docstrings intact」断言 `helper.__doc__` 精确等于 `'First summary line.\n Details follow.'`,在 3.14 下不成立。与 5.1 同源(内核 Python 版本漂移),需在 3.11 下复验。
161
+
162
+ ---
163
+
164
+ ## 6. 问题清单(按严重度)
165
+
166
+ ### 🔴 P0 — 快照功能整体失效
167
+ README「State Snapshot & Revival 💾 Full Namespace Snapshot (dill)」在当前环境不可用。需修复内核 Python 环境(重建 3.11 venv + `ipykernel dill`),或让运行时在缺 dill 时显式告警而非静默跳过。
168
+
169
+ ### 🟠 P1 — docstring 回归
170
+ 可能由 Python 3.14 引入;需在 3.11 内核下确认是否仍存在。
171
+
172
+ ### 🟡 P2 — 文档/命名漂移(多处)
173
+ 1. **`agent_message` vs `send_message`**:`CONTEXT.md` 术语表写 A2A 函数为 `agent_message(receiver, message, *, subagent_id)`,但 v0.1.8 实际桥接名为 **`send_message`**(`tool.send_message`)。实测 `tool.agent_message` → `unknown binding`。
174
+ 2. **flat-global vs `tool.*`**:`CONTEXT.md`「Binding = flat global」及 `V0.1.5-development-plan.md`(Q8 平级 globals)描述的是旧形态;v0.1.8 已切换为统一 `tool.*` namespace,`rlm`/`agent_list` 等**不再是裸全局**(实测 `rlm(...)` 裸调用 → `NameError`)。
175
+ 3. **`subagents-surface.ts` 头注释**仍描述「preset 的 entry-local `isolate: { replRuntime: true }` realm」旧架构;v0.1.8 已改为 HOST 平面全局挂载,注释过时。
176
+ 4. **`@fgm-builds/dashr` vs `pgmi-builds`**:最近一次 commit(`ec7b844`)把 GitHub namespace 从 fgm-builds 改成 pgmi-builds,但 `package.json` 的 `name` 仍是 `@fgm-builds/dashr`,仅 `repository.url` 是 pgmi-builds,未同步。
177
+ 5. **masking 数量**:ADR-0002 / V0.1.5 plan 写 7 个 masked 名,代码 `MASKED_TOOL_NAMES` 实际 **8 个**(多了 `report`)。
178
+
179
+ ### 🟡 P3 — 观察项(供决策,非必然 bug)
180
+ 1. **masking 对「直接 function-calling 面」无效**:ADR-0002 意图是「模型看不到这 7/8 个名」,但实测 masking 只作用于 REPL 内 `tool.*`;作为 dual-exposure(both 模式)副作用,`subagent`/`send_message`/`list_agents`/`interrupt_agent`/`workflow`/`ralph`/`subagent_fork` 仍出现在模型**直接可调用的工具面**。这是 both 模式与 masking 意图的结构性张力,需 maintainer 决策(是否要在直接面也收敛)。
181
+ 2. **桥接工具错误风格不一致**:`rlm()` 参数校验失败返回**结构化 error 值**,`rlm_workflow()` 校验失败抛 **ToolCallError**,两种风格并存。
182
+ 3. **README/描述措辞**:`package.json` description 写 `tool.*`,README 正文仍写 `tools.*`(复数,旧名),需统一。
183
+ 4. **`compact` 依赖宿主压缩引擎**:本部署无 `ctx.compaction` 引擎,DASHR 的「Global Context Recency Window / compact」压缩能力未在此环境生效,需在目标部署形态下复验。
184
+
185
+ ---
186
+
187
+ ## 7. 建议
188
+
189
+ 1. **优先修复内核环境**:重建 `.venv-kernel`(Python 3.11 + `ipykernel` + `dill`),消除悬空 symlink;否则快照功能与 7 个测试持续红灯。
190
+ 2. **为缺 dill / 版本漂移加显式护栏**:运行时启动时探测 `dill` 与 Python 版本,缺依赖时降级快照并**告警到模型/日志**,而非静默跳过。
191
+ 3. **同步文档与命名**:统一 `CONTEXT.md`(`agent_message`→`send_message`、flat-global→`tool.*`)、`subagents-surface.ts` 头注释、`package.json` `name`(fgm→pgmi)、README 的 `tools.*`→`tool.*`。
192
+ 4. **明确 masking 边界**:在 dual-exposure 下重新定义「masking 语义」——是只收敛 REPL 内 `tool.*`,还是也要在直接工具面收敛,形成 ADR。
193
+ 5. **CI 退出码**:核对 vitest 失败时是否向 CI 返回非零退出码,避免「红测试绿流水线」。
@@ -0,0 +1,96 @@
1
+ # DASHR v0.1.8b 实测报告(决策记录 + 待拿掉缺口清单)
2
+
3
+ > 状态:决策已定,代码待落地。本文为**需求移交文档**:本会话只做实测/记录,不动代码;后续开发 agent 按 §4 一次性改。
4
+ > 日期:2026-08-24
5
+
6
+ ---
7
+
8
+ ## 0. 结论摘要
9
+
10
+ | 项 | 决策 |
11
+ |---|---|
12
+ | `refine`(Continual Harness) | 🔴 **移除**(本轮定) |
13
+ | `compact`(`tool.compact` 上下文压缩 REPL 桥接) | 🔴 **移除**(上轮已定) |
14
+ | `recency`(被动 recency 压缩引擎,后台 auto) | ✅ **保留** |
15
+ | `send_message`(A2A 双向桥接) | ✅ 保留 |
16
+ | `eval`(传输工具) | ✅ 保留 |
17
+
18
+ DASHR 自登记的工具从 4 个(eval + send_message + refine + compact)收敛为 **2 个(eval + send_message)**——即「DASHR 独有、原生工具链没有的」两个桥接(refine/compact)全部拿掉。
19
+
20
+ ---
21
+
22
+ ## 1. 决策一:移除 `refine`(本轮,2026-08-24)
23
+
24
+ `refine` 是抄 Prime Agent 的 **Continual Harness**(Prime Agent 三大支柱:RLM / Context as variable / Continual harness)。移除理由(用户定):
25
+
26
+ **1.1 定位与界限不清**
27
+ - `refine` 功能上接近「记忆 / 技能」(memory / skill)。
28
+ - Hermes、openclaw 这类 Persona Agent 已经在做 cross-session enhancement(harness 跨 session persist)。
29
+ - DASHR 在 runtime 内重组 System Prompt 确实难得;但**同 session 重组后 persist 下来,下个 session 也会带着这个 harness**——这混淆了 **cross-session(跨会话)** 与 **per-session real-time(会话内实时)** 的界限。
30
+ - 很多「当时当地有用」的配置并不该跨 session 固化;做 coding/项目的 agent,用户更倾向**每次唤醒时外围 harness 固定、可控**,需要调整再走别的机制。
31
+ - 核心未决问题:**Dash 的定位到底是 Persona Agent(人格体、跨会话增强),还是 CLI 式(每次唤醒执行独立新任务)?** 定位不清,refine 的语义就悬空。
32
+
33
+ **1.2 有效性待测**
34
+ - real-time harness 的作用有多大未验证。
35
+ - 它是在 runtime 内由**旁路大模型**做总结,且 persist over session——多一次推理、多一层持久状态,收益不明确。
36
+ - Memory / Skill 已经有外围插件填补了生态位;唯一缺口只是「不能在 runtime 内实时重组」,而「实时重组」目前看偏超前、有效性存疑。
37
+
38
+ **1.3 模型没空主动调它(用户补充)**
39
+ - 大模型几乎**每一个 turn、每一个 user prompt 都有任务要做**,不会「有心思」在 runtime 里主动去调用 refine 这种自我维护动作。
40
+ - 让模型在忙正事的同时抽空做 harness 重组,是天方夜谭;它只会专注手头任务。
41
+
42
+ **可逆性**:项目有 Git 版本控制,随时可切回 v0.1.6 或更早查看源码;上游 Prime Agent 也在做相关探索,届时可再引入。故本次**暂不引入 Refine**。
43
+
44
+ ---
45
+
46
+ ## 2. 决策二:移除 `compact`(上轮已定)
47
+
48
+ `compact` 是把宿主 `ctx.compaction` 引擎硬桥进 REPL 的 DASHR 独有桥接。移除理由:
49
+ - 上下文压缩是**宿主运行时的事**,不属于 REPL(REPL 是 Agent 运行时的「外部环境」)。
50
+ - 原生工具链根本没有 `compact` 工具(只有 CLI 命令 + 压缩引擎 service),DASHR 是「无中生有」映射进来的。
51
+ - 实测 `tool.compact` 一调就返回 `no ctx.compaction engine is mounted`(本部署未挂引擎),映射了也没意义。
52
+ - 程序逻辑上「既不桥接、也不屏蔽」最简洁——上游不提供,删掉即自然缺位。
53
+
54
+ > 注意:移除的是 `tool.compact` 这个**模型可见的 REPL 桥接**;被动 recency 压缩引擎(`RecencyAwareCompactionEngine`,`auto: true` 后台自动压)**保留**——两者是两回事(见 §4)。
55
+
56
+ ---
57
+
58
+ ## 3. 全量「待拿掉缺口」清单
59
+
60
+ | # | 缺口 | 类型 | 状态 |
61
+ |---|---|---|---|
62
+ | 1 | `compact` REPL 桥接(`compactCallable` + catalog + bindings) | 代码 | 🔴 待落地 |
63
+ | 2 | `refine` REPL 桥接(`refineCallable` + catalog + bindings) | 代码 | 🔴 待落地 |
64
+ | 3 | `refine` 连带 machinery:`refineModel` 配置、`dashr:harness` prompt 段、`src/refine.ts`、`src/harness-store.ts`(注:`compactModel`/`src/compaction-surface.ts`/`src/compaction/recency-engine.ts` 属 recency,**保留**) | 代码 | 🔴 待落地(随 1/2 一并) |
65
+ | 4 | `dashr/README.md` 中后段仍描述旧架构(`ipython` 传输、FLAT callables、`rlm`/`agent_list`/`rlm_workflow`/`rlm_ralph`、`dsh-rlm-mode`、`rlm-mode` preset、`dashr-kernel` isolate realm) | 文档 | 🟡 待修 |
66
+ | 5 | 根 `README.md` 完全未 rebrand(仍「RLM Plugin for dsh」+ `dsh-rlm-mode` badge + `rlm()` API) | 文档 | 🟡 待修 |
67
+ | 6 | 持久会话热升级插件后 Tool Catalog 不刷新(system prompt 残留 `rlm`/`agent_list` 等旧名) | 运行时 | 🟡 待修(新开会话自愈,属会话续接边界) |
68
+
69
+ ---
70
+
71
+ ## 4. 落地范围(已定稿:refine 删、recency 保留)
72
+
73
+ **移除 —— refine(Continual Harness):**
74
+ 1. `BRIDGE_TOOL_SCHEMAS` 删 `refine` 条目(留 `send_message`)。
75
+ 2. 删 `refineCallable` 函数 + bindings 装配处 `refine: refineCallable`。
76
+ 3. 删 `src/refine.ts`、`src/harness-store.ts`(及其测试)。
77
+ 4. 删 `refineModel` 配置项 + `resolveRefineTarget` + `requireLlm` 相关 wiring。
78
+ 5. 删 `dashr:harness` prompt 段(refine 是唯一写入方,删后必然为空)。
79
+
80
+ **移除 —— compact(仅 `tool.compact` 桥接,不动 recency):**
81
+ 6. `BRIDGE_TOOL_SCHEMAS` 删 `compact` 条目。
82
+ 7. 删 `compactCallable` 函数 + bindings 装配处 `compact: compactCallable`。
83
+
84
+ **保留:**
85
+ - `send_message` 桥接(A2A 双向)。
86
+ - `eval`(传输核心)。
87
+ - **被动 recency 压缩引擎**:`src/compaction/recency-engine.ts`(`RecencyAwareCompactionEngine`,`auto: true` step 间自动压)+ `compactModel` 配置 + `src/compaction-surface.ts` + `scopedCompaction` wiring —— **全部保留**(被动压缩有用,且不占 REPL 面)。
88
+
89
+ ---
90
+
91
+ ## 5. 复测计划(落地后执行)
92
+
93
+ 1. 跑 `npm test`(预期原 156 用例中,refine/compact/harness 相关 spec 删除或转绿)。
94
+ 2. 实测 `tool.*` 面:`tool.refine` / `tool.compact` → `unknown binding`;`tool.send_message` / `tool.eval` 正常。
95
+ 3. 确认 `refine`/`compact` 不再出现在 Tool Catalog。
96
+ 4. 文档缺口(#4/#5)核对 README 是否对齐 v0.1.8b 实际形态。
@@ -0,0 +1,127 @@
1
+ # DASHR v0.1.8c 实测报告(URL Schema 第一人称实测)
2
+
3
+ > 状态:URL schema 已部署到运行时,但**部分生效**——本报告为实测记录 + 待修缺口清单,只做实测/记录,不动代码。
4
+ > 日期:2026-08-26
5
+ > 变更对象:`openspec/changes/url-schema/`(proposal + design + specs + impl-contract)
6
+ > 发布包:`@pgmi-builds/dashr@0.1.10`(`package.json` 已升 0.1.10;本 openspec change 沿用 v0.1.8c 标签)
7
+
8
+ ---
9
+
10
+ ## 0. 结论摘要
11
+
12
+ | 验收面 | 结果 | 一句话 |
13
+ |---|---|---|
14
+ | URL resolver + read 路由 | ✅ 生效 | `read` 能把 `scheme://` 分流到 handler |
15
+ | `skill://` | 🔴 坏 | `ctx.skills` 注册表空,与 prompt 里的 skill 目录不同源 |
16
+ | `agent://`(名册 / 输出 / transcript / child) | ✅ 生效 | 四形态返回真实内容;但名册字段与 spec 不符 |
17
+ | `history://` 并入 `agent://` | ✅ 生效 | 返回「已并入」提示 |
18
+ | `dsh://config` | ✅ 生效 | 返回 resolved settings,无 secret 泄漏 |
19
+ | `dsh://docs` | 🔴 坏 | `docs/` 没打进发布包,`resolveDocsDir` 从安装路径向上找不到 |
20
+ | `ctx://` 读 | 🔴 坏 | URL 分支传空 env,落到 `AGENTLESS_KEY` 空内核 |
21
+ | `ctx://` 写 | 🔴 未接线 | `writeCtxVar` 是死代码,`defaultSchemeWrite` 直接抛不支持 |
22
+ | `xd://` 读 + 写 | ✅ 生效 | 空占位行为与 spec 一致 |
23
+ | selector 语法(`:N-M` / `:raw` / …) | ✅ 生效 | `dsh://config:1-3` 正确按行截断 |
24
+ | 未注册 scheme 报错 | ✅ 生效 | 结构化报错并列出 `registered: agent, ctx, dsh, skill, xd` |
25
+ | mask `skill` 工具(D5) | 🔴 未生效 | 只挡 REPL 的 `tool.*` 面,host 层原生 `skill` + `<available_skills>` 仍在 |
26
+ | **`write` 普通路径(透传)** | 🔴 **回归** | **`write` 工具对工作区任意路径一律拒绝,只放行 `/tmp`;`read`/`edit`/bash 均正常** |
27
+
28
+ **净结果:6 个 scheme 里 3 个半生效(agent / dsh:config / xd + selector/history),2 个半坏(skill / ctx 读),1 个彻底坏(ctx 写),1 个配套改造(dsh:docs)坏,1 个 BREAKING(mask skill)未生效;另有 1 处**非 URL 路径 `write` 的回归**(破坏「普通路径透传」spec)。**
29
+
30
+ ---
31
+
32
+ ## 1. 部署状态确认(不是 stale host)
33
+
34
+ 上一轮 v0.1.8c 实测结论是「stale host + BetterEdit shadow 冲突」。本轮复核**推翻该结论**:
35
+
36
+ - 运行时实际加载的 DASHR 包 = `~/.dsh/profiles/web/node_modules/@pgmi-builds/dashr`,`package.json` version `0.1.10`。
37
+ - 部署 `lib/index.js`(2026-08-26 04:22 构建,210482 字节)与工作区 `dashr/lib/index.js`(04:21)**逐字节一致**——是最新构建,非旧代码。
38
+ - `dashr/src/url-schema/` 源码完整(resolver / selector / handlers×5 / tools×4 / vendored hashline)。
39
+ - 5 个 handler **都已注册**(未注册 scheme 报错里列得全:`agent, ctx, dsh, skill, xd`)。
40
+
41
+ 所以剩余问题**不是代码没跑起来,是部署接线/打包缺口 + 一处 write 回归**。
42
+
43
+ ---
44
+
45
+ ## 2. 逐项实测记录
46
+
47
+ > 以下均为本人(Dash Agent 运行时)直接调用自身 `read`/`write`/`grep`/`glob` 工具得到的第一人称结果。
48
+
49
+ | scheme / 面 | 调用 | 实际返回 |
50
+ |---|---|---|
51
+ | skill:// 存在名 | `read skill://markitdown` | `skill "markitdown" is unknown or no longer available`(markitdown 在 `<available_skills>` 里真实存在) |
52
+ | skill:// 不存在名 | `read skill://__nonexistent__` | 同上结构化报错 |
53
+ | agent:// 裸 | `read agent://` | 名册表 `id / origin / depth / cwd`(4 条 session) |
54
+ | agent://<id> | `read agent://<session-id>` | 返回该 agent 最后一条非空 assistant 输出文本 |
55
+ | agent://<id>/transcript | `read agent://<id>/transcript` | 返回完整 transcript(role-headed) |
56
+ | history:// | `read history://` | `history:// 已并入 agent://:…` |
57
+ | dsh://config | `read dsh://config` | 6296 字节 resolved settings JSON;`api` 命中全为端点 URL(`api.z.ai` 等),无 key/token/secret |
58
+ | dsh://docs | `read dsh://docs` | `dsh://docs: no docs directory found (provide docsDir to createDshHandler)` |
59
+ | ctx:// 裸 | `read ctx://` | 空串(空命名空间) |
60
+ | ctx://<var> | `read ctx://probe_marker` | `ctx://probe_marker: no such variable in the kernel namespace`(该变量在 eval 内核里真实存在) |
61
+ | ctx:// 写 | `write ctx://test_var` | `write to ctx:// is not supported (read-only scheme, or its write channel is not wired yet)` |
62
+ | xd:// 裸 | `read xd://` | `no devices mounted` |
63
+ | xd://<device> | `read xd://lsp` | `unknown device: lsp` |
64
+ | xd:// 写 | `write xd://lsp` | `xd:// write dispatch: no devices mounted to route the write to` |
65
+ | 未注册 scheme | `read http://example.com/x` | `no handler registered for scheme "http" (registered: agent, ctx, dsh, skill, xd)` |
66
+ | selector | `read dsh://config:1-3` | 按 1–3 行截断返回 |
67
+ | grep/glob scheme | `grep skill://markitdown`、`glob skill://markitdown/**` | 均因 skill 未知而报错(路由生效,handler 上游失败) |
68
+ | read 普通文件 | `read docs/.__editprobe.md` | 正常返回 `HASH│content` 锚点 |
69
+ | edit 普通文件 | `edit`(先 read 后 edit) | 正常改写,锚点随内容更新 |
70
+ | **write 普通文件** | `write /home/u1/workspaces/dashr/docs/test-ascii.md` | `cannot write "…": file access denied under workspace-write mode` |
71
+ | **write 工作区根** | `write /home/u1/workspaces/dashr/test-root.md` | 同上被拒 |
72
+ | **write /tmp** | `write /tmp/dashr-test.md` | 成功 `{operation: 'create'}` |
73
+ | **bash 写工作区** | `printf … > docs/.__probe.md` | 成功(OS/bash 层不受影响) |
74
+
75
+ ---
76
+
77
+ ## 3. 失效点根因(已定位到源码)
78
+
79
+ 1. **`skill://`** —— `dashr/src/url-schema/handlers/skill.ts` 查 `ctx.skills.get(name)`(`@deepseek-ai/dsh-skill` 的 `SkillRegistry`),但该注册表**为空**,与注入 prompt 的 harness session skill 目录(`<available_skills>`)不是同一来源。skill handler 本身逻辑正确(错误分支、`/path` 资源寻址、路径逃逸守卫都在),只是上游 `ctx.skills` 没被喂进实际可用的 skill。
80
+
81
+ 2. **`dsh://docs`** —— `dashr/src/url-schema/index.ts` 的 `resolveDocsDir()` 从 `import.meta.url` 向上找 `docs/`。发布包 `@pgmi-builds/dashr` 里**没有 `docs/`**(`docs/` 在仓库根 `/home/u1/workspaces/dashr/docs`,位于包根 `dashr/` 之外,未进 npm 包)。运行时从 `~/.dsh/profiles/web/node_modules/...` 加载,向上走到 `/` 也够不着仓库里的 docs。dev 布局(`dashr/lib/index.js` 向上能到 `/home/u1/workspaces/dashr/docs`)能跑通,装进 node_modules 就断——纯打包缺口。
82
+
83
+ 3. **`ctx://` 读** —— `dashr/src/url-schema/tools/read.ts` 的 URL 分支调 `resolver.resolve({}, rawPath)`,传**空 env**;`handlers/ctx.ts` 随之 `queryVar(name)` 不传 `principal`,`runtime.ts:393` 落到 `AGENTLESS_KEY`(共享默认内核)——而 eval cell 跑在**会话 principal 键**的内核上。所以永远读一个没人用的空内核,真实存在的变量也报 missing。对比:文件分支正确用了 `execSessionKey(exec)`,URL 分支没传。
84
+
85
+ 4. **`ctx://` 写** —— `dashr/src/url-schema/tools/write.ts` 的 `defaultSchemeWrite` 对除 `xd` 外一律抛 `URL_WRITE_UNSUPPORTED`;`handlers/ctx.ts` 里已写好的 `writeCtxVar` 是**死代码**(`index.ts` 装 write 工具只传 `{ nativeWrite }`,没传 `writeScheme` 把 `ctx://` 路由到 `writeCtxVar`)。
86
+
87
+ 5. **mask `skill`(D5)** —— `dashr/src/index.ts:154` 的 `MASKED_TOOL_NAMES` 确实含 `'skill'`,但它只作用于 REPL 自己的 `tool.*` 绑定面(`index.ts:761`)+ Tool Catalog(`index.ts:901`),所以 eval cell 里 `tool.skill` 确实没了;但**挡不住 host 层注入的原生 `skill` 工具 + `<available_skills>` 目录**,模型从原生工具面照样能看见并调用 `skill`。验收项「工具目录不含 skill」未达成。
88
+
89
+ 6. **`write` 普通路径回归(新增)** —— 设计 D2 明确「不替换 write(write 保留原生,只挂 write-hook 装饰结果)」,但 v0.1.10 实际用 `tools/write.ts` 的 `createWriteTool` 以 `name: 'write'` **shadow 了原生 write**,其 `nativeWrite` 直接 `ctx.fs.resolve(...)` + `ctx.fs.writeText(...)`,**没走原生 write 工具的 write-intent 政策门**,于是对工作区路径被 sandbox 拒绝(`file access denied under workspace-write mode`),只放行 `/tmp`。对比:`read`/`edit` 走 vendored hashline 的 fs-bridge(含 `fs/write-intent` + `fs/observed` 政策门),工作区读写正常;bash 也正常。**这直接违反 spec「普通路径透传」——非 scheme 的 `write` 行为与引入 URL schema 之前不一致。**
90
+
91
+ ---
92
+
93
+ ## 4. 一处 spec 偏差(非阻断)
94
+
95
+ `agent://` 名册 schema 与 spec 不符:
96
+
97
+ - `specs/agent/spec.md` 要求:`id / status / kind / parent / last activity`
98
+ - `handlers/agent.ts` 的 `renderRoster` 实际:`id / origin / depth / cwd`
99
+
100
+ 字段语义对不上(`origin`≠`kind`、`depth`≠`parent`、缺 `status`/`last activity`、多了 `cwd`)。
101
+
102
+ ---
103
+
104
+ ## 5. 最小修复清单
105
+
106
+ | # | 缺口 | 落点 | 类型 |
107
+ |---|---|---|---|
108
+ | 1 | URL 分支透传会话 `principal`(复用 `execSessionKey(exec)`)给 `queryVar`/`setVar` | `tools/read.ts`、`handlers/ctx.ts`、resolver env | 代码 |
109
+ | 2 | write 工具接上 `writeScheme`,把 `ctx://` 路由到 `writeCtxVar` | `tools/write.ts`、`index.ts` `installAgentTools` | 代码 |
110
+ | 3 | `ctx.skills` 注册表与 harness session skill 目录同源(或 skill handler 改读 `<available_skills>` 来源) | `handlers/skill.ts`、`index.ts` 接线 | 代码 |
111
+ | 4 | `docs/` 收进发布包(`package.json` files / 或 `docsDir` 指向随包路径) | `index.ts` `resolveDocsDir`、打包配置 | 打包 |
112
+ | 5 | mask `skill` 到 host 注入层(非只 REPL `tool.*` 面) | host 层 / `index.ts` mask 机制 | 代码 |
113
+ | 6 | `agent://` 名册字段对齐 spec(id/status/kind/parent/last activity) | `handlers/agent.ts` `renderRoster` | 代码/文档 |
114
+ | 7 | **修复 `write` 普通路径回归**:native 分支走原生 write-intent 政策门(或直接委托上游原生 write),而非裸 `ctx.fs.writeText` | `tools/write.ts` `nativeWrite`、`index.ts` | 代码 |
115
+
116
+ ---
117
+
118
+ ## 6. 复测计划(修复后执行)
119
+
120
+ 1. `read skill://<真实 skill 名>` 返回正文;`skill://<name>/<path>` 返回内部资源;未注册名结构化报错。
121
+ 2. 原生工具面不再出现 `skill`(且 `<available_skills>` 保留为发现层)。
122
+ 3. `read dsh://docs` 返回文档清单,`dsh://docs/<doc>` 返回正文。
123
+ 4. eval 里 `x = 1` 后 `read ctx://x` 返回 `1`;`write ctx://y` 后 `read ctx://y` 返回新值。
124
+ 5. `read ctx://` 列出命名空间(含刚写的 y)。
125
+ 6. `agent://` 名册含 status/kind/parent/last activity。
126
+ 7. **`write <工作区普通路径>` 成功(回归修复)**。
127
+ 8. 回归:`read`/`write`/`grep`/`glob` 普通路径 + hashline 锚点无回归;`npm test` 全绿。