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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/enno-oduno/schemas.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,622 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import * as z from 'zod/v4';
|
|
3
|
-
import { KiokukoError } from '../errors.js';
|
|
4
|
-
import { STANDARD_FUNCTION_EXPERT_IDS, STANDARD_FUNCTION_SKILL_NAME, STANDARD_SOUL_SKILL_NAME, STANDARD_UI_EXPERT_IDS, STANDARD_UI_SKILL_NAME, } from '../dsh/standard-skills.js';
|
|
5
|
-
import { findSecret } from '../memory/secrets.js';
|
|
6
|
-
import { ADVISORY_FAILURE_CODES, ADVISORY_OUTCOMES, ADVISORY_PHASES, ADVISORY_SLOT_DEFINITIONS, ENNO_MAX_ATTEMPTS, ENNO_MIN_ATTEMPTS, ENNO_PROVENANCE_KEYS, WORK_UNIT_ROUTES, } from './types.js';
|
|
7
|
-
import { ennoZodValidationError, } from './validation-errors.js';
|
|
8
|
-
import { containsDisallowedTextCharacters } from '../serialization/validate.js';
|
|
9
|
-
const canonicalText = (maximum) => z.string().min(1).max(maximum).refine((value) => value.trim() === value && !containsDisallowedTextCharacters(value), 'Value must be bounded canonical text');
|
|
10
|
-
const canonicalMultilineText = (maximum) => z.string().min(1).max(maximum).refine((value) => value.trim() === value && !value.includes('\r') && !containsDisallowedTextCharacters(value, true), 'Value must be bounded canonical multiline text');
|
|
11
|
-
const identifier = canonicalText(256).refine((value) => value !== '.' && value !== '..' && !/[\\/]/u.test(value));
|
|
12
|
-
const boundedPath = canonicalText(4_096).refine((value) => !value.includes('\0'));
|
|
13
|
-
const repositoryRelativePath = boundedPath.refine((value) => !path.posix.isAbsolute(value)
|
|
14
|
-
&& !path.win32.isAbsolute(value)
|
|
15
|
-
&& !value.split(/[\\/]/u).includes('..')
|
|
16
|
-
&& !value.split(/[\\/]/u).some((segment) => segment.includes(':')), 'Path must be repository-relative without parent traversal');
|
|
17
|
-
const verifierSpecShape = {
|
|
18
|
-
id: identifier,
|
|
19
|
-
kind: z.enum(['test', 'typecheck', 'build', 'lint', 'custom']),
|
|
20
|
-
executable: canonicalText(1_024).refine((value) => !/\s/u.test(value), 'Executable must be one program, not a shell command'),
|
|
21
|
-
args: z.array(z.string().max(16_384).refine((value) => !value.includes('\0'))).max(128),
|
|
22
|
-
timeoutMs: z.number().int().min(100).max(300_000),
|
|
23
|
-
};
|
|
24
|
-
export const verifierSpecSchema = z.object({ ...verifierSpecShape, cwd: boundedPath }).strict();
|
|
25
|
-
export const submissionVerifierSpecSchema = z.object({
|
|
26
|
-
...verifierSpecShape,
|
|
27
|
-
cwd: repositoryRelativePath.describe('"." or a repository-relative directory; absolute paths and parent traversal are rejected'),
|
|
28
|
-
}).strict();
|
|
29
|
-
const verifierListSchema = (minimum = 0) => z.array(verifierSpecSchema)
|
|
30
|
-
.min(minimum)
|
|
31
|
-
.max(32)
|
|
32
|
-
.superRefine((verifiers, context) => {
|
|
33
|
-
const seen = new Set();
|
|
34
|
-
for (const [index, verifier] of verifiers.entries()) {
|
|
35
|
-
if (seen.has(verifier.id)) {
|
|
36
|
-
context.addIssue({ code: 'custom', message: 'Verifier IDs must be unique', path: [index, 'id'] });
|
|
37
|
-
}
|
|
38
|
-
seen.add(verifier.id);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
const submissionVerifierListSchema = (minimum = 0) => z.array(submissionVerifierSpecSchema)
|
|
42
|
-
.min(minimum)
|
|
43
|
-
.max(32)
|
|
44
|
-
.superRefine((verifiers, context) => {
|
|
45
|
-
const seen = new Set();
|
|
46
|
-
for (const [index, verifier] of verifiers.entries()) {
|
|
47
|
-
if (seen.has(verifier.id)) {
|
|
48
|
-
context.addIssue({ code: 'custom', message: 'Verifier IDs must be unique', path: [index, 'id'] });
|
|
49
|
-
}
|
|
50
|
-
seen.add(verifier.id);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
const standardExpertIds = [...STANDARD_FUNCTION_EXPERT_IDS, ...STANDARD_UI_EXPERT_IDS];
|
|
54
|
-
export const expertRefSchema = z.object({
|
|
55
|
-
id: z.enum(standardExpertIds),
|
|
56
|
-
reason: canonicalText(500),
|
|
57
|
-
}).strict();
|
|
58
|
-
export const workUnitSchema = z.object({
|
|
59
|
-
id: identifier,
|
|
60
|
-
objective: canonicalText(16_384),
|
|
61
|
-
scope: z.array(boundedPath).min(1).max(256),
|
|
62
|
-
dependencies: z.array(identifier).max(128),
|
|
63
|
-
skillNames: z.array(canonicalText(300)).max(64),
|
|
64
|
-
expertRefs: z.array(expertRefSchema).max(3).default([]),
|
|
65
|
-
acceptanceCriteria: z.array(canonicalText(8_192)).min(1).max(128),
|
|
66
|
-
focusedVerifiers: verifierListSchema(),
|
|
67
|
-
routes: z.array(z.enum(WORK_UNIT_ROUTES)).min(1).max(WORK_UNIT_ROUTES.length),
|
|
68
|
-
}).strict().superRefine((unit, context) => {
|
|
69
|
-
const ids = unit.expertRefs.map((reference) => reference.id);
|
|
70
|
-
if (new Set(ids).size !== ids.length) {
|
|
71
|
-
context.addIssue({ code: 'custom', message: 'WorkUnit expertRefs must be unique', path: ['expertRefs'] });
|
|
72
|
-
}
|
|
73
|
-
if (new Set(unit.routes).size !== unit.routes.length) {
|
|
74
|
-
context.addIssue({ code: 'custom', message: 'WorkUnit routes must be unique', path: ['routes'] });
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
const submissionWorkUnitSchema = z.object({
|
|
78
|
-
id: identifier,
|
|
79
|
-
objective: canonicalText(16_384),
|
|
80
|
-
scope: z.array(repositoryRelativePath).min(1).max(256),
|
|
81
|
-
dependencies: z.array(identifier).max(128),
|
|
82
|
-
skillNames: z.array(canonicalText(300)).max(64),
|
|
83
|
-
expertRefs: z.array(expertRefSchema).max(3).default([]),
|
|
84
|
-
acceptanceCriteria: z.array(canonicalText(8_192)).min(1).max(128),
|
|
85
|
-
focusedVerifiers: submissionVerifierListSchema(),
|
|
86
|
-
routes: z.array(z.enum(WORK_UNIT_ROUTES)).min(1).max(WORK_UNIT_ROUTES.length),
|
|
87
|
-
}).strict().superRefine((unit, context) => {
|
|
88
|
-
const expertIds = unit.expertRefs.map((reference) => reference.id);
|
|
89
|
-
if (new Set(expertIds).size !== expertIds.length) {
|
|
90
|
-
context.addIssue({ code: 'custom', message: 'WorkUnit expertRefs must be unique', path: ['expertRefs'] });
|
|
91
|
-
}
|
|
92
|
-
if (new Set(unit.routes).size !== unit.routes.length) {
|
|
93
|
-
context.addIssue({ code: 'custom', message: 'WorkUnit routes must be unique', path: ['routes'] });
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
export const workPlanSchema = z.object({
|
|
97
|
-
objective: canonicalText(16_384),
|
|
98
|
-
units: z.array(workUnitSchema).min(1).max(128),
|
|
99
|
-
}).strict().superRefine((plan, context) => {
|
|
100
|
-
const ids = new Set(plan.units.map((unit) => unit.id));
|
|
101
|
-
if (ids.size !== plan.units.length) {
|
|
102
|
-
context.addIssue({ code: 'custom', message: 'WorkUnit IDs must be unique' });
|
|
103
|
-
}
|
|
104
|
-
for (const unit of plan.units) {
|
|
105
|
-
if (unit.dependencies.includes(unit.id) || unit.dependencies.some((dependency) => !ids.has(dependency))) {
|
|
106
|
-
context.addIssue({ code: 'custom', message: `WorkUnit ${unit.id} has an invalid dependency` });
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
const dependencies = new Map(plan.units.map((unit) => [unit.id, unit.dependencies]));
|
|
110
|
-
const visiting = new Set();
|
|
111
|
-
const visited = new Set();
|
|
112
|
-
const hasCycle = (id) => {
|
|
113
|
-
if (visiting.has(id))
|
|
114
|
-
return true;
|
|
115
|
-
if (visited.has(id))
|
|
116
|
-
return false;
|
|
117
|
-
visiting.add(id);
|
|
118
|
-
for (const dependency of dependencies.get(id) ?? []) {
|
|
119
|
-
if (hasCycle(dependency))
|
|
120
|
-
return true;
|
|
121
|
-
}
|
|
122
|
-
visiting.delete(id);
|
|
123
|
-
visited.add(id);
|
|
124
|
-
return false;
|
|
125
|
-
};
|
|
126
|
-
if (plan.units.some((unit) => hasCycle(unit.id))) {
|
|
127
|
-
context.addIssue({ code: 'custom', message: 'WorkUnit dependencies must be acyclic' });
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
export const submissionWorkPlanSchema = z.object({
|
|
131
|
-
objective: canonicalText(16_384),
|
|
132
|
-
units: z.array(submissionWorkUnitSchema).min(1).max(128),
|
|
133
|
-
}).strict().superRefine((plan, context) => {
|
|
134
|
-
const ids = new Set(plan.units.map((unit) => unit.id));
|
|
135
|
-
if (ids.size !== plan.units.length) {
|
|
136
|
-
context.addIssue({ code: 'custom', message: 'WorkUnit IDs must be unique', path: ['units'] });
|
|
137
|
-
}
|
|
138
|
-
const dependencies = new Map(plan.units.map((unit) => [unit.id, unit.dependencies]));
|
|
139
|
-
for (const [index, unit] of plan.units.entries()) {
|
|
140
|
-
if (unit.dependencies.includes(unit.id) || unit.dependencies.some((dependency) => !ids.has(dependency))) {
|
|
141
|
-
context.addIssue({ code: 'custom', message: 'WorkUnit has an invalid dependency', path: ['units', index, 'dependencies'] });
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
const visiting = new Set();
|
|
145
|
-
const visited = new Set();
|
|
146
|
-
const hasCycle = (id) => {
|
|
147
|
-
if (visiting.has(id))
|
|
148
|
-
return true;
|
|
149
|
-
if (visited.has(id))
|
|
150
|
-
return false;
|
|
151
|
-
visiting.add(id);
|
|
152
|
-
for (const dependency of dependencies.get(id) ?? []) {
|
|
153
|
-
if (hasCycle(dependency))
|
|
154
|
-
return true;
|
|
155
|
-
}
|
|
156
|
-
visiting.delete(id);
|
|
157
|
-
visited.add(id);
|
|
158
|
-
return false;
|
|
159
|
-
};
|
|
160
|
-
if (plan.units.some((unit) => hasCycle(unit.id))) {
|
|
161
|
-
context.addIssue({ code: 'custom', message: 'WorkUnit dependencies must be acyclic', path: ['units'] });
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
const draftWorkPlanSchema = z.object({
|
|
165
|
-
objective: canonicalText(16_384),
|
|
166
|
-
units: z.array(workUnitSchema).length(0),
|
|
167
|
-
}).strict();
|
|
168
|
-
const contractProvenanceSchema = z.object(Object.fromEntries(ENNO_PROVENANCE_KEYS.map((key) => [key, z.enum(['explicit_user', 'repository_evidence', 'inferred'])]))).strict();
|
|
169
|
-
export const acceptanceCriterionSchema = z.object({
|
|
170
|
-
id: identifier,
|
|
171
|
-
description: canonicalMultilineText(8_192),
|
|
172
|
-
}).strict();
|
|
173
|
-
export const skillRequirementSchema = z.object({
|
|
174
|
-
name: canonicalText(300),
|
|
175
|
-
purposes: z.array(z.enum(['planning', 'implementation', 'ui', 'testing', 'review', 'operations'])).min(1).max(6),
|
|
176
|
-
required: z.boolean(),
|
|
177
|
-
}).strict();
|
|
178
|
-
const skillDiscoverySummarySchema = z.object({
|
|
179
|
-
attempted: z.boolean(),
|
|
180
|
-
mode: z.enum(['off', 'official', 'community']),
|
|
181
|
-
requirements: z.array(canonicalText(300)).max(64),
|
|
182
|
-
queries: z.array(canonicalText(500)).max(3),
|
|
183
|
-
cacheHits: z.number().int().min(0),
|
|
184
|
-
candidates: z.number().int().min(0),
|
|
185
|
-
selected: z.array(z.object({
|
|
186
|
-
skillId: canonicalText(1_000),
|
|
187
|
-
name: canonicalText(500),
|
|
188
|
-
source: canonicalText(201),
|
|
189
|
-
officialStatus: z.enum(['curated', 'catalog-verified', 'owner-verified', 'registry-only', 'unknown']),
|
|
190
|
-
imported: z.boolean(),
|
|
191
|
-
updated: z.boolean(),
|
|
192
|
-
}).strict()).max(2),
|
|
193
|
-
failures: z.array(z.object({
|
|
194
|
-
stage: z.enum(['search', 'source', 'validation', 'persistence']),
|
|
195
|
-
code: canonicalText(200),
|
|
196
|
-
}).strict()).max(128),
|
|
197
|
-
}).strict();
|
|
198
|
-
const skillSetEntrySchema = z.object({
|
|
199
|
-
name: canonicalText(300),
|
|
200
|
-
purposes: z.array(z.enum(['planning', 'implementation', 'ui', 'testing', 'review', 'operations'])).min(1).max(6),
|
|
201
|
-
required: z.boolean(),
|
|
202
|
-
availability: z.enum(['local', 'imported_fresh', 'external_reference', 'unavailable']),
|
|
203
|
-
referenceId: canonicalText(1_000).nullable(),
|
|
204
|
-
}).strict();
|
|
205
|
-
const orchestrationIdSchema = canonicalText(256)
|
|
206
|
-
.describe('Exact host-owned Enno-Oduno orchestration identity; this is not the DSH session ID');
|
|
207
|
-
const resumeTokenSchema = canonicalText(256).describe('Opaque continuation token bound by the current DSH route');
|
|
208
|
-
const requireExplicitIdentityOrResumeToken = (value, context) => {
|
|
209
|
-
const explicit = value.workspace !== undefined && value.orchestrationId !== undefined;
|
|
210
|
-
const partialExplicit = value.workspace !== undefined || value.orchestrationId !== undefined;
|
|
211
|
-
const resumed = value.resumeToken !== undefined;
|
|
212
|
-
if ((!explicit && !resumed) || (partialExplicit && !explicit) || (explicit && resumed)) {
|
|
213
|
-
context.addIssue({
|
|
214
|
-
code: 'custom',
|
|
215
|
-
message: 'Provide either workspace plus orchestrationId or resumeToken',
|
|
216
|
-
path: ['resumeToken'],
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
export const ennoRequestHandoffSchema = z.object({
|
|
221
|
-
sourceRole: z.literal('enno-oduno'),
|
|
222
|
-
taskType: z.enum(['build', 'debug', 'review', 'devops']),
|
|
223
|
-
objective: canonicalMultilineText(16_384),
|
|
224
|
-
target: canonicalText(4_096).nullable(),
|
|
225
|
-
expected: canonicalMultilineText(8_192).nullable(),
|
|
226
|
-
constraints: z.array(canonicalMultilineText(8_192)).max(16),
|
|
227
|
-
verification: z.array(canonicalMultilineText(8_192)).max(16),
|
|
228
|
-
stopConditions: z.array(canonicalMultilineText(8_192)).max(16),
|
|
229
|
-
}).strict();
|
|
230
|
-
const advisorySlotIds = ADVISORY_SLOT_DEFINITIONS.map((slot) => slot.slotId);
|
|
231
|
-
const advisorySlotIdSchema = z.string().pipe(z.enum(advisorySlotIds));
|
|
232
|
-
const advisoryContextSchema = z.discriminatedUnion('phase', [
|
|
233
|
-
z.object({
|
|
234
|
-
phase: z.literal('ideal'),
|
|
235
|
-
// Host projections must accept the exact text accepted by their source.
|
|
236
|
-
// Do not flatten lines: that changes the request and its advisory digest.
|
|
237
|
-
objective: ennoRequestHandoffSchema.shape.objective,
|
|
238
|
-
constraints: z.array(ennoRequestHandoffSchema.shape.constraints.element).max(32),
|
|
239
|
-
expectedOutcome: ennoRequestHandoffSchema.shape.expected.unwrap().or(z.literal('')),
|
|
240
|
-
successSignals: z.array(ennoRequestHandoffSchema.shape.verification.element).max(32),
|
|
241
|
-
skillTrust: z.array(z.object({
|
|
242
|
-
name: canonicalText(500),
|
|
243
|
-
source: z.enum(['local', 'imported_fresh', 'external_reference', 'unavailable']),
|
|
244
|
-
required: z.boolean(),
|
|
245
|
-
trustStatus: z.enum(['available', 'reference_only', 'unavailable']),
|
|
246
|
-
}).strict()).max(64),
|
|
247
|
-
}).strict(),
|
|
248
|
-
z.object({
|
|
249
|
-
phase: z.literal('planning'),
|
|
250
|
-
availableSkills: z.array(z.string().max(300)).max(2000).optional(),
|
|
251
|
-
candidate: z.record(z.string(), z.unknown()).optional(),
|
|
252
|
-
draftDigest: z.string().optional(),
|
|
253
|
-
catalogDigest: z.string().optional(),
|
|
254
|
-
idealObjective: ennoRequestHandoffSchema.shape.objective,
|
|
255
|
-
acceptanceCriteria: z.array(acceptanceCriterionSchema.shape.description).max(128),
|
|
256
|
-
planningConstraints: z.array(ennoRequestHandoffSchema.shape.constraints.element).max(32),
|
|
257
|
-
skillAvailability: z.array(z.object({
|
|
258
|
-
name: canonicalText(500),
|
|
259
|
-
source: z.enum(['local', 'imported_fresh', 'external_reference', 'unavailable']),
|
|
260
|
-
required: z.boolean(),
|
|
261
|
-
trustStatus: z.enum(['available', 'reference_only', 'unavailable']),
|
|
262
|
-
}).strict()).max(64),
|
|
263
|
-
}).strict(),
|
|
264
|
-
z.object({
|
|
265
|
-
phase: z.literal('final_review'),
|
|
266
|
-
workPlanSummary: canonicalText(16_384),
|
|
267
|
-
acceptanceCriteria: z.array(acceptanceCriterionSchema).max(128),
|
|
268
|
-
workUnitOutcomes: z.array(z.object({
|
|
269
|
-
id: identifier,
|
|
270
|
-
objective: canonicalText(16_384),
|
|
271
|
-
acceptanceCriteria: z.array(canonicalText(8_192)).max(128),
|
|
272
|
-
routes: z.array(z.enum(WORK_UNIT_ROUTES)).max(WORK_UNIT_ROUTES.length),
|
|
273
|
-
status: z.enum(['completed', 'failed', 'blocked']),
|
|
274
|
-
summary: canonicalText(16_384),
|
|
275
|
-
mutated: z.boolean(),
|
|
276
|
-
changedPaths: z.array(repositoryRelativePath).max(256),
|
|
277
|
-
}).strict()).max(128),
|
|
278
|
-
changedPaths: z.array(repositoryRelativePath).max(256),
|
|
279
|
-
verifierEvidence: z.array(z.object({
|
|
280
|
-
id: identifier,
|
|
281
|
-
kind: z.enum(['test', 'typecheck', 'build', 'lint', 'custom']),
|
|
282
|
-
executable: canonicalText(1_024),
|
|
283
|
-
args: z.array(z.string().max(16_384)).max(128),
|
|
284
|
-
directory: repositoryRelativePath,
|
|
285
|
-
timeoutMs: z.number().int().min(100).max(300_000),
|
|
286
|
-
status: z.enum(['passed', 'failed', 'timeout', 'spawn_failed']),
|
|
287
|
-
exitCode: z.number().int().nullable(),
|
|
288
|
-
signal: z.string().max(200).nullable(),
|
|
289
|
-
stdoutDigest: z.string().regex(/^[0-9a-f]{64}$/u),
|
|
290
|
-
stderrDigest: z.string().regex(/^[0-9a-f]{64}$/u),
|
|
291
|
-
stdoutPreview: z.string().max(2_048),
|
|
292
|
-
stderrPreview: z.string().max(2_048),
|
|
293
|
-
repositoryStatePolicyVersion: z.number().int().min(1).nullable(),
|
|
294
|
-
repositoryStateDigest: z.string().regex(/^[0-9a-f]{64}$/u).nullable(),
|
|
295
|
-
}).strict()).max(32),
|
|
296
|
-
freshnessMarker: canonicalText(256),
|
|
297
|
-
evidenceSetDigest: z.string().regex(/^[0-9a-f]{64}$/u),
|
|
298
|
-
repositoryStateDigest: z.string().regex(/^[0-9a-f]{64}$/u),
|
|
299
|
-
evidenceFreshnessPolicyVersion: z.number().int().min(1),
|
|
300
|
-
}).strict(),
|
|
301
|
-
]);
|
|
302
|
-
const advisoryEvidenceSchema = z.object({
|
|
303
|
-
path: repositoryRelativePath,
|
|
304
|
-
statement: canonicalText(8_192),
|
|
305
|
-
}).strict();
|
|
306
|
-
const advisoryContributionSchema = z.union([
|
|
307
|
-
z.object({
|
|
308
|
-
slotId: advisorySlotIdSchema,
|
|
309
|
-
outcome: z.literal('completed'),
|
|
310
|
-
summary: canonicalText(8_192),
|
|
311
|
-
recommendations: z.array(canonicalText(8_192)).max(32).default([]),
|
|
312
|
-
risks: z.array(canonicalText(8_192)).max(32).default([]),
|
|
313
|
-
evidence: z.array(advisoryEvidenceSchema).max(32).default([]),
|
|
314
|
-
}).strict(),
|
|
315
|
-
z.object({
|
|
316
|
-
slotId: advisorySlotIdSchema,
|
|
317
|
-
outcome: z.enum(ADVISORY_OUTCOMES.filter((outcome) => outcome !== 'completed')),
|
|
318
|
-
reasonCode: z.enum(ADVISORY_FAILURE_CODES),
|
|
319
|
-
}).strict(),
|
|
320
|
-
]);
|
|
321
|
-
function parseStoredAdvisoryContribution(input) {
|
|
322
|
-
const parsed = advisoryContributionSchema.safeParse(input);
|
|
323
|
-
if (!parsed.success)
|
|
324
|
-
throw new KiokukoError('INTEGRITY_ERROR', 'Stored advisory contribution is invalid');
|
|
325
|
-
return parsed.data;
|
|
326
|
-
}
|
|
327
|
-
export { parseStoredAdvisoryContribution };
|
|
328
|
-
export const advisoryContributionSchemaPublic = advisoryContributionSchema;
|
|
329
|
-
export const adviceSubmissionSchema = z.object({
|
|
330
|
-
runId: identifier,
|
|
331
|
-
workspace: canonicalText(256).optional(),
|
|
332
|
-
orchestrationId: orchestrationIdSchema.optional(),
|
|
333
|
-
resumeToken: resumeTokenSchema.optional(),
|
|
334
|
-
expectedRevision: z.number().int().min(1),
|
|
335
|
-
mutationRevision: z.number().int().min(0),
|
|
336
|
-
idempotencyKey: identifier,
|
|
337
|
-
phase: z.enum(ADVISORY_PHASES),
|
|
338
|
-
allowlistedContext: advisoryContextSchema,
|
|
339
|
-
contributions: z.array(advisoryContributionSchema).length(3),
|
|
340
|
-
}).strict().superRefine(requireExplicitIdentityOrResumeToken);
|
|
341
|
-
const advisoryRoundDigestSchema = z.string().regex(/^[0-9a-f]{64}$/u);
|
|
342
|
-
export const adviceReadSchema = z.object({
|
|
343
|
-
runId: identifier,
|
|
344
|
-
workspace: canonicalText(256).optional(),
|
|
345
|
-
orchestrationId: orchestrationIdSchema.optional(),
|
|
346
|
-
resumeToken: resumeTokenSchema.optional(),
|
|
347
|
-
expectedRevision: z.number().int().min(1),
|
|
348
|
-
advisoryRoundDigest: advisoryRoundDigestSchema,
|
|
349
|
-
}).strict().superRefine(requireExplicitIdentityOrResumeToken);
|
|
350
|
-
const advisoryDispositionSchema = z.object({
|
|
351
|
-
slotId: advisorySlotIdSchema,
|
|
352
|
-
disposition: z.enum(['adopted', 'not_adopted', 'unavailable']),
|
|
353
|
-
rationale: canonicalText(500).refine((value) => findSecret(value) === undefined, 'Advisory rationale must not contain secret material'),
|
|
354
|
-
}).strict();
|
|
355
|
-
const requireDispositionWithDigest = (value, context) => {
|
|
356
|
-
if (value.advisoryRoundDigest !== undefined) {
|
|
357
|
-
if (value.advisoryDisposition === undefined
|
|
358
|
-
|| !Array.isArray(value.advisoryDisposition)
|
|
359
|
-
|| value.advisoryDisposition.length === 0) {
|
|
360
|
-
context.addIssue({ code: 'custom', message: 'advisoryDisposition is required when an advisory digest is supplied' });
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
};
|
|
365
|
-
export const ennoContractSchema = z.object({
|
|
366
|
-
revision: z.number().int().min(1),
|
|
367
|
-
scope: z.array(boundedPath).max(256),
|
|
368
|
-
exclusions: z.array(boundedPath).max(256),
|
|
369
|
-
acceptanceCriteria: z.array(acceptanceCriterionSchema).max(128),
|
|
370
|
-
workPlan: z.union([workPlanSchema, draftWorkPlanSchema]),
|
|
371
|
-
skillSet: z.object({
|
|
372
|
-
entries: z.array(skillSetEntrySchema).max(64),
|
|
373
|
-
intakeDiscovery: skillDiscoverySummarySchema,
|
|
374
|
-
zenkiDiscovery: skillDiscoverySummarySchema,
|
|
375
|
-
}).strict(),
|
|
376
|
-
finalVerifiers: verifierListSchema(),
|
|
377
|
-
maxAttempts: z.number().int().min(ENNO_MIN_ATTEMPTS).max(ENNO_MAX_ATTEMPTS),
|
|
378
|
-
provenance: contractProvenanceSchema,
|
|
379
|
-
}).strict();
|
|
380
|
-
export const odunoIdealSchema = z.object({
|
|
381
|
-
objective: canonicalText(16_384),
|
|
382
|
-
principles: z.array(canonicalText(8_192)).min(1).max(32),
|
|
383
|
-
skillContributions: z.array(z.object({
|
|
384
|
-
skillName: canonicalText(500),
|
|
385
|
-
contribution: canonicalText(8_192),
|
|
386
|
-
}).strict()).max(2),
|
|
387
|
-
successSignals: z.array(canonicalText(8_192)).min(1).max(32),
|
|
388
|
-
}).strict().superRefine((ideal, context) => {
|
|
389
|
-
const names = ideal.skillContributions.map((item) => item.skillName);
|
|
390
|
-
if (new Set(names).size !== names.length) {
|
|
391
|
-
context.addIssue({ code: 'custom', message: 'Oduno ideal Skill contributions must be unique', path: ['skillContributions'] });
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
export const odunoMeditationSchema = z.object({
|
|
395
|
-
summary: canonicalText(16_384),
|
|
396
|
-
inspectedPaths: z.array(repositoryRelativePath).min(1).max(256),
|
|
397
|
-
deletionCandidates: z.array(z.object({
|
|
398
|
-
kind: z.enum(['test', 'function']),
|
|
399
|
-
path: repositoryRelativePath,
|
|
400
|
-
name: canonicalText(1_000),
|
|
401
|
-
reason: canonicalText(8_192),
|
|
402
|
-
evidence: z.array(canonicalText(8_192)).min(1).max(16),
|
|
403
|
-
}).strict()).max(128),
|
|
404
|
-
}).strict().superRefine((meditation, context) => {
|
|
405
|
-
if (new Set(meditation.inspectedPaths).size !== meditation.inspectedPaths.length) {
|
|
406
|
-
context.addIssue({ code: 'custom', message: 'Oduno meditation inspected paths must be unique', path: ['inspectedPaths'] });
|
|
407
|
-
}
|
|
408
|
-
const inspected = new Set(meditation.inspectedPaths);
|
|
409
|
-
const candidateKeys = new Set();
|
|
410
|
-
for (const [index, candidate] of meditation.deletionCandidates.entries()) {
|
|
411
|
-
if (!inspected.has(candidate.path)) {
|
|
412
|
-
context.addIssue({ code: 'custom', message: 'Deletion candidate path must be inspected', path: ['deletionCandidates', index, 'path'] });
|
|
413
|
-
}
|
|
414
|
-
const key = `${candidate.kind}\0${candidate.path}\0${candidate.name}`;
|
|
415
|
-
if (candidateKeys.has(key)) {
|
|
416
|
-
context.addIssue({ code: 'custom', message: 'Oduno meditation deletion candidates must be unique', path: ['deletionCandidates', index] });
|
|
417
|
-
}
|
|
418
|
-
candidateKeys.add(key);
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
export const idealSubmissionSchema = z.object({
|
|
422
|
-
executionHints: z.unknown().optional().describe('Optional task-condition proposals: [{field, text, quote}]. Invalid proposals are ignored without retrying the phase.'),
|
|
423
|
-
runId: identifier,
|
|
424
|
-
workspace: canonicalText(256).optional(),
|
|
425
|
-
orchestrationId: orchestrationIdSchema.optional(),
|
|
426
|
-
resumeToken: resumeTokenSchema.optional(),
|
|
427
|
-
expectedRevision: z.number().int().min(1),
|
|
428
|
-
idempotencyKey: identifier,
|
|
429
|
-
advisoryRoundDigest: advisoryRoundDigestSchema.optional(),
|
|
430
|
-
advisoryDisposition: z.array(advisoryDispositionSchema).max(3).optional(),
|
|
431
|
-
ideal: odunoIdealSchema,
|
|
432
|
-
}).strict().superRefine((value, context) => {
|
|
433
|
-
requireExplicitIdentityOrResumeToken(value, context);
|
|
434
|
-
requireDispositionWithDigest(value, context);
|
|
435
|
-
});
|
|
436
|
-
export const planSubmissionSchema = z.object({
|
|
437
|
-
executionHints: z.unknown().optional().describe('Optional task-condition proposals: [{field: readPaths|writePaths|excludedPaths|constraints|completion, text, quote}]. Exact user quote; proposals require plan approval.'),
|
|
438
|
-
runId: identifier,
|
|
439
|
-
workspace: canonicalText(256).optional(),
|
|
440
|
-
orchestrationId: orchestrationIdSchema.optional(),
|
|
441
|
-
resumeToken: resumeTokenSchema.optional(),
|
|
442
|
-
expectedRevision: z.number().int().min(1),
|
|
443
|
-
idempotencyKey: identifier,
|
|
444
|
-
advisoryRoundDigest: advisoryRoundDigestSchema.optional(),
|
|
445
|
-
advisoryDisposition: z.array(advisoryDispositionSchema).max(3).optional(),
|
|
446
|
-
scope: z.array(repositoryRelativePath).min(1).max(256),
|
|
447
|
-
exclusions: z.array(repositoryRelativePath).max(256),
|
|
448
|
-
acceptanceCriteria: z.array(acceptanceCriterionSchema).min(1).max(128),
|
|
449
|
-
workPlan: submissionWorkPlanSchema,
|
|
450
|
-
skillRequirements: z.array(skillRequirementSchema).max(64),
|
|
451
|
-
finalVerifiers: submissionVerifierListSchema(1),
|
|
452
|
-
maxAttempts: z.number().int().min(ENNO_MIN_ATTEMPTS).max(ENNO_MAX_ATTEMPTS).default(8),
|
|
453
|
-
provenance: contractProvenanceSchema,
|
|
454
|
-
recoveryAction: z.enum(['continue_same_plan', 'revise_plan']).optional().describe('Required only when explicitly resuming a same-run plan-start recovery after the user chose one displayed option.'),
|
|
455
|
-
capabilities: z.array(z.unknown()).optional().describe('Complete current DSH capability descriptors. The field remains host-optional only so omission can return a safe user-facing recovery choice before any plan effect.'),
|
|
456
|
-
}).strict().superRefine((submission, context) => {
|
|
457
|
-
requireExplicitIdentityOrResumeToken(submission, context);
|
|
458
|
-
requireDispositionWithDigest(submission, context);
|
|
459
|
-
const requirements = new Set(submission.skillRequirements.map((requirement) => requirement.name.normalize('NFKC').toLowerCase()));
|
|
460
|
-
const standardSkills = new Set([
|
|
461
|
-
STANDARD_SOUL_SKILL_NAME,
|
|
462
|
-
STANDARD_FUNCTION_SKILL_NAME,
|
|
463
|
-
STANDARD_UI_SKILL_NAME,
|
|
464
|
-
]);
|
|
465
|
-
for (const [index, unit] of submission.workPlan.units.entries()) {
|
|
466
|
-
for (const skillName of unit.skillNames) {
|
|
467
|
-
const normalized = skillName.normalize('NFKC').toLowerCase();
|
|
468
|
-
if (!requirements.has(normalized) && !standardSkills.has(normalized)) {
|
|
469
|
-
context.addIssue({
|
|
470
|
-
code: 'custom',
|
|
471
|
-
message: `WorkUnit ${unit.id} uses an undeclared Skill`,
|
|
472
|
-
path: ['workPlan', 'units', index, 'skillNames'],
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
});
|
|
478
|
-
export const ennoAnswerSchema = z.object({
|
|
479
|
-
runId: identifier,
|
|
480
|
-
workspace: canonicalText(256).optional(),
|
|
481
|
-
orchestrationId: orchestrationIdSchema.optional(),
|
|
482
|
-
resumeToken: resumeTokenSchema.optional(),
|
|
483
|
-
expectedRevision: z.number().int().min(1),
|
|
484
|
-
idempotencyKey: identifier,
|
|
485
|
-
action: z.enum(['approve', 'revise', 'cancel']),
|
|
486
|
-
requestedChanges: canonicalText(16_384).optional(),
|
|
487
|
-
}).strict().superRefine((value, context) => {
|
|
488
|
-
requireExplicitIdentityOrResumeToken(value, context);
|
|
489
|
-
if (value.action === 'revise' && value.requestedChanges === undefined) {
|
|
490
|
-
context.addIssue({ code: 'custom', message: 'requestedChanges is required when revising' });
|
|
491
|
-
}
|
|
492
|
-
if (value.action !== 'revise' && value.requestedChanges !== undefined) {
|
|
493
|
-
context.addIssue({ code: 'custom', message: 'requestedChanges is only valid when revising' });
|
|
494
|
-
}
|
|
495
|
-
});
|
|
496
|
-
export const workReportSchema = z.object({
|
|
497
|
-
runId: identifier,
|
|
498
|
-
workspace: canonicalText(256).optional(),
|
|
499
|
-
orchestrationId: orchestrationIdSchema.optional(),
|
|
500
|
-
resumeToken: resumeTokenSchema.optional(),
|
|
501
|
-
expectedRevision: z.number().int().min(1),
|
|
502
|
-
idempotencyKey: identifier,
|
|
503
|
-
leaseToken: canonicalText(256).optional(),
|
|
504
|
-
routeEpoch: z.number().int().min(0).optional(),
|
|
505
|
-
workUnitId: identifier,
|
|
506
|
-
result: z.object({
|
|
507
|
-
outcome: z.enum(['completed', 'failed', 'blocked']),
|
|
508
|
-
summary: canonicalText(16_384),
|
|
509
|
-
mutated: z.boolean(),
|
|
510
|
-
changedPaths: z.array(repositoryRelativePath).max(256),
|
|
511
|
-
}).strict(),
|
|
512
|
-
}).strict().superRefine(requireExplicitIdentityOrResumeToken);
|
|
513
|
-
export const finishSchema = z.object({
|
|
514
|
-
runId: identifier,
|
|
515
|
-
workspace: canonicalText(256).optional(),
|
|
516
|
-
orchestrationId: orchestrationIdSchema.optional(),
|
|
517
|
-
resumeToken: resumeTokenSchema.optional(),
|
|
518
|
-
expectedRevision: z.number().int().min(1),
|
|
519
|
-
idempotencyKey: identifier,
|
|
520
|
-
advisoryRoundDigest: advisoryRoundDigestSchema.optional(),
|
|
521
|
-
advisoryDisposition: z.array(advisoryDispositionSchema).max(3).optional(),
|
|
522
|
-
review: z.object({
|
|
523
|
-
decision: z.enum(['accept', 'replan']),
|
|
524
|
-
summary: canonicalText(16_384),
|
|
525
|
-
}).strict(),
|
|
526
|
-
}).strict().superRefine((value, context) => {
|
|
527
|
-
requireExplicitIdentityOrResumeToken(value, context);
|
|
528
|
-
requireDispositionWithDigest(value, context);
|
|
529
|
-
});
|
|
530
|
-
export const verificationPrepareSchema = z.object({
|
|
531
|
-
runId: identifier,
|
|
532
|
-
workspace: canonicalText(256).optional(),
|
|
533
|
-
orchestrationId: orchestrationIdSchema.optional(),
|
|
534
|
-
resumeToken: resumeTokenSchema.optional(),
|
|
535
|
-
expectedRevision: z.number().int().min(1),
|
|
536
|
-
idempotencyKey: identifier,
|
|
537
|
-
}).strict().superRefine(requireExplicitIdentityOrResumeToken);
|
|
538
|
-
export const meditationSubmissionSchema = z.object({
|
|
539
|
-
runId: identifier,
|
|
540
|
-
workspace: canonicalText(256).optional(),
|
|
541
|
-
orchestrationId: orchestrationIdSchema.optional(),
|
|
542
|
-
resumeToken: resumeTokenSchema.optional(),
|
|
543
|
-
expectedRevision: z.number().int().min(1),
|
|
544
|
-
idempotencyKey: identifier,
|
|
545
|
-
meditation: odunoMeditationSchema,
|
|
546
|
-
}).strict().superRefine(requireExplicitIdentityOrResumeToken);
|
|
547
|
-
function parseBoundary(schema, input, message) {
|
|
548
|
-
const parsed = schema.safeParse(input);
|
|
549
|
-
if (!parsed.success)
|
|
550
|
-
throw new KiokukoError('VALIDATION_ERROR', message);
|
|
551
|
-
return parsed.data;
|
|
552
|
-
}
|
|
553
|
-
function parseInputBoundary(operation, schema, input) {
|
|
554
|
-
const parsed = schema.safeParse(input);
|
|
555
|
-
if (!parsed.success)
|
|
556
|
-
throw ennoZodValidationError(operation, parsed.error);
|
|
557
|
-
return parsed.data;
|
|
558
|
-
}
|
|
559
|
-
export function parseWorkPlan(input) {
|
|
560
|
-
return parseBoundary(workPlanSchema, input, 'Enno WorkPlan is invalid');
|
|
561
|
-
}
|
|
562
|
-
export function parseEnnoContract(input) {
|
|
563
|
-
return parseBoundary(ennoContractSchema, input, 'Stored Enno contract is invalid');
|
|
564
|
-
}
|
|
565
|
-
export function parseEnnoRequestHandoff(input) {
|
|
566
|
-
return parseBoundary(ennoRequestHandoffSchema, input, 'Stored Enno request handoff is invalid');
|
|
567
|
-
}
|
|
568
|
-
export function parseOdunoIdeal(input) {
|
|
569
|
-
return parseBoundary(odunoIdealSchema, input, 'Stored Oduno ideal is invalid');
|
|
570
|
-
}
|
|
571
|
-
export function parseOdunoMeditation(input) {
|
|
572
|
-
return parseBoundary(odunoMeditationSchema, input, 'Stored Oduno meditation is invalid');
|
|
573
|
-
}
|
|
574
|
-
export function parseVerifierSpec(input) {
|
|
575
|
-
return parseBoundary(verifierSpecSchema, input, 'Enno verifier is invalid');
|
|
576
|
-
}
|
|
577
|
-
export function parseWorkReportResult(input) {
|
|
578
|
-
return parseBoundary(workReportSchema.shape.result, input, 'Enno work report is invalid');
|
|
579
|
-
}
|
|
580
|
-
export function parsePlanSubmission(input) {
|
|
581
|
-
return parseInputBoundary('plan_submit', planSubmissionSchema, input);
|
|
582
|
-
}
|
|
583
|
-
export function parseAdviceSubmission(input) {
|
|
584
|
-
return parseInputBoundary('advice_submit', adviceSubmissionSchema, input);
|
|
585
|
-
}
|
|
586
|
-
export function parseAdviceRead(input) {
|
|
587
|
-
return parseInputBoundary('advice_read', adviceReadSchema, input);
|
|
588
|
-
}
|
|
589
|
-
export function parseIdealSubmission(input) {
|
|
590
|
-
return parseInputBoundary('ideal_submit', idealSubmissionSchema, input);
|
|
591
|
-
}
|
|
592
|
-
export function parseEnnoAnswer(input) {
|
|
593
|
-
return parseBoundary(ennoAnswerSchema, input, 'Enno answer is invalid');
|
|
594
|
-
}
|
|
595
|
-
export function parseWorkReport(input) {
|
|
596
|
-
return parseInputBoundary('work_report', workReportSchema, input);
|
|
597
|
-
}
|
|
598
|
-
export function parseFinishRequest(input) {
|
|
599
|
-
return parseInputBoundary('finish', finishSchema, input);
|
|
600
|
-
}
|
|
601
|
-
export function parseVerificationPrepare(input) {
|
|
602
|
-
return parseInputBoundary('verify_prepare', verificationPrepareSchema, input);
|
|
603
|
-
}
|
|
604
|
-
export function parseMeditationSubmission(input) {
|
|
605
|
-
return parseInputBoundary('meditation_submit', meditationSubmissionSchema, input);
|
|
606
|
-
}
|
|
607
|
-
export function assertVerifierCwd(repositoryRoot, verifier) {
|
|
608
|
-
const candidate = path.isAbsolute(verifier.cwd) ? verifier.cwd : path.resolve(repositoryRoot, verifier.cwd);
|
|
609
|
-
const relative = path.relative(repositoryRoot, candidate);
|
|
610
|
-
if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
|
|
611
|
-
throw new KiokukoError('SECURITY_REJECTION', 'Verifier cwd must stay inside the canonical repository root');
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
export function assertContractVerifierCwds(repositoryRoot, contract) {
|
|
615
|
-
for (const verifier of contract.finalVerifiers)
|
|
616
|
-
assertVerifierCwd(repositoryRoot, verifier);
|
|
617
|
-
for (const unit of contract.workPlan.units) {
|
|
618
|
-
for (const verifier of unit.focusedVerifiers)
|
|
619
|
-
assertVerifierCwd(repositoryRoot, verifier);
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
//# sourceMappingURL=schemas.js.map
|