modkh 0.0.0-stage → 0.2.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.
- package/README.md +66 -2
- package/dist/agent/bundled-skills.d.ts +13 -0
- package/dist/agent/bundled-skills.js +95 -0
- package/dist/agent/compaction.d.ts +53 -0
- package/dist/agent/compaction.js +191 -0
- package/dist/agent/images.d.ts +10 -0
- package/dist/agent/images.js +33 -0
- package/dist/agent/loop.d.ts +103 -0
- package/dist/agent/loop.js +267 -0
- package/dist/agent/skills.d.ts +26 -0
- package/dist/agent/skills.js +190 -0
- package/dist/agent/types.d.ts +137 -0
- package/dist/agent/types.js +12 -0
- package/dist/cli/agenticreplay.d.ts +1 -0
- package/dist/cli/agenticreplay.js +66 -0
- package/dist/cli/agents.d.ts +8 -0
- package/dist/cli/agents.js +12 -0
- package/dist/cli/answer-markdown.d.ts +3 -0
- package/dist/cli/answer-markdown.js +29 -0
- package/dist/cli/approval.d.ts +29 -0
- package/dist/cli/approval.js +92 -0
- package/dist/cli/catalog.d.ts +37 -0
- package/dist/cli/catalog.js +46 -0
- package/dist/cli/chat.d.ts +18 -0
- package/dist/cli/chat.js +1061 -0
- package/dist/cli/clipboard.d.ts +11 -0
- package/dist/cli/clipboard.js +82 -0
- package/dist/cli/color.d.ts +59 -0
- package/dist/cli/color.js +244 -0
- package/dist/cli/compaction-settings.d.ts +21 -0
- package/dist/cli/compaction-settings.js +54 -0
- package/dist/cli/completion-art.d.ts +2 -0
- package/dist/cli/completion-art.js +62 -0
- package/dist/cli/config.d.ts +50 -0
- package/dist/cli/config.js +192 -0
- package/dist/cli/editor.d.ts +23 -0
- package/dist/cli/editor.js +115 -0
- package/dist/cli/file-mentions.d.ts +14 -0
- package/dist/cli/file-mentions.js +141 -0
- package/dist/cli/head-checks.d.ts +41 -0
- package/dist/cli/head-checks.js +146 -0
- package/dist/cli/initial-connection.d.ts +7 -0
- package/dist/cli/initial-connection.js +20 -0
- package/dist/cli/keys.d.ts +29 -0
- package/dist/cli/keys.js +107 -0
- package/dist/cli/language.d.ts +1 -0
- package/dist/cli/language.js +105 -0
- package/dist/cli/limits.d.ts +13 -0
- package/dist/cli/limits.js +19 -0
- package/dist/cli/lines.d.ts +18 -0
- package/dist/cli/lines.js +80 -0
- package/dist/cli/model-catalog.d.ts +16 -0
- package/dist/cli/model-catalog.js +130 -0
- package/dist/cli/models.d.ts +4 -0
- package/dist/cli/models.js +101 -0
- package/dist/cli/official-models.d.ts +6 -0
- package/dist/cli/official-models.js +77 -0
- package/dist/cli/pdf.d.ts +8 -0
- package/dist/cli/pdf.js +71 -0
- package/dist/cli/permissions.d.ts +25 -0
- package/dist/cli/permissions.js +30 -0
- package/dist/cli/plugins.d.ts +1 -0
- package/dist/cli/plugins.js +53 -0
- package/dist/cli/providers.d.ts +10 -0
- package/dist/cli/providers.js +82 -0
- package/dist/cli/shell-display.d.ts +6 -0
- package/dist/cli/shell-display.js +35 -0
- package/dist/cli/stateright.d.ts +1 -0
- package/dist/cli/stateright.js +37 -0
- package/dist/cli/terminal-mouse.d.ts +21 -0
- package/dist/cli/terminal-mouse.js +51 -0
- package/dist/cli/terminal.d.ts +231 -0
- package/dist/cli/terminal.js +1417 -0
- package/dist/cli/tool-display.d.ts +9 -0
- package/dist/cli/tool-display.js +87 -0
- package/dist/cli/transcript-selection.d.ts +22 -0
- package/dist/cli/transcript-selection.js +75 -0
- package/dist/cli/usage.d.ts +22 -0
- package/dist/cli/usage.js +117 -0
- package/dist/cli/waiting-nyan.d.ts +3 -0
- package/dist/cli/waiting-nyan.js +17 -0
- package/dist/cli/waiting-whales.d.ts +3 -0
- package/dist/cli/waiting-whales.js +24 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +186 -0
- package/dist/language/catalog.d.ts +44 -0
- package/dist/language/catalog.js +100 -0
- package/dist/language/commonlisp-bundled.d.ts +11 -0
- package/dist/language/commonlisp-bundled.js +22 -0
- package/dist/language/commonlisp-dependencies.d.ts +16 -0
- package/dist/language/commonlisp-dependencies.js +68 -0
- package/dist/language/commonlisp-install.d.ts +15 -0
- package/dist/language/commonlisp-install.js +214 -0
- package/dist/language/commonlisp-reader.d.ts +17 -0
- package/dist/language/commonlisp-reader.js +47 -0
- package/dist/language/commonlisp-systems.d.ts +3 -0
- package/dist/language/commonlisp-systems.js +32 -0
- package/dist/language/commonlisp-tls.d.ts +10 -0
- package/dist/language/commonlisp-tls.js +51 -0
- package/dist/language/detect.d.ts +29 -0
- package/dist/language/detect.js +103 -0
- package/dist/language/grammars/LICENSE +24 -0
- package/dist/language/grammars/manifest.json +76 -0
- package/dist/language/grammars/tree-sitter-c.wasm +0 -0
- package/dist/language/grammars/tree-sitter-cpp.wasm +0 -0
- package/dist/language/grammars/tree-sitter-css.wasm +0 -0
- package/dist/language/grammars/tree-sitter-html.wasm +0 -0
- package/dist/language/grammars/tree-sitter-javascript.wasm +0 -0
- package/dist/language/grammars/tree-sitter-php.wasm +0 -0
- package/dist/language/grammars/tree-sitter-python.wasm +0 -0
- package/dist/language/grammars/tree-sitter-ruby.wasm +0 -0
- package/dist/language/grammars/tree-sitter-rust.wasm +0 -0
- package/dist/language/grammars/tree-sitter-swift.wasm +0 -0
- package/dist/language/grammars/tree-sitter-tsx.wasm +0 -0
- package/dist/language/grammars/tree-sitter-typescript.wasm +0 -0
- package/dist/language/install.d.ts +50 -0
- package/dist/language/install.js +293 -0
- package/dist/language/lsp/client.d.ts +97 -0
- package/dist/language/lsp/client.js +340 -0
- package/dist/language/lsp/pool.d.ts +75 -0
- package/dist/language/lsp/pool.js +140 -0
- package/dist/language/lsp/service.d.ts +50 -0
- package/dist/language/lsp/service.js +174 -0
- package/dist/language/native.d.ts +8 -0
- package/dist/language/native.js +100 -0
- package/dist/language/platform.d.ts +14 -0
- package/dist/language/platform.js +20 -0
- package/dist/language/positions.d.ts +20 -0
- package/dist/language/positions.js +46 -0
- package/dist/language/syntax/assets.d.ts +9 -0
- package/dist/language/syntax/assets.js +73 -0
- package/dist/language/syntax/parser.d.ts +33 -0
- package/dist/language/syntax/parser.js +162 -0
- package/dist/language/typescript-capability.d.ts +6 -0
- package/dist/language/typescript-capability.js +42 -0
- package/dist/lisp/builtin-agents.d.ts +5 -0
- package/dist/lisp/builtin-agents.js +52 -0
- package/dist/lisp/config.d.ts +25 -0
- package/dist/lisp/config.js +202 -0
- package/dist/lisp/routing.d.ts +5 -0
- package/dist/lisp/routing.js +24 -0
- package/dist/lisp/runtime.d.ts +26 -0
- package/dist/lisp/runtime.js +107 -0
- package/dist/memory/kiokuko.d.ts +32 -0
- package/dist/memory/kiokuko.js +102 -0
- package/dist/memory/mcp.d.ts +38 -0
- package/dist/memory/mcp.js +211 -0
- package/dist/model/ai-sdk.d.ts +27 -0
- package/dist/model/ai-sdk.js +185 -0
- package/dist/model/chatgpt/login.d.ts +42 -0
- package/dist/model/chatgpt/login.js +180 -0
- package/dist/model/chatgpt/responses.d.ts +41 -0
- package/dist/model/chatgpt/responses.js +254 -0
- package/dist/model/chatgpt/tokens.d.ts +11 -0
- package/dist/model/chatgpt/tokens.js +50 -0
- package/dist/model/connection.d.ts +6 -0
- package/dist/model/connection.js +67 -0
- package/dist/model/context-window.d.ts +3 -0
- package/dist/model/context-window.js +64 -0
- package/dist/model/context.d.ts +11 -0
- package/dist/model/context.js +69 -0
- package/dist/model/factory.d.ts +27 -0
- package/dist/model/factory.js +89 -0
- package/dist/model/fixed.d.ts +17 -0
- package/dist/model/fixed.js +41 -0
- package/dist/model/harness-profile.d.ts +6 -0
- package/dist/model/harness-profile.js +23 -0
- package/dist/model/providers.d.ts +32 -0
- package/dist/model/providers.js +72 -0
- package/dist/model/reasoning.d.ts +16 -0
- package/dist/model/reasoning.js +84 -0
- package/dist/model/record-fetch.d.ts +2 -0
- package/dist/model/record-fetch.js +19 -0
- package/dist/plugins/api.d.ts +60 -0
- package/dist/plugins/api.js +1 -0
- package/dist/plugins/manager.d.ts +35 -0
- package/dist/plugins/manager.js +280 -0
- package/dist/plugins/package.d.ts +13 -0
- package/dist/plugins/package.js +99 -0
- package/dist/plugins/registry.d.ts +8 -0
- package/dist/plugins/registry.js +14 -0
- package/dist/session/store.d.ts +93 -0
- package/dist/session/store.js +311 -0
- package/dist/session/workspace.d.ts +19 -0
- package/dist/session/workspace.js +73 -0
- package/dist/subagents/head-assignment.d.ts +11 -0
- package/dist/subagents/head-assignment.js +47 -0
- package/dist/subagents/limits.d.ts +4 -0
- package/dist/subagents/limits.js +6 -0
- package/dist/subagents/processes.d.ts +18 -0
- package/dist/subagents/processes.js +73 -0
- package/dist/subagents/request.d.ts +4 -0
- package/dist/subagents/request.js +38 -0
- package/dist/subagents/service.d.ts +73 -0
- package/dist/subagents/service.js +645 -0
- package/dist/subagents/settings.d.ts +10 -0
- package/dist/subagents/settings.js +32 -0
- package/dist/subagents/types.d.ts +63 -0
- package/dist/subagents/types.js +1 -0
- package/dist/subagents/verification.d.ts +34 -0
- package/dist/subagents/verification.js +215 -0
- package/dist/tools/browse.d.ts +13 -0
- package/dist/tools/browse.js +117 -0
- package/dist/tools/browser-capability.d.ts +3 -0
- package/dist/tools/browser-capability.js +29 -0
- package/dist/tools/diff.d.ts +6 -0
- package/dist/tools/diff.js +82 -0
- package/dist/tools/edit.d.ts +3 -0
- package/dist/tools/edit.js +152 -0
- package/dist/tools/files.d.ts +6 -0
- package/dist/tools/files.js +96 -0
- package/dist/tools/formal-input.d.ts +6 -0
- package/dist/tools/formal-input.js +29 -0
- package/dist/tools/formal.d.ts +9 -0
- package/dist/tools/formal.js +79 -0
- package/dist/tools/guard.d.ts +7 -0
- package/dist/tools/guard.js +48 -0
- package/dist/tools/job-tools.d.ts +19 -0
- package/dist/tools/job-tools.js +148 -0
- package/dist/tools/jobs.d.ts +79 -0
- package/dist/tools/jobs.js +186 -0
- package/dist/tools/language.d.ts +6 -0
- package/dist/tools/language.js +172 -0
- package/dist/tools/lean-proof.d.ts +38 -0
- package/dist/tools/lean-proof.js +83 -0
- package/dist/tools/registry.d.ts +30 -0
- package/dist/tools/registry.js +113 -0
- package/dist/tools/run.d.ts +13 -0
- package/dist/tools/run.js +163 -0
- package/dist/tools/search.d.ts +2 -0
- package/dist/tools/search.js +156 -0
- package/dist/tools/shell-process.d.ts +115 -0
- package/dist/tools/shell-process.js +297 -0
- package/dist/tools/skills.d.ts +2 -0
- package/dist/tools/skills.js +46 -0
- package/dist/tools/stateright-runtime.d.ts +3 -0
- package/dist/tools/stateright-runtime.js +16 -0
- package/dist/tools/stateright.d.ts +3 -0
- package/dist/tools/stateright.js +78 -0
- package/dist/tools/web.d.ts +24 -0
- package/dist/tools/web.js +391 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +2 -0
- package/docs/ci-repair-20261116.md +30 -0
- package/docs/commonlisp-build-output.md +14 -0
- package/docs/commonlisp-provider-migration.md +22 -0
- package/docs/commonlisp-qlot-recovery.md +28 -0
- package/docs/commonlisp-tls-recovery.md +28 -0
- package/docs/context-efficiency.md +122 -0
- package/docs/input.md +126 -0
- package/docs/languages.md +117 -0
- package/docs/models.md +109 -0
- package/docs/modkh-evidence.json +641 -0
- package/docs/modkh-failure-comparison.json +675 -0
- package/docs/modkh-namespace.md +39 -0
- package/docs/modkh-qlot-evidence.json +37 -0
- package/docs/modkh-verification.md +173 -0
- package/docs/modkh.md +128 -0
- package/docs/presets.md +64 -0
- package/docs/setup.md +99 -0
- package/docs/stateright.md +45 -0
- package/docs/subagents.md +152 -0
- package/docs/web.md +57 -0
- package/experiments/presets/common-lisp.lisp +38 -0
- package/experiments/presets/css.lisp +38 -0
- package/experiments/presets/formal.lisp +18 -0
- package/experiments/presets/html.lisp +38 -0
- package/experiments/presets/js.lisp +38 -0
- package/experiments/presets/language-microagents.lisp +29 -0
- package/experiments/presets/php.lisp +38 -0
- package/experiments/presets/svelte.lisp +38 -0
- package/experiments/presets/tailwindcss.lisp +24 -0
- package/experiments/presets/ts.lisp +38 -0
- package/native/stateright/Cargo.lock +478 -0
- package/native/stateright/Cargo.toml +11 -0
- package/native/stateright/src/lib.rs +163 -0
- package/native/stateright/src/main.rs +38 -0
- package/package.json +57 -4
- package/plugins/modkh-explorer/index.mjs +3 -0
- package/plugins/modkh-explorer/plugin.json +1 -0
- package/plugins/modkh-worker/index.mjs +3 -0
- package/plugins/modkh-worker/plugin.json +1 -0
- package/skills/kiokuko-dsh/LICENSE +21 -0
- package/skills/kiokuko-dsh/coding-ideal-routine-skill/SKILL.md +106 -0
- package/skills/kiokuko-dsh/japanese-translation-for-oss-models/SKILL.md +65 -0
- package/skills/kiokuko-dsh/kiokuko-architecture/SKILL.md +20 -0
- package/skills/kiokuko-dsh/kiokuko-architecture/references/cases.md +11 -0
- package/skills/kiokuko-dsh/kiokuko-benchmark/SKILL.md +20 -0
- package/skills/kiokuko-dsh/kiokuko-benchmark/references/cases.md +11 -0
- package/skills/kiokuko-dsh/kiokuko-investigate/SKILL.md +20 -0
- package/skills/kiokuko-dsh/kiokuko-investigate/references/cases.md +11 -0
- package/skills/kiokuko-dsh/kiokuko-lisp/SKILL.md +390 -0
- package/skills/kiokuko-dsh/kiokuko-review/SKILL.md +20 -0
- package/skills/kiokuko-dsh/kiokuko-review/references/cases.md +11 -0
- package/skills/kiokuko-dsh/kiokuko-simple-work/SKILL.md +70 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/SKILL.md +79 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/boundaries-and-ownership.md +52 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/domain-and-types.md +48 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/effects-and-data.md +43 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/kiokuko-patterns.md +314 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/problem-shaping-and-language.md +90 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/protocols-and-idempotency.md +42 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/review-checklist.md +92 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/verification.md +45 -0
- package/skills/kiokuko-dsh/kiokuko-skill-authoring/SKILL.md +20 -0
- package/skills/kiokuko-dsh/kiokuko-skill-authoring/references/cases.md +11 -0
- package/skills/kiokuko-dsh/kiokuko-soul/SKILL.md +25 -0
- package/skills/kiokuko-dsh/kiokuko-technical-writing/SKILL.md +20 -0
- package/skills/kiokuko-dsh/kiokuko-technical-writing/references/cases.md +11 -0
- package/skills/kiokuko-dsh/kiokuko-ui-design-soul/SKILL.md +64 -0
- package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/accessibility-and-navigation.md +31 -0
- package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/async-recovery.md +49 -0
- package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/forms-and-controls.md +35 -0
- package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/interaction-feedback.md +34 -0
- package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/responsive-and-platform.md +38 -0
- package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/safety-and-review.md +43 -0
- package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/ui-checklist.md +75 -0
- package/skills/kiokuko-dsh/kiokuko-verification/SKILL.md +20 -0
- package/skills/kiokuko-dsh/kiokuko-verification/references/cases.md +11 -0
- package/skills/kiokuko-dsh/manifest.json +168 -0
- package/skills/kiokuko-dsh/memory-reasoning/SKILL.md +44 -0
- package/skills/kiokuko-dsh/one-shot-software-completion/SKILL.md +113 -0
- package/skills/kiokuko-dsh/one-shot-software-completion/references/boundaries-and-lifecycle.md +70 -0
- package/skills/kiokuko-dsh/one-shot-software-completion/references/discovery-and-scope.md +71 -0
- package/skills/kiokuko-dsh/one-shot-software-completion/references/failure-recovery.md +43 -0
- package/skills/kiokuko-dsh/one-shot-software-completion/references/verification-and-completion.md +73 -0
- 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,128 @@
|
|
|
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
|
+
Ordinary `modkh` includes language-specific observation roles alongside the generic agents and installed plugins. The head can delegate to these roles and retains its ordinary editing tools. Loading a custom `--lisp-config` requires SBCL. In that session the supplied roles replace the default catalog, the head has read/language/delegation tools only, and editing/formal checking is delegated. Hermes cannot be used as the custom Lisp head because its remote tools bypass this boundary. Normal input 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
|
+
During editing, the child gets a private snapshot containing only the approved target and tools that list the exact permitted path. Give the child behavioral acceptance criteria in the assignment. In a configured head workflow, the host also supplies the current user request and preloads the approved source. When the child stages a change, the host pauses editing and runs the fixed command against the candidate and pinned verifier inputs in a separate workspace, through the existing approval path, with a 30-second limit and no job promotion. After a settled test failure, the same child can revise its candidate within its remaining turns. The child receives the verdict without protected file contents or test output. 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. If the trusted configuration uses `set-head-instruction`, normal chat input always goes to the head so its workflow can coordinate multiple roles. Explicit `/agents` commands still dispatch directly.
|
|
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
|
+
--lean /path/to/lean
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Install the front verifier with `modkh stateright install` (Rust/Cargo required at installation). Normal chat automatically registers `modkh-micro-zenki` when installed. The Lisp preset uses `micro-zenki`. Both tools require command approval, snapshot bounded inputs, omit API credentials from the environment, and bound time/output. Stateright checks explicit finite-state JSON models; a complete exploration and matching input digest are required for success. Counterexamples are replayed by the host. See [installation, schema and migration](stateright.md). Model checking does not establish equivalence to application code.
|
|
81
|
+
|
|
82
|
+
To check a proof, create a separate workspace file such as `Expected.lean` with an owner-reviewed proposition, for example `def modkhExpected : Prop := ∀ n : Nat, n + 0 = n`. Add `--lean-contract Expected.lean --lean-theorem Examples.addZero` to the command. Delegate the proof source to 後鬼 and let the host load the expected proposition. The theorem name must be declared in the proof source. In the parent receipt, `proofPath` identifies the proof source and `target.expectedPropositionPath` identifies the expectation.
|
|
83
|
+
|
|
84
|
+
Compiler exit zero records `status: accepted`. With a configured target, a separate Lean process loads the compiled declarations, replays the candidate additions through the kernel, and checks the named theorem against the expected proposition using kernel definitional equality. It also checks transitive axioms, allowing Lean's standard `propext`, `Classical.choice` and `Quot.sound`. The receipt distinguishes `proofStatus: proved`, `rejected` (including missing declarations, different statements and disallowed axioms), and `unverified`. Without a configured target, even a successful compile remains `PROOF_UNVERIFIED`. The parent receives the proof verdict, target, input hashes and execution receipts in `formalEvidence`.
|
|
85
|
+
|
|
86
|
+
The contract and proof must be standalone Lean files. Project imports and universe-polymorphic target declarations are unsupported. Keep both inputs reviewed because Lean metaprograms can execute OS code during compilation. The verdict covers the configured proposition. The parent still checks whether that proposition addresses the user request and how it relates to any implementation.
|
|
87
|
+
|
|
88
|
+
## Language tooling and verification
|
|
89
|
+
|
|
90
|
+
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.
|
|
91
|
+
|
|
92
|
+
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.
|
|
93
|
+
|
|
94
|
+
Run focused/source tests and built-entry checks:
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
npm run typecheck
|
|
98
|
+
npm run build
|
|
99
|
+
node --test test/lisp*.test.ts test/formal*.test.ts test/language.overlay.test.ts test/language.install-platform.test.ts
|
|
100
|
+
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
|
|
101
|
+
node scripts/modkh-mutation-check.mjs /tmp/modkh-mutations.json
|
|
102
|
+
npm test
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Real-server probe (explicit installed binary; does not install or touch a real project):
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
node scripts/modkh-language-probe.mjs typescript /path/to/typescript-language-server /tmp/ts-result.json --stdio
|
|
109
|
+
node scripts/modkh-language-probe.mjs tailwind /path/to/tailwindcss-language-server /tmp/tailwind-result.json --stdio
|
|
110
|
+
node scripts/modkh-language-probe.mjs commonlisp /path/to/cl-lsp /tmp/cl-result.json
|
|
111
|
+
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
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
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.
|
|
115
|
+
|
|
116
|
+
## Common Lisp diagnostics and current verification limits
|
|
117
|
+
|
|
118
|
+
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.
|
|
119
|
+
|
|
120
|
+
After building, the real CL probe is:
|
|
121
|
+
|
|
122
|
+
```sh
|
|
123
|
+
node scripts/modkh-language-probe.mjs commonlisp /absolute/path/to/cl-lsp /absolute/path/to/result.json
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
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.
|
|
127
|
+
|
|
128
|
+
Each edit verification receipt applies to its tested candidate. Acceptance pauses the edit tools and only a settled test failure reopens them for revision in the same child. 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.
|
package/docs/presets.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Lispプリセット
|
|
2
|
+
|
|
3
|
+
引数なしの `modkh` には、PHP・Common Lisp・JavaScript・TypeScript・Svelte・HTML・CSS・Tailwind CSS の調査担当が組み込まれています。親モデルが依頼を分割して順に委譲し、結果をまとめます。たとえば、対応するモデルに接続して「`src/client.ts` と `src/server.js` の構造を調べ、共通点をまとめて」と依頼できます。担当は `/agents` に `modkh-micro-` で始まる名前で表示されます。
|
|
4
|
+
|
|
5
|
+
組み込み担当を登録するために SBCL は不要です。診断や参照検索などには言語別の機能が必要です。以下の Lisp プリセットは、担当を独自に編成したり、検証付き編集を設定したりする場合に使います。
|
|
6
|
+
|
|
7
|
+
[プリセット一覧](../experiments/presets/)から使う言語のファイルを選びます。SBCLを用意し、ファイルを置いたプロジェクトで実行します。以下はリポジトリのルートでTypeScript用を使う例です。
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
less experiments/presets/ts.lisp
|
|
11
|
+
shasum -a 256 experiments/presets/ts.lisp
|
|
12
|
+
modkh chat --lisp-config experiments/presets/ts.lisp --trust-lisp-sha256 REVIEWED_SHA256
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Lispファイルはコードとして実行されます。内容を確認し、表示されたSHA-256を `REVIEWED_SHA256` に入れます。ファイルを変更したら確認とハッシュ計算をやり直します。
|
|
16
|
+
|
|
17
|
+
チャットで `/agents` を開くと担当を確認できます。たとえば `/agents route ts outline Inspect src/index.ts` で構造調査を委譲できます。
|
|
18
|
+
|
|
19
|
+
## 役小角・前鬼・後鬼と作業を始める
|
|
20
|
+
|
|
21
|
+
前鬼はStaterightを使います。`modkh stateright install` で導入すると通常起動で利用できます(SBCL不要)。以下は前鬼と後鬼を必須の検証担当にするLispプリセットの設定です。[モデル形式](stateright.md)も参照してください。
|
|
22
|
+
|
|
23
|
+
複数言語の調査も役小角に委譲させる場合は、[言語別の担当一覧](../experiments/presets/language-microagents.lisp)を `formal.lisp` と同じ設定にまとめます。次の例はリポジトリのルートで実行します。
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
cat experiments/presets/formal.lisp experiments/presets/language-microagents.lisp > agents-with-languages.lisp
|
|
27
|
+
shasum -a 256 agents-with-languages.lisp
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
内容を確認し、起動例の `--lisp-config` に `agents-with-languages.lisp`、`--trust-lisp-sha256` にその SHA-256 を指定します。役小角は言語、作業種別、ツールの一覧から `micro-ts-outline` などを直接選べます。子には対象ファイルを一つ渡し、定義・参照・ホバーには対象位置も添えます。各調査担当は専用ツール一つで、結果と位置を返します。言語別に編集を委譲する場合は、対象と保護テストを設定した編集担当を追加してください。
|
|
31
|
+
|
|
32
|
+
TypeScript・JavaScript・PHP・HTML・CSSの構文検索には、`micro-ts-syntax-search` などの担当を使えます。ファイルと宣言名を渡すと、Tree-sitterが候補の宣言全体の範囲を返します。役小角はこの範囲を編集担当に引き継げます。編集担当は現行ソースを読み取ってから変更を適用します。
|
|
33
|
+
|
|
34
|
+
`formal.lisp` を同じ手順で確認し、そのファイルの SHA-256 を指定して起動します。
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
modkh chat --lisp-config experiments/presets/formal.lisp --trust-lisp-sha256 REVIEWED_SHA256 \
|
|
38
|
+
--lean /path/to/lean \
|
|
39
|
+
--lean-contract Expected.lean --lean-theorem orders_cancel
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
通常チャットでは、MoA の親エージェントが **役小角(`enno-oduno`)** を担います。役小角は依頼を検証できる単位に分け、担当ごとの作業と確認条件を `start_subagent` の `task` に、全体の目的と関係する依存関係を `context` に渡します。担当を起動した後も親は独立した調査や確認を進め、子の結果が必要になった時点で待ちます。前鬼(`micro-zenki`)には `formalInput.path` で Stateright のモデルJSONを、後鬼(`micro-goki`)には `formalInput.path` で証明元の Lean ファイルを指定します。ホストは指定されたパスで各担当の検証ツールを一度実行します。起動時の `--lean-contract` と `--lean-theorem` は対象定理の照合に使います。後鬼から命題不一致が返れば、その条件は不合格として記録します。役小角は両者のツール結果と実装の受け入れ結果を元の依頼に照らして確認します。
|
|
43
|
+
|
|
44
|
+
`formal.lisp` に登録されているのは検証担当です。実装の編集も委譲する場合は、確認済みの同じ Lisp ファイルに編集担当と [検証コマンド・対象ファイルの設定](modkh.md#one-file-edit-and-independent-acceptance)を加え、SHA-256 を取り直してください。
|
|
45
|
+
|
|
46
|
+
`(require-head-checks)` を含む正式プリセットでは、修正や実装を依頼したターンを終える前に、ホストがそのターンの検証記録を確認します。結果が不足していれば、同じターンで役小角に確認を続けさせます。Lean の命題不一致は形式検証の不合格です。不合格が確定すると、ホストはそのターンの追加のツール呼び出しを止めます。同じセッションの次の依頼は、次のターンで得た検証記録で判定します。
|
|
47
|
+
|
|
48
|
+
プロジェクト固有の入力が決まっている場合は、信頼する Lisp 設定に次のように書くと、役小角が応答を終えようとした時点でホストが不足している検証を補えます。
|
|
49
|
+
|
|
50
|
+
```lisp
|
|
51
|
+
(set-head-check-inputs "Orders.json" "Orders.lean")
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
第3引数に編集担当の ID を指定すると、その担当に登録された1つのソースの編集・反映も完了条件に加わります。ホストが補う処理にも通常の委譲、承認、受け入れチェックが適用されます。設定を変更したら SHA-256 を取り直してください。
|
|
55
|
+
|
|
56
|
+
編集担当を設定した実装依頼で、役小角の応答が委譲前に出力上限 `length` に達した場合、ホストは設定済みソースの先頭60行を読み、同じチャットターンを一度続けます。復帰直後の応答では、指定編集担当への `run_subagent` 一件だけを受け付けます。途中で切れた応答は実行記録に残します。その応答にツール要求が含まれていた場合は、実行せずにターンをエラーで終えます。編集担当から `EDIT_TURN_LIMIT` が届いた場合は編集不合格が確定します。
|
|
57
|
+
|
|
58
|
+
`(set-head-instruction "...")` は、信頼済みの Lisp 設定から親エージェントの進め方を指定します。指定した進め方が、標準の委譲手順とターンごとの汎用スキル指示に代わります。この設定があるセッションでは、`--routing auto` を指定していても通常のチャット入力は親を通ります。`/agents run` などで担当を明示した場合は、その担当を直接呼び出します。
|
|
59
|
+
|
|
60
|
+
## どんなときに役立つか
|
|
61
|
+
|
|
62
|
+
定義や参照の検索、診断などを専用ツール付きの担当に切り出せます。対応する言語サーバーが必要な操作もあります。編集は対象ファイルと固定の検証コマンドを設定したときだけ有効になります。通常のチャットと比べた速度やトークン消費の改善幅は未計測です。
|
|
63
|
+
|
|
64
|
+
[編集・検証の設定](modkh.md) · [言語解析](languages.md)
|
package/docs/setup.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
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
|
+
| 前鬼(Stateright) | 導入時にRust/Cargo。`modkh stateright install`。通常のMoDKH起動には不要 |
|
|
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
|
+
# 文法をソースから再構築する開発者のみ
|
|
29
|
+
brew install emscripten tree-sitter-cli
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`cc`・`make`はCommand Line Tools、`tar`・`bzip2`はOSのものを使います。既存のSBCLやQuicklispが動作するなら、削除・再導入する必要はありません。
|
|
33
|
+
|
|
34
|
+
## Arch Linux
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
sudo pacman -Syu --needed base-devel nodejs npm git sbcl curl ca-certificates tar bzip2
|
|
38
|
+
|
|
39
|
+
# Roswellを手動で使う場合のみ
|
|
40
|
+
sudo pacman -S --needed roswell
|
|
41
|
+
|
|
42
|
+
# 文法をソースから再構築する開発者のみ
|
|
43
|
+
sudo pacman -S --needed emscripten tree-sitter-cli
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
上記はArch Linuxの公式パッケージ向けです。Linuxの実CL-LSP・隔離機構をこのREADME更新で実機検証したものではありません。
|
|
47
|
+
|
|
48
|
+
## Common Lisp
|
|
49
|
+
|
|
50
|
+
MoDKHは [askdkc/cl-lsp](https://github.com/askdkc/cl-lsp) を専用領域に導入します。同梱の `vendor/` とheadless installerを使用し、別のLem・Qlot・OpenSSL設定は不要です。取得revisionと同梱ソース一覧のdigestを記録し、LSPの初期化・同期・定義応答を確認します。
|
|
51
|
+
|
|
52
|
+
手動で管理する場合のみ、次を実行します(`~/.roswell` を更新します)。
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
ros install askdkc/cl-lsp
|
|
56
|
+
~/.roswell/bin/cl-lsp --help
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Roswellが既存checkoutを再利用して古いコードを読む場合は、そのcheckoutを更新してから再導入します。MoDKHの自動導入は新しい専用checkoutを取得します。
|
|
60
|
+
|
|
61
|
+
既に動くCL-LSPがある場合は `~/.config/modkh/config.json` の既存設定に次を統合します。
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"language": {
|
|
66
|
+
"autoInstall": false,
|
|
67
|
+
"servers": {
|
|
68
|
+
"commonlisp": { "command": "/absolute/path/to/cl-lsp", "args": [] }
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`autoInstall: false` は全言語の自動導入を止めます。CL-MCP-Serverの `run-server.lisp` はMCP用なので、このLSP設定の実行ファイルには指定しません。
|
|
75
|
+
|
|
76
|
+
## その他の言語・形式検証
|
|
77
|
+
|
|
78
|
+
必要な言語だけ準備してください。対象プロジェクト自体の依存は、そのプロジェクトの通常の手順で導入します。
|
|
79
|
+
|
|
80
|
+
| 対象 | MoDKHが使うパッケージ・実行ファイル |
|
|
81
|
+
|---|---|
|
|
82
|
+
| JS / TS / TSX | `typescript-language-server`、`typescript`(専用npm prefixへ自動導入) |
|
|
83
|
+
| Svelte | `svelte-language-server`(自動導入) |
|
|
84
|
+
| HTML / CSS | `vscode-langservers-extracted`(自動導入) |
|
|
85
|
+
| Tailwind CSS | `@tailwindcss/language-server`(自動導入)、対象側のTailwind設定・依存 |
|
|
86
|
+
| Python | `basedpyright`(自動導入)、対象側のPython環境 |
|
|
87
|
+
| PHP | PHPantom(対応releaseの自動導入経路あり)、対象側のPHP/Composer依存 |
|
|
88
|
+
| Rust | Rust toolchainと `rust-analyzer`(ホスト側で準備) |
|
|
89
|
+
| C / C++ | LLVMの `clangd`、対象側のヘッダー・ビルド情報 |
|
|
90
|
+
| Ruby | Rubyと `ruby-lsp` gem(ホスト側で準備) |
|
|
91
|
+
| Swift | Swift toolchainの `sourcekit-lsp`。macOSではXcodeのtoolchainも利用可能 |
|
|
92
|
+
|
|
93
|
+
前鬼は `modkh stateright install` で導入します。導入済みなら通常起動で自動登録されます。Java/TLCは不要です。[導入・モデル形式](stateright.md)を参照してください。ソースからテストする開発者もRust/Cargoが必要です(`npm test` が検証器をビルドします)。
|
|
94
|
+
|
|
95
|
+
後鬼に使うLeanは[公式インストール手順](https://lean-lang.org/install/)を参照してください。
|
|
96
|
+
|
|
97
|
+
CL/Svelteの実WASMは未同梱であり、Emscriptenを入れるだけでは有効になりません。強いOS検証隔離も未提供です。[機能ごとの検証状況](modkh-verification.md)
|
|
98
|
+
|
|
99
|
+
公式情報:[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)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# 前鬼とStateright
|
|
2
|
+
|
|
3
|
+
前鬼は[Stateright](https://github.com/stateright/stateright) 0.31.0による有限状態探索を使います。MoDKH同梱のRustソースから専用コマンド `modkh-stateright` を構築します。
|
|
4
|
+
|
|
5
|
+
## 導入・更新
|
|
6
|
+
|
|
7
|
+
[Rust公式手順](https://rust-lang.org/tools/install/)でRust/Cargoを用意し、`cargo --version` を確認します。macOSではビルド用のCommand Line Toolsも必要です。
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
modkh stateright install
|
|
11
|
+
modkh stateright status
|
|
12
|
+
modkh
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
初回ビルドには依存取得のネット接続が必要です。導入先は `~/.config/modkh/stateright/bin/modkh-stateright`(`MODKH_HOME` 指定時はその配下)です。次の起動で前鬼が自動登録されます。通常チャットでは親モデルに状態遷移や不変条件の検証を依頼してください。`/agents` に `modkh-micro-zenki` が表示されます。明示的に無効化した担当は自動で有効に戻しません。
|
|
16
|
+
|
|
17
|
+
更新時も同じinstallコマンドを使います。管理領域の検証器を優先し、なければPATH上の `modkh-stateright` を探します。独自の配置には `modkh --stateright /absolute/path/to/modkh-stateright` を使えます。RustライブラリがCargoのキャッシュにあるだけでは導入済みとは扱いません。
|
|
18
|
+
|
|
19
|
+
## モデルJSON
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"schemaVersion": 1,
|
|
24
|
+
"states": ["idle", "running", "done"],
|
|
25
|
+
"initial": ["idle"],
|
|
26
|
+
"transitions": [
|
|
27
|
+
{"from": "idle", "to": "running", "action": "Start"},
|
|
28
|
+
{"from": "running", "to": "done", "action": "Finish"}
|
|
29
|
+
],
|
|
30
|
+
"invariants": [{"name": "ValidState", "allowedStates": ["idle", "running", "done"]}],
|
|
31
|
+
"checkDeadlocks": false
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
全フィールド必須です。状態と遷移を明示し、各不変条件の許容状態を列挙します。到達可能な状態を幅優先探索し、許容状態から外れたら反例の状態列と操作列を返します。上記で `done` を許容状態から除けば反例になります。`checkDeadlocks: true` では、出る遷移がない到達状態も不合格です(正常な終端を含むため、モデルの意図に応じて指定してください)。
|
|
36
|
+
|
|
37
|
+
入力上限256KiB、状態1〜10,000件、不変条件1〜64件、遷移50,000件以下。検証時間は最大30秒です。未知のフィールド、重複名、存在しない状態への参照は拒否します。探索完了時のみpassedとし、反例はfailed、中断・時間切れ・不正な出力はunverifiedです。入力SHA-256を実行記録に結び付け、反例の遷移と違反をホストでも照合します。
|
|
38
|
+
|
|
39
|
+
親からは `run_subagent` に `pluginId: "modkh-micro-zenki"` と `formalInput: {"path": "Model.json"}` を渡します。Lisp正式プリセットでは担当IDは `micro-zenki` です。
|
|
40
|
+
|
|
41
|
+
## 旧TLC設定からの移行と範囲
|
|
42
|
+
|
|
43
|
+
`verify_tla`、`--java`、`--tla-jar` は廃止しました。TLA+/cfgの自動変換はありません。対象の状態・遷移・不変条件をJSONに書き直し、`verify_stateright` を使います。Lispは `(set-head-check-inputs "Model.json" "Proof.lean")` に変更し、設定のSHA-256を取り直してください。
|
|
44
|
+
|
|
45
|
+
検証するのはこの有限モデルだけです。公平性・時相論理・無限状態の証明、実装との等価性は扱いません。モデルの仮定と実装への対応をレビューし、実装の通常テストも併用してください。後鬼のLean検証は独立して利用できます。
|