kiokuko-dsh 0.2.39 → 0.2.41
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/PERMISSIONS.md +2 -2
- package/README.ja.md +17 -5
- package/README.ko.md +17 -5
- package/README.md +17 -5
- package/README.zh-CN.md +17 -5
- package/dist/akinator/skill-discovery-attempt.d.ts +3 -1
- package/dist/akinator/skill-discovery-attempt.d.ts.map +1 -1
- package/dist/akinator/skill-discovery-attempt.js +12 -11
- package/dist/akinator/skill-discovery-attempt.js.map +1 -1
- package/dist/client.cjs +7 -10
- package/dist/client.d.ts.map +1 -1
- package/dist/context/continuity-view.d.ts +0 -11
- package/dist/context/continuity-view.d.ts.map +1 -1
- package/dist/context/continuity-view.js +5 -9
- package/dist/context/continuity-view.js.map +1 -1
- package/dist/deep-thinker/controller.d.ts +4 -1
- package/dist/deep-thinker/controller.d.ts.map +1 -1
- package/dist/deep-thinker/controller.js +10 -0
- package/dist/deep-thinker/controller.js.map +1 -1
- package/dist/deep-thinker/core/contracts.d.ts +11 -11
- package/dist/deep-thinker/memory-finalizer.d.ts +1 -1
- package/dist/deep-thinker/native-executor.d.ts +1 -1
- package/dist/deep-thinker/native-executor.d.ts.map +1 -1
- package/dist/deep-thinker/prompts.js +1 -1
- package/dist/deep-thinker/prompts.js.map +1 -1
- package/dist/deep-thinker/quality-prompts.js +1 -1
- package/dist/deep-thinker/quality-prompts.js.map +1 -1
- package/dist/deep-thinker/report.d.ts +1 -1
- package/dist/deep-thinker/store.d.ts +1 -1
- package/dist/dsh/agenticreplay-hooks.d.ts.map +1 -1
- package/dist/dsh/agenticreplay-hooks.js +13 -0
- package/dist/dsh/agenticreplay-hooks.js.map +1 -1
- package/dist/dsh/agenticreplay-recorder.d.ts +5 -0
- package/dist/dsh/agenticreplay-recorder.d.ts.map +1 -1
- package/dist/dsh/agenticreplay-recorder.js +19 -0
- package/dist/dsh/agenticreplay-recorder.js.map +1 -1
- package/dist/dsh/coding-workflow/contracts.d.ts +2 -5
- package/dist/dsh/coding-workflow/contracts.d.ts.map +1 -1
- package/dist/dsh/coding-workflow/contracts.js +1 -1
- package/dist/dsh/coding-workflow/contracts.js.map +1 -1
- package/dist/dsh/coding-workflow/host.d.ts.map +1 -1
- package/dist/dsh/coding-workflow/host.js +1 -4
- package/dist/dsh/coding-workflow/host.js.map +1 -1
- package/dist/dsh/coding-workflow/intent.d.ts.map +1 -1
- package/dist/dsh/coding-workflow/intent.js +0 -6
- package/dist/dsh/coding-workflow/intent.js.map +1 -1
- package/dist/dsh/coding-workflow/service.d.ts +4 -8
- package/dist/dsh/coding-workflow/service.d.ts.map +1 -1
- package/dist/dsh/coding-workflow/service.js +5 -57
- package/dist/dsh/coding-workflow/service.js.map +1 -1
- package/dist/dsh/completion-report.d.ts +0 -31
- package/dist/dsh/completion-report.d.ts.map +1 -1
- package/dist/dsh/completion-report.js +16 -94
- package/dist/dsh/completion-report.js.map +1 -1
- package/dist/dsh/composition.d.ts +1 -3
- package/dist/dsh/composition.d.ts.map +1 -1
- package/dist/dsh/composition.js +13 -34
- package/dist/dsh/composition.js.map +1 -1
- package/dist/dsh/config.d.ts +1 -22
- package/dist/dsh/config.d.ts.map +1 -1
- package/dist/dsh/config.js +0 -8
- package/dist/dsh/config.js.map +1 -1
- package/dist/dsh/context-injection.d.ts +1 -11
- package/dist/dsh/context-injection.d.ts.map +1 -1
- package/dist/dsh/context-injection.js +3 -24
- package/dist/dsh/context-injection.js.map +1 -1
- package/dist/dsh/continuity-adapter.d.ts +0 -5
- package/dist/dsh/continuity-adapter.d.ts.map +1 -1
- package/dist/dsh/continuity-adapter.js +1 -39
- package/dist/dsh/continuity-adapter.js.map +1 -1
- package/dist/dsh/decisions/contracts.d.ts +0 -1
- package/dist/dsh/decisions/contracts.d.ts.map +1 -1
- package/dist/dsh/decisions/contracts.js +1 -1
- package/dist/dsh/decisions/contracts.js.map +1 -1
- package/dist/dsh/decisions/diagnostics.d.ts +8 -11
- package/dist/dsh/decisions/diagnostics.d.ts.map +1 -1
- package/dist/dsh/decisions/diagnostics.js +1 -9
- package/dist/dsh/decisions/diagnostics.js.map +1 -1
- package/dist/dsh/decisions/intent-assessment.d.ts +2 -5
- package/dist/dsh/decisions/intent-assessment.d.ts.map +1 -1
- package/dist/dsh/decisions/intent-assessment.js +17 -9
- package/dist/dsh/decisions/intent-assessment.js.map +1 -1
- package/dist/dsh/efficiency.d.ts +0 -3
- package/dist/dsh/efficiency.d.ts.map +1 -1
- package/dist/dsh/efficiency.js +1 -9
- package/dist/dsh/efficiency.js.map +1 -1
- package/dist/dsh/execution-selection.d.ts +6 -7
- package/dist/dsh/execution-selection.d.ts.map +1 -1
- package/dist/dsh/execution-selection.js +10 -15
- package/dist/dsh/execution-selection.js.map +1 -1
- package/dist/dsh/execution-support.d.ts +0 -4
- package/dist/dsh/execution-support.d.ts.map +1 -1
- package/dist/dsh/execution-support.js +3 -15
- package/dist/dsh/execution-support.js.map +1 -1
- package/dist/dsh/harness/factory.d.ts +109 -0
- package/dist/dsh/harness/factory.d.ts.map +1 -0
- package/dist/dsh/harness/factory.js +566 -0
- package/dist/dsh/harness/factory.js.map +1 -0
- package/dist/dsh/harness/inbox.d.ts +22 -0
- package/dist/dsh/harness/inbox.d.ts.map +1 -0
- package/dist/dsh/harness/inbox.js +61 -0
- package/dist/dsh/harness/inbox.js.map +1 -0
- package/dist/dsh/harness/index.d.ts +19 -0
- package/dist/dsh/harness/index.d.ts.map +1 -0
- package/dist/dsh/harness/index.js +26 -0
- package/dist/dsh/harness/index.js.map +1 -0
- package/dist/dsh/harness/lifecycle.d.ts +26 -0
- package/dist/dsh/harness/lifecycle.d.ts.map +1 -0
- package/dist/dsh/harness/lifecycle.js +21 -0
- package/dist/dsh/harness/lifecycle.js.map +1 -0
- package/dist/dsh/harness/projections.d.ts +16 -0
- package/dist/dsh/harness/projections.d.ts.map +1 -0
- package/dist/dsh/harness/projections.js +34 -0
- package/dist/dsh/harness/projections.js.map +1 -0
- package/dist/dsh/head-worker-configuration.d.ts +1 -2
- package/dist/dsh/head-worker-configuration.d.ts.map +1 -1
- package/dist/dsh/head-worker-configuration.js +0 -5
- package/dist/dsh/head-worker-configuration.js.map +1 -1
- package/dist/dsh/host-adapter/admission.d.ts +1 -8
- package/dist/dsh/host-adapter/admission.d.ts.map +1 -1
- package/dist/dsh/host-adapter/admission.js +51 -260
- package/dist/dsh/host-adapter/admission.js.map +1 -1
- package/dist/dsh/host-adapter/boundaries.d.ts +1 -28
- package/dist/dsh/host-adapter/boundaries.d.ts.map +1 -1
- package/dist/dsh/host-adapter/boundaries.js +27 -328
- package/dist/dsh/host-adapter/boundaries.js.map +1 -1
- package/dist/dsh/host-adapter/context.d.ts +1 -7
- package/dist/dsh/host-adapter/context.d.ts.map +1 -1
- package/dist/dsh/host-adapter/context.js +5 -28
- package/dist/dsh/host-adapter/context.js.map +1 -1
- package/dist/dsh/host-adapter/efficiency-host.d.ts +0 -2
- package/dist/dsh/host-adapter/efficiency-host.d.ts.map +1 -1
- package/dist/dsh/host-adapter/efficiency-host.js +2 -2
- package/dist/dsh/host-adapter/efficiency-host.js.map +1 -1
- package/dist/dsh/host-adapter/lifecycle.d.ts +0 -7
- package/dist/dsh/host-adapter/lifecycle.d.ts.map +1 -1
- package/dist/dsh/host-adapter/lifecycle.js +58 -71
- package/dist/dsh/host-adapter/lifecycle.js.map +1 -1
- package/dist/dsh/host-adapter/memory-application-host.d.ts +0 -2
- package/dist/dsh/host-adapter/memory-application-host.d.ts.map +1 -1
- package/dist/dsh/host-adapter/memory-application-host.js +2 -2
- package/dist/dsh/host-adapter/memory-application-host.js.map +1 -1
- package/dist/dsh/host-adapter/routing.d.ts +1 -5
- package/dist/dsh/host-adapter/routing.d.ts.map +1 -1
- package/dist/dsh/host-adapter/routing.js +21 -73
- package/dist/dsh/host-adapter/routing.js.map +1 -1
- package/dist/dsh/host-adapter/session-observation.d.ts +1 -8
- package/dist/dsh/host-adapter/session-observation.d.ts.map +1 -1
- package/dist/dsh/host-adapter/session-observation.js +2 -55
- package/dist/dsh/host-adapter/session-observation.js.map +1 -1
- package/dist/dsh/host-adapter/tool-host.d.ts +3 -41
- package/dist/dsh/host-adapter/tool-host.d.ts.map +1 -1
- package/dist/dsh/host-adapter/tool-host.js +14 -243
- package/dist/dsh/host-adapter/tool-host.js.map +1 -1
- package/dist/dsh/host-adapter/turn-state.d.ts +0 -4
- package/dist/dsh/host-adapter/turn-state.d.ts.map +1 -1
- package/dist/dsh/host-adapter/turn-state.js +16 -93
- package/dist/dsh/host-adapter/turn-state.js.map +1 -1
- package/dist/dsh/host-adapter.d.ts +0 -11
- package/dist/dsh/host-adapter.d.ts.map +1 -1
- package/dist/dsh/host-adapter.js +17 -179
- package/dist/dsh/host-adapter.js.map +1 -1
- package/dist/dsh/index.d.ts +3 -16
- package/dist/dsh/index.d.ts.map +1 -1
- package/dist/dsh/index.js +0 -6
- package/dist/dsh/index.js.map +1 -1
- package/dist/dsh/lifecycle-memory.d.ts +3 -0
- package/dist/dsh/lifecycle-memory.d.ts.map +1 -1
- package/dist/dsh/lifecycle-memory.js +67 -45
- package/dist/dsh/lifecycle-memory.js.map +1 -1
- package/dist/dsh/lisp/candidate.d.ts +2 -2
- package/dist/dsh/lisp/code-intelligence-contracts.d.ts +1 -1
- package/dist/dsh/lisp/compiled-cache.d.ts.map +1 -1
- package/dist/dsh/lisp/compiled-cache.js +27 -6
- package/dist/dsh/lisp/compiled-cache.js.map +1 -1
- package/dist/dsh/lisp/host-tool-dispatch.d.ts.map +1 -1
- package/dist/dsh/lisp/host-tool-dispatch.js +14 -5
- package/dist/dsh/lisp/host-tool-dispatch.js.map +1 -1
- package/dist/dsh/lisp/manager.d.ts +7 -4
- package/dist/dsh/lisp/manager.d.ts.map +1 -1
- package/dist/dsh/lisp/manager.js +132 -103
- package/dist/dsh/lisp/manager.js.map +1 -1
- package/dist/dsh/lisp/sandbox.d.ts.map +1 -1
- package/dist/dsh/lisp/sandbox.js +1 -5
- package/dist/dsh/lisp/sandbox.js.map +1 -1
- package/dist/dsh/lisp/supervision.d.ts +33 -0
- package/dist/dsh/lisp/supervision.d.ts.map +1 -0
- package/dist/dsh/lisp/supervision.js +89 -0
- package/dist/dsh/lisp/supervision.js.map +1 -0
- package/dist/dsh/lisp/surface.d.ts +2 -2
- package/dist/dsh/lisp/surface.d.ts.map +1 -1
- package/dist/dsh/lisp/surface.js +105 -11
- package/dist/dsh/lisp/surface.js.map +1 -1
- package/dist/dsh/lisp/worker.d.ts +2 -1
- package/dist/dsh/lisp/worker.d.ts.map +1 -1
- package/dist/dsh/lisp/worker.js +7 -1
- package/dist/dsh/lisp/worker.js.map +1 -1
- package/dist/dsh/loop-guard.d.ts +0 -8
- package/dist/dsh/loop-guard.d.ts.map +1 -1
- package/dist/dsh/loop-guard.js +0 -51
- package/dist/dsh/loop-guard.js.map +1 -1
- package/dist/dsh/memory-application.d.ts.map +1 -1
- package/dist/dsh/memory-application.js +0 -6
- package/dist/dsh/memory-application.js.map +1 -1
- package/dist/dsh/message-sources.d.ts +2 -12
- package/dist/dsh/message-sources.d.ts.map +1 -1
- package/dist/dsh/message-sources.js +20 -39
- package/dist/dsh/message-sources.js.map +1 -1
- package/dist/dsh/model-configuration.d.ts +6 -24
- package/dist/dsh/model-configuration.d.ts.map +1 -1
- package/dist/dsh/model-configuration.js +1 -78
- package/dist/dsh/model-configuration.js.map +1 -1
- package/dist/dsh/model-routing.d.ts +1 -3
- package/dist/dsh/model-routing.d.ts.map +1 -1
- package/dist/dsh/model-routing.js +0 -11
- package/dist/dsh/model-routing.js.map +1 -1
- package/dist/dsh/model-selection-ui.d.ts +1 -2
- package/dist/dsh/model-selection-ui.d.ts.map +1 -1
- package/dist/dsh/model-selection-ui.js +48 -309
- package/dist/dsh/model-selection-ui.js.map +1 -1
- package/dist/dsh/models/contracts.d.ts +2 -2
- package/dist/dsh/models/service.d.ts +1 -1
- package/dist/dsh/modules/legacy-bindings.d.ts +3 -1
- package/dist/dsh/modules/legacy-bindings.d.ts.map +1 -1
- package/dist/dsh/modules/legacy-bindings.js +5 -5
- package/dist/dsh/modules/legacy-bindings.js.map +1 -1
- package/dist/dsh/modules/lisp.js +1 -1
- package/dist/dsh/modules/lisp.js.map +1 -1
- package/dist/dsh/native-execution-ownership.d.ts.map +1 -1
- package/dist/dsh/native-execution-ownership.js +0 -2
- package/dist/dsh/native-execution-ownership.js.map +1 -1
- package/dist/dsh/native-worker-routing.d.ts.map +1 -1
- package/dist/dsh/native-worker-routing.js +7 -2
- package/dist/dsh/native-worker-routing.js.map +1 -1
- package/dist/dsh/on-demand-intake.d.ts.map +1 -1
- package/dist/dsh/on-demand-intake.js +17 -8
- package/dist/dsh/on-demand-intake.js.map +1 -1
- package/dist/dsh/orchestration/execution-owner.d.ts +3 -1
- package/dist/dsh/orchestration/execution-owner.d.ts.map +1 -1
- package/dist/dsh/orchestration/execution-owner.js.map +1 -1
- package/dist/dsh/owned-execution.js +1 -1
- package/dist/dsh/owned-execution.js.map +1 -1
- package/dist/dsh/replay-memory-extract.d.ts.map +1 -1
- package/dist/dsh/replay-memory-extract.js +15 -1
- package/dist/dsh/replay-memory-extract.js.map +1 -1
- package/dist/dsh/repository-learning.d.ts.map +1 -1
- package/dist/dsh/repository-learning.js +3 -0
- package/dist/dsh/repository-learning.js.map +1 -1
- package/dist/dsh/runtime.d.ts +10 -2
- package/dist/dsh/runtime.d.ts.map +1 -1
- package/dist/dsh/runtime.js +22 -43
- package/dist/dsh/runtime.js.map +1 -1
- package/dist/dsh/semantic-compaction/policy.js +1 -1
- package/dist/dsh/semantic-compaction/policy.js.map +1 -1
- package/dist/dsh/session-bridge.d.ts +1 -1
- package/dist/dsh/session-bridge.d.ts.map +1 -1
- package/dist/dsh/session-bridge.js +1 -1
- package/dist/dsh/session-bridge.js.map +1 -1
- package/dist/dsh/session-memory-finalizer.js +1 -1
- package/dist/dsh/session-memory-finalizer.js.map +1 -1
- package/dist/dsh/session-review-context.d.ts.map +1 -1
- package/dist/dsh/session-review-context.js +3 -16
- package/dist/dsh/session-review-context.js.map +1 -1
- package/dist/dsh/setup.d.ts +1 -1
- package/dist/dsh/setup.d.ts.map +1 -1
- package/dist/dsh/skill-compiler.js +1 -1
- package/dist/dsh/skill-compiler.js.map +1 -1
- package/dist/dsh/skill-prompt-contracts.d.ts +2 -2
- package/dist/dsh/skill-prompt-contracts.js +1 -1
- package/dist/dsh/skill-prompts.json +1 -1
- package/dist/dsh/standard-skills.d.ts +1 -8
- package/dist/dsh/standard-skills.d.ts.map +1 -1
- package/dist/dsh/standard-skills.js +1 -8
- package/dist/dsh/standard-skills.js.map +1 -1
- package/dist/dsh/task-authority-context.d.ts +3 -0
- package/dist/dsh/task-authority-context.d.ts.map +1 -1
- package/dist/dsh/task-authority-context.js +3 -0
- package/dist/dsh/task-authority-context.js.map +1 -1
- package/dist/dsh/task-completion-guidance.d.ts +1 -5
- package/dist/dsh/task-completion-guidance.d.ts.map +1 -1
- package/dist/dsh/task-completion-guidance.js +4 -6
- package/dist/dsh/task-completion-guidance.js.map +1 -1
- package/dist/dsh/task-completion-host.js +4 -4
- package/dist/dsh/task-completion-host.js.map +1 -1
- package/dist/dsh/task-completion.d.ts +1 -13
- package/dist/dsh/task-completion.d.ts.map +1 -1
- package/dist/dsh/task-completion.js +9 -104
- package/dist/dsh/task-completion.js.map +1 -1
- package/dist/dsh/task-intake.d.ts +2 -3
- package/dist/dsh/task-intake.d.ts.map +1 -1
- package/dist/dsh/task-intake.js +90 -86
- package/dist/dsh/task-intake.js.map +1 -1
- package/dist/dsh/task-state.d.ts.map +1 -1
- package/dist/dsh/task-state.js +0 -8
- package/dist/dsh/task-state.js.map +1 -1
- package/dist/dsh/tool-exposure.d.ts +1 -1
- package/dist/dsh/tool-exposure.d.ts.map +1 -1
- package/dist/dsh/tool-exposure.js +0 -2
- package/dist/dsh/tool-exposure.js.map +1 -1
- package/dist/dsh/tool-policy.d.ts +5 -8
- package/dist/dsh/tool-policy.d.ts.map +1 -1
- package/dist/dsh/tool-policy.js +3 -35
- package/dist/dsh/tool-policy.js.map +1 -1
- package/dist/dsh/tools.d.ts +2 -6
- package/dist/dsh/tools.d.ts.map +1 -1
- package/dist/dsh/tools.js +7 -63
- package/dist/dsh/tools.js.map +1 -1
- package/dist/dsh/turn-process.d.ts +0 -93
- package/dist/dsh/turn-process.d.ts.map +1 -1
- package/dist/dsh/turn-process.js +1 -307
- package/dist/dsh/turn-process.js.map +1 -1
- package/dist/dsh/user-interaction.d.ts +9 -16
- package/dist/dsh/user-interaction.d.ts.map +1 -1
- package/dist/dsh/user-interaction.js +19 -158
- package/dist/dsh/user-interaction.js.map +1 -1
- package/dist/index.js +2 -19
- package/dist/ledger/types.d.ts +1 -1
- package/dist/ledger/types.d.ts.map +1 -1
- package/dist/ledger/types.js +0 -7
- package/dist/ledger/types.js.map +1 -1
- package/dist/locale/en.json +1 -1
- package/dist/locale/ja.json +1 -1
- package/dist/locale/ko.json +1 -1
- package/dist/locale/zh-CN.json +1 -1
- package/dist/memory/correction-contract.d.ts +4 -4
- package/dist/memory/lifecycle.d.ts +1 -1
- package/dist/memory/review/evidence.js +1 -1
- package/dist/memory/review/evidence.js.map +1 -1
- package/dist/model-tools/contracts.d.ts +0 -437
- package/dist/model-tools/contracts.d.ts.map +1 -1
- package/dist/model-tools/contracts.js +0 -13
- package/dist/model-tools/contracts.js.map +1 -1
- package/dist/model-tools/names.d.ts +1 -1
- package/dist/model-tools/names.d.ts.map +1 -1
- package/dist/model-tools/names.js +0 -7
- package/dist/model-tools/names.js.map +1 -1
- package/dist/model-tools/registry.js +1 -1
- package/dist/model-tools/registry.js.map +1 -1
- package/dist/models-client.cjs +2 -2
- package/dist/models-client.js +2 -2
- package/dist/models-client.js.map +1 -1
- package/docs/README.ja.md +0 -1
- package/docs/README.md +0 -1
- package/docs/agenticreplay-recording.md +1 -1
- package/docs/agenticreplay-verification.md +1 -1
- package/docs/answer-review.md +2 -2
- package/docs/architecture.md +4 -7
- package/docs/auto-memory-review.md +3 -3
- package/docs/coding-workflow.md +1 -1
- package/docs/concepts.ja.md +3 -5
- package/docs/concepts.md +3 -5
- package/docs/core-modules.md +5 -16
- package/docs/database.md +5 -10
- package/docs/decision-diagnostics.md +1 -2
- package/docs/deep-planning.md +3 -3
- package/docs/dsh-plugin.md +42 -178
- package/docs/execution-ledger.md +1 -2
- package/docs/execution-support.md +6 -7
- package/docs/harness-map.md +1 -1
- package/docs/japanese-output.md +1 -1
- package/docs/keyboard-shortcuts.md +1 -1
- package/docs/kiokuko-harness.md +71 -0
- package/docs/kiokuko-models.md +4 -9
- package/docs/lisp-hot-tools.md +12 -7
- package/docs/lisp.md +43 -9
- package/docs/memory-application.md +5 -5
- package/docs/memory-delivery.md +1 -1
- package/docs/memory-reuse.md +1 -1
- package/docs/model-selection.ja.md +40 -123
- package/docs/model-selection.md +45 -114
- package/docs/on-demand-intake.md +2 -2
- package/docs/owned-execution.md +7 -7
- package/docs/pr72-ci-verification.md +2 -2
- package/docs/pstack-adaptation.json +0 -34
- package/docs/pstack-skills.md +1 -1
- package/docs/semantic-compaction.md +2 -2
- package/docs/session-history-repair.md +2 -2
- package/docs/skill-compiler.md +2 -4
- package/docs/tool-exposure.md +1 -1
- package/docs/typed-decisions.md +1 -9
- package/docs/verification.md +11 -7
- package/dsh/cordis.legacy.patch.yml +7 -0
- package/dsh/cordis.patch.yml +6 -1
- package/lisp/supervisor.mjs +16 -7
- package/lisp/tools.lisp +1 -1
- package/migrations/051_drop_enno.sql +19 -0
- package/package.json +5 -14
- package/scripts/session-history-codec.mjs +1 -1
- package/skills/coding-ideal-routine-skill/SKILL.md +1 -1
- package/skills/kiokuko-lisp/SKILL.md +11 -5
- package/skills/kiokuko-single-purpose-functions/SKILL.md +1 -1
- package/skills/kiokuko-ui-design-soul/SKILL.md +2 -2
- package/skills/one-shot-software-completion/SKILL.md +4 -7
- package/skills/one-shot-software-completion/references/boundaries-and-lifecycle.md +3 -5
- package/dist/dsh/advisory-runner.d.ts +0 -32
- package/dist/dsh/advisory-runner.d.ts.map +0 -1
- package/dist/dsh/advisory-runner.js +0 -116
- package/dist/dsh/advisory-runner.js.map +0 -1
- package/dist/dsh/completion-verifiers.d.ts +0 -45
- package/dist/dsh/completion-verifiers.d.ts.map +0 -1
- package/dist/dsh/completion-verifiers.js +0 -9
- package/dist/dsh/completion-verifiers.js.map +0 -1
- package/dist/dsh/continuation.d.ts +0 -24
- package/dist/dsh/continuation.d.ts.map +0 -1
- package/dist/dsh/continuation.js +0 -215
- package/dist/dsh/continuation.js.map +0 -1
- package/dist/dsh/decisions/check-model.d.ts +0 -6
- package/dist/dsh/decisions/check-model.d.ts.map +0 -1
- package/dist/dsh/decisions/check-model.js +0 -36
- package/dist/dsh/decisions/check-model.js.map +0 -1
- package/dist/dsh/decisions/plan-review.d.ts +0 -17
- package/dist/dsh/decisions/plan-review.d.ts.map +0 -1
- package/dist/dsh/decisions/plan-review.js +0 -68
- package/dist/dsh/decisions/plan-review.js.map +0 -1
- package/dist/dsh/directive-projection.d.ts +0 -7
- package/dist/dsh/directive-projection.d.ts.map +0 -1
- package/dist/dsh/directive-projection.js +0 -32
- package/dist/dsh/directive-projection.js.map +0 -1
- package/dist/dsh/enno-controller.d.ts +0 -132
- package/dist/dsh/enno-controller.d.ts.map +0 -1
- package/dist/dsh/enno-controller.js +0 -368
- package/dist/dsh/enno-controller.js.map +0 -1
- package/dist/dsh/enno-delegation.d.ts +0 -36
- package/dist/dsh/enno-delegation.d.ts.map +0 -1
- package/dist/dsh/enno-delegation.js +0 -203
- package/dist/dsh/enno-delegation.js.map +0 -1
- package/dist/dsh/enno-memory-refresh-store.d.ts +0 -26
- package/dist/dsh/enno-memory-refresh-store.d.ts.map +0 -1
- package/dist/dsh/enno-memory-refresh-store.js +0 -45
- package/dist/dsh/enno-memory-refresh-store.js.map +0 -1
- package/dist/dsh/enno-memory-refresh.d.ts +0 -57
- package/dist/dsh/enno-memory-refresh.d.ts.map +0 -1
- package/dist/dsh/enno-memory-refresh.js +0 -280
- package/dist/dsh/enno-memory-refresh.js.map +0 -1
- package/dist/dsh/host-adapter/enno-memory-host.d.ts +0 -29
- package/dist/dsh/host-adapter/enno-memory-host.d.ts.map +0 -1
- package/dist/dsh/host-adapter/enno-memory-host.js +0 -49
- package/dist/dsh/host-adapter/enno-memory-host.js.map +0 -1
- package/dist/dsh/modules/enno.d.ts +0 -70
- package/dist/dsh/modules/enno.d.ts.map +0 -1
- package/dist/dsh/modules/enno.js +0 -22
- package/dist/dsh/modules/enno.js.map +0 -1
- package/dist/dsh/verification-identity.d.ts +0 -3
- package/dist/dsh/verification-identity.d.ts.map +0 -1
- package/dist/dsh/verification-identity.js +0 -15
- package/dist/dsh/verification-identity.js.map +0 -1
- package/dist/enno-oduno/advisory-store.d.ts +0 -31
- package/dist/enno-oduno/advisory-store.d.ts.map +0 -1
- package/dist/enno-oduno/advisory-store.js +0 -105
- package/dist/enno-oduno/advisory-store.js.map +0 -1
- package/dist/enno-oduno/advisory.d.ts +0 -18
- package/dist/enno-oduno/advisory.d.ts.map +0 -1
- package/dist/enno-oduno/advisory.js +0 -311
- package/dist/enno-oduno/advisory.js.map +0 -1
- package/dist/enno-oduno/coding-workflow.d.ts +0 -39
- package/dist/enno-oduno/coding-workflow.d.ts.map +0 -1
- package/dist/enno-oduno/coding-workflow.js +0 -33
- package/dist/enno-oduno/coding-workflow.js.map +0 -1
- package/dist/enno-oduno/confirmation.d.ts +0 -4
- package/dist/enno-oduno/confirmation.d.ts.map +0 -1
- package/dist/enno-oduno/confirmation.js +0 -146
- package/dist/enno-oduno/confirmation.js.map +0 -1
- package/dist/enno-oduno/directives.d.ts +0 -10
- package/dist/enno-oduno/directives.d.ts.map +0 -1
- package/dist/enno-oduno/directives.js +0 -294
- package/dist/enno-oduno/directives.js.map +0 -1
- package/dist/enno-oduno/experts.d.ts +0 -3
- package/dist/enno-oduno/experts.d.ts.map +0 -1
- package/dist/enno-oduno/experts.js +0 -28
- package/dist/enno-oduno/experts.js.map +0 -1
- package/dist/enno-oduno/handoff.d.ts +0 -4
- package/dist/enno-oduno/handoff.d.ts.map +0 -1
- package/dist/enno-oduno/handoff.js +0 -18
- package/dist/enno-oduno/handoff.js.map +0 -1
- package/dist/enno-oduno/language.d.ts +0 -4
- package/dist/enno-oduno/language.d.ts.map +0 -1
- package/dist/enno-oduno/language.js +0 -6
- package/dist/enno-oduno/language.js.map +0 -1
- package/dist/enno-oduno/memory-focus.d.ts +0 -32
- package/dist/enno-oduno/memory-focus.d.ts.map +0 -1
- package/dist/enno-oduno/memory-focus.js +0 -87
- package/dist/enno-oduno/memory-focus.js.map +0 -1
- package/dist/enno-oduno/memory-refresh-policy.d.ts +0 -17
- package/dist/enno-oduno/memory-refresh-policy.d.ts.map +0 -1
- package/dist/enno-oduno/memory-refresh-policy.js +0 -11
- package/dist/enno-oduno/memory-refresh-policy.js.map +0 -1
- package/dist/enno-oduno/memory-verification.d.ts +0 -7
- package/dist/enno-oduno/memory-verification.d.ts.map +0 -1
- package/dist/enno-oduno/memory-verification.js +0 -59
- package/dist/enno-oduno/memory-verification.js.map +0 -1
- package/dist/enno-oduno/plan-draft.d.ts +0 -15
- package/dist/enno-oduno/plan-draft.d.ts.map +0 -1
- package/dist/enno-oduno/plan-draft.js +0 -20
- package/dist/enno-oduno/plan-draft.js.map +0 -1
- package/dist/enno-oduno/plan-recovery.d.ts +0 -44
- package/dist/enno-oduno/plan-recovery.d.ts.map +0 -1
- package/dist/enno-oduno/plan-recovery.js +0 -160
- package/dist/enno-oduno/plan-recovery.js.map +0 -1
- package/dist/enno-oduno/repository-state.d.ts +0 -10
- package/dist/enno-oduno/repository-state.d.ts.map +0 -1
- package/dist/enno-oduno/repository-state.js +0 -146
- package/dist/enno-oduno/repository-state.js.map +0 -1
- package/dist/enno-oduno/sanitize.d.ts +0 -17
- package/dist/enno-oduno/sanitize.d.ts.map +0 -1
- package/dist/enno-oduno/sanitize.js +0 -88
- package/dist/enno-oduno/sanitize.js.map +0 -1
- package/dist/enno-oduno/schemas.d.ts +0 -968
- package/dist/enno-oduno/schemas.d.ts.map +0 -1
- package/dist/enno-oduno/schemas.js +0 -622
- package/dist/enno-oduno/schemas.js.map +0 -1
- package/dist/enno-oduno/service.d.ts +0 -62
- package/dist/enno-oduno/service.d.ts.map +0 -1
- package/dist/enno-oduno/service.js +0 -1505
- package/dist/enno-oduno/service.js.map +0 -1
- package/dist/enno-oduno/skills.d.ts +0 -22
- package/dist/enno-oduno/skills.d.ts.map +0 -1
- package/dist/enno-oduno/skills.js +0 -127
- package/dist/enno-oduno/skills.js.map +0 -1
- package/dist/enno-oduno/store.d.ts +0 -109
- package/dist/enno-oduno/store.d.ts.map +0 -1
- package/dist/enno-oduno/store.js +0 -833
- package/dist/enno-oduno/store.js.map +0 -1
- package/dist/enno-oduno/types.d.ts +0 -457
- package/dist/enno-oduno/types.d.ts.map +0 -1
- package/dist/enno-oduno/types.js +0 -66
- package/dist/enno-oduno/types.js.map +0 -1
- package/dist/enno-oduno/validation-errors.d.ts +0 -93
- package/dist/enno-oduno/validation-errors.d.ts.map +0 -1
- package/dist/enno-oduno/validation-errors.js +0 -159
- package/dist/enno-oduno/validation-errors.js.map +0 -1
- package/dist/enno-oduno/verifier.d.ts +0 -16
- package/dist/enno-oduno/verifier.d.ts.map +0 -1
- package/dist/enno-oduno/verifier.js +0 -271
- package/dist/enno-oduno/verifier.js.map +0 -1
- package/docs/enno-memory-benchmark.json +0 -761
- package/docs/enno-memory-evaluation.md +0 -137
- package/docs/enno-oduno.ja.md +0 -68
- package/docs/enno-oduno.md +0 -94
- package/skills/kiokuko-enno-oduno/SKILL.md +0 -64
- package/skills/kiokuko-enno-oduno/enno-oduno.png +0 -0
package/dist/dsh/lisp/manager.js
CHANGED
|
@@ -11,10 +11,8 @@ import { z } from 'zod';
|
|
|
11
11
|
import { EvalInput, LispError, digest, fail, failure, identifier } from './contracts.js';
|
|
12
12
|
import { LispStore } from './store.js';
|
|
13
13
|
import { sessionCodingWorkflow } from '../coding-workflow/store.js';
|
|
14
|
-
import {
|
|
15
|
-
import { prepareLayout } from './sandbox.js';
|
|
14
|
+
import { LispSupervisor } from './supervision.js';
|
|
16
15
|
import { verifyLispVendor } from './integrity.js';
|
|
17
|
-
import { CompiledLispCache } from './compiled-cache.js';
|
|
18
16
|
import { backupUsage, checkedBytes, snapshot, under } from './files.js';
|
|
19
17
|
import { describeVerifiers } from './ci.js';
|
|
20
18
|
import { PackageRequest } from './packages.js';
|
|
@@ -68,7 +66,7 @@ export class LispManager {
|
|
|
68
66
|
#config;
|
|
69
67
|
#store;
|
|
70
68
|
#library;
|
|
71
|
-
#
|
|
69
|
+
#supervisor;
|
|
72
70
|
#taskTools;
|
|
73
71
|
#hot;
|
|
74
72
|
#closed = false;
|
|
@@ -76,8 +74,8 @@ export class LispManager {
|
|
|
76
74
|
#claims = new Set();
|
|
77
75
|
#ownsSessions = false;
|
|
78
76
|
#artifactReserved = 0;
|
|
79
|
-
#admissionQueue = Promise.resolve();
|
|
80
77
|
#inflight = new Map();
|
|
78
|
+
#sessionWorkerAdmissions = new Map();
|
|
81
79
|
constructor(options) {
|
|
82
80
|
this.options = options;
|
|
83
81
|
this.#config = options.config;
|
|
@@ -87,7 +85,7 @@ export class LispManager {
|
|
|
87
85
|
authorizeEffect: async (owner) => { await this.taskAuthority.authorizeEffect(owner); },
|
|
88
86
|
...(options.config.executionMode === 'development' && options.toolCall ? { execute: async (owner, name, args, signal, callId) => options.toolCall(owner, name, args, signal, callId, await this.taskAuthority.authorizeEffect(owner, 'owned')) } : {}) });
|
|
89
87
|
this.#library = options.library ?? fileURLToPath(new URL('../../../lisp/', import.meta.url));
|
|
90
|
-
this.#
|
|
88
|
+
this.#supervisor = new LispSupervisor(this.#config, options.dataRoot, this.#library);
|
|
91
89
|
this.#taskTools = new TaskToolCatalog(this.#store);
|
|
92
90
|
this.#hot = new HotToolRuntime({ store: this.#store, ...(options.questions ? { questions: options.questions } : {}),
|
|
93
91
|
authorizeEffect: async (owner) => { await this.taskAuthority.authorizeEffect(owner); },
|
|
@@ -189,9 +187,52 @@ export class LispManager {
|
|
|
189
187
|
signal?.throwIfAborted();
|
|
190
188
|
const state = this.entry(owner);
|
|
191
189
|
state.hostBusy = hostBusy;
|
|
192
|
-
await this.startWorker(state);
|
|
190
|
+
await this.startWorker(state, signal);
|
|
193
191
|
return this.status(owner);
|
|
194
192
|
}
|
|
193
|
+
/** A routed session keeps its own heap. Project effects still cross the host
|
|
194
|
+
* boundary; its scratch runtime never takes the standalone repository lease. */
|
|
195
|
+
enableSessionWorker(owner, hostBusy = false, signal) {
|
|
196
|
+
const key = JSON.stringify([owner.sessionId, owner.agentId, owner.root]);
|
|
197
|
+
const pending = this.#sessionWorkerAdmissions.get(key);
|
|
198
|
+
if (pending)
|
|
199
|
+
return pending;
|
|
200
|
+
const admission = this.admitSessionWorker(owner, hostBusy, signal)
|
|
201
|
+
.finally(() => this.#sessionWorkerAdmissions.delete(key));
|
|
202
|
+
this.#sessionWorkerAdmissions.set(key, admission);
|
|
203
|
+
return admission;
|
|
204
|
+
}
|
|
205
|
+
async admitSessionWorker(owner, hostBusy, signal) {
|
|
206
|
+
await this.authorizeCodingTask(owner);
|
|
207
|
+
signal?.throwIfAborted();
|
|
208
|
+
if (!this.#config.enabled || this.#closed)
|
|
209
|
+
fail('LISP_DISABLED', 'Lisp is unavailable for this worker session.');
|
|
210
|
+
if (await realpath(owner.root) !== owner.root)
|
|
211
|
+
fail('SCOPE_CONFLICT', 'Worker workspace identity changed.');
|
|
212
|
+
if (!await this.isSessionWorker(owner)) {
|
|
213
|
+
if ([...this.#agents.values()].some(state => state.owner.sessionId === owner.sessionId
|
|
214
|
+
&& (state.admission || state.active.size || state.worker && !state.worker.stopped))
|
|
215
|
+
|| await this.#store.hasPending(owner.sessionId))
|
|
216
|
+
fail('WORKER_MODE_BUSY', 'Settle the current Lisp operations before admitting a session worker.');
|
|
217
|
+
await this.#store.enable(owner);
|
|
218
|
+
this.enabled.set(owner.sessionId, owner.root);
|
|
219
|
+
const epoch = (await this.#store.session(owner.sessionId)).epoch;
|
|
220
|
+
const modeOwner = { ...owner, agentId: '__session__' }, id = `session-worker-${epoch}`;
|
|
221
|
+
await this.#store.reserve(modeOwner, id, 'session_worker', digest({ root: owner.root, epoch }), 'host', { root: owner.root, epoch });
|
|
222
|
+
await this.#store.transition(modeOwner, id, ['RUNNING'], 'SUCCEEDED', { mode: 'session-worker' });
|
|
223
|
+
}
|
|
224
|
+
signal?.throwIfAborted();
|
|
225
|
+
this.setAgentBusy(owner, hostBusy);
|
|
226
|
+
return this.prepare(owner, signal);
|
|
227
|
+
}
|
|
228
|
+
async isSessionWorker(owner) {
|
|
229
|
+
const session = await this.#store.session(owner.sessionId);
|
|
230
|
+
if (!session?.enabled || session.root_path !== owner.root)
|
|
231
|
+
return false;
|
|
232
|
+
const record = await this.#store.get({ ...owner, agentId: '__session__' }, `session-worker-${session.epoch}`);
|
|
233
|
+
return record?.kind === 'session_worker' && record.state === 'SUCCEEDED'
|
|
234
|
+
&& record.digest === digest({ root: owner.root, epoch: session.epoch });
|
|
235
|
+
}
|
|
195
236
|
async enableTask(owner, signal) {
|
|
196
237
|
await this.authorizeCodingTask(owner);
|
|
197
238
|
signal?.throwIfAborted();
|
|
@@ -218,6 +259,8 @@ export class LispManager {
|
|
|
218
259
|
return { ok: true, state: 'TASK_READY' };
|
|
219
260
|
}
|
|
220
261
|
async isTaskMode(owner) {
|
|
262
|
+
if (await this.isSessionWorker(owner))
|
|
263
|
+
return false;
|
|
221
264
|
const epoch = (await this.#store.session(owner.sessionId))?.epoch;
|
|
222
265
|
if (!epoch)
|
|
223
266
|
return false;
|
|
@@ -232,7 +275,7 @@ export class LispManager {
|
|
|
232
275
|
for (const abort of state.active)
|
|
233
276
|
abort.abort(new LispError('CANCELLED', '作業用 Lisp の処理を取り消しました。'));
|
|
234
277
|
try {
|
|
235
|
-
await state.worker
|
|
278
|
+
await this.#supervisor.stop(state.worker);
|
|
236
279
|
// A task can still be preparing its compiled runtime without a worker.
|
|
237
280
|
// Keep its admission visible until its own cleanup has settled.
|
|
238
281
|
await state.taskSettlement;
|
|
@@ -253,12 +296,11 @@ export class LispManager {
|
|
|
253
296
|
}
|
|
254
297
|
/** A managed call uses the same admission queue and OS sandbox as legacy Lisp. */
|
|
255
298
|
async runTask(owner, code, input, signal, mode = 'call') {
|
|
256
|
-
await this.
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
fail('REPOSITORY_IN_USE', 'このリポジトリの Lisp は別の owner が使用中です。状態は保持し、別 SBCL を起動しません。');
|
|
299
|
+
await this.claimSession(owner);
|
|
300
|
+
const resident = this.#agents.get(JSON.stringify([owner.sessionId, owner.agentId]));
|
|
301
|
+
// Schemas do not make arbitrary Lisp pure. Only reuse this caller's already
|
|
302
|
+
// protected heap; other callers and development heaps get private scratch.
|
|
303
|
+
if (mode !== 'eval' && resident?.owner.root === owner.root && resident.worker?.layout.protected && resident.worker.config.executionMode === 'protected' && !resident.worker.stopped) {
|
|
262
304
|
return this.runResidentTask(resident, code, input, signal, mode);
|
|
263
305
|
}
|
|
264
306
|
if ([...this.#agents.values()].some(s => s.owner.sessionId === owner.sessionId && s.state === 'STOP_UNCONFIRMED'))
|
|
@@ -278,37 +320,24 @@ export class LispManager {
|
|
|
278
320
|
let worker;
|
|
279
321
|
try {
|
|
280
322
|
assertCurrent();
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
layout
|
|
289
|
-
worker = this.#config.executionMode === 'protected' ? new LispWorker(layout, this.#config, undefined, () => false) : new LispWorker(layout, this.#config, (method, args, context) => this.bridge(state, method, args, context));
|
|
290
|
-
state.worker = worker;
|
|
291
|
-
assertCurrent();
|
|
292
|
-
await worker.start();
|
|
293
|
-
assertCurrent();
|
|
294
|
-
if (this.#config.executionMode === 'protected') {
|
|
295
|
-
const canary = join(base, 'host-canary');
|
|
296
|
-
await writeFile(canary, 'protected', { mode: 0o600 });
|
|
297
|
-
const probe = await this.journalRequest(state, worker, 'eval', { inputs: [], code: `(let ((read-denied (handler-case (progn (with-open-file (s ${JSON.stringify(canary)}) (read-char s)) nil) (file-error () t))) (delete-denied (handler-case (progn (delete-file ${JSON.stringify(canary)}) nil) (file-error () t)))) (unless (and read-denied delete-denied) (error "ISOLATION_FAILED")) :protected)` }, this.#config.startupTimeoutMs, combined);
|
|
298
|
-
if (!probe.ok || await readFile(canary, 'utf8') !== 'protected')
|
|
299
|
-
fail('ISOLATION_FAILED', 'OS によるファイル保護を確認できません。');
|
|
300
|
-
}
|
|
301
|
-
assertCurrent();
|
|
323
|
+
// Disposable computations share the master's admission and startup path,
|
|
324
|
+
// but receive neither a repository mount nor host RPC authority.
|
|
325
|
+
worker = await this.#supervisor.start(state, {
|
|
326
|
+
signal: combined, assertCurrent, executionMode: 'protected', rpcAllowed: () => false,
|
|
327
|
+
assigned: child => { state.worker = child; worker = child; },
|
|
328
|
+
inspect: (child, code) => this.journalRequest(state, child, 'eval', { inputs: [], code }, this.#config.startupTimeoutMs, combined, false),
|
|
329
|
+
});
|
|
330
|
+
const layout = worker.layout;
|
|
302
331
|
state.state = 'EVALUATING';
|
|
303
332
|
if (mode === 'compile') {
|
|
304
|
-
const checked = await this.journalRequest(state, worker, 'task-compile', { code }, this.#config.timeoutMs, combined);
|
|
333
|
+
const checked = await this.journalRequest(state, worker, 'task-compile', { code }, this.#config.timeoutMs, combined, false);
|
|
305
334
|
assertCurrent();
|
|
306
335
|
if (!checked.ok || checked.proposals.length)
|
|
307
336
|
fail('TASK_COMPILE_FAILED', String(checked.value).slice(0, 1000));
|
|
308
337
|
return { value: null, output: worker.output(), generation: worker.generation };
|
|
309
338
|
}
|
|
310
339
|
if (mode === 'eval') {
|
|
311
|
-
const evaluated = await this.journalRequest(state, worker, 'eval', { code, inputs: [] }, this.#config.timeoutMs, combined);
|
|
340
|
+
const evaluated = await this.journalRequest(state, worker, 'eval', { code, inputs: [] }, this.#config.timeoutMs, combined, false);
|
|
312
341
|
assertCurrent();
|
|
313
342
|
if (!evaluated.ok || evaluated.proposals.length)
|
|
314
343
|
fail('TASK_EVAL_FAILED', String(evaluated.value).slice(0, 1000));
|
|
@@ -322,7 +351,7 @@ export class LispManager {
|
|
|
322
351
|
await writeFile(inputPath, encoded, { flag: 'wx', mode: 0o400 });
|
|
323
352
|
assertCurrent();
|
|
324
353
|
state.state = 'EVALUATING';
|
|
325
|
-
const response = await this.journalRequest(state, worker, 'task', { code, input: inputPath }, this.#config.timeoutMs, combined);
|
|
354
|
+
const response = await this.journalRequest(state, worker, 'task', { code, input: inputPath }, this.#config.timeoutMs, combined, false);
|
|
326
355
|
if (!response.ok || response.proposals.length)
|
|
327
356
|
fail('TASK_EXECUTION_FAILED', String(response.value).slice(0, 1000));
|
|
328
357
|
const result = await snapshot(layout.scratch, 'task-result.json', []);
|
|
@@ -336,7 +365,7 @@ export class LispManager {
|
|
|
336
365
|
try {
|
|
337
366
|
if (worker) {
|
|
338
367
|
try {
|
|
339
|
-
await
|
|
368
|
+
await this.#supervisor.stop(worker);
|
|
340
369
|
}
|
|
341
370
|
catch (error) {
|
|
342
371
|
state.state = 'STOP_UNCONFIRMED';
|
|
@@ -413,7 +442,7 @@ export class LispManager {
|
|
|
413
442
|
state.state = 'READY';
|
|
414
443
|
}
|
|
415
444
|
}
|
|
416
|
-
async startWorker(state) {
|
|
445
|
+
async startWorker(state, signal) {
|
|
417
446
|
await this.authorizeCodingTask(state.owner);
|
|
418
447
|
if (state.admission)
|
|
419
448
|
return state.admission;
|
|
@@ -424,48 +453,34 @@ export class LispManager {
|
|
|
424
453
|
state.compilation = { state: 'checking' };
|
|
425
454
|
const abort = new AbortController();
|
|
426
455
|
state.active.add(abort);
|
|
456
|
+
const combined = signal ? AbortSignal.any([signal, abort.signal]) : abort.signal;
|
|
427
457
|
const admission = (async () => {
|
|
428
458
|
let worker;
|
|
429
459
|
try {
|
|
430
|
-
await this.
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
const quote = (value) => JSON.stringify(value);
|
|
449
|
-
const probe = await this.journalRequest(state, worker, 'eval', { inputs: [], code: `(let ((read-denied (handler-case (progn (with-open-file (s ${quote(canary)}) (read-char s)) nil) (file-error () t))) (delete-denied (handler-case (progn (delete-file ${quote(canary)}) nil) (file-error () t)))) (unless (and read-denied delete-denied) (error "ISOLATION_FAILED")) (kioku.files:write-text (merge-pathnames "probe" (kioku.files:scratch)) "ok") :protected)` }, this.#config.startupTimeoutMs);
|
|
450
|
-
if (!probe.ok || await readFile(canary, 'utf8') !== 'protected')
|
|
451
|
-
fail('ISOLATION_FAILED', 'OS によるファイル保護を確認できません。');
|
|
452
|
-
}
|
|
453
|
-
if (this.#closed || state.state !== 'PREFLIGHT') {
|
|
454
|
-
await worker.stop();
|
|
455
|
-
fail('CANCELLED', '起動を取り消しました。');
|
|
456
|
-
}
|
|
460
|
+
const sessionWorker = await this.isSessionWorker(state.owner);
|
|
461
|
+
worker = await this.#supervisor.start(state, {
|
|
462
|
+
signal: combined, ...(!sessionWorker ? { workspace: state.owner.root } : {}), executionMode: this.#config.executionMode,
|
|
463
|
+
assertCurrent: () => { if (this.#closed || state.disposed || state.state !== 'PREFLIGHT' || combined.aborted)
|
|
464
|
+
fail('CANCELLED', '起動は取り消されています。'); },
|
|
465
|
+
compilation: status => { state.compilation = status; },
|
|
466
|
+
assigned: child => { state.worker = child; },
|
|
467
|
+
failed: (child, error) => {
|
|
468
|
+
// Process events, not UI polling, report an idle child's failure.
|
|
469
|
+
// Active operations settle through their journal-aware catch path.
|
|
470
|
+
if (state.worker === child && state.state === 'READY')
|
|
471
|
+
this.halted(state, error);
|
|
472
|
+
},
|
|
473
|
+
hostCall: (method, args, context) => this.bridge(state, method, args, context),
|
|
474
|
+
beforeJob: () => this.taskAuthority.bound(state.execution, async () => { await this.taskAuthority.authorizeEffect(state.owner, this.#config.executionMode === 'protected' ? 'protected' : 'direct'); }),
|
|
475
|
+
auditJob: (input, launch) => this.journalProtectedJob(state, input, launch),
|
|
476
|
+
inspect: (child, code) => this.journalRequest(state, child, 'eval', { inputs: [], code }, this.#config.startupTimeoutMs, combined, false),
|
|
477
|
+
});
|
|
457
478
|
state.state = 'READY';
|
|
458
479
|
state.inputBytes = 0;
|
|
459
480
|
delete state.error;
|
|
460
481
|
return worker;
|
|
461
482
|
}
|
|
462
483
|
catch (error) {
|
|
463
|
-
try {
|
|
464
|
-
await worker?.stop();
|
|
465
|
-
}
|
|
466
|
-
catch (stop) {
|
|
467
|
-
error = stop;
|
|
468
|
-
}
|
|
469
484
|
if (error instanceof LispError && error.code === 'WORKER_LIMIT') {
|
|
470
485
|
state.state = 'SUSPENDED';
|
|
471
486
|
delete state.error;
|
|
@@ -481,26 +496,10 @@ export class LispManager {
|
|
|
481
496
|
}
|
|
482
497
|
finally {
|
|
483
498
|
delete state.admission;
|
|
484
|
-
delete state.slotReserved;
|
|
485
499
|
state.active.delete(abort);
|
|
486
500
|
this.scheduleIdle(state);
|
|
487
501
|
}
|
|
488
502
|
}
|
|
489
|
-
/** Serialize only slot allocation/eviction; compilation remains concurrent. */
|
|
490
|
-
reserveSlot(state) {
|
|
491
|
-
const allocation = this.#admissionQueue.then(async () => {
|
|
492
|
-
if (this.#closed || state.disposed || state.state !== 'PREFLIGHT')
|
|
493
|
-
fail('CANCELLED', 'Lisp の起動を取り消しました。');
|
|
494
|
-
const occupied = () => [...this.#agents.values()].filter(a => a.slotReserved || (a.worker && !a.worker.stopped)).length;
|
|
495
|
-
if (occupied() >= this.#config.maxWorkers)
|
|
496
|
-
throw new LispError('WORKER_LIMIT', 'Lisp の起動枠はすべて使用中です。既存リポジトリの worker と状態は保持します。', '使い終わったセッションを明示的に disable するか、maxWorkers の設定を確認して再試行してください。');
|
|
497
|
-
if (this.#closed || state.disposed || state.state !== 'PREFLIGHT')
|
|
498
|
-
fail('CANCELLED', 'Lisp の起動を取り消しました。');
|
|
499
|
-
state.slotReserved = true;
|
|
500
|
-
});
|
|
501
|
-
this.#admissionQueue = allocation.catch(() => { });
|
|
502
|
-
return allocation;
|
|
503
|
-
}
|
|
504
503
|
canSuspend(state) {
|
|
505
504
|
return !this.#closed && !state.disposed && state.state === 'READY' && !state.hostBusy && !state.admission && state.active.size === 0
|
|
506
505
|
&& !state.ownedJobs?.size && !state.ownedCalls?.size && Boolean(state.worker?.healthy) && !state.worker?.hasRunningJobs;
|
|
@@ -533,7 +532,7 @@ export class LispManager {
|
|
|
533
532
|
state.state = 'READY';
|
|
534
533
|
return;
|
|
535
534
|
}
|
|
536
|
-
await state.worker
|
|
535
|
+
await this.#supervisor.stop(state.worker);
|
|
537
536
|
state.state = 'SUSPENDED';
|
|
538
537
|
delete state.error;
|
|
539
538
|
delete state.worker;
|
|
@@ -551,14 +550,43 @@ export class LispManager {
|
|
|
551
550
|
delete state.suspension;
|
|
552
551
|
}
|
|
553
552
|
}
|
|
554
|
-
/**
|
|
555
|
-
async prepare(owner) {
|
|
553
|
+
/** Admit a fresh generation only after the master has reconciled its old child and journals. */
|
|
554
|
+
async prepare(owner, signal) {
|
|
556
555
|
await this.authorizeCodingTask(owner);
|
|
557
556
|
const state = this.entry(owner);
|
|
558
557
|
if (state.suspension)
|
|
559
558
|
await state.suspension;
|
|
559
|
+
if (state.state === 'READY' && !state.worker?.healthy)
|
|
560
|
+
this.halted(state, new LispError('WORKER_EXITED', 'Lisp の子プロセスが終了しています。'));
|
|
561
|
+
const cold = state.error?.code === 'WORKER_NOT_RESUMED' && !state.worker;
|
|
562
|
+
const exited = state.error?.code === 'WORKER_EXITED' && state.active.size === 0 && !state.admission;
|
|
563
|
+
if (cold || exited) {
|
|
564
|
+
const previous = state.worker;
|
|
565
|
+
if (exited) {
|
|
566
|
+
try {
|
|
567
|
+
await this.#supervisor.stop(previous);
|
|
568
|
+
}
|
|
569
|
+
catch (error) {
|
|
570
|
+
this.halted(state, error);
|
|
571
|
+
return this.status(owner);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
const pending = await this.#store.hasPending(owner.sessionId);
|
|
575
|
+
const managed = await this.managedUnresolved(owner);
|
|
576
|
+
// A cancel, another admission, or a late callback can win while we read.
|
|
577
|
+
if (!pending && managed.total === 0 && state.worker === previous &&
|
|
578
|
+
state.state === 'RECOVERY_REQUIRED' && state.error?.code === (cold ? 'WORKER_NOT_RESUMED' : 'WORKER_EXITED')) {
|
|
579
|
+
if (exited && !this.#supervisor.admitRestart(state)) {
|
|
580
|
+
this.halted(state, new LispError('WORKER_RESTART_LIMIT', 'Lisp の異常終了が続いたため自動再起動を停止しました。', '停止理由を確認してから /kioku-lisp recover を実行してください。'));
|
|
581
|
+
return this.status(owner);
|
|
582
|
+
}
|
|
583
|
+
state.state = 'SUSPENDED';
|
|
584
|
+
delete state.error;
|
|
585
|
+
delete state.worker;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
560
588
|
if (state.state === 'SUSPENDED') {
|
|
561
|
-
await this.startWorker(state);
|
|
589
|
+
await this.startWorker(state, signal);
|
|
562
590
|
state.resumed = true;
|
|
563
591
|
}
|
|
564
592
|
else if (state.admission)
|
|
@@ -974,7 +1002,7 @@ export class LispManager {
|
|
|
974
1002
|
executionMode: this.#config.executionMode,
|
|
975
1003
|
compilation: state.compilation ?? null, resumed: state.resumed ?? false,
|
|
976
1004
|
limits: { timeoutMs: this.#config.timeoutMs, maxOutputBytes: this.#config.maxOutputBytes, maxWorkers: this.#config.maxWorkers, idleTimeoutMs: this.#config.idleTimeoutMs,
|
|
977
|
-
aggregateMemory: 'unavailable', aggregateCpu: 'unavailable', scratchQuota: 'unavailable', termination: 'supervised', fileBoundary:
|
|
1005
|
+
aggregateMemory: 'unavailable', aggregateCpu: 'unavailable', scratchQuota: 'unavailable', termination: 'supervised', fileBoundary: process.platform === 'darwin' ? 'seatbelt' : 'bubblewrap' },
|
|
978
1006
|
operations, operationCount: summary.count, pendingCount: Object.values(summary.pendingStates).reduce((a, b) => a + b, 0), pendingStates: summary.pendingStates,
|
|
979
1007
|
...(taskSummary ? { task: taskSummary } : {}),
|
|
980
1008
|
hot: await this.#hot.status(owner),
|
|
@@ -1026,7 +1054,9 @@ export class LispManager {
|
|
|
1026
1054
|
if (tool === 'lisp_status')
|
|
1027
1055
|
return await this.status(owner, z.number().int().nonnegative().parse(input.offset ?? 0));
|
|
1028
1056
|
const state = this.entry(owner);
|
|
1029
|
-
if (
|
|
1057
|
+
if (['lisp_define', 'lisp_call', 'lisp_observe', 'lisp_hot_call'].includes(tool))
|
|
1058
|
+
await this.claimSession(owner);
|
|
1059
|
+
else if (!['lisp_hot_status', 'lisp_inspect', 'lisp_cancel'].includes(tool))
|
|
1030
1060
|
await this.authorizeCodingTask(owner);
|
|
1031
1061
|
if (tool === 'lisp_cancel')
|
|
1032
1062
|
await this.claimSession(owner);
|
|
@@ -1068,7 +1098,7 @@ export class LispManager {
|
|
|
1068
1098
|
typesafe: '(kioku.typesafe:status); (kioku.typesafe:evaluate state questions :model "jev-latest" :timeout-ms 30000). Explicit semantic decisions via the host; consume answers with gethash. Strings/hash tables/vectors use JSON conventions. Catch kioku.typesafe:service-error; no retries or approval bypass. Configure with /kioku-typesafe-key.',
|
|
1069
1099
|
describe: 'symbol="kioku.files" lists bundled exports; symbol="kioku.user" lists your task functions; an exact function name returns arguments/docs.',
|
|
1070
1100
|
workflow: 'Define task-specific defun helpers once, compose them into one useful operation, and call that function in later evaluations. Batch known reads and checks; return a compact result. Definitions last for this worker generation. Stop before decisions requiring new evidence or approval.',
|
|
1071
|
-
hot: 'Use lisp_hot_contract, lisp_hot_install and lisp_hot_call for approved project-shared functions.
|
|
1101
|
+
hot: 'Use lisp_hot_contract, lisp_hot_install and lisp_hot_call for approved project-shared functions. Reuse only your own protected worker with a fresh package and no host RPC; otherwise use private protected scratch without a repository mount. Schemas do not establish purity. No mode switch is needed. lisp_hot_status reads active versions.',
|
|
1072
1102
|
run: '(kioku.process:run "node" (list "--test" "--experimental-test-isolation=none" "test/public.test.mjs") :directory "project") uses a project-relative directory in development mode (scratch-relative in protected mode). Check final receipts and result-code.',
|
|
1073
1103
|
inspect: 'lisp_inspect accepts ref, or resultOperationId with section/offset/limit (Unicode characters). Never rerun to retrieve output.',
|
|
1074
1104
|
reads: 'Use native read/glob/grep/skill for repository exploration; lisp_eval.inputs for read-only workspace or session-attachment copies.',
|
|
@@ -1123,8 +1153,6 @@ export class LispManager {
|
|
|
1123
1153
|
if (tool.startsWith('lisp_hot_'))
|
|
1124
1154
|
return await this.#hot.execute(owner, tool, id, hash, Object.fromEntries(Object.entries(input).filter(([key]) => key !== 'operationId')), signal);
|
|
1125
1155
|
if (tool === 'lisp_define' || tool === 'lisp_call' || tool === 'lisp_observe') {
|
|
1126
|
-
if (!await this.isTaskMode(owner))
|
|
1127
|
-
fail('TASK_MODE_REQUIRED', '作業用ツールには /kioku-lisp enable-task を使用してください。');
|
|
1128
1156
|
if (tool === 'lisp_observe') {
|
|
1129
1157
|
const request = z.object({ paths: z.array(z.string().min(1).max(4096)).min(1).max(100), format: z.enum(['text', 'json']).default('text') }).strict()
|
|
1130
1158
|
.parse(Object.fromEntries(Object.entries(input).filter(([key]) => key !== 'operationId')));
|
|
@@ -1427,7 +1455,7 @@ export class LispManager {
|
|
|
1427
1455
|
const applied = await this.#proposals.apply(owner, id, worker.generation, response.proposals, combined, undefined, state.packageBase);
|
|
1428
1456
|
const uncertain = applied.some(change => change.state === 'UNKNOWN');
|
|
1429
1457
|
if (uncertain) {
|
|
1430
|
-
await
|
|
1458
|
+
await this.#supervisor.stop(worker);
|
|
1431
1459
|
this.halted(state, new LispError('RECONCILIATION_REQUIRED', '変更結果が未確定です。記録とバックアップを照合してください。'));
|
|
1432
1460
|
}
|
|
1433
1461
|
else if (state.state === 'EVALUATING')
|
|
@@ -1453,7 +1481,7 @@ export class LispManager {
|
|
|
1453
1481
|
// Close admission before attempting a potentially failing journal write.
|
|
1454
1482
|
state.state = 'STOPPING';
|
|
1455
1483
|
try {
|
|
1456
|
-
await
|
|
1484
|
+
await this.#supervisor.stop(worker);
|
|
1457
1485
|
}
|
|
1458
1486
|
catch (stop) {
|
|
1459
1487
|
outcome = { ...outcome, stopFailure: failure(stop) };
|
|
@@ -1472,7 +1500,7 @@ export class LispManager {
|
|
|
1472
1500
|
}
|
|
1473
1501
|
else if (!worker.healthy) {
|
|
1474
1502
|
try {
|
|
1475
|
-
await
|
|
1503
|
+
await this.#supervisor.stop(worker);
|
|
1476
1504
|
}
|
|
1477
1505
|
catch (stop) {
|
|
1478
1506
|
error = stop;
|
|
@@ -1528,7 +1556,7 @@ export class LispManager {
|
|
|
1528
1556
|
catch (error) {
|
|
1529
1557
|
ownedStopFailure = new LispError('STOP_UNCONFIRMED', `管理中のプロセスの停止を確認できません。${failure(error).message}`);
|
|
1530
1558
|
}
|
|
1531
|
-
await state.worker
|
|
1559
|
+
await this.#supervisor.stop(state.worker);
|
|
1532
1560
|
if (state.admission) {
|
|
1533
1561
|
try {
|
|
1534
1562
|
await state.admission;
|
|
@@ -1538,10 +1566,11 @@ export class LispManager {
|
|
|
1538
1566
|
throw error;
|
|
1539
1567
|
}
|
|
1540
1568
|
}
|
|
1541
|
-
this.#
|
|
1569
|
+
this.#supervisor.assertCompilationStopped();
|
|
1542
1570
|
if (ownedStopFailure)
|
|
1543
1571
|
throw ownedStopFailure;
|
|
1544
1572
|
state.state = 'RECOVERY_REQUIRED';
|
|
1573
|
+
state.error = failure(new LispError('CANCELLED', 'Lisp の処理を取り消しました。'));
|
|
1545
1574
|
}
|
|
1546
1575
|
catch (error) {
|
|
1547
1576
|
this.halted(state, error);
|