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
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { nativeRequestProposals } from '../request-proposals.js';
|
|
2
2
|
import { isNativeSubagent } from '../native-subagent.js';
|
|
3
3
|
import { recordDiagnosticAdmission, observeDiagnostic, } from '../decisions/diagnostics.js';
|
|
4
|
-
import { policyState } from '../host-adapter/turn-state.js';
|
|
5
4
|
import { dshTurnRequestId } from '../intake-profile-resolver.js';
|
|
6
5
|
import { classifyTaskForIntake, selectInstalledSkills, } from '../decisions/workflows.js';
|
|
7
6
|
import { classifyRequestIntent, createRequestIntentContext, rebindRequestIntentDecision, requestIntentMessageRefs, requestIntentReferenceIds, requestIntentTaskType, requestIntentIsUnresolved, } from '../decisions/request-intent.js';
|
|
8
7
|
import { ANSWER_REVIEW_FORM, hasHumanInput, } from '../answer-review/contracts.js';
|
|
9
8
|
import { saveSessionNotice } from '../plugin-records.js';
|
|
10
|
-
import { explicitExecutionMode,
|
|
9
|
+
import { explicitExecutionMode, readExecutionSelection, writeExecutionSelection, } from '../execution-selection.js';
|
|
11
10
|
import { getHeadWorkerForSession } from '../models/session-selection.js';
|
|
12
11
|
import { selectExecution, ExecutionSelectionPending, } from '../model-selection-ui.js';
|
|
13
|
-
import { ennoStateForPreparedTask } from '../../enno-oduno/service.js';
|
|
14
12
|
import { realpathSync } from 'node:fs';
|
|
15
13
|
import { withImmediateTransaction } from '../../db/transaction.js';
|
|
16
14
|
import { DshIntakeGate, } from '../intake-gate.js';
|
|
@@ -22,11 +20,7 @@ import { dshTurnBoundarySeq, } from '../session-memory-finalizer.js';
|
|
|
22
20
|
import { createDshIntakeAnswerer, } from '../user-interaction.js';
|
|
23
21
|
import { canonicalContentHash } from '../../serialization/validate.js';
|
|
24
22
|
import { KiokukoError } from '../../errors.js';
|
|
25
|
-
import { answerEnno, stateForSnapshot, inapplicableEnnoState, } from '../../enno-oduno/service.js';
|
|
26
|
-
import { claimExecutionLeaseInTransaction, readEnnoSnapshot, terminalizeLedgerRunInTransaction, } from '../../enno-oduno/store.js';
|
|
27
|
-
import { decideDshContinuation } from '../continuation.js';
|
|
28
23
|
import { resolveProjectWorkspaceReadOnly } from '../../memory/workspaces.js';
|
|
29
|
-
import { ENNO_APPLICABLE_TASK_TYPES, } from '../../enno-oduno/types.js';
|
|
30
24
|
import { supersedeBoundaryJobsAtOrBeforeRevisionInTransaction, supersedeOutboxAtOrBeforeRevisionInTransaction, } from '../turn-process.js';
|
|
31
25
|
import { unexecutedRunInput } from '../input-claim.js';
|
|
32
26
|
import { resetLoopGuardForUserInTransaction } from '../loop-guard.js';
|
|
@@ -42,24 +36,10 @@ import { claimExecutionOwner, readExecutionOwner, } from '../orchestration/execu
|
|
|
42
36
|
import { initializeCodingWorkflow } from '../coding-workflow/store.js';
|
|
43
37
|
import { codingWorkRequested } from '../coding-workflow/intent.js';
|
|
44
38
|
import { initializeTaskCompletion } from '../task-completion.js';
|
|
45
|
-
export function createAdmission({ native, skills, tools, userQuestions, sessions, agents, deepPlanning, modelCatalog, modelCompatibility, modelRoutes, now, runtime, decisions, answerReview,
|
|
39
|
+
export function createAdmission({ native, skills, tools, userQuestions, sessions, agents, deepPlanning, modelCatalog, modelCompatibility, modelRoutes, now, runtime, decisions, answerReview, executionSupport, memoryFinalizer, autoReview, sessionMirror, akinatorMemoryConfig, memoryRetrievalConfig, completionMode, turnState, getSelection, setSelection, executionBinding, captureInitialInput, contextMessages, resolveIdleClose, retireSupersededRun, cancelBoundarySession, isSelectionBlocked, closeTurn, capabilityCatalog, sessionEventSource, objectRecord, isHumanMessage, textFromMessages, pluginContinuationId, isLoopRecoveryMessage, }) {
|
|
46
40
|
const currentSession = turnState.currentSession;
|
|
47
41
|
const currentForAgentEvent = turnState.currentForAgentEvent;
|
|
48
42
|
let resumeExistingRun;
|
|
49
|
-
function supersedesUnstartedEnno(event, state) {
|
|
50
|
-
if (state.status !== 'oduno_ideal')
|
|
51
|
-
return false;
|
|
52
|
-
const incomingType = resolveGroundedIntakeProfile({
|
|
53
|
-
task: event.task,
|
|
54
|
-
cwd: event.cwd,
|
|
55
|
-
deferTaskTypeInference: event.deferTaskTypeInference === true,
|
|
56
|
-
...(event.profileHints === undefined
|
|
57
|
-
? {}
|
|
58
|
-
: { profileHints: event.profileHints }),
|
|
59
|
-
}).profileHints.taskType;
|
|
60
|
-
return (incomingType !== null &&
|
|
61
|
-
!ENNO_APPLICABLE_TASK_TYPES.includes(incomingType));
|
|
62
|
-
}
|
|
63
43
|
function eventTurn(event) {
|
|
64
44
|
const data = typeof event.data === 'object' &&
|
|
65
45
|
event.data !== null &&
|
|
@@ -89,6 +69,10 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
89
69
|
bindTaskRepository(database, identity);
|
|
90
70
|
if (event.signal.aborted)
|
|
91
71
|
return undefined;
|
|
72
|
+
// Completion can settle while the final model response is streaming.
|
|
73
|
+
// Retain that response without issuing another execution lease.
|
|
74
|
+
if (readTaskSnapshot(database, identity).state === 'Done')
|
|
75
|
+
return undefined;
|
|
92
76
|
// A continued native turn can reuse an already Working task without a
|
|
93
77
|
// fresh admission. Capture its current lease from SQLite as well; never
|
|
94
78
|
// synthesize authority from the model or a cached turn record.
|
|
@@ -125,11 +109,9 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
125
109
|
!item.closed &&
|
|
126
110
|
!item.failed &&
|
|
127
111
|
item.prepared.run.status === 'active' &&
|
|
128
|
-
!item.prepared.ennoOduno.applicable &&
|
|
129
112
|
!selection?.discussion &&
|
|
130
113
|
(!selection ||
|
|
131
114
|
(selection.mode === 'normal' && selection.status === 'ready')) &&
|
|
132
|
-
!delegation.isChild(reviewAgent) &&
|
|
133
115
|
!deepPlanning.executor.isChild(reviewAgent) &&
|
|
134
116
|
!isNativeSubagent(reviewAgent) &&
|
|
135
117
|
!executionSupport.paused(event.sessionId));
|
|
@@ -183,37 +165,6 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
183
165
|
undefined);
|
|
184
166
|
});
|
|
185
167
|
}
|
|
186
|
-
const refreshContinuedWorkLease = async (item, expected) => {
|
|
187
|
-
const expectedWorkUnitId = expected.nextAction === 'execute_work_unit'
|
|
188
|
-
? expected.directive?.workUnit?.id
|
|
189
|
-
: undefined;
|
|
190
|
-
if (expectedWorkUnitId === undefined)
|
|
191
|
-
return undefined;
|
|
192
|
-
return runtime.withDatabase((database) => withImmediateTransaction(database, () => {
|
|
193
|
-
const snapshot = readEnnoSnapshot(database, {
|
|
194
|
-
runId: item.runId,
|
|
195
|
-
workspace: item.workspace,
|
|
196
|
-
orchestrationId: item.orchestrationId,
|
|
197
|
-
});
|
|
198
|
-
const state = stateForSnapshot(snapshot);
|
|
199
|
-
const workUnitId = state.nextAction === 'execute_work_unit'
|
|
200
|
-
? state.directive?.workUnit?.id
|
|
201
|
-
: undefined;
|
|
202
|
-
if (state.contractRevision !== expected.contractRevision ||
|
|
203
|
-
workUnitId !== expectedWorkUnitId) {
|
|
204
|
-
throw new KiokukoError('CONFLICT', 'Enno WorkUnit changed before DSH turn recovery');
|
|
205
|
-
}
|
|
206
|
-
if (snapshot.dshSessionId !== item.sessionId) {
|
|
207
|
-
throw new KiokukoError('CONFLICT', 'Enno DSH route changed before WorkUnit recovery');
|
|
208
|
-
}
|
|
209
|
-
return {
|
|
210
|
-
state,
|
|
211
|
-
lease: claimExecutionLeaseInTransaction(database, snapshot, workUnitId, {
|
|
212
|
-
dshSessionId: item.sessionId,
|
|
213
|
-
}),
|
|
214
|
-
};
|
|
215
|
-
}));
|
|
216
|
-
};
|
|
217
168
|
class CapturingGate extends DshIntakeGate {
|
|
218
169
|
supersededChoices = new Map();
|
|
219
170
|
async choose(event, result) {
|
|
@@ -223,7 +174,7 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
223
174
|
const inherited = this.supersededChoices.get(key);
|
|
224
175
|
if (stored?.value.mode === 'pending' &&
|
|
225
176
|
inherited?.value.status === 'ready' &&
|
|
226
|
-
|
|
177
|
+
inherited.value.mode === 'normal' &&
|
|
227
178
|
(!explicitExecutionMode(event.task) ||
|
|
228
179
|
explicitExecutionMode(event.task) === inherited.value.mode)) {
|
|
229
180
|
const revision = stored.revision;
|
|
@@ -237,20 +188,6 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
237
188
|
}).task);
|
|
238
189
|
result.prepared.selectedSkills = await selectInstalledSkills(decisions, `run:${runId}`, task, [...event.capabilities.skills, ...event.capabilities.tools], result.prepared.capabilities, event.signal);
|
|
239
190
|
}
|
|
240
|
-
// Legacy accepted plans keep their original execution contract. A draft
|
|
241
|
-
// awaiting the new review gate must first acquire an explicit check binding.
|
|
242
|
-
if (!stored && result.prepared.ennoOduno.status === 'zenki_planning') {
|
|
243
|
-
stored = await runtime.withDatabase((db) => {
|
|
244
|
-
initializeExecutionSelection(db, runId);
|
|
245
|
-
const current = readExecutionSelection(db, runId);
|
|
246
|
-
return current.value.mode === 'pending'
|
|
247
|
-
? writeExecutionSelection(db, runId, current.revision, {
|
|
248
|
-
mode: 'enno',
|
|
249
|
-
status: 'selecting',
|
|
250
|
-
})
|
|
251
|
-
: current;
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
191
|
if (!stored)
|
|
255
192
|
return result;
|
|
256
193
|
const discussion = stored.value.discussion;
|
|
@@ -273,13 +210,13 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
273
210
|
: { ...value, mode: 'pending' }));
|
|
274
211
|
}
|
|
275
212
|
}
|
|
276
|
-
if (
|
|
277
|
-
.
|
|
213
|
+
if (stored.value.mode === 'pending' &&
|
|
214
|
+
!explicitExecutionMode(event.task) &&
|
|
215
|
+
!['build', 'debug', 'review', 'devops'].includes(result.prepared.intake.profile.taskType ?? '')) {
|
|
278
216
|
const revision = stored.revision;
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
.run(runId, revision));
|
|
217
|
+
await runtime.withDatabase((db) => db
|
|
218
|
+
.prepare('DELETE FROM dsh_execution_selections WHERE run_id = ? AND revision = ?')
|
|
219
|
+
.run(runId, revision));
|
|
283
220
|
return result;
|
|
284
221
|
}
|
|
285
222
|
setSelection(runId, stored);
|
|
@@ -302,10 +239,7 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
302
239
|
},
|
|
303
240
|
});
|
|
304
241
|
setSelection(runId, selected);
|
|
305
|
-
|
|
306
|
-
? result.prepared.ennoOduno
|
|
307
|
-
: await runtime.withDatabase((db) => ennoStateForPreparedTask(db, result.prepared, event.sessionId));
|
|
308
|
-
return { ...result, prepared: { ...result.prepared, ennoOduno } };
|
|
242
|
+
return result;
|
|
309
243
|
}
|
|
310
244
|
async prepare(event) {
|
|
311
245
|
if (event.requestIntent?.action === 'change' &&
|
|
@@ -359,7 +293,6 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
359
293
|
!prior.closed &&
|
|
360
294
|
!prior.failed &&
|
|
361
295
|
prior.turn < event.turn &&
|
|
362
|
-
!prior.prepared.ennoOduno.applicable &&
|
|
363
296
|
!(await runtime.withDatabase((db) => readCodingWorkflow(db, current.taskId)));
|
|
364
297
|
if (resumeCanonicalContinuation ||
|
|
365
298
|
!taskCanExecute(current) ||
|
|
@@ -600,64 +533,34 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
600
533
|
prepared: previous.prepared,
|
|
601
534
|
catalog: event.capabilities,
|
|
602
535
|
};
|
|
603
|
-
|
|
604
|
-
// DSH's dedicated plan-review card returns the composer to the user
|
|
605
|
-
// when they choose "Chat about it". The next human message is the
|
|
606
|
-
// requested plan revision; settle it host-side before Zenki resumes.
|
|
607
|
-
// This keeps enno_answer host-only and avoids reopening Akinator.
|
|
608
|
-
if (previousState.nextAction === 'ask_user_confirmation' &&
|
|
609
|
-
previousState.contractRevision !== null) {
|
|
610
|
-
const expectedRevision = previousState.contractRevision;
|
|
611
|
-
const requestedChanges = event.task.trim();
|
|
612
|
-
if (requestedChanges.length === 0)
|
|
613
|
-
throw new KiokukoError('VALIDATION_ERROR', 'Plan revision feedback is empty');
|
|
614
|
-
const revised = await runtime.withDatabase((database) => answerEnno(database, {
|
|
615
|
-
runId: previous.runId,
|
|
616
|
-
workspace: previous.workspace,
|
|
617
|
-
orchestrationId: previous.orchestrationId,
|
|
618
|
-
expectedRevision,
|
|
619
|
-
idempotencyKey: `dsh-confirmation-feedback:${canonicalContentHash({
|
|
620
|
-
runId: previous.runId,
|
|
621
|
-
revision: expectedRevision,
|
|
622
|
-
sessionId: event.sessionId,
|
|
623
|
-
turn: event.turn,
|
|
624
|
-
requestedChanges,
|
|
625
|
-
})}`,
|
|
626
|
-
action: 'revise',
|
|
627
|
-
requestedChanges,
|
|
628
|
-
}));
|
|
629
|
-
previous.prepared = {
|
|
630
|
-
...previous.prepared,
|
|
631
|
-
ennoOduno: revised.ennoOduno,
|
|
632
|
-
};
|
|
633
|
-
const next = policyState(revised.ennoOduno, previous, previous.sessionId, revised.executionLease);
|
|
634
|
-
turnState.applyPolicy(previous.runId, next);
|
|
635
|
-
previousState = revised.ennoOduno;
|
|
636
|
-
}
|
|
637
|
-
const previousWasChat = previous.prepared.intake.profile.taskType === 'chat';
|
|
638
|
-
const superseded = previous.prepared.ennoOduno.applicable &&
|
|
639
|
-
supersedesUnstartedEnno(event, previousState);
|
|
536
|
+
const previousWasChat = previous.prepared.intake.profile.taskType === "chat";
|
|
640
537
|
const selection = getSelection(previous.runId)?.value;
|
|
641
538
|
const coding = await runtime.withDatabase((db) => readCodingWorkflow(db, previous.runId));
|
|
642
539
|
// Child results and other generated turns continue the admitted Goal.
|
|
643
540
|
// Only a new human request can replace it without an explicit continuation.
|
|
644
541
|
const resumeCoding = coding &&
|
|
645
|
-
![
|
|
542
|
+
!["completed", "cancelled", "superseded"].includes(coding.state) &&
|
|
646
543
|
(!hasHumanInput(event.nativeMessages ?? []) ||
|
|
647
544
|
continuesCodingScope(event));
|
|
545
|
+
// Durable ledger state owns run liveness; an in-memory active record
|
|
546
|
+
// cannot resurrect a failed, cancelled or missing run.
|
|
547
|
+
const durableStatus = await runtime.withDatabase((db) => new LedgerStore(db).readRun(previous.runId)?.status);
|
|
548
|
+
const durableOpen = durableStatus === "intake" || durableStatus === "active";
|
|
648
549
|
const continuePrevious = resumeCoding ||
|
|
649
550
|
(selection &&
|
|
650
|
-
(selection.status !==
|
|
651
|
-
(selection.mode ===
|
|
551
|
+
(selection.status !== "ready" ||
|
|
552
|
+
(selection.mode === "normal" && previous.failed)))
|
|
652
553
|
? true
|
|
653
554
|
: previousWasChat
|
|
654
|
-
? event.profileHints?.taskType ===
|
|
655
|
-
:
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
555
|
+
? event.profileHints?.taskType === "chat"
|
|
556
|
+
: event.requestIntent?.relation !== 'new' &&
|
|
557
|
+
(!coding || !['completed', 'cancelled', 'superseded'].includes(coding.state)) &&
|
|
558
|
+
durableOpen &&
|
|
559
|
+
!previous.failed &&
|
|
560
|
+
previous.prepared.run.status === "active" &&
|
|
561
|
+
(event.profileHints?.taskType ??
|
|
562
|
+
previous.prepared.intake.profile.taskType) ===
|
|
563
|
+
previous.prepared.intake.profile.taskType;
|
|
661
564
|
if (continuePrevious) {
|
|
662
565
|
this.assertCatalog(previous.catalog, event.capabilities);
|
|
663
566
|
const intent = event.requestIntent;
|
|
@@ -675,15 +578,6 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
675
578
|
repositoryRoot: previous.repositoryRoot,
|
|
676
579
|
}, `request-intent:${event.sessionId}:${event.turn}:${intent.evidence.requestDigest}`, intent.evidence.requestDigest, evidenceRefs));
|
|
677
580
|
}
|
|
678
|
-
const refreshedWork = await refreshContinuedWorkLease(previous, previousState);
|
|
679
|
-
if (refreshedWork !== undefined) {
|
|
680
|
-
previous.prepared = {
|
|
681
|
-
...previous.prepared,
|
|
682
|
-
ennoOduno: refreshedWork.state,
|
|
683
|
-
};
|
|
684
|
-
const next = policyState(refreshedWork.state, previous, previous.sessionId, refreshedWork.lease);
|
|
685
|
-
turnState.applyPolicy(previous.runId, next);
|
|
686
|
-
}
|
|
687
581
|
const continuedMemory = {
|
|
688
582
|
context: null,
|
|
689
583
|
memoryPolicy: {
|
|
@@ -740,11 +634,16 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
740
634
|
prepared: previous.prepared,
|
|
741
635
|
catalog: event.capabilities,
|
|
742
636
|
};
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
637
|
+
// The durable ledger status owns the retire outcome: a directly
|
|
638
|
+
// failed/cancelled run must close with its recorded status (idempotent
|
|
639
|
+
// close), never as 'completed' (which would fake verified completion
|
|
640
|
+
// or collide with the immutable close-status ledger guard).
|
|
641
|
+
const priorLedgerStatus = await runtime.withDatabase((db) => new LedgerStore(db).readRun(previous.runId)?.status);
|
|
642
|
+
const priorStatus = priorLedgerStatus === 'failed' || priorLedgerStatus === 'cancelled'
|
|
643
|
+
? priorLedgerStatus
|
|
644
|
+
: 'completed';
|
|
645
|
+
await retireSupersededRun(previous, priorStatus);
|
|
646
|
+
this.supersedeTurn(event.sessionId, event.turn);
|
|
748
647
|
}
|
|
749
648
|
const resumed = await resumeExistingRun?.(event);
|
|
750
649
|
if (resumed !== undefined) {
|
|
@@ -778,8 +677,6 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
778
677
|
answerReview.humanInput(event.sessionId, event.turn);
|
|
779
678
|
cancelBoundarySession(event.sessionId);
|
|
780
679
|
const previous = currentSession(event.sessionId);
|
|
781
|
-
if (previous)
|
|
782
|
-
ennoMemory.invalidate(previous.runId);
|
|
783
680
|
const state = previous === undefined
|
|
784
681
|
? undefined
|
|
785
682
|
: turnState.policyState(previous.runId);
|
|
@@ -839,7 +736,7 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
839
736
|
return result;
|
|
840
737
|
}
|
|
841
738
|
async preStep(event, next) {
|
|
842
|
-
if (event.nativeAgent &&
|
|
739
|
+
if (event.nativeAgent && deepPlanning.executor.isChild(event.nativeAgent))
|
|
843
740
|
return next();
|
|
844
741
|
// The native chain owns admission and the original message ordering.
|
|
845
742
|
// Run it before any Kiokuko storage or classification work so an
|
|
@@ -945,8 +842,6 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
945
842
|
return { kind: 'reject' };
|
|
946
843
|
}
|
|
947
844
|
}
|
|
948
|
-
if (item !== undefined && !getSelection(item.runId)?.value.discussion)
|
|
949
|
-
await refreshEnnoMemory(item, event.signal);
|
|
950
845
|
const messages = await contextMessages(event, nativeDecision.messages);
|
|
951
846
|
return {
|
|
952
847
|
...nativeDecision,
|
|
@@ -1020,64 +915,13 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
1020
915
|
const selection = readExecutionSelection(database, runId)?.value;
|
|
1021
916
|
if (selection?.mode === 'deep-thinker')
|
|
1022
917
|
throw new KiokukoError('CONFLICT', 'Deep Thinker recovery requires its own execution lane');
|
|
1023
|
-
|
|
1024
|
-
// Enno selection can recover Enno ownership instead of ordinary execution.
|
|
1025
|
-
const executionMode = selection?.mode === 'enno' ? 'enno' : 'normal';
|
|
918
|
+
const executionMode = 'normal';
|
|
1026
919
|
const owner = readExecutionOwner(database, event.sessionId);
|
|
1027
920
|
if (owner &&
|
|
1028
921
|
(owner.run_id !== runId ||
|
|
1029
922
|
owner.workspace !== project.workspace ||
|
|
1030
923
|
owner.mode !== executionMode))
|
|
1031
924
|
throw new KiokukoError('CONFLICT', 'Task execution owner changed');
|
|
1032
|
-
const orchestration = database
|
|
1033
|
-
.prepare('SELECT orchestration_session_id AS id FROM enno_contracts WHERE run_id=?')
|
|
1034
|
-
.get(runId);
|
|
1035
|
-
const snapshot = !orchestration
|
|
1036
|
-
? undefined
|
|
1037
|
-
: readEnnoSnapshot(database, {
|
|
1038
|
-
runId,
|
|
1039
|
-
workspace: project.workspace,
|
|
1040
|
-
orchestrationId: orchestration.id,
|
|
1041
|
-
});
|
|
1042
|
-
if (executionMode === 'enno' && !snapshot)
|
|
1043
|
-
throw new KiokukoError('CONFLICT', 'Persisted Enno selection has no matching execution contract');
|
|
1044
|
-
if (snapshot &&
|
|
1045
|
-
!event.signal.aborted &&
|
|
1046
|
-
supersedesUnstartedEnno(event, stateForSnapshot(snapshot))) {
|
|
1047
|
-
terminalizeLedgerRunInTransaction(database, runId, 'cancelled');
|
|
1048
|
-
return undefined;
|
|
1049
|
-
}
|
|
1050
|
-
const automaticMessage = event.nativeMessages?.find((message) => {
|
|
1051
|
-
const continuationId = pluginContinuationId(message);
|
|
1052
|
-
if (continuationId === undefined)
|
|
1053
|
-
return false;
|
|
1054
|
-
const outbox = database
|
|
1055
|
-
.prepare(`
|
|
1056
|
-
SELECT message_form AS messageForm
|
|
1057
|
-
FROM dsh_continuation_outbox
|
|
1058
|
-
WHERE continuation_id = ?
|
|
1059
|
-
`)
|
|
1060
|
-
.get(continuationId);
|
|
1061
|
-
return outbox === undefined
|
|
1062
|
-
? !isLoopRecoveryMessage(message)
|
|
1063
|
-
: outbox.messageForm !== 'loop-recovery';
|
|
1064
|
-
});
|
|
1065
|
-
const automaticClaimId = automaticMessage === undefined
|
|
1066
|
-
? undefined
|
|
1067
|
-
: pluginContinuationId(automaticMessage);
|
|
1068
|
-
const decision = snapshot
|
|
1069
|
-
? decideDshContinuation(database, {
|
|
1070
|
-
dshSessionId: event.sessionId,
|
|
1071
|
-
cwd: event.cwd,
|
|
1072
|
-
...(automaticClaimId === undefined
|
|
1073
|
-
? {}
|
|
1074
|
-
: { claimId: automaticClaimId }),
|
|
1075
|
-
}, runId)
|
|
1076
|
-
: undefined;
|
|
1077
|
-
if (decision && (!decision.continue || decision.runId !== runId)) {
|
|
1078
|
-
throw new KiokukoError('CONFLICT', decision.warning ??
|
|
1079
|
-
'The active run cannot be resumed by this DSH session');
|
|
1080
|
-
}
|
|
1081
925
|
const capabilityEntries = [
|
|
1082
926
|
...event.capabilities.skills,
|
|
1083
927
|
...event.capabilities.tools,
|
|
@@ -1193,13 +1037,8 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
1193
1037
|
: hasBlockingRequiredCapability(capabilityResolution)
|
|
1194
1038
|
? 'required_capability_unavailable'
|
|
1195
1039
|
: 'answer_from_evidence_or_ask_user',
|
|
1196
|
-
securityNotice: 'This resumed DSH run uses only current repository evidence and the current host capability catalog; previously delivered ordinary memory is not replayed implicitly.
|
|
1197
|
-
ennoOduno: snapshot
|
|
1198
|
-
? stateForSnapshot(snapshot)
|
|
1199
|
-
: inapplicableEnnoState(),
|
|
1040
|
+
securityNotice: 'This resumed DSH run uses only current repository evidence and the current host capability catalog; previously delivered ordinary memory is not replayed implicitly.',
|
|
1200
1041
|
};
|
|
1201
|
-
if (decision?.executionLease)
|
|
1202
|
-
turnState.stageLease(runId, decision.executionLease);
|
|
1203
1042
|
return { admitted, prepared, catalog: event.capabilities };
|
|
1204
1043
|
});
|
|
1205
1044
|
const requestIntentContextFor = async (input, sessionId, nativeSession, previous, task) => {
|
|
@@ -1237,19 +1076,16 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
1237
1076
|
if (!project)
|
|
1238
1077
|
return undefined;
|
|
1239
1078
|
const candidates = database
|
|
1240
|
-
.prepare(`SELECT lr.run_id AS runId
|
|
1241
|
-
ec.orchestration_session_id AS orchestrationId
|
|
1079
|
+
.prepare(`SELECT lr.run_id AS runId
|
|
1242
1080
|
FROM ledger_runs AS lr
|
|
1243
1081
|
LEFT JOIN dsh_coding_workflows AS cw ON cw.run_id = lr.run_id
|
|
1244
|
-
LEFT JOIN enno_contracts AS ec ON ec.run_id = lr.run_id
|
|
1245
1082
|
WHERE lr.workspace = ? AND COALESCE(lr.task_owner_session_id, lr.dsh_session_id) = ? AND lr.status = 'active'
|
|
1246
1083
|
AND lr.task_state NOT IN ('Done', 'Ignore')
|
|
1247
1084
|
AND ((json_extract(cw.snapshot_json, '$.repositoryRoot') = ?
|
|
1248
1085
|
AND json_extract(cw.snapshot_json, '$.sessionId') = ?
|
|
1249
|
-
AND json_extract(cw.snapshot_json, '$.state') NOT IN ('completed', 'cancelled', 'superseded'))
|
|
1250
|
-
OR (ec.repository_root = ? AND ec.status NOT IN ('completed', 'cancelled', 'blocked')))
|
|
1086
|
+
AND json_extract(cw.snapshot_json, '$.state') NOT IN ('completed', 'cancelled', 'superseded')))
|
|
1251
1087
|
ORDER BY lr.created_at, lr.run_id LIMIT 2`)
|
|
1252
|
-
.all(project.workspace, sessionId, project.repositoryRoot, sessionId
|
|
1088
|
+
.all(project.workspace, sessionId, project.repositoryRoot, sessionId);
|
|
1253
1089
|
if (candidates.length > 1)
|
|
1254
1090
|
throw new KiokukoError('CONFLICT', 'Multiple active tasks match this session; refusing to guess');
|
|
1255
1091
|
return candidates[0] === undefined
|
|
@@ -1262,15 +1098,6 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
1262
1098
|
const workflow = readCodingWorkflow(database, runId);
|
|
1263
1099
|
const definition = workflow?.definition;
|
|
1264
1100
|
const frame = readExecutionFrame(database, runId);
|
|
1265
|
-
const enno = !workflow &&
|
|
1266
|
-
persistedRun?.runId === runId &&
|
|
1267
|
-
persistedRun.orchestrationId !== null
|
|
1268
|
-
? readEnnoSnapshot(database, {
|
|
1269
|
-
runId,
|
|
1270
|
-
workspace: persistedRun.workspace,
|
|
1271
|
-
orchestrationId: persistedRun.orchestrationId,
|
|
1272
|
-
})
|
|
1273
|
-
: undefined;
|
|
1274
1101
|
const active = definition
|
|
1275
1102
|
? {
|
|
1276
1103
|
runId,
|
|
@@ -1291,43 +1118,7 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
1291
1118
|
outOfScope: [],
|
|
1292
1119
|
constraints: [],
|
|
1293
1120
|
}
|
|
1294
|
-
:
|
|
1295
|
-
? {
|
|
1296
|
-
runId,
|
|
1297
|
-
workflowRevision: enno.revision,
|
|
1298
|
-
goalRevision: enno.revision,
|
|
1299
|
-
scopeRevision: enno.revision,
|
|
1300
|
-
ideal: enno.ideal?.objective ?? enno.handoff.objective,
|
|
1301
|
-
...(enno.handoff.target === null
|
|
1302
|
-
? {}
|
|
1303
|
-
: { target: enno.handoff.target }),
|
|
1304
|
-
outOfScope: [...enno.contract.exclusions],
|
|
1305
|
-
constraints: [...enno.handoff.constraints],
|
|
1306
|
-
}
|
|
1307
|
-
: sameOwner && previous.prepared.ennoOduno.applicable
|
|
1308
|
-
? {
|
|
1309
|
-
runId,
|
|
1310
|
-
...(previous.prepared.ennoOduno.contractRevision === null
|
|
1311
|
-
? {}
|
|
1312
|
-
: {
|
|
1313
|
-
workflowRevision: previous.prepared.ennoOduno.contractRevision,
|
|
1314
|
-
goalRevision: previous.prepared.ennoOduno.contractRevision,
|
|
1315
|
-
scopeRevision: previous.prepared.ennoOduno.contractRevision,
|
|
1316
|
-
}),
|
|
1317
|
-
...(previous.prepared.ennoOduno.directive?.objective
|
|
1318
|
-
? {
|
|
1319
|
-
ideal: previous.prepared.ennoOduno.directive.objective,
|
|
1320
|
-
}
|
|
1321
|
-
: {}),
|
|
1322
|
-
...(previous.prepared.intake.profile.target
|
|
1323
|
-
? { target: previous.prepared.intake.profile.target }
|
|
1324
|
-
: {}),
|
|
1325
|
-
outOfScope: [],
|
|
1326
|
-
constraints: previous.prepared.intake.profile.constraints
|
|
1327
|
-
? [previous.prepared.intake.profile.constraints]
|
|
1328
|
-
: [],
|
|
1329
|
-
}
|
|
1330
|
-
: undefined;
|
|
1121
|
+
: undefined;
|
|
1331
1122
|
const candidates = (frame?.conditions ?? [])
|
|
1332
1123
|
.filter((condition) => condition.approval === 'proposed')
|
|
1333
1124
|
.slice(0, 7)
|
|
@@ -1373,7 +1164,7 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
1373
1164
|
throw new Error('kiokuko-dsh native session cwd is unavailable');
|
|
1374
1165
|
if (!currentSession(sessionId) &&
|
|
1375
1166
|
boundSession &&
|
|
1376
|
-
!
|
|
1167
|
+
!deepPlanning.executor.isChild(payload.agent))
|
|
1377
1168
|
await answerReview.recover(payload.agent, async (row) => {
|
|
1378
1169
|
await sessions?.flush?.(boundSession);
|
|
1379
1170
|
await sessionMirror.checkpointAfterNativeFlush(boundSession);
|
|
@@ -1394,7 +1185,7 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
1394
1185
|
// the authoritative task projection.
|
|
1395
1186
|
// After a turn was deliberately paused, DSH may consume the next-turn
|
|
1396
1187
|
// inbox item before pre-step and expose an empty step-local message batch.
|
|
1397
|
-
// The durable
|
|
1188
|
+
// The durable resumed run is still authoritative, so fall back to its last
|
|
1398
1189
|
// human task. The native conversation retains the new user message for the
|
|
1399
1190
|
// model, while any supplied step-local user text still replaces this
|
|
1400
1191
|
// fallback and is recorded as the continuation instruction.
|
|
@@ -1437,7 +1228,7 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
1437
1228
|
const activeRecord = bound ?? previous;
|
|
1438
1229
|
if (!reviewing &&
|
|
1439
1230
|
hasHumanInput(payload.messages) &&
|
|
1440
|
-
!
|
|
1231
|
+
!deepPlanning.executor.isChild(payload.agent) &&
|
|
1441
1232
|
intentTask.trim()) {
|
|
1442
1233
|
requestIntentContext = await requestIntentContextFor(payload, sessionId, boundSession, activeRecord, intentTask);
|
|
1443
1234
|
const requestId = dshTurnRequestId({
|