modkh 0.0.0-stage → 0.1.0

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 (256) hide show
  1. package/README.md +24 -2
  2. package/dist/agent/bundled-skills.d.ts +13 -0
  3. package/dist/agent/bundled-skills.js +95 -0
  4. package/dist/agent/images.d.ts +10 -0
  5. package/dist/agent/images.js +33 -0
  6. package/dist/agent/loop.d.ts +56 -0
  7. package/dist/agent/loop.js +155 -0
  8. package/dist/agent/skills.d.ts +20 -0
  9. package/dist/agent/skills.js +169 -0
  10. package/dist/agent/types.d.ts +132 -0
  11. package/dist/agent/types.js +12 -0
  12. package/dist/cli/agents.d.ts +8 -0
  13. package/dist/cli/agents.js +12 -0
  14. package/dist/cli/approval.d.ts +27 -0
  15. package/dist/cli/approval.js +62 -0
  16. package/dist/cli/catalog.d.ts +39 -0
  17. package/dist/cli/catalog.js +76 -0
  18. package/dist/cli/chat.d.ts +18 -0
  19. package/dist/cli/chat.js +733 -0
  20. package/dist/cli/clipboard.d.ts +9 -0
  21. package/dist/cli/clipboard.js +54 -0
  22. package/dist/cli/color.d.ts +42 -0
  23. package/dist/cli/color.js +176 -0
  24. package/dist/cli/config.d.ts +41 -0
  25. package/dist/cli/config.js +188 -0
  26. package/dist/cli/editor.d.ts +16 -0
  27. package/dist/cli/editor.js +77 -0
  28. package/dist/cli/keys.d.ts +18 -0
  29. package/dist/cli/keys.js +82 -0
  30. package/dist/cli/language.d.ts +1 -0
  31. package/dist/cli/language.js +105 -0
  32. package/dist/cli/limits.d.ts +13 -0
  33. package/dist/cli/limits.js +19 -0
  34. package/dist/cli/lines.d.ts +18 -0
  35. package/dist/cli/lines.js +80 -0
  36. package/dist/cli/models.d.ts +4 -0
  37. package/dist/cli/models.js +69 -0
  38. package/dist/cli/permissions.d.ts +25 -0
  39. package/dist/cli/permissions.js +30 -0
  40. package/dist/cli/plugins.d.ts +1 -0
  41. package/dist/cli/plugins.js +53 -0
  42. package/dist/cli/providers.d.ts +46 -0
  43. package/dist/cli/providers.js +76 -0
  44. package/dist/cli/terminal.d.ts +143 -0
  45. package/dist/cli/terminal.js +742 -0
  46. package/dist/cli/usage.d.ts +29 -0
  47. package/dist/cli/usage.js +75 -0
  48. package/dist/index.d.ts +11 -0
  49. package/dist/index.js +164 -0
  50. package/dist/language/catalog.d.ts +44 -0
  51. package/dist/language/catalog.js +100 -0
  52. package/dist/language/commonlisp-bundled.d.ts +11 -0
  53. package/dist/language/commonlisp-bundled.js +22 -0
  54. package/dist/language/commonlisp-dependencies.d.ts +16 -0
  55. package/dist/language/commonlisp-dependencies.js +68 -0
  56. package/dist/language/commonlisp-install.d.ts +14 -0
  57. package/dist/language/commonlisp-install.js +213 -0
  58. package/dist/language/commonlisp-reader.d.ts +17 -0
  59. package/dist/language/commonlisp-reader.js +47 -0
  60. package/dist/language/commonlisp-systems.d.ts +3 -0
  61. package/dist/language/commonlisp-systems.js +32 -0
  62. package/dist/language/commonlisp-tls.d.ts +10 -0
  63. package/dist/language/commonlisp-tls.js +51 -0
  64. package/dist/language/detect.d.ts +29 -0
  65. package/dist/language/detect.js +103 -0
  66. package/dist/language/grammars/LICENSE +24 -0
  67. package/dist/language/grammars/manifest.json +76 -0
  68. package/dist/language/grammars/tree-sitter-c.wasm +0 -0
  69. package/dist/language/grammars/tree-sitter-cpp.wasm +0 -0
  70. package/dist/language/grammars/tree-sitter-css.wasm +0 -0
  71. package/dist/language/grammars/tree-sitter-html.wasm +0 -0
  72. package/dist/language/grammars/tree-sitter-javascript.wasm +0 -0
  73. package/dist/language/grammars/tree-sitter-php.wasm +0 -0
  74. package/dist/language/grammars/tree-sitter-python.wasm +0 -0
  75. package/dist/language/grammars/tree-sitter-ruby.wasm +0 -0
  76. package/dist/language/grammars/tree-sitter-rust.wasm +0 -0
  77. package/dist/language/grammars/tree-sitter-swift.wasm +0 -0
  78. package/dist/language/grammars/tree-sitter-tsx.wasm +0 -0
  79. package/dist/language/grammars/tree-sitter-typescript.wasm +0 -0
  80. package/dist/language/install.d.ts +50 -0
  81. package/dist/language/install.js +293 -0
  82. package/dist/language/lsp/client.d.ts +97 -0
  83. package/dist/language/lsp/client.js +337 -0
  84. package/dist/language/lsp/pool.d.ts +67 -0
  85. package/dist/language/lsp/pool.js +122 -0
  86. package/dist/language/lsp/service.d.ts +46 -0
  87. package/dist/language/lsp/service.js +138 -0
  88. package/dist/language/native.d.ts +8 -0
  89. package/dist/language/native.js +100 -0
  90. package/dist/language/platform.d.ts +14 -0
  91. package/dist/language/platform.js +20 -0
  92. package/dist/language/positions.d.ts +20 -0
  93. package/dist/language/positions.js +46 -0
  94. package/dist/language/syntax/assets.d.ts +9 -0
  95. package/dist/language/syntax/assets.js +73 -0
  96. package/dist/language/syntax/parser.d.ts +24 -0
  97. package/dist/language/syntax/parser.js +144 -0
  98. package/dist/language/typescript-capability.d.ts +6 -0
  99. package/dist/language/typescript-capability.js +42 -0
  100. package/dist/lisp/config.d.ts +16 -0
  101. package/dist/lisp/config.js +159 -0
  102. package/dist/lisp/routing.d.ts +5 -0
  103. package/dist/lisp/routing.js +24 -0
  104. package/dist/lisp/runtime.d.ts +21 -0
  105. package/dist/lisp/runtime.js +83 -0
  106. package/dist/memory/kiokuko.d.ts +32 -0
  107. package/dist/memory/kiokuko.js +102 -0
  108. package/dist/memory/mcp.d.ts +38 -0
  109. package/dist/memory/mcp.js +211 -0
  110. package/dist/model/ai-sdk.d.ts +27 -0
  111. package/dist/model/ai-sdk.js +180 -0
  112. package/dist/model/chatgpt/login.d.ts +42 -0
  113. package/dist/model/chatgpt/login.js +180 -0
  114. package/dist/model/chatgpt/responses.d.ts +41 -0
  115. package/dist/model/chatgpt/responses.js +202 -0
  116. package/dist/model/chatgpt/tokens.d.ts +11 -0
  117. package/dist/model/chatgpt/tokens.js +50 -0
  118. package/dist/model/connection.d.ts +6 -0
  119. package/dist/model/connection.js +65 -0
  120. package/dist/model/context.d.ts +9 -0
  121. package/dist/model/context.js +69 -0
  122. package/dist/model/factory.d.ts +25 -0
  123. package/dist/model/factory.js +88 -0
  124. package/dist/model/fixed.d.ts +17 -0
  125. package/dist/model/fixed.js +41 -0
  126. package/dist/model/reasoning.d.ts +16 -0
  127. package/dist/model/reasoning.js +62 -0
  128. package/dist/plugins/api.d.ts +60 -0
  129. package/dist/plugins/api.js +1 -0
  130. package/dist/plugins/manager.d.ts +34 -0
  131. package/dist/plugins/manager.js +261 -0
  132. package/dist/plugins/package.d.ts +13 -0
  133. package/dist/plugins/package.js +99 -0
  134. package/dist/plugins/registry.d.ts +8 -0
  135. package/dist/plugins/registry.js +14 -0
  136. package/dist/session/store.d.ts +82 -0
  137. package/dist/session/store.js +285 -0
  138. package/dist/session/workspace.d.ts +19 -0
  139. package/dist/session/workspace.js +73 -0
  140. package/dist/subagents/processes.d.ts +18 -0
  141. package/dist/subagents/processes.js +73 -0
  142. package/dist/subagents/request.d.ts +4 -0
  143. package/dist/subagents/request.js +21 -0
  144. package/dist/subagents/service.d.ts +39 -0
  145. package/dist/subagents/service.js +352 -0
  146. package/dist/subagents/settings.d.ts +10 -0
  147. package/dist/subagents/settings.js +32 -0
  148. package/dist/subagents/types.d.ts +43 -0
  149. package/dist/subagents/types.js +1 -0
  150. package/dist/subagents/verification.d.ts +31 -0
  151. package/dist/subagents/verification.js +178 -0
  152. package/dist/tools/diff.d.ts +6 -0
  153. package/dist/tools/diff.js +82 -0
  154. package/dist/tools/edit.d.ts +3 -0
  155. package/dist/tools/edit.js +152 -0
  156. package/dist/tools/files.d.ts +6 -0
  157. package/dist/tools/files.js +96 -0
  158. package/dist/tools/formal.d.ts +8 -0
  159. package/dist/tools/formal.js +77 -0
  160. package/dist/tools/guard.d.ts +7 -0
  161. package/dist/tools/guard.js +48 -0
  162. package/dist/tools/job-tools.d.ts +19 -0
  163. package/dist/tools/job-tools.js +148 -0
  164. package/dist/tools/jobs.d.ts +77 -0
  165. package/dist/tools/jobs.js +181 -0
  166. package/dist/tools/language.d.ts +6 -0
  167. package/dist/tools/language.js +174 -0
  168. package/dist/tools/registry.d.ts +28 -0
  169. package/dist/tools/registry.js +105 -0
  170. package/dist/tools/run.d.ts +13 -0
  171. package/dist/tools/run.js +159 -0
  172. package/dist/tools/search.d.ts +2 -0
  173. package/dist/tools/search.js +156 -0
  174. package/dist/tools/shell-process.d.ts +115 -0
  175. package/dist/tools/shell-process.js +286 -0
  176. package/dist/tools/skills.d.ts +2 -0
  177. package/dist/tools/skills.js +46 -0
  178. package/dist/tools/web.d.ts +24 -0
  179. package/dist/tools/web.js +386 -0
  180. package/docs/ci-repair-20261116.md +30 -0
  181. package/docs/commonlisp-provider-migration.md +22 -0
  182. package/docs/commonlisp-qlot-recovery.md +28 -0
  183. package/docs/commonlisp-tls-recovery.md +28 -0
  184. package/docs/context-efficiency.md +100 -0
  185. package/docs/input.md +66 -0
  186. package/docs/languages.md +117 -0
  187. package/docs/models.md +85 -0
  188. package/docs/modkh-evidence.json +641 -0
  189. package/docs/modkh-failure-comparison.json +675 -0
  190. package/docs/modkh-namespace.md +39 -0
  191. package/docs/modkh-qlot-evidence.json +37 -0
  192. package/docs/modkh-verification.md +173 -0
  193. package/docs/modkh.md +124 -0
  194. package/docs/presets.md +19 -0
  195. package/docs/setup.md +112 -0
  196. package/docs/subagents.md +134 -0
  197. package/docs/web.md +57 -0
  198. package/experiments/presets/common-lisp.lisp +38 -0
  199. package/experiments/presets/css.lisp +38 -0
  200. package/experiments/presets/formal.lisp +7 -0
  201. package/experiments/presets/html.lisp +38 -0
  202. package/experiments/presets/js.lisp +38 -0
  203. package/experiments/presets/php.lisp +38 -0
  204. package/experiments/presets/svelte.lisp +38 -0
  205. package/experiments/presets/tailwindcss.lisp +24 -0
  206. package/experiments/presets/ts.lisp +38 -0
  207. package/package.json +49 -4
  208. package/plugins/modkh-explorer/index.mjs +3 -0
  209. package/plugins/modkh-explorer/plugin.json +1 -0
  210. package/plugins/modkh-worker/index.mjs +3 -0
  211. package/plugins/modkh-worker/plugin.json +1 -0
  212. package/skills/kiokuko-dsh/LICENSE +21 -0
  213. package/skills/kiokuko-dsh/coding-ideal-routine-skill/SKILL.md +106 -0
  214. package/skills/kiokuko-dsh/japanese-translation-for-oss-models/SKILL.md +65 -0
  215. package/skills/kiokuko-dsh/kiokuko-architecture/SKILL.md +20 -0
  216. package/skills/kiokuko-dsh/kiokuko-architecture/references/cases.md +11 -0
  217. package/skills/kiokuko-dsh/kiokuko-benchmark/SKILL.md +20 -0
  218. package/skills/kiokuko-dsh/kiokuko-benchmark/references/cases.md +11 -0
  219. package/skills/kiokuko-dsh/kiokuko-investigate/SKILL.md +20 -0
  220. package/skills/kiokuko-dsh/kiokuko-investigate/references/cases.md +11 -0
  221. package/skills/kiokuko-dsh/kiokuko-lisp/SKILL.md +390 -0
  222. package/skills/kiokuko-dsh/kiokuko-review/SKILL.md +20 -0
  223. package/skills/kiokuko-dsh/kiokuko-review/references/cases.md +11 -0
  224. package/skills/kiokuko-dsh/kiokuko-simple-work/SKILL.md +70 -0
  225. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/SKILL.md +79 -0
  226. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/boundaries-and-ownership.md +52 -0
  227. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/domain-and-types.md +48 -0
  228. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/effects-and-data.md +43 -0
  229. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/kiokuko-patterns.md +314 -0
  230. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/problem-shaping-and-language.md +90 -0
  231. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/protocols-and-idempotency.md +42 -0
  232. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/review-checklist.md +92 -0
  233. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/verification.md +45 -0
  234. package/skills/kiokuko-dsh/kiokuko-skill-authoring/SKILL.md +20 -0
  235. package/skills/kiokuko-dsh/kiokuko-skill-authoring/references/cases.md +11 -0
  236. package/skills/kiokuko-dsh/kiokuko-soul/SKILL.md +25 -0
  237. package/skills/kiokuko-dsh/kiokuko-technical-writing/SKILL.md +20 -0
  238. package/skills/kiokuko-dsh/kiokuko-technical-writing/references/cases.md +11 -0
  239. package/skills/kiokuko-dsh/kiokuko-ui-design-soul/SKILL.md +64 -0
  240. package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/accessibility-and-navigation.md +31 -0
  241. package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/async-recovery.md +49 -0
  242. package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/forms-and-controls.md +35 -0
  243. package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/interaction-feedback.md +34 -0
  244. package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/responsive-and-platform.md +38 -0
  245. package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/safety-and-review.md +43 -0
  246. package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/ui-checklist.md +75 -0
  247. package/skills/kiokuko-dsh/kiokuko-verification/SKILL.md +20 -0
  248. package/skills/kiokuko-dsh/kiokuko-verification/references/cases.md +11 -0
  249. package/skills/kiokuko-dsh/manifest.json +168 -0
  250. package/skills/kiokuko-dsh/memory-reasoning/SKILL.md +44 -0
  251. package/skills/kiokuko-dsh/one-shot-software-completion/SKILL.md +113 -0
  252. package/skills/kiokuko-dsh/one-shot-software-completion/references/boundaries-and-lifecycle.md +70 -0
  253. package/skills/kiokuko-dsh/one-shot-software-completion/references/discovery-and-scope.md +71 -0
  254. package/skills/kiokuko-dsh/one-shot-software-completion/references/failure-recovery.md +43 -0
  255. package/skills/kiokuko-dsh/one-shot-software-completion/references/verification-and-completion.md +73 -0
  256. package/skills/kiokuko-dsh/veteran-programmer-skill/SKILL.md +66 -0
@@ -0,0 +1,39 @@
1
+ # MoDKH名前空間への統一
2
+
3
+ 旧DKHから独立した保存先と識別子へ変更しました。ユーザーの既存データやグローバルインストールは変更していません。旧設定の暗黙フォールバック・移行はありません。
4
+
5
+ | 対象 | 新しい値 |
6
+ |---|---|
7
+ | 設定・認証・セッション・言語cache | XDG_CONFIG_HOME/modkh(既定 ~/.config/modkh) |
8
+ | 保存先指定 | MODKH_HOME |
9
+ | 行入力モード | MODKH_PLAIN |
10
+ | ワークスペース記録 | .modkh/sessions |
11
+ | ワークスペーススキル設定 | .modkh/skills.json |
12
+ | Lisp設定package | :modkh |
13
+ | 組込み担当ID | modkh-worker、modkh-explorer |
14
+ | CLI・LSP/MCPクライアント識別名 | modkh |
15
+
16
+ 初回は /connect で新しい保存先に接続を設定してください。独自Lisp設定は (in-package :modkh) に変更し、内容確認後にtrust hashを取り直します。旧 .dkh や ~/.config/dkh は削除しません。
17
+
18
+ ソース・全プリセット・組込みplugin・利用手順・試験と受入スクリプトの参照を更新。名前の由来 Mixture of DKH、第三者の同梱スキル原文・hash、過去の検証記録、旧環境を模した回帰fixture、除外済みの検証領域 .dkh-feasibility は履歴/出典として保持しています。
19
+
20
+ ## 検証(macOS arm64)
21
+
22
+ - npm run typecheck / npm run build / git diff --check: 成功。
23
+ - 保存先・workspace記録・skills・plugin lifecycle・実SBCL設定: 26成功。
24
+ - npm test: 450件、384成功、58失敗、8skip。58件の試験名/error/codeは前回記録と一致、新規失敗なし。全体成功とはしません。
25
+ - 実ビルドCLIをfixed/scriptedで起動し、.modkh/sessionsに記録を作成。.dkhは未作成。意図的に指定した旧DKH_HOMEのmarkerだけが残り、そこへ追加書込みなし。
26
+ - 全体suite内のpacked artifact試験も成功。実モデル委譲・実CL-LSPの完了を示すものではありません。
27
+ - CIは未pushのため未実行。既報のCI SBCL導入漏れは今回の名前空間修正とは別の未修正事項です。
28
+
29
+ source digest: 46a7a5ca2ec27d543af0235eb4a1de2a4f3f626871dbd7037193f67a6fcd4103
30
+
31
+ built dist digest: c0a5d7d9a01b73f0104b60340ae734f58bdbd6874c5680a313d022f6dcdf29d1
32
+
33
+ 既存グローバルコマンドにはまだ反映していません。READMEの手順で再pack・導入が必要です。commit/pushなし。
34
+
35
+ ## Roswellアーカイブ誤拒否の修正
36
+
37
+ ユーザーの実失敗receiptでrelease-downloadとSHA256検証は成功。archive-pathsには公式の install+sigsegv.lisp などが含まれ、旧allowlistが + を拒否していた。+ を許可し、範囲外パス・親参照・不正文字の拒否は維持。検査をarchive-layout段階として記録し、拒否した名前をエラーに含める。
38
+
39
+ 実一覧と出典digestをtest/fixtures/roswell-archive-paths.*へ保存。旧条件での拒否・修正後の許可、危険パス拒否を検証。関連8試験成功、再build済み入口の同じ関数でも実一覧を受理。アーカイブ本体の展開やCL-LSP初期化を今回成功確認したものではない。
@@ -0,0 +1,37 @@
1
+ {
2
+ "date": "2026-11-15",
3
+ "baseRevision": "55c4aab",
4
+ "platform": "darwin",
5
+ "arch": "arm64",
6
+ "identity": {
7
+ "source": {
8
+ "sha256": "92c5e73fff37cbf9f7a09614d841db28f7ed0c853a81991ba9d9ffa6fc6e9da5",
9
+ "files": 150
10
+ },
11
+ "artifact": {
12
+ "sha256": "af772e277d520b078eabf24e2faedc5e71d9b79edd78ca9d38b87169ab98e6c0",
13
+ "files": 174
14
+ }
15
+ },
16
+ "status": "partial; real Qlot installation and CL-LSP startup blocked",
17
+ "network": {
18
+ "command": "git ls-remote https://github.com/fukamachi/qlot.git HEAD",
19
+ "exitCode": 128,
20
+ "error": "Could not resolve host: github.com"
21
+ },
22
+ "checks": {
23
+ "typecheck": "passed",
24
+ "build": "passed; 12 bundled grammars, 17 skills",
25
+ "suite": {
26
+ "tests": 446,
27
+ "pass": 380,
28
+ "fail": 58,
29
+ "skip": 8
30
+ },
31
+ "failureComparison": "same names/error/code as previous recorded final suite; not a fresh pre-edit run",
32
+ "realLsp": "not run",
33
+ "qlotStageTests": "scripted runner; not real Qlot",
34
+ "microsTest": "real SBCL with minimal fixture; not real micros server"
35
+ },
36
+ "globalEnvironment": "unchanged"
37
+ }
@@ -0,0 +1,173 @@
1
+ # Lem/Qlot依存環境の修正(2026-11-15)
2
+
3
+ **PLAN全体は未完了。実CL-LSPの起動は未検証。** 対象 /Users/dkc/Sites/Src/mdkh、開始HEAD 55c4aab、開始時clean。AGENTS.md/PLAN.mdは現在のcheckoutに存在せず、本会話の指示を継承。グローバル設定、既存Roswell/Quicklisp、commit/pushは変更なし。
4
+
5
+ ## 変更
6
+
7
+ - src/language/commonlisp-dependencies.ts: 専用RoswellへQlotを導入し、取得済みLemのqlfileを専用dependenciesディレクトリへコピーして公式の install --no-deps を実行。上流の過去lockをコピーせず現在のmanifestを解決し、生成lock本文・hash、setup hash、Qlot版出力を記録。終了0だけでなくsetup/lockの存在と後続ASDF discoveryを要求。
8
+ - src/language/commonlisp-install.ts: 手書きの依存Git一覧をLemのmanifest解決へ置換。QUICKLISP_HOMEと明示CL_SOURCE_REGISTRYをfrontend/backendの両方へ渡す。async-processのnative buildはASDFが選択した専用領域内のソースを使用。領域外・symlinkによる逸脱は拒否。
9
+ - test/language.commonlisp-dependencies.test.ts: 段階順序、依存失敗、不完全出力、元lock保持、native source境界の3試験。Qlot runnerはscripted。
10
+ - test/language.commonlisp-systems.test.ts: 実SBCLでmicros不在を確認してからregistry修復後のloadを確認する1試験追加。microsは最小fixtureであり実サーバーではない。
11
+
12
+ ## 最終ソースの検証
13
+
14
+ TMPDIRは .dkh-feasibility/qlot-recovery/tmp。
15
+
16
+ - npm run typecheck: 成功。
17
+ - npm run build: 成功。現在のdistを再生成(既存12文法、17スキル)。CL/Svelte実文法を追加したとは主張しない。
18
+ - npm test: 446件、380成功、58失敗、8skip。前回記録の442件と名前/error/codeを照合し新規失敗0、原因変更0。変更前suiteの再実行はしていない。
19
+ - node --test test/language.commonlisp-*.test.ts: 15成功、失敗・skipなし。
20
+ - git diff --check: 成功。
21
+ - packed artifactの既存試験は全体suiteで実行。Qlot実導入をpacked artifactから確認したものではない。
22
+
23
+ ## ブロッカー
24
+
25
+ この実行環境から git ls-remote https://github.com/fukamachi/qlot.git HEAD を実行しexit128、Could not resolve host: github.com。Qlotの実取得・manifest解決・CL-LSP initialize/didOpen/definition/診断は未実行。ユーザーの通常端末で成功したLem/CL-LSP取得とは別の結果。ネットワークへ到達できる許可済み環境で今回のprivate installerを実行する必要がある。OS設定・権限を変更していない。
26
+
27
+ Lem最初の323行目での失敗理由はユーザーログに具体的conditionがなく未確定。今回の修正がそのエラー自体を解消したとは主張しない。既存導入の自動再利用・中断cache再開、他のPLAN残件は引き続き未完了。source/distのdigestとこの試行の範囲は modkh-qlot-evidence.json に記録。
28
+
29
+ ---
30
+
31
+ # MoDKH CL依存の再調査と修正(2026-11-15)
32
+
33
+ **PLAN全体は未完了。** 現在のMacリポジトリを直接編集。基準HEAD `a82a9d447fa8ca85a8d1b289770e22f7b211f81c`、開始時clean。既存PLAN.mdはこの開始時点では存在しなかった。削除・再作成・上書きはしていない。本会話の要求と既存検証記録を継承した。commit/push/グローバル変更なし。
34
+
35
+ ## 今回確認できた原因
36
+
37
+ 既存 `/opt/homebrew/bin/sbcl`、`/opt/homebrew/bin/ros`、Roswell版Quicklisp、取得済みLem/CL-LSPが存在する。過去のDNS失敗を現在の全原因として扱わない。
38
+
39
+ 1. 実SBCL/ASDFで `lem-language-server/cli` は探索先登録前NIL、取得済みLemの探索先登録後は `extensions/language-server/lem-language-server.asd` に解決した。
40
+ 2. SBCL単独+専用領域へコピーしたRoswell版Quicklispのロードは、そのlocal-initがROSWELL packageを要求して失敗。元のQuicklispを変更せず、コピーのlocal-initだけを退避して再試行。
41
+ 3. その結果、LEM_CLIの解決が成功し、`ql:quickload :cl-lsp` は次の依存 `System "micros" not found` まで進んだ。SBCL未導入ではない。
42
+ 4. 不足取得を `https://github.com/lem-project/micros.git` に対してこの実行環境から試し、git exit128 / `Could not resolve host: github.com`。ユーザーが別実行で成功したGitHub取得を否定する結果ではない。
43
+
44
+ ## 直接変更
45
+
46
+ - `src/language/commonlisp-systems.ts`: trusted dependency root内の実.asdディレクトリを列挙し、ASDFへ明示登録。symlink/.git/.qlot/node_modulesを探索しない。システム発見probeを生成。
47
+ - `src/language/commonlisp-install.ts`: cold構築へ `asdf-system-discovery` 段階を追加。Quicklispロード前にLem CLI等の場所をreceiptへ記録し、専用成功markerを要求。startupでもregistryを明示。取得済みLemの現在のlem.asd/qlfileで要求されていた `lem-extension-manager` を公式取得一覧へ追加。
48
+ - `test/language.commonlisp-systems.test.ts`: 実SBCLによる「Lem secondary system不在→registry修復→発見」と、探索境界の2試験。
49
+ - 検証記録3ファイルを更新。
50
+
51
+ この修正はASDF discoveryの修正であり、CL-LSP実起動成功ではない。新テストのASDF定義は最小fixture。実Lemの発見確認は別の実ホストprobe。既存SBCL/Quicklispの自動再利用経路、取得済みcacheの完全再開、RoswellなしでのCL-LSP backendはまだ未完成。既存Lemのmicros-clientは内部で `ros run` を起動するコードを持つことも確認した。Roswell一般が必須という主張ではない。
52
+
53
+ ## 指定されたCL-MCP-Server
54
+
55
+ `~/.quicklisp/local-projects/cl-mcp-server/run-server.lisp`、README、ASDF定義を確認。originは `https://github.com/quasi/cl-mcp-server.git`、revision `23322aa01dd01c44a57f9869729c457dd660ede5`。これはMCP(REPL/評価/内省)サーバーで、LSPではない。launcherは通常のSBCLと `~/.quicklisp/setup.lisp` を優先し、Lemに依存しない。既存SBCL/Quicklispを再利用できる構成として重要だが、LSP initialize/didOpen/definitionの代替成功証拠にはならない。稼働中サーバーは再起動・変更していない。MCP連携自体は今回追加していない。
56
+
57
+ ## 最終変更後の検証
58
+
59
+ cwdは `/Users/dkc/Sites/Src/mdkh`。試験TMPDIRは既存除外領域 `.dkh-feasibility/cl-recovery/tmp`。
60
+
61
+ | コマンド | 結果 |
62
+ |---|---|
63
+ | `npm run typecheck` / `npm run build` / `git diff --check` | 成功、現在のdistを再生成 |
64
+ | `node --test test/lisp*.test.ts test/formal*.test.ts test/language*.test.ts test/language.grammar-artifact.test.mjs` | 101件:92成功/1失敗/8skip |
65
+ | `npm test` | 442件:376成功/58失敗/8skip |
66
+ | build済みchat/fixedを指定した `node --test test/lisp.cli.test.ts` | 2成功 |
67
+ | `node scripts/modkh-mutation-check.mjs .dkh-feasibility/cl-recovery/mutations.json` | 既存11改変すべて検出 |
68
+ | packed artifact | 上記suite内で実WASM・preset・子へのスキル本文試験成功。CL/Svelte実文法ではない。 |
69
+
70
+ 58失敗の名前とerror/codeは前回最終記録と一致。新規失敗0。今回は変更前suiteを再実行しておらず、比較基準はその旨を明記した前回の確定記録。関連1失敗は全体に含まれるHTTP EPERM、残り57件のHTTP EPERM+1件watch EMFILEという内訳は維持。8skipも従来の実Lean6/TLC2で未実行。全件は[比較JSON](modkh-failure-comparison.json)。source/dist、実ASDF、実Quicklisp失敗、正確な取得URLは[証跡JSON](modkh-evidence.json)。
71
+
72
+ CL実LSPの初期化・同期・定義・診断、CL/Svelte実文法、実ファイル監視、Tailwind/PHP診断受入、強いOS隔離、実Lean/TLC・実モデル委譲は未完了。これらをこのターンで再実行したとは主張しない。下記の前回棚卸しを継承し、CL discoveryのみ今回の部分実装として更新する。グローバル実行環境は未更新。
73
+
74
+ ---
75
+
76
+ # 前回時点の検証記録(以下は過去の実測)
77
+
78
+ # MoDKH 最終ソースの検証記録
79
+
80
+ 2026-11-15。**PLAN全体は未完了。** 編集先 `/Users/dkc/Sites/Src/mdkh`、branch `main`。基準HEAD `3e2ae09e40e85d27154a4ccdcda5831ae04544d3`。開始時git statusはclean。現在のリポジトリを直接編集し、既存PLANを変更していない。commit/push/グローバル環境の更新なし。CL構築・通知EPIPE・process cleanupと前回文法digest検査はHEADに存在し、再適用していない。
81
+
82
+ ## 今回の直接変更
83
+
84
+ | ファイル | 内容 |
85
+ |---|---|
86
+ | `src/subagents/verification.ts` | ホスト所有の隔離要件を追加。requiredなら検証器を起動せずnot-executed/unavailable/not-started receiptを返す。source適用なし。receipt digestに隔離方針も含める。 |
87
+ | `src/subagents/service.ts`, `src/cli/chat.ts`, `src/index.ts` | `--verification-isolation required\|integrity-only` を入口からホスト検証まで伝搬。不正値拒否。子のrequestやplugin定義には変更権限なし。 |
88
+ | `test/lisp.edit-service.test.ts` | required時の対象外marker非作成、承認呼出しゼロ、source未適用、JSON保存/再読後の終了状態・digest保持、receipt再利用拒否。 |
89
+ | `test/lisp.cli.test.ts` | 実入口でrequired拒否がheadへ返る試験を追加。両policyで子の実model requestへの2スキル全文、source digest、構造化receiptをassert。 |
90
+ | `test/language.grammar-artifact.test.mjs` | packed artifactから8技術+formalの9presetを実SBCLで評価。同じartifactの入口とスキルを使った子の編集/検証/拒否を実行。 |
91
+ | `scripts/modkh-mutation-check.mjs` | required拒否を削除する改変試験を追加。既存10種を維持。 |
92
+ | `scripts/modkh-language-probe.mjs` | PHPの不正コードに対する実push/pull診断を別記録。空診断で成功にしない。PHP定義位置を呼出し箇所へ修正。 |
93
+ | `docs/modkh.md`, 本書、比較JSON、証跡JSON | 使用方法、方針の限界、現在の証拠に更新。 |
94
+
95
+ ### 隔離方針の契約
96
+
97
+ ```sh
98
+ node dist/index.js chat --lisp-config agents.lisp \
99
+ --trust-lisp-sha256 REVIEWED_SHA256 --verification-isolation required
100
+ ```
101
+
102
+ 現在は検証済みOS backendがないためrequiredは常に未実行を返す。**OS隔離そのものを実装したという意味ではない。** 無隔離への自動降格はない。互換既定値integrity-onlyは既存のsnapshot/鮮度/manifest検査を維持し、`private-snapshot-not-os-sandbox` と明示。信頼したコード専用で、OS書込み防止・秘密保護ではない。`os-enforced`を返す経路はない。信頼Lisp設定自体の任意コード実行もこの方針のsandbox対象ではない。
103
+
104
+ ## 実測と未達
105
+
106
+ - **CL-LSP**: 新規private領域・通常ensureInstalled入口で再試行。compiler確認後、`api.github.com` のDNSがENOTFOUND。取得以降は未実行で、initialize/同期/lexical/global定義/push/pull診断は未検証。成功stateを作らない。既存SBCL reader副作用反例は関連suiteで成功。
107
+ - **実CL/Svelte文法**: `registry.npmjs.org` DNS失敗。CL/Svelte WASMと構築ツール未取得。既存12WASM・整合性試験を維持。CL/Svelteの実ノード/埋込座標/ABI/上流revision/license受入は未完了。
108
+ - **OS隔離**: sandbox-execで最小profile+`/usr/bin/true`を再probeしexit71、`sandbox_apply: Operation not permitted`。cleanup settled。能力probeは製品backendではない。権限変更・迂回なし。Linux実機試験なし。
109
+ - **watch EMFILE**: 新しいNodeプロセスで空fixtureディレクトリへのfs.watchを1個だけ作るprobeもEMFILE。全体suiteの並行負荷がなくても失敗する。これだけでOS制約の内部原因まで確定したとは言わない。元の子孫停止試験を削除せず失敗として保持。
110
+ - **PHP実LSP**: `/opt/homebrew/bin/phpantom_lsp`で初期化・hover・定義参照成功。構文エラー入りファイルはpull応答が空、push通知0。診断品質の受入は未達。空の有効pull reportというプロトコル事実と「エラーなし」は別。実binary digestを保存。
111
+ - **Tailwind実LSP**: `/opt/homebrew/bin/tailwindcss-language-server --stdio` を新規fixtureからcold起動。FSEvents stream起動失敗、hover null、診断waiting。定義済みselectorの配線は通っても実hover受入は未達。
112
+ - **TS実LSP**: 既存 `/usr/local/bin/typescript-language-server --stdio` で初期化・定義・型不一致診断・終了確認成功。latest cold installではない。
113
+ - **実モデル**: 設定にollama-cloudのモデルがあることだけ確認。`ollama.com` DNS解決失敗。自律委譲は未実施。資格情報の有効性は未確認で、scripted成功とは分離。
114
+ - **LSPファイル変更監視**: 現行client/registerCapabilityはACKのみ。実監視は未実装で、今回も完了扱いにしない。8技術すべての実機能成功は未達。
115
+
116
+ ## 最終変更後のコマンド
117
+
118
+ cwdは現在のリポジトリ、テストでは `TMPDIR="$PWD/.dkh-feasibility/final-plan/tmp"` を指定。既存除外領域内でfixture・private導入・ログ・改変試験snapshotを作成。snapshotを実装保存先にしていない。
119
+
120
+ | コマンド | 結果 |
121
+ |---|---|
122
+ | `git diff --check` | 成功 |
123
+ | `npm run typecheck` | 成功 |
124
+ | `npm run build` | 成功、現在のdistを再生成。12文法/17スキル。 |
125
+ | `node --test test/lisp*.test.ts test/formal*.test.ts test/language*.test.ts test/language.grammar-artifact.test.mjs` | 99件: 90成功 / 1失敗 / 8skip |
126
+ | `npm test` | 440件: 374成功 / 58失敗 / 8skip、exit1 |
127
+ | ビルド済みchat/fixedをMODKH_TEST_CHAT/MODKH_TEST_FIXEDで指定した `node --test test/lisp.cli.test.ts` | 2成功。scriptedモデル/実SBCL/実Node検証またはrequired拒否。 |
128
+ | `node scripts/modkh-mutation-check.mjs .dkh-feasibility/final-plan/mutations.json` | 既存10+required拒否削除1、11件すべて検出 |
129
+ | `node scripts/modkh-language-probe.mjs typescript /usr/local/bin/typescript-language-server .dkh-feasibility/final-plan/typescript.json --stdio` | 成功 |
130
+ | 同probeのphp `/opt/homebrew/bin/phpantom_lsp` / tailwind `/opt/homebrew/bin/tailwindcss-language-server --stdio` | いずれもunverified、exit1。上記の範囲のみ実測。 |
131
+ | `node scripts/modkh-source-identity.mjs .dkh-feasibility/final-plan/identity.json` | 最終source/dist SHA256記録 |
132
+
133
+ 開始時438件:372成功/58失敗/8skip。最終440件:374成功/58失敗/8skip。全58件の試験名・error・codeが一致。新規・消失・同名原因変化いずれも0。[全件比較](modkh-failure-comparison.json)。HTTP待受EPERM57件、watch EMFILE1件を成功に置き換えていない。
134
+
135
+ 関連suiteの1失敗は `test/language.integration.test.ts:108` の `the public CLI wires analysis into read_file without any extra flag`。`listen EPERM: operation not permitted 127.0.0.1` であり、全体58件に含まれる。
136
+
137
+ ## 8件のskip(全件未実行)
138
+
139
+ | 試験名 | 実行時の理由 |
140
+ |---|---|
141
+ | `real Lean transitive sorry remains unverified even when its consumer is accepted` | Official Lean executable unavailable; real kernel/counterexample tests not run |
142
+ | `real Lean sorry cannot be certified by compiler acceptance` | Official Lean executable unavailable; real kernel/counterexample tests not run |
143
+ | `real Lean false theorem cannot be certified by compiler acceptance` | Official Lean executable unavailable; real kernel/counterexample tests not run |
144
+ | `real Lean custom axiom cannot be certified by compiler acceptance` | Official Lean executable unavailable; real kernel/counterexample tests not run |
145
+ | `real Lean generated axiom cannot be certified by compiler acceptance` | Official Lean executable unavailable; real kernel/counterexample tests not run |
146
+ | `real Lean true theorem is accepted/unverified` | Official Lean executable not supplied |
147
+ | `real TLC good.cfg` | Java/TLC host settings not supplied |
148
+ | `real TLC bad.cfg` | Java/TLC host settings not supplied |
149
+
150
+ LeanはPATH上に見つからず、`/usr/bin/java -version` はJava Runtime不在。取得もネットワークでblocked。安全な初版のaccepted/unverifiedを維持し、fake compiler結果を実証明と呼ばない。TLC model/cfg/範囲receiptを保持するが実runtimeは未検証。
151
+
152
+ ## 原PLAN・追加要求の棚卸し
153
+
154
+ | 対象 | 分類 | 根拠/残る条件 |
155
+ |---|---|---|
156
+ | 0–2: 編集先と基準 | 完了 | 現在Macに直接反映、基準測定・既存差分保持。 |
157
+ | 3A: 実Lisp設定 | 完了(限定契約) | 実SBCL、信頼hash、未知/重複/原子性、timeout回帰。追加loadの信頼は入口hashでは保証しない。 |
158
+ | 3B: preset/必須スキル | 完了(配布・注入)/実能力は部分実装 | packed9preset実評価、子model requestへの本文一致。CL/Svelte能力は未達。 |
159
+ | 3C: 委譲・迂回拒否 | 部分実装/実モデルblocked | packed実入口、head直接edit/shell/formalなし、子限定ツール、未検証を完了にしない回帰。自律モデル未実施。 |
160
+ | 3D: 編集・独立検証 | 部分実装/OS隔離blocked | 強い隔離必須時の非実行を追加。既存改変/鮮度を維持。OS readonly依存閉包・全競合保証なし。 |
161
+ | 4: LSP/Tree-sitter | 部分実装/blocked | TS実応答、PHP定義成功。PHP不正診断/Tailwind hover/実watch/CL・Svelte実文法未達。 |
162
+ | 5: 自動導入 | 部分実装/blocked | private構築ソース・失敗回帰あり。CL冷導入DNSで停止。Linux実導入なし。 |
163
+ | 6: 前鬼 | 部分実装/blocked | preset/配布/ツール分類確認。実TLC2件未実行。 |
164
+ | 7: 後鬼 | 部分実装/blocked | accepted/unverified維持。実Lean6件未実行。形式検証の実モデル委譲未実施。 |
165
+ | 8: テスト受入 | 部分実装 | 最終一式実行。58失敗/8skip残。 |
166
+ | 9: 過去Linux結果 | 未検証 | 今回の実測へ流用しない。 |
167
+ | 10: 引渡し | 部分実装 | git diff、証跡、制約を保存。全PLAN受入は未達。 |
168
+
169
+ 新規create/rename/deleteと複数ファイルの安全な適用は既存仕様上未対応、既存1ファイルの編集・変更なしverified/unverifiedを区別。host receiptをJSON保存/再読して終了状態・source digestが保持されることを実入口でassertしたが、ディスク改ざんへの署名検証を実装したという意味ではない。
170
+
171
+ [証跡JSON](modkh-evidence.json)に最終source/dist identity、各実サーバー、host probe、11改変、ログhashを保存。source更新・build済みdist・実入口試験は現在のリポジトリに反映済み。グローバルコマンドや稼働中のハーネスは更新していない。
172
+
173
+ 次に必要なのは、公式配布元へ到達できる許可済みネットワーク、実WASM構築toolchain/artifact、許可されたOS隔離backend、Lean/Java/TLC runtime、モデルへの利用可能な接続。これらを取得/実測するまでは当該項目を完了に変更しない。
package/docs/modkh.md ADDED
@@ -0,0 +1,124 @@
1
+ # MoDKH: trusted Common Lisp microagents
2
+
3
+ MoDKH (Mixture of DKH) is distributed as `modkh`, exposing only the `modkh` command so an existing `dkh` installation is not overwritten. Configuration uses `MODKH_HOME` or `~/.config/modkh`; workspace records and skill configuration use `.modkh`. Legacy DKH data is not read, migrated or removed automatically. Lisp configuration uses the `:modkh` package. No npm publication or global installation is required to test this checkout.
4
+
5
+ ## Run
6
+
7
+ See [Lisp presets](presets.md) for a single-preset example.
8
+
9
+ SBCL must already be installed. Without `--lisp-config`, ordinary MODKH behavior remains available. With it, builtin/installed plugins are excluded for this session, the head has read/language/delegation tools only, and editing/formal checking is delegated. Hermes cannot be used as the head because its remote tools bypass this boundary. Normal input always goes through the head model unless `--routing auto` is explicitly supplied.
10
+
11
+ The trusted Lisp file is **arbitrary OS code**, not sandboxed configuration. Its input bytes are snapshotted, hash checked, and evaluated with startup files disabled in a private temporary HOME/TMPDIR and a minimal environment. Additional files loaded by that trusted code are not recursively covered by the hash. Relative loads resolve in the snapshot directory. Review any absolute dependencies separately. There is no implicit reload or workspace discovery.
12
+
13
+ Limits: input 64 KiB, combined process output 256 KiB, evaluation 10 seconds, 64 simultaneous definitions, 1–32 turns per microagent. These are host ceilings, not model options. POSIX process groups are stopped on timeout/abort; processes that deliberately escape the group are outside this guarantee. Unconfirmed cleanup is reported as unknown.
14
+
15
+ ## Verification isolation policy
16
+
17
+ `--verification-isolation required` is a host-owned requirement for delegated edit acceptance. Plugins, child prompts and skill contents cannot lower it. There is currently no verified OS enforcement backend: this mode returns `not-executed`, `isolation: unavailable`, and a structured `not-started` receipt, without launching the fixed checker or applying the edited snapshot. The receipt digest includes the isolation policy. This is refusal when isolation is unavailable, not an implementation of OS isolation.
18
+
19
+ The compatibility default is `--verification-isolation integrity-only`. It retains the existing snapshot/digest/freshness checks and explicitly reports `private-snapshot-not-os-sandbox`; it is suitable only for trusted checker/input code. It does not protect host secrets or prevent arbitrary OS writes. No mode currently reports `os-enforced`. This option does not sandbox evaluation of the trusted Lisp configuration itself.
20
+
21
+ ## Configuration API
22
+
23
+ ```lisp
24
+ (in-package :modkh)
25
+ (defmicroagent micro-ts-outline
26
+ :title "TypeScript構造担当"
27
+ :tool "code_outline" :language "ts" :task-kind "outline"
28
+ :instruction "指定ファイルを調べ、根拠と未確認事項を返す。"
29
+ :max-turns 4)
30
+ (register-agent "micro-example" :tool "code_hover" :instruction "型情報を調べる。")
31
+ (disable-agent "micro-example")
32
+ (remove-agent "micro-example")
33
+ (list-agents)
34
+ ```
35
+
36
+ The eight presets contain 30 observation roles and 8 editors. Editors remain disabled until BOTH a fixed check and an owner-controlled source/verifier manifest are present. `formal.lisp` adds 前鬼 (`micro-zenki`) and 後鬼 (`micro-goki`).
37
+
38
+ Every role receives the full manifest-verified `kiokuko-single-purpose-functions/SKILL.md` and `one-shot-software-completion/SKILL.md`. The bundled upstream revision and per-file SHA256 are in `skills/kiokuko-dsh/manifest.json`. Other generic automatic skill injection is disabled for these children. Referenced documents are not implicitly read. Roles cannot add tools beyond host/user permissions; missing tools prevent model execution.
39
+
40
+ ## One-file edit and independent acceptance
41
+
42
+ ```lisp
43
+ (defmicroagent micro-js-edit
44
+ :title "JavaScript編集担当"
45
+ :tool "edit_file" :workflow "edit-verify"
46
+ :language "js" :task-kind "edit"
47
+ :instruction "指定ソースだけを修正する。受入テストを変更しない。"
48
+ :max-turns 8)
49
+ (set-agent-check "micro-js-edit" "node --test test/addition.test.mjs"
50
+ :sources '("src/addition.mjs")
51
+ :protected '("test/addition.test.mjs" "package.json"))
52
+ ```
53
+
54
+ The manifest must explicitly include the trusted check's project inputs/dependencies. The model cannot supply the manifest or command. `targetPaths` must be an exact subset of owner-approved sources and cannot include protected files. Paths must be relative; existing single-link regular files only; symlinks, creation, rename, deletion and multi-file edits are refused. The request format allows up to eight paths for future workflows, but this workflow currently accepts exactly one.
55
+
56
+ The child only reads/edits private source snapshots. It cannot read/edit the verifier tree through its tools. The host runs the fixed command through the existing approval path in the snapshot, with a 30-second limit and no job promotion. Exit state/code come from the host process handle; stdout cannot fabricate them. On success, current source/verifier hashes and source inode identity are checked before applying the single-file change through a no-follow file descriptor. Concurrent changes produce stale/unknown instead of a pass for another revision. Checks that fail leave the original source unchanged. Successful no-ops are `no-change/verified`; failed or unexecuted checks cannot verify a no-op.
57
+
58
+ **Security limitation:** the private snapshot is not an OS sandbox. Arbitrary checker or tested source code may execute OS operations, and pre/post hashes do not prove the verifier stayed unchanged throughout execution. External executable/dependency closures and hostile filesystem races are not fully protected. A process can interfere with its own test execution. `passed` means this fixed command exited zero for the recorded unchanged snapshots, not a proof against adversarial code or proof of the task's semantics. Use reviewed trusted execution inputs. Strong hostile-input isolation remains unfinished; see `modkh-verification.md`.
59
+
60
+ Examples inside the chat:
61
+
62
+ ```text
63
+ /head Fix src/addition.mjs and delegate the edit with targetPaths.
64
+ /agents
65
+ /agents run micro-js-edit --target src/addition.mjs Fix addition.
66
+ /agents route ts outline Inspect src/example.ts.
67
+ ```
68
+
69
+ `--routing auto` is an optional conservative deterministic router, not LLM judgment. Unsupported/ambiguous requests go back to the head. Mixed intents, negation, conditionals, multiple files, URLs and outside paths do not directly dispatch a role.
70
+
71
+ ## Formal tools
72
+
73
+ Host flags select executables; the model never selects binaries or arbitrary verifier argv:
74
+
75
+ ```sh
76
+ modkh chat --lisp-config experiments/presets/formal.lisp --trust-lisp-sha256 REVIEWED_SHA256 \
77
+ --java /path/to/java --tla-jar /path/to/tla2tools.jar --lean /path/to/lean
78
+ ```
79
+
80
+ Both tools require command approval, snapshot bounded inputs, omit API credentials from the environment, and bound time/output. TLC uses one worker and 512 MiB heap. Only exit zero AND TLC completion/state-count output permit a finite-model check to pass. Exact source/config hashes and cfg content scope the result; fairness, constants, constraints and deadlock settings do not establish equivalence to application code.
81
+
82
+ Lean exit zero always means `accepted`, `proofStatus: unverified`, tool error `PROOF_UNVERIFIED`. This applies to true theorems, empty inputs and convincing-looking output. Compiler rejection is failed; timeout/abort/output overflow is unverified. Project imports are unsupported. Standard distribution imports do not change proof status. No target theorem statement comparison, dependency-axiom audit, comparator or external proof checker is implemented.
83
+
84
+ ## Language tooling and verification
85
+
86
+ Children now receive language tools within the host ceiling. Tailwind semantic roles force the explicit `server: "tailwind"` selector; ordinary HTML servers are not substituted. Cold position queries initialize the selected server. Unavailable/waiting diagnostics return an error, not zero diagnostics. Dynamic registration acknowledgments do not implement continuous filesystem watching.
87
+
88
+ Npm installers use `latest`, the official npm registry, private runtime environment, process-group timeout, disk reserve, initialize-before-publish and a 60-second retry cooldown. TypeScript must expose `typescript/lib/tsserver.js`; if latest lacks that API, the installer makes one fallback attempt using an unambiguous numeric TypeScript package recommendation from the installed official server README. It never hardcodes a major version. Missing or conflicting recommendations fail closed. The actual language service must produce a known semantic diagnostic, and LSP initialization must succeed before publication. The receipt records the selected specifier, resolved version, and README/API hashes. Failed staging directories are removed. The control flow is fixture-tested; real registry cold installation remains unverified. PHP native installation selects an official OS/CPU release asset with SHA256 metadata, verifies bytes before extraction, rejects links/traversal, and initializes the binary before publishing. This path has not been exercised against downloaded releases here. Common Lisp bootstrap and real CL/Svelte grammar bundling are still pending.
89
+
90
+ Run focused/source tests and built-entry checks:
91
+
92
+ ```sh
93
+ npm run typecheck
94
+ npm run build
95
+ node --test test/lisp*.test.ts test/formal*.test.ts test/language.overlay.test.ts test/language.install-platform.test.ts
96
+ MODKH_TEST_CHAT="file://$PWD/dist/cli/chat.js" MODKH_TEST_FIXED="file://$PWD/dist/model/fixed.js" node --test test/lisp.cli.test.ts
97
+ node scripts/modkh-mutation-check.mjs /tmp/modkh-mutations.json
98
+ npm test
99
+ ```
100
+
101
+ Real-server probe (explicit installed binary; does not install or touch a real project):
102
+
103
+ ```sh
104
+ node scripts/modkh-language-probe.mjs typescript /path/to/typescript-language-server /tmp/ts-result.json --stdio
105
+ node scripts/modkh-language-probe.mjs tailwind /path/to/tailwindcss-language-server /tmp/tailwind-result.json --stdio
106
+ node scripts/modkh-language-probe.mjs commonlisp /path/to/cl-lsp /tmp/cl-result.json
107
+ MODKH_TEST_LEAN=/path/to/lean MODKH_TEST_JAVA=/path/to/java MODKH_TEST_TLA_JAR=/path/to/tla2tools.jar node --test test/formal*.test.ts
108
+ ```
109
+
110
+ The probe reports initialize-only separately from semantic success. In particular, the current CL probe does not establish global-function runtime definitions. Full PLAN.md acceptance has not been reached; consult the evidence report before relying on unsupported capabilities.
111
+
112
+ ## Common Lisp diagnostics and current verification limits
113
+
114
+ When CL-LSP diagnostics are unavailable, `code_diagnostics` also runs a bounded SBCL reader check with a private HOME and disabled startup files. It reads forms as data; it never evaluates, compiles, macroexpands, or loads the project. Read-time evaluation and unresolved project packages remain unverified. This supplemental result **does not change the LSP_UNVERIFIED tool status**, even for readable input. It is neither CL-LSP semantic diagnostics nor a replacement for the required CL-LSP acceptance test.
115
+
116
+ After building, the real CL probe is:
117
+
118
+ ```sh
119
+ node scripts/modkh-language-probe.mjs commonlisp /absolute/path/to/cl-lsp /absolute/path/to/result.json
120
+ ```
121
+
122
+ It checks lexical definition coordinates and a separate malformed document, records push notifications and supported pull requests, and returns nonzero unless both checks succeed. It never loads/evaluates the project to manufacture a global definition result. CL-LSP private cold installation remains unimplemented.
123
+
124
+ Edit verification receipts are single-use. Beginning acceptance closes the child edit tools; changed or restored original files and changed snapshot dependencies invalidate acceptance. These checks do not establish OS isolation: arbitrary executed source can still access resources outside the snapshot, and complete verifier dependency isolation is not implemented. See `modkh-verification.md` for remaining acceptance failures.
@@ -0,0 +1,19 @@
1
+ # Lispプリセット
2
+
3
+ [プリセット一覧](../experiments/presets/)から使う言語のファイルを選びます。SBCLを用意し、ファイルを置いたプロジェクトで実行します。以下はリポジトリのルートでTypeScript用を使う例です。
4
+
5
+ ```sh
6
+ less experiments/presets/ts.lisp
7
+ shasum -a 256 experiments/presets/ts.lisp
8
+ modkh chat --lisp-config experiments/presets/ts.lisp --trust-lisp-sha256 REVIEWED_SHA256
9
+ ```
10
+
11
+ Lispファイルはコードとして実行されます。内容を確認し、表示されたSHA-256を `REVIEWED_SHA256` に入れます。ファイルを変更したら確認とハッシュ計算をやり直します。
12
+
13
+ チャットで `/agents` を開くと担当を確認できます。たとえば `/agents route ts outline Inspect src/index.ts` で構造調査を委譲できます。
14
+
15
+ ## どんなときに役立つか
16
+
17
+ 定義や参照の検索、診断などを専用ツール付きの担当に切り出せます。対応する言語サーバーが必要な操作もあります。編集は対象ファイルと固定の検証コマンドを設定したときだけ有効になります。通常のチャットと比べた速度やトークン消費の改善幅は未計測です。
18
+
19
+ [編集・検証の設定](modkh.md) · [言語解析](languages.md)
package/docs/setup.md ADDED
@@ -0,0 +1,112 @@
1
+ # 依存パッケージとLisp環境
2
+
3
+ ## 必須・任意の区別
4
+
5
+ | 用途 | 必要なもの |
6
+ |---|---|
7
+ | MoDKHの起動・ビルド | Node.js(package.jsonのengines準拠)、npm。ソース取得にはGit |
8
+ | npm依存 | `npm ci` でpackage-lock.jsonどおりに導入。個別のグローバル導入は不要 |
9
+ | Lisp担当設定・補助構文診断 | SBCL。ASDF/QuicklispやLSPは設定評価には不要 |
10
+ | CL-LSPの構築 | Cコンパイラ、make、tar/bzip2、Git、HTTPS接続。専用領域へRoswell、SBCL、ASDFとaskdkc/cl-lspを導入。Lisp依存はCL-LSPに同梱 |
11
+ | 導入時のHTTPS通信 | curl、CA証明書。CL-LSP用のOpenSSL設定やQlotは不要 |
12
+ | 前鬼(TLC) | Javaと公式の `tla2tools.jar` |
13
+ | 後鬼(Lean) | Lean。elanでtoolchainを管理可能 |
14
+ | 文法WASMの再構築 | Tree-sitter CLIとEmscripten。通常buildは同梱用の既存WASMをコピーするため不要 |
15
+
16
+ npmの直接依存はAI SDK(`ai`、`@ai-sdk/anthropic`、`deepseek`、`google`、`openai`、`openai-compatible`)、`vscode-jsonrpc`、`web-tree-sitter`。開発依存はTypeScript、`@types/node`、`tree-sitter-wasms`です。正確な一覧は[package.json](../package.json)、解決済み推移依存は[package-lock.json](../package-lock.json)を参照してください。
17
+
18
+ ## macOS
19
+
20
+ ```sh
21
+ # 未導入の場合のみ
22
+ xcode-select --install
23
+ brew install node git sbcl curl ca-certificates
24
+
25
+ # Roswellを手動で使う場合のみ
26
+ brew install roswell
27
+
28
+ # 前鬼を使う場合のみ。システムJavaの置換は不要
29
+ brew install openjdk
30
+ export PATH="$(brew --prefix openjdk)/bin:$PATH"
31
+
32
+ # 文法をソースから再構築する開発者のみ
33
+ brew install emscripten tree-sitter-cli
34
+ ```
35
+
36
+ `cc`・`make`はCommand Line Tools、`tar`・`bzip2`はOSのものを使います。既存のSBCLやQuicklispが動作するなら、削除・再導入する必要はありません。
37
+
38
+ ## Arch Linux
39
+
40
+ ```sh
41
+ sudo pacman -Syu --needed base-devel nodejs npm git sbcl curl ca-certificates tar bzip2
42
+
43
+ # Roswellを手動で使う場合のみ
44
+ sudo pacman -S --needed roswell
45
+
46
+ # 前鬼を使う場合のみ
47
+ sudo pacman -S --needed jre-openjdk
48
+
49
+ # 文法をソースから再構築する開発者のみ
50
+ sudo pacman -S --needed emscripten tree-sitter-cli
51
+ ```
52
+
53
+ 上記はArch Linuxの公式パッケージ向けです。Linuxの実CL-LSP・隔離機構をこのREADME更新で実機検証したものではありません。
54
+
55
+ ## Common Lisp
56
+
57
+ MoDKHは [askdkc/cl-lsp](https://github.com/askdkc/cl-lsp) を専用領域に導入します。同梱の `vendor/` とheadless installerを使用し、別のLem・Qlot・OpenSSL設定は不要です。取得revisionと同梱ソース一覧のdigestを記録し、LSPの初期化・同期・定義応答を確認します。
58
+
59
+ 手動で管理する場合のみ、次を実行します(`~/.roswell` を更新します)。
60
+
61
+ ```sh
62
+ ros install askdkc/cl-lsp
63
+ ~/.roswell/bin/cl-lsp --help
64
+ ```
65
+
66
+ Roswellが既存checkoutを再利用して古いコードを読む場合は、そのcheckoutを更新してから再導入します。MoDKHの自動導入は新しい専用checkoutを取得します。
67
+
68
+ 既に動くCL-LSPがある場合は `~/.config/modkh/config.json` の既存設定に次を統合します。
69
+
70
+ ```json
71
+ {
72
+ "language": {
73
+ "autoInstall": false,
74
+ "servers": {
75
+ "commonlisp": { "command": "/absolute/path/to/cl-lsp", "args": [] }
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ `autoInstall: false` は全言語の自動導入を止めます。CL-MCP-Serverの `run-server.lisp` はMCP用なので、このLSP設定の実行ファイルには指定しません。
82
+
83
+ ## その他の言語・形式検証
84
+
85
+ 必要な言語だけ準備してください。対象プロジェクト自体の依存は、そのプロジェクトの通常の手順で導入します。
86
+
87
+ | 対象 | MoDKHが使うパッケージ・実行ファイル |
88
+ |---|---|
89
+ | JS / TS / TSX | `typescript-language-server`、`typescript`(専用npm prefixへ自動導入) |
90
+ | Svelte | `svelte-language-server`(自動導入) |
91
+ | HTML / CSS | `vscode-langservers-extracted`(自動導入) |
92
+ | Tailwind CSS | `@tailwindcss/language-server`(自動導入)、対象側のTailwind設定・依存 |
93
+ | Python | `basedpyright`(自動導入)、対象側のPython環境 |
94
+ | PHP | PHPantom(対応releaseの自動導入経路あり)、対象側のPHP/Composer依存 |
95
+ | Rust | Rust toolchainと `rust-analyzer`(ホスト側で準備) |
96
+ | C / C++ | LLVMの `clangd`、対象側のヘッダー・ビルド情報 |
97
+ | Ruby | Rubyと `ruby-lsp` gem(ホスト側で準備) |
98
+ | Swift | Swift toolchainの `sourcekit-lsp`。macOSではXcodeのtoolchainも利用可能 |
99
+
100
+ Leanは[公式インストール手順](https://lean-lang.org/install/)、TLCのjarは[公式release](https://github.com/tlaplus/tlaplus/releases/latest)を使用します。取得した実行ファイルを指定します。
101
+
102
+ ```sh
103
+ modkh chat --lisp-config experiments/presets/formal.lisp --trust-lisp-sha256 REVIEWED_SHA256 \
104
+ --lean /absolute/path/to/lean \
105
+ --java /absolute/path/to/java --tla-jar /absolute/path/to/tla2tools.jar
106
+ ```
107
+
108
+ [プリセットの手順](presets.md)で `formal.lisp` を確認し、そのSHA-256を `REVIEWED_SHA256` に指定します。現在のLean結果は成功終了でも `accepted / unverified`。TLCの成功は指定した有限モデルに限定されます。
109
+
110
+ CL/Svelteの実WASMは未同梱であり、Emscriptenを入れるだけでは有効になりません。強いOS検証隔離も未提供です。[機能ごとの検証状況](modkh-verification.md)
111
+
112
+ 公式情報:[Homebrew SBCL](https://formulae.brew.sh/formula/sbcl)・[Roswell](https://formulae.brew.sh/formula/roswell)・[Arch SBCL](https://archlinux.org/packages/extra/x86_64/sbcl/)・[Arch Roswell](https://archlinux.org/packages/extra/x86_64/roswell/)・[CL-LSP](https://github.com/askdkc/cl-lsp)