kiokuko-dsh 0.2.8 → 0.2.9
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 +1 -1
- package/README.ja.md +35 -10
- package/README.ko.md +30 -3
- package/README.md +36 -12
- package/README.zh-CN.md +30 -3
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/db/transaction.d.ts +2 -1
- package/dist/db/transaction.d.ts.map +1 -1
- package/dist/db/transaction.js +44 -7
- package/dist/db/transaction.js.map +1 -1
- package/dist/deep-planning-config.d.ts +32 -0
- package/dist/deep-planning-config.d.ts.map +1 -0
- package/dist/deep-planning-config.js +20 -0
- package/dist/deep-planning-config.js.map +1 -0
- package/dist/deep-thinker/core/contracts.d.ts +1 -29
- package/dist/deep-thinker/core/contracts.d.ts.map +1 -1
- package/dist/deep-thinker/core/contracts.js +2 -17
- package/dist/deep-thinker/core/contracts.js.map +1 -1
- package/dist/deep-thinker/memory-finalizer.d.ts.map +1 -1
- package/dist/deep-thinker/memory-finalizer.js +1 -114
- package/dist/deep-thinker/memory-finalizer.js.map +1 -1
- package/dist/deep-thinker/native-executor.d.ts.map +1 -1
- package/dist/deep-thinker/native-executor.js +3 -4
- package/dist/deep-thinker/native-executor.js.map +1 -1
- package/dist/deep-thinker/store.js +1 -2
- package/dist/deep-thinker/store.js.map +1 -1
- package/dist/dsh/agenticreplay-event-mapper.d.ts +1 -1
- package/dist/dsh/agenticreplay-event-mapper.d.ts.map +1 -1
- package/dist/dsh/agenticreplay-event-mapper.js +5 -1
- package/dist/dsh/agenticreplay-event-mapper.js.map +1 -1
- package/dist/dsh/agenticreplay-files.d.ts +1 -0
- package/dist/dsh/agenticreplay-files.d.ts.map +1 -1
- package/dist/dsh/agenticreplay-files.js +19 -2
- package/dist/dsh/agenticreplay-files.js.map +1 -1
- package/dist/dsh/agenticreplay-host.js +3 -3
- package/dist/dsh/agenticreplay-host.js.map +1 -1
- package/dist/dsh/agenticreplay-read-service.d.ts +14 -0
- package/dist/dsh/agenticreplay-read-service.d.ts.map +1 -1
- package/dist/dsh/agenticreplay-read-service.js +17 -0
- package/dist/dsh/agenticreplay-read-service.js.map +1 -1
- package/dist/dsh/agenticreplay-recorder.d.ts.map +1 -1
- package/dist/dsh/agenticreplay-recorder.js +5 -2
- package/dist/dsh/agenticreplay-recorder.js.map +1 -1
- package/dist/dsh/answer-review/coordinator.js +2 -1
- package/dist/dsh/answer-review/coordinator.js.map +1 -1
- package/dist/dsh/auto-memory-review.d.ts.map +1 -1
- package/dist/dsh/auto-memory-review.js +10 -193
- package/dist/dsh/auto-memory-review.js.map +1 -1
- package/dist/dsh/coding-workflow/contracts.d.ts +2 -0
- package/dist/dsh/coding-workflow/contracts.d.ts.map +1 -1
- package/dist/dsh/coding-workflow/contracts.js.map +1 -1
- package/dist/dsh/coding-workflow/intent.d.ts.map +1 -1
- package/dist/dsh/coding-workflow/intent.js +5 -2
- package/dist/dsh/coding-workflow/intent.js.map +1 -1
- package/dist/dsh/coding-workflow/service.d.ts +10 -81
- package/dist/dsh/coding-workflow/service.d.ts.map +1 -1
- package/dist/dsh/coding-workflow/service.js +52 -1
- package/dist/dsh/coding-workflow/service.js.map +1 -1
- package/dist/dsh/completion-verifiers.d.ts +6 -0
- package/dist/dsh/completion-verifiers.d.ts.map +1 -1
- package/dist/dsh/completion-verifiers.js.map +1 -1
- package/dist/dsh/composition.d.ts +2 -0
- package/dist/dsh/composition.d.ts.map +1 -1
- package/dist/dsh/composition.js +3 -0
- package/dist/dsh/composition.js.map +1 -1
- package/dist/dsh/config.d.ts +1 -1
- package/dist/dsh/config.d.ts.map +1 -1
- package/dist/dsh/config.js +3 -3
- package/dist/dsh/config.js.map +1 -1
- package/dist/dsh/core/host.d.ts.map +1 -1
- package/dist/dsh/core/host.js +151 -33
- package/dist/dsh/core/host.js.map +1 -1
- package/dist/dsh/core/tasks.d.ts +5 -2
- package/dist/dsh/core/tasks.d.ts.map +1 -1
- package/dist/dsh/core/tasks.js +124 -93
- package/dist/dsh/core/tasks.js.map +1 -1
- package/dist/dsh/decisions/request-intent.d.ts +101 -1
- package/dist/dsh/decisions/request-intent.d.ts.map +1 -1
- package/dist/dsh/decisions/request-intent.js +77 -15
- package/dist/dsh/decisions/request-intent.js.map +1 -1
- package/dist/dsh/execution-result.d.ts +1 -0
- package/dist/dsh/execution-result.d.ts.map +1 -1
- package/dist/dsh/execution-support.d.ts +2 -0
- package/dist/dsh/execution-support.d.ts.map +1 -1
- package/dist/dsh/execution-support.js +39 -4
- package/dist/dsh/execution-support.js.map +1 -1
- package/dist/dsh/existing-task-intake.d.ts +22 -0
- package/dist/dsh/existing-task-intake.d.ts.map +1 -0
- package/dist/dsh/existing-task-intake.js +46 -0
- package/dist/dsh/existing-task-intake.js.map +1 -0
- package/dist/dsh/finalization-request.d.ts +1 -1
- package/dist/dsh/finalization-request.d.ts.map +1 -1
- package/dist/dsh/finalization-request.js +1 -1
- package/dist/dsh/finalization-request.js.map +1 -1
- package/dist/dsh/guardrail/contracts.d.ts +85 -0
- package/dist/dsh/guardrail/contracts.d.ts.map +1 -0
- package/dist/dsh/guardrail/contracts.js +10 -0
- package/dist/dsh/guardrail/contracts.js.map +1 -0
- package/dist/dsh/guardrail/engine.d.ts +19 -0
- package/dist/dsh/guardrail/engine.d.ts.map +1 -0
- package/dist/dsh/guardrail/engine.js +178 -0
- package/dist/dsh/guardrail/engine.js.map +1 -0
- package/dist/dsh/guardrail/evidence.d.ts +16 -0
- package/dist/dsh/guardrail/evidence.d.ts.map +1 -0
- package/dist/dsh/guardrail/evidence.js +101 -0
- package/dist/dsh/guardrail/evidence.js.map +1 -0
- package/dist/dsh/guardrail/service.d.ts +27 -0
- package/dist/dsh/guardrail/service.d.ts.map +1 -0
- package/dist/dsh/guardrail/service.js +253 -0
- package/dist/dsh/guardrail/service.js.map +1 -0
- package/dist/dsh/host-adapter/admission.d.ts.map +1 -1
- package/dist/dsh/host-adapter/admission.js +143 -144
- package/dist/dsh/host-adapter/admission.js.map +1 -1
- package/dist/dsh/host-adapter/lifecycle.d.ts.map +1 -1
- package/dist/dsh/host-adapter/lifecycle.js +104 -90
- package/dist/dsh/host-adapter/lifecycle.js.map +1 -1
- package/dist/dsh/host-adapter/routing.d.ts.map +1 -1
- package/dist/dsh/host-adapter/routing.js +4 -4
- package/dist/dsh/host-adapter/routing.js.map +1 -1
- package/dist/dsh/host-adapter/turn-state.d.ts +4 -2
- package/dist/dsh/host-adapter/turn-state.d.ts.map +1 -1
- package/dist/dsh/host-adapter/turn-state.js +14 -7
- package/dist/dsh/host-adapter/turn-state.js.map +1 -1
- package/dist/dsh/host-adapter.d.ts.map +1 -1
- package/dist/dsh/host-adapter.js +115 -24
- package/dist/dsh/host-adapter.js.map +1 -1
- package/dist/dsh/intake-clarification.js +2 -2
- package/dist/dsh/intake-clarification.js.map +1 -1
- package/dist/dsh/intake-gate.js +6 -7
- package/dist/dsh/intake-gate.js.map +1 -1
- package/dist/dsh/legacy-session-codecs.d.ts +1 -0
- package/dist/dsh/legacy-session-codecs.d.ts.map +1 -1
- package/dist/dsh/legacy-session-codecs.js +831 -127
- package/dist/dsh/legacy-session-codecs.js.map +4 -4
- package/dist/dsh/lifecycle-memory.d.ts +30 -29
- package/dist/dsh/lifecycle-memory.d.ts.map +1 -1
- package/dist/dsh/lifecycle-memory.js +309 -431
- package/dist/dsh/lifecycle-memory.js.map +1 -1
- package/dist/dsh/lisp/candidate.d.ts +2 -2
- package/dist/dsh/lisp/ci.d.ts +2 -1
- package/dist/dsh/lisp/ci.d.ts.map +1 -1
- package/dist/dsh/lisp/ci.js +15 -2
- package/dist/dsh/lisp/ci.js.map +1 -1
- package/dist/dsh/lisp/contracts.d.ts +1 -18
- package/dist/dsh/lisp/contracts.d.ts.map +1 -1
- package/dist/dsh/lisp/contracts.js +1 -10
- package/dist/dsh/lisp/contracts.js.map +1 -1
- package/dist/dsh/lisp/files.d.ts +1 -1
- package/dist/dsh/lisp/files.d.ts.map +1 -1
- package/dist/dsh/lisp/files.js +17 -4
- package/dist/dsh/lisp/files.js.map +1 -1
- package/dist/dsh/lisp/hot-store.d.ts.map +1 -1
- package/dist/dsh/lisp/hot-store.js +4 -0
- package/dist/dsh/lisp/hot-store.js.map +1 -1
- package/dist/dsh/lisp/hot-tools.d.ts +2 -0
- package/dist/dsh/lisp/hot-tools.d.ts.map +1 -1
- package/dist/dsh/lisp/hot-tools.js +10 -0
- package/dist/dsh/lisp/hot-tools.js.map +1 -1
- package/dist/dsh/lisp/manager.d.ts +14 -1
- package/dist/dsh/lisp/manager.d.ts.map +1 -1
- package/dist/dsh/lisp/manager.js +238 -37
- package/dist/dsh/lisp/manager.js.map +1 -1
- package/dist/dsh/lisp/memory-verification.d.ts +5 -2
- package/dist/dsh/lisp/memory-verification.d.ts.map +1 -1
- package/dist/dsh/lisp/memory-verification.js +5 -1
- package/dist/dsh/lisp/memory-verification.js.map +1 -1
- package/dist/dsh/lisp/package-manager.d.ts +1 -1
- package/dist/dsh/lisp/package-manager.d.ts.map +1 -1
- package/dist/dsh/lisp/package-manager.js +10 -1
- package/dist/dsh/lisp/package-manager.js.map +1 -1
- package/dist/dsh/lisp/packages.d.ts +1 -1
- package/dist/dsh/lisp/packages.d.ts.map +1 -1
- package/dist/dsh/lisp/packages.js +15 -5
- package/dist/dsh/lisp/packages.js.map +1 -1
- package/dist/dsh/lisp/proposal-batch.d.ts +2 -0
- package/dist/dsh/lisp/proposal-batch.d.ts.map +1 -1
- package/dist/dsh/lisp/proposal-batch.js +17 -3
- package/dist/dsh/lisp/proposal-batch.js.map +1 -1
- package/dist/dsh/lisp/request-surface.d.ts +12 -0
- package/dist/dsh/lisp/request-surface.d.ts.map +1 -1
- package/dist/dsh/lisp/store.d.ts +2 -1
- package/dist/dsh/lisp/store.d.ts.map +1 -1
- package/dist/dsh/lisp/store.js +5 -1
- package/dist/dsh/lisp/store.js.map +1 -1
- package/dist/dsh/lisp/surface.d.ts.map +1 -1
- package/dist/dsh/lisp/surface.js +107 -13
- package/dist/dsh/lisp/surface.js.map +1 -1
- package/dist/dsh/lisp/task-authority.d.ts +29 -0
- package/dist/dsh/lisp/task-authority.d.ts.map +1 -0
- package/dist/dsh/lisp/task-authority.js +87 -0
- package/dist/dsh/lisp/task-authority.js.map +1 -0
- package/dist/dsh/lisp/worker.d.ts +3 -1
- package/dist/dsh/lisp/worker.d.ts.map +1 -1
- package/dist/dsh/lisp/worker.js +26 -4
- package/dist/dsh/lisp/worker.js.map +1 -1
- package/dist/dsh/lisp-config.d.ts +21 -0
- package/dist/dsh/lisp-config.d.ts.map +1 -0
- package/dist/dsh/lisp-config.js +13 -0
- package/dist/dsh/lisp-config.js.map +1 -0
- package/dist/dsh/memory-application.d.ts +3 -2
- package/dist/dsh/memory-application.d.ts.map +1 -1
- package/dist/dsh/memory-application.js +31 -22
- package/dist/dsh/memory-application.js.map +1 -1
- package/dist/dsh/model-handoff.d.ts.map +1 -1
- package/dist/dsh/model-handoff.js +2 -1
- package/dist/dsh/model-handoff.js.map +1 -1
- package/dist/dsh/models/service.d.ts.map +1 -1
- package/dist/dsh/models/service.js +13 -2
- package/dist/dsh/models/service.js.map +1 -1
- package/dist/dsh/native-cancellation-observer.d.ts +13 -0
- package/dist/dsh/native-cancellation-observer.d.ts.map +1 -0
- package/dist/dsh/native-cancellation-observer.js +54 -0
- package/dist/dsh/native-cancellation-observer.js.map +1 -0
- package/dist/dsh/native-execution-ownership.d.ts +6 -0
- package/dist/dsh/native-execution-ownership.d.ts.map +1 -0
- package/dist/dsh/native-execution-ownership.js +34 -0
- package/dist/dsh/native-execution-ownership.js.map +1 -0
- package/dist/dsh/native-subagent.d.ts +2 -2
- package/dist/dsh/native-subagent.d.ts.map +1 -1
- package/dist/dsh/native-subagent.js +2 -3
- package/dist/dsh/native-subagent.js.map +1 -1
- package/dist/dsh/native-task-authority.d.ts +66 -0
- package/dist/dsh/native-task-authority.d.ts.map +1 -0
- package/dist/dsh/native-task-authority.js +220 -0
- package/dist/dsh/native-task-authority.js.map +1 -0
- package/dist/dsh/on-demand-intake.d.ts +23 -1
- package/dist/dsh/on-demand-intake.d.ts.map +1 -1
- package/dist/dsh/on-demand-intake.js +171 -10
- package/dist/dsh/on-demand-intake.js.map +1 -1
- package/dist/dsh/orchestration/execution-owner.js +1 -1
- package/dist/dsh/orchestration/execution-owner.js.map +1 -1
- package/dist/dsh/orchestration/managed-agent-executor.d.ts +12 -1
- package/dist/dsh/orchestration/managed-agent-executor.d.ts.map +1 -1
- package/dist/dsh/orchestration/managed-agent-executor.js +28 -2
- package/dist/dsh/orchestration/managed-agent-executor.js.map +1 -1
- package/dist/dsh/owned-completion-evidence.d.ts +11 -0
- package/dist/dsh/owned-completion-evidence.d.ts.map +1 -0
- package/dist/dsh/owned-completion-evidence.js +59 -0
- package/dist/dsh/owned-completion-evidence.js.map +1 -0
- package/dist/dsh/owned-execution.d.ts +28 -1
- package/dist/dsh/owned-execution.d.ts.map +1 -1
- package/dist/dsh/owned-execution.js +325 -101
- package/dist/dsh/owned-execution.js.map +1 -1
- package/dist/dsh/owned-read-owner.d.ts +6 -0
- package/dist/dsh/owned-read-owner.d.ts.map +1 -0
- package/dist/dsh/owned-read-owner.js +22 -0
- package/dist/dsh/owned-read-owner.js.map +1 -0
- package/dist/dsh/replay-memory-extract.d.ts +36 -0
- package/dist/dsh/replay-memory-extract.d.ts.map +1 -0
- package/dist/dsh/replay-memory-extract.js +192 -0
- package/dist/dsh/replay-memory-extract.js.map +1 -0
- package/dist/dsh/semantic-compaction/coordinator.d.ts.map +1 -1
- package/dist/dsh/semantic-compaction/coordinator.js +2 -1
- package/dist/dsh/semantic-compaction/coordinator.js.map +1 -1
- package/dist/dsh/session-bridge.d.ts +3 -0
- package/dist/dsh/session-bridge.d.ts.map +1 -1
- package/dist/dsh/session-bridge.js +22 -25
- package/dist/dsh/session-bridge.js.map +1 -1
- package/dist/dsh/session-history-compatibility.d.ts.map +1 -1
- package/dist/dsh/session-history-compatibility.js +15 -1
- package/dist/dsh/session-history-compatibility.js.map +1 -1
- package/dist/dsh/session-history-lookup.d.ts +1 -1
- package/dist/dsh/session-history-lookup.d.ts.map +1 -1
- package/dist/dsh/session-history-lookup.js +4 -3
- package/dist/dsh/session-history-lookup.js.map +1 -1
- package/dist/dsh/session-memory-finalizer.d.ts.map +1 -1
- package/dist/dsh/session-memory-finalizer.js +129 -117
- package/dist/dsh/session-memory-finalizer.js.map +1 -1
- package/dist/dsh/setup.d.ts +1 -1
- package/dist/dsh/setup.d.ts.map +1 -1
- package/dist/dsh/setup.js +1 -1
- package/dist/dsh/skill-prompts.json +1 -1
- package/dist/dsh/task-authority-context.d.ts +8 -0
- package/dist/dsh/task-authority-context.d.ts.map +1 -0
- package/dist/dsh/task-authority-context.js +28 -0
- package/dist/dsh/task-authority-context.js.map +1 -0
- package/dist/dsh/task-completion-host.d.ts +2 -1
- package/dist/dsh/task-completion-host.d.ts.map +1 -1
- package/dist/dsh/task-completion-host.js +17 -5
- package/dist/dsh/task-completion-host.js.map +1 -1
- package/dist/dsh/task-completion.d.ts +13 -0
- package/dist/dsh/task-completion.d.ts.map +1 -1
- package/dist/dsh/task-completion.js +23 -6
- package/dist/dsh/task-completion.js.map +1 -1
- package/dist/dsh/task-intake.d.ts.map +1 -1
- package/dist/dsh/task-intake.js +7 -16
- package/dist/dsh/task-intake.js.map +1 -1
- package/dist/dsh/task-source-history.d.ts +33 -0
- package/dist/dsh/task-source-history.d.ts.map +1 -0
- package/dist/dsh/task-source-history.js +62 -0
- package/dist/dsh/task-source-history.js.map +1 -0
- package/dist/dsh/task-state-host.d.ts +124 -0
- package/dist/dsh/task-state-host.d.ts.map +1 -0
- package/dist/dsh/task-state-host.js +403 -0
- package/dist/dsh/task-state-host.js.map +1 -0
- package/dist/dsh/task-state-surface.d.ts +8 -0
- package/dist/dsh/task-state-surface.d.ts.map +1 -0
- package/dist/dsh/task-state-surface.js +113 -0
- package/dist/dsh/task-state-surface.js.map +1 -0
- package/dist/dsh/task-state.d.ts +217 -0
- package/dist/dsh/task-state.d.ts.map +1 -0
- package/dist/dsh/task-state.js +315 -0
- package/dist/dsh/task-state.js.map +1 -0
- package/dist/dsh/tool-exposure-config.d.ts +12 -0
- package/dist/dsh/tool-exposure-config.d.ts.map +1 -0
- package/dist/dsh/tool-exposure-config.js +4 -0
- package/dist/dsh/tool-exposure-config.js.map +1 -0
- package/dist/dsh/tool-exposure.d.ts +2 -11
- package/dist/dsh/tool-exposure.d.ts.map +1 -1
- package/dist/dsh/tool-exposure.js +2 -2
- package/dist/dsh/tool-exposure.js.map +1 -1
- package/dist/dsh/tools.d.ts +2 -2
- package/dist/dsh/tools.d.ts.map +1 -1
- package/dist/dsh/tools.js +3 -2
- package/dist/dsh/tools.js.map +1 -1
- package/dist/enno-oduno/memory-verification.d.ts +2 -1
- package/dist/enno-oduno/memory-verification.d.ts.map +1 -1
- package/dist/enno-oduno/memory-verification.js +42 -30
- package/dist/enno-oduno/memory-verification.js.map +1 -1
- package/dist/enno-oduno/schemas.d.ts +1 -1
- package/dist/enno-oduno/store.d.ts +7 -0
- package/dist/enno-oduno/store.d.ts.map +1 -1
- package/dist/enno-oduno/store.js +42 -0
- package/dist/enno-oduno/store.js.map +1 -1
- package/dist/ledger/store.d.ts.map +1 -1
- package/dist/ledger/store.js +0 -5
- package/dist/ledger/store.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/auto-globalization.d.ts.map +1 -1
- package/dist/memory/auto-globalization.js +4 -82
- package/dist/memory/auto-globalization.js.map +1 -1
- package/dist/memory/evolution/contracts.d.ts +3 -1
- package/dist/memory/evolution/contracts.d.ts.map +1 -1
- package/dist/memory/evolution/contracts.js +1 -1
- package/dist/memory/evolution/contracts.js.map +1 -1
- package/dist/memory/evolution/store.d.ts +2 -1
- package/dist/memory/evolution/store.d.ts.map +1 -1
- package/dist/memory/evolution/store.js +75 -34
- package/dist/memory/evolution/store.js.map +1 -1
- package/dist/memory/evolution/worker.d.ts +1 -0
- package/dist/memory/evolution/worker.d.ts.map +1 -1
- package/dist/memory/evolution/worker.js +6 -18
- package/dist/memory/evolution/worker.js.map +1 -1
- package/dist/memory/explain.d.ts.map +1 -1
- package/dist/memory/explain.js +2 -2
- package/dist/memory/explain.js.map +1 -1
- package/dist/memory/forget.d.ts.map +1 -1
- package/dist/memory/forget.js +12 -3
- package/dist/memory/forget.js.map +1 -1
- package/dist/memory/index-reasoning/service.d.ts.map +1 -1
- package/dist/memory/index-reasoning/service.js +5 -43
- package/dist/memory/index-reasoning/service.js.map +1 -1
- package/dist/memory/index-reasoning/worker.d.ts.map +1 -1
- package/dist/memory/index-reasoning/worker.js +1 -15
- package/dist/memory/index-reasoning/worker.js.map +1 -1
- package/dist/memory/lifecycle.d.ts +1 -1
- package/dist/memory/lifecycle.d.ts.map +1 -1
- package/dist/memory/lifecycle.js +4 -79
- package/dist/memory/lifecycle.js.map +1 -1
- package/dist/memory/replay-review.d.ts +90 -0
- package/dist/memory/replay-review.d.ts.map +1 -0
- package/dist/memory/replay-review.js +82 -0
- package/dist/memory/replay-review.js.map +1 -0
- package/dist/memory/replay-store.d.ts +14 -0
- package/dist/memory/replay-store.d.ts.map +1 -0
- package/dist/memory/replay-store.js +117 -0
- package/dist/memory/replay-store.js.map +1 -0
- package/dist/memory/review/adoption.d.ts.map +1 -1
- package/dist/memory/review/adoption.js +2 -106
- package/dist/memory/review/adoption.js.map +1 -1
- package/dist/memory/review/store.d.ts.map +1 -1
- package/dist/memory/review/store.js +9 -5
- package/dist/memory/review/store.js.map +1 -1
- package/dist/memory/review/worker.d.ts.map +1 -1
- package/dist/memory/review/worker.js +1 -7
- package/dist/memory/review/worker.js.map +1 -1
- package/dist/memory/scoped-memory.js +1 -1
- package/dist/memory/scoped-memory.js.map +1 -1
- package/dist/model-tools/contracts.d.ts +2 -2
- package/dist/model-tools/contracts.d.ts.map +1 -1
- package/dist/model-tools/contracts.js +1 -11
- package/dist/model-tools/contracts.js.map +1 -1
- package/dist/model-tools/names.d.ts +4 -0
- package/dist/model-tools/names.d.ts.map +1 -0
- package/dist/model-tools/names.js +13 -0
- package/dist/model-tools/names.js.map +1 -0
- package/docs/code-intelligence.md +54 -119
- package/docs/dsh-plugin.md +86 -9
- package/docs/getting-started.md +10 -0
- package/docs/guardrail-licenses/Apache-2.0.txt +73 -0
- package/docs/guardrail-licenses/BSD-2-Clause.txt +9 -0
- package/docs/guardrail-licenses/COPYRIGHT-Rust.txt +34 -0
- package/docs/guardrail-licenses/COPYRIGHT-library.html +29357 -0
- package/docs/guardrail-licenses/ISC.txt +7 -0
- package/docs/guardrail-licenses/LICENSE-APACHE +176 -0
- package/docs/guardrail-licenses/LICENSE-MIT +25 -0
- package/docs/guardrail-licenses/LLVM-exception.txt +15 -0
- package/docs/guardrail-licenses/MIT.txt +9 -0
- package/docs/guardrail-licenses/NCSA.txt +29 -0
- package/docs/guardrail-licenses/README.md +7 -0
- package/docs/guardrail-licenses/Unicode-3.0.txt +39 -0
- package/docs/guardrail-licenses/libunwind-LICENSE.txt +311 -0
- package/docs/guardrail-licenses/manifest.json +71 -0
- package/docs/guardrail-licenses/musl-COPYRIGHT.txt +193 -0
- package/docs/guardrail.md +33 -0
- package/docs/lisp.md +33 -9
- package/docs/memory-evolution.md +6 -6
- package/docs/replay-memory-review.md +26 -0
- package/guardrail/aarch64-apple-darwin/kiokuko-guardrail +0 -0
- package/guardrail/aarch64-apple-darwin/manifest.json +71 -0
- package/guardrail/aarch64-unknown-linux-musl/kiokuko-guardrail +0 -0
- package/guardrail/aarch64-unknown-linux-musl/manifest.json +69 -0
- package/guardrail/manifest.json +204 -0
- package/guardrail/node-runner.mjs +37 -0
- package/guardrail/protocols/coding-routine.lisp +33 -0
- package/guardrail/x86_64-apple-darwin/kiokuko-guardrail +0 -0
- package/guardrail/x86_64-apple-darwin/manifest.json +71 -0
- package/guardrail/x86_64-unknown-linux-musl/kiokuko-guardrail +0 -0
- package/guardrail/x86_64-unknown-linux-musl/manifest.json +68 -0
- package/migrations/040_task_state.sql +45 -0
- package/migrations/041_task_source_history.sql +88 -0
- package/migrations/042_evolution_source_epochs.sql +148 -0
- package/package.json +45 -27
- package/scripts/guardrail-artifacts.d.mts +13 -0
- package/scripts/guardrail-artifacts.mjs +136 -0
- package/skills/kiokuko-lisp/SKILL.md +1 -1
- package/skills/kiokuko-soul/SKILL.md +6 -6
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": 1,
|
|
3
|
+
"package": "kiokuko-guardrail",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"protocol": {
|
|
6
|
+
"path": "guardrail/protocols/coding-routine.lisp",
|
|
7
|
+
"bytes": 948,
|
|
8
|
+
"sha256": "82b56af81d12a8cab8352b0825c913f00f73708b2339a9b567cc6f4d4e52da49"
|
|
9
|
+
},
|
|
10
|
+
"targets": {
|
|
11
|
+
"x86_64-unknown-linux-musl": {
|
|
12
|
+
"platform": "linux",
|
|
13
|
+
"arch": "x64",
|
|
14
|
+
"binary": "guardrail/x86_64-unknown-linux-musl/kiokuko-guardrail",
|
|
15
|
+
"manifest": "guardrail/x86_64-unknown-linux-musl/manifest.json",
|
|
16
|
+
"manifestSha256": "00e2c0ebf29867ff87e5c6e47c25e4c65d8884f70a8ace85f63717932356197c",
|
|
17
|
+
"bytes": 516792,
|
|
18
|
+
"sha256": "d262a712893945a1525dc9c8f19c806a44a832747879c1af8f6e33634b15636b",
|
|
19
|
+
"verification": {
|
|
20
|
+
"independent_builds_equal": true,
|
|
21
|
+
"native_smoke": "passed",
|
|
22
|
+
"package_sha256": "27273d1914e0c406425722973dec110da019c37ca6dd43afdff8f8c86013b868",
|
|
23
|
+
"source_sha256": "c835782d88444f03f9bce01106b75b9c071fa18543d51e7fcb754f403ba6deab",
|
|
24
|
+
"static_no_pt_interp": true
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"aarch64-unknown-linux-musl": {
|
|
28
|
+
"platform": "linux",
|
|
29
|
+
"arch": "arm64",
|
|
30
|
+
"binary": "guardrail/aarch64-unknown-linux-musl/kiokuko-guardrail",
|
|
31
|
+
"manifest": "guardrail/aarch64-unknown-linux-musl/manifest.json",
|
|
32
|
+
"manifestSha256": "2f1560bb9aa7b12ecba9000f0ae540598e433a06869138c861a68ecc26fd2787",
|
|
33
|
+
"bytes": 445888,
|
|
34
|
+
"sha256": "62b8f751d99e24c71d4223037221207ecd7877ddbf0ac3784e31df26c8af0beb",
|
|
35
|
+
"verification": {
|
|
36
|
+
"independent_builds_equal": true,
|
|
37
|
+
"native_smoke": "not run",
|
|
38
|
+
"package_sha256": "9db094881a6fb18c3457f46e1c285dffe223414c982b2b4f5071babe182c5c02",
|
|
39
|
+
"source_sha256": "c835782d88444f03f9bce01106b75b9c071fa18543d51e7fcb754f403ba6deab",
|
|
40
|
+
"static_no_pt_interp": true,
|
|
41
|
+
"status": "cross-built; not executed on ARM64 Linux"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"x86_64-apple-darwin": {
|
|
45
|
+
"platform": "darwin",
|
|
46
|
+
"arch": "x64",
|
|
47
|
+
"binary": "guardrail/x86_64-apple-darwin/kiokuko-guardrail",
|
|
48
|
+
"manifest": "guardrail/x86_64-apple-darwin/manifest.json",
|
|
49
|
+
"manifestSha256": "48e718f7c8d23cae7d11f11c722c85785f78ad53abff33eb7d25c6ddb01e9d66",
|
|
50
|
+
"bytes": 414856,
|
|
51
|
+
"sha256": "673e9b26eda59ba18e217034c6502daa65a2ab10f22403685c4aaf42181631f0",
|
|
52
|
+
"verification": {
|
|
53
|
+
"imports": [
|
|
54
|
+
"/usr/lib/libSystem.B.dylib"
|
|
55
|
+
],
|
|
56
|
+
"independent_builds_equal": true,
|
|
57
|
+
"interpreter": "/usr/lib/dyld",
|
|
58
|
+
"linker_ad_hoc_signature": false,
|
|
59
|
+
"minimum_os": "13.0.0",
|
|
60
|
+
"native_smoke": "not run",
|
|
61
|
+
"package_sha256": "fb3a2c767f2a077dbe86af44814b93ae9ef81722359423882c029db0f5afdcb3",
|
|
62
|
+
"source_sha256": "c835782d88444f03f9bce01106b75b9c071fa18543d51e7fcb754f403ba6deab",
|
|
63
|
+
"status": "cross-built; not executed on macOS"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"aarch64-apple-darwin": {
|
|
67
|
+
"platform": "darwin",
|
|
68
|
+
"arch": "arm64",
|
|
69
|
+
"binary": "guardrail/aarch64-apple-darwin/kiokuko-guardrail",
|
|
70
|
+
"manifest": "guardrail/aarch64-apple-darwin/manifest.json",
|
|
71
|
+
"manifestSha256": "4e5e9e56dbfc3de7d70a703da3ec69c2ec4600cc9b5ae728606fe1ea47e85440",
|
|
72
|
+
"bytes": 384672,
|
|
73
|
+
"sha256": "c60cb16daa7a536d876017da01815fce3719bae16fc6cd42ea74df04f3e53af4",
|
|
74
|
+
"verification": {
|
|
75
|
+
"imports": [
|
|
76
|
+
"/usr/lib/libSystem.B.dylib"
|
|
77
|
+
],
|
|
78
|
+
"independent_builds_equal": true,
|
|
79
|
+
"interpreter": "/usr/lib/dyld",
|
|
80
|
+
"linker_ad_hoc_signature": true,
|
|
81
|
+
"minimum_os": "13.0.0",
|
|
82
|
+
"native_smoke": "not run",
|
|
83
|
+
"package_sha256": "9ba9b967e8eae733972ce01d5841ddb432f1c863dd5f86792527266ddeb73530",
|
|
84
|
+
"source_sha256": "c835782d88444f03f9bce01106b75b9c071fa18543d51e7fcb754f403ba6deab",
|
|
85
|
+
"status": "cross-built; not executed on macOS"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"unavailableTargets": [],
|
|
90
|
+
"scope": "Bundled artifact identity and declared build provenance only. Cross-built targets are not native execution evidence. No OS sandbox, signatures, deterministic inference, or restored Common Lisp heap is claimed.",
|
|
91
|
+
"toolchainProvenance": {
|
|
92
|
+
"toolchain-inputs": {
|
|
93
|
+
"cc_binary_sha256": "a23ecab8ff08f09ad8c80602c2c5df7f49e09c25905cb8975902e101bf72635f",
|
|
94
|
+
"cc_version": "cc (Debian 14.2.0-19) 14.2.0",
|
|
95
|
+
"components": [
|
|
96
|
+
{
|
|
97
|
+
"sha256": "77171ba2a0345fdf2abc4fedda55d6de078dae7a68527c28be8c77dcc9604bd5",
|
|
98
|
+
"url": "https://static.rust-lang.org/dist/2026-10-01/rustc-1.99.0-x86_64-unknown-linux-gnu.tar.xz"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"sha256": "3e58dff2d0b72196b5ea4e90536e174d400de88564a52694686b81e091169933",
|
|
102
|
+
"url": "https://static.rust-lang.org/dist/2026-10-01/rust-std-1.99.0-x86_64-unknown-linux-gnu.tar.xz"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"sha256": "d7674918d28093097614cd9728b6ca60db9ea3038f640f0bd1e9a4188c7568ce",
|
|
106
|
+
"url": "https://static.rust-lang.org/dist/2026-10-01/cargo-1.99.0-x86_64-unknown-linux-gnu.tar.xz"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"sha256": "b22c09ab9e258ec5571da170d88bd1624a4ea602e6d70d95720c5b47494cadce",
|
|
110
|
+
"url": "https://static.rust-lang.org/dist/2026-10-01/rustfmt-1.99.0-x86_64-unknown-linux-gnu.tar.xz"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"sha256": "b106b0aa4565cc3525fd3161c69203a9e39044e6e6b4d618f261c3eeda14ad50",
|
|
114
|
+
"url": "https://static.rust-lang.org/dist/2026-10-01/rust-std-1.99.0-x86_64-unknown-linux-musl.tar.xz"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"ld_binary_sha256": "d2766988b6a1b1d1518cdc09242e726d1f24e151e16410ada3092b11ffd9081b",
|
|
118
|
+
"ld_version": "GNU ld (GNU Binutils for Debian) 2.44",
|
|
119
|
+
"official_manifest_sha256": "ce6dddc886364f8d786514771212cebe9b731ba82d6b859951c6b0ccc516b6a2",
|
|
120
|
+
"scope": "Recorded cloud toolchain inputs. This is not a fully isolated Guix derivation or a cross-platform deterministic inference claim."
|
|
121
|
+
},
|
|
122
|
+
"macos-cross-verification": {
|
|
123
|
+
"components": [
|
|
124
|
+
{
|
|
125
|
+
"sha256": "1cbe9df9f27e6b78d14ccbca43b6703a404ef79ef1c463de901d7f088d4e2026",
|
|
126
|
+
"url": "https://ziglang.org/download/0.17.0/zig-x86_64-linux-0.17.0.tar.xz"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"sha256": "a7c6de8aa21e7c31163a7656295b321bb85f5dce55ed8ea95ac9ac561202bb5b",
|
|
130
|
+
"url": "https://static.rust-lang.org/dist/2026-10-01/rust-std-1.99.0-aarch64-apple-darwin.tar.xz"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"sha256": "18ee81961a73c3ae966ecb1e8f6096438c90aeefece8856201a6ecc17f5bc850",
|
|
134
|
+
"url": "https://static.rust-lang.org/dist/2026-10-01/rust-std-1.99.0-x86_64-apple-darwin.tar.xz"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"macos": [
|
|
138
|
+
{
|
|
139
|
+
"binary_bytes": 384672,
|
|
140
|
+
"binary_sha256": "c60cb16daa7a536d876017da01815fce3719bae16fc6cd42ea74df04f3e53af4",
|
|
141
|
+
"imports": [
|
|
142
|
+
"/usr/lib/libSystem.B.dylib"
|
|
143
|
+
],
|
|
144
|
+
"independent_builds_equal": true,
|
|
145
|
+
"interpreter": "/usr/lib/dyld",
|
|
146
|
+
"linker_ad_hoc_signature": true,
|
|
147
|
+
"minimum_os": "13.0.0",
|
|
148
|
+
"native_smoke": "not run",
|
|
149
|
+
"package_sha256": "9ba9b967e8eae733972ce01d5841ddb432f1c863dd5f86792527266ddeb73530",
|
|
150
|
+
"source_sha256": "c835782d88444f03f9bce01106b75b9c071fa18543d51e7fcb754f403ba6deab",
|
|
151
|
+
"status": "cross-built; not executed on macOS",
|
|
152
|
+
"target": "aarch64-apple-darwin"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"binary_bytes": 414856,
|
|
156
|
+
"binary_sha256": "673e9b26eda59ba18e217034c6502daa65a2ab10f22403685c4aaf42181631f0",
|
|
157
|
+
"imports": [
|
|
158
|
+
"/usr/lib/libSystem.B.dylib"
|
|
159
|
+
],
|
|
160
|
+
"independent_builds_equal": true,
|
|
161
|
+
"interpreter": "/usr/lib/dyld",
|
|
162
|
+
"linker_ad_hoc_signature": false,
|
|
163
|
+
"minimum_os": "13.0.0",
|
|
164
|
+
"native_smoke": "not run",
|
|
165
|
+
"package_sha256": "fb3a2c767f2a077dbe86af44814b93ae9ef81722359423882c029db0f5afdcb3",
|
|
166
|
+
"source_sha256": "c835782d88444f03f9bce01106b75b9c071fa18543d51e7fcb754f403ba6deab",
|
|
167
|
+
"status": "cross-built; not executed on macOS",
|
|
168
|
+
"target": "x86_64-apple-darwin"
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"scope": "Cloud cross-build and Mach-O structural/import/reproducibility checks only. No native macOS execution, notarization, or external-effect determinism claim.",
|
|
172
|
+
"zig_binary_sha256": "7c61539af19fa4082c94848f1c2b57b89e76dc6cfd5bd4c57764c3caf8f82272",
|
|
173
|
+
"zig_version": "0.17.0"
|
|
174
|
+
},
|
|
175
|
+
"arm-cross-verification": {
|
|
176
|
+
"component": {
|
|
177
|
+
"sha256": "ea8fd309578a09c9e12401621a470e6d6b1047f25933207fb8a39d66647d4561",
|
|
178
|
+
"url": "https://static.rust-lang.org/dist/2026-10-01/rust-std-1.99.0-aarch64-unknown-linux-musl.tar.xz"
|
|
179
|
+
},
|
|
180
|
+
"linker_binary_sha256": "4739514e3484915747c34b35007cd990235cc6b490b2d0525a61ac402ca16af9",
|
|
181
|
+
"linker_version": "LLD 23.1.1 (/checkout/src/llvm-project/llvm 1b9c0d5ff9bbe7634aead059efe6b11a7eeba145) (compatible with GNU linkers)",
|
|
182
|
+
"linux_arm64": {
|
|
183
|
+
"binary_bytes": 445888,
|
|
184
|
+
"binary_sha256": "62b8f751d99e24c71d4223037221207ecd7877ddbf0ac3784e31df26c8af0beb",
|
|
185
|
+
"independent_builds_equal": true,
|
|
186
|
+
"native_smoke": "not run",
|
|
187
|
+
"package_sha256": "9db094881a6fb18c3457f46e1c285dffe223414c982b2b4f5071babe182c5c02",
|
|
188
|
+
"source_sha256": "c835782d88444f03f9bce01106b75b9c071fa18543d51e7fcb754f403ba6deab",
|
|
189
|
+
"static_no_pt_interp": true,
|
|
190
|
+
"status": "cross-built; not executed on ARM64 Linux",
|
|
191
|
+
"target": "aarch64-unknown-linux-musl"
|
|
192
|
+
},
|
|
193
|
+
"macos_ad_hoc_signature_checks": [
|
|
194
|
+
{
|
|
195
|
+
"native_execution": "not run",
|
|
196
|
+
"sha256": "c60cb16daa7a536d876017da01815fce3719bae16fc6cd42ea74df04f3e53af4",
|
|
197
|
+
"sha256_code_pages_verified": true,
|
|
198
|
+
"target": "aarch64-apple-darwin"
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"scope": "Cross-build and ELF/Mach-O structural/hash verification only; ARM64 Linux and macOS native execution not run."
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Host-owned reporter. Test stdout is diagnostic data and cannot issue receipts.
|
|
2
|
+
import { run } from 'node:test'
|
|
3
|
+
import { tap } from 'node:test/reporters'
|
|
4
|
+
import { writeSync } from 'node:fs'
|
|
5
|
+
import path from 'node:path'
|
|
6
|
+
const input = JSON.parse(process.argv[2])
|
|
7
|
+
if (!Array.isArray(input.files) || !input.files.length || input.files.length > 32 || input.files.some(file => typeof file !== 'string' || !path.isAbsolute(file))) throw Error('Invalid selected test files')
|
|
8
|
+
const observation = { schema: 1, operationId: input.operationId, runtimeDigest: input.runtimeDigest, environmentDigest: input.environmentDigest, complete: false, tests: 0, passed: 0, failed: 0, assertionFailures: 0, otherFailures: 0, skipped: 0, todo: 0, cancelled: 0, explicit: 0 }
|
|
9
|
+
const files = new Set(input.files.map(file => path.resolve(file)))
|
|
10
|
+
let summaries = 0, finalSummary
|
|
11
|
+
const stream = run({ files: input.files, isolation: 'process', concurrency: false, timeout: input.timeoutMs })
|
|
12
|
+
stream.on('data', event => {
|
|
13
|
+
const d = event.data
|
|
14
|
+
if (event.type === 'test:summary' && d.file === undefined) { summaries++; finalSummary = d }
|
|
15
|
+
if (!['test:pass', 'test:fail'].includes(event.type) || d.details?.type === 'suite') return
|
|
16
|
+
if (!files.has(path.resolve(d.file ?? ''))) { observation.otherFailures++; return }
|
|
17
|
+
observation.tests++
|
|
18
|
+
const fileOnly = d.line === 1 && d.column === 1 && [d.file, path.relative(process.cwd(), d.file), path.basename(d.file)].includes(d.name)
|
|
19
|
+
if (!fileOnly) observation.explicit++
|
|
20
|
+
if (d.skip) observation.skipped++
|
|
21
|
+
else if (d.todo) observation.todo++
|
|
22
|
+
else if (event.type === 'test:pass') observation.passed++
|
|
23
|
+
else {
|
|
24
|
+
observation.failed++
|
|
25
|
+
const error = d.details?.error, cause = error?.cause ?? error
|
|
26
|
+
// Node serializes errors across the isolated test process. These fields reject renamed ordinary
|
|
27
|
+
// Errors, but model-written tests can fabricate assertion semantics; this is not attestation.
|
|
28
|
+
if (!fileOnly && cause?.code === 'ERR_ASSERTION' && cause?.name === 'AssertionError' && typeof cause.operator === 'string' && cause.operator.length > 0 && typeof cause.generatedMessage === 'boolean' && Object.hasOwn(cause,'actual') && Object.hasOwn(cause,'expected')) observation.assertionFailures++
|
|
29
|
+
else { observation.otherFailures++; if (error?.failureType === 'cancelledByParent' || error?.failureType === 'testTimeoutFailure') observation.cancelled++ }
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
stream.compose(tap).pipe(process.stdout)
|
|
33
|
+
stream.on('end', () => {
|
|
34
|
+
observation.complete = summaries === 1 && finalSummary?.counts?.tests === observation.tests && observation.tests > 0
|
|
35
|
+
writeSync(3, JSON.stringify(observation) + '\n')
|
|
36
|
+
process.exitCode = observation.failed || observation.otherFailures || observation.cancelled ? 1 : 0
|
|
37
|
+
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
; A bounded CL-like protocol. No CL runtime, user functions, mutation, or I/O.
|
|
2
|
+
(defprotocol coding-routine
|
|
3
|
+
(:phase receive-request
|
|
4
|
+
:produces request-context
|
|
5
|
+
:next determine-changes)
|
|
6
|
+
(:phase determine-changes
|
|
7
|
+
:requires request-context
|
|
8
|
+
:produces change-plan
|
|
9
|
+
:next write-tests)
|
|
10
|
+
(:phase write-tests
|
|
11
|
+
:requires change-plan
|
|
12
|
+
:produces test-spec
|
|
13
|
+
:next verify-red)
|
|
14
|
+
(:phase verify-red
|
|
15
|
+
:requires test-spec
|
|
16
|
+
:guard (and (fails-p test-spec)
|
|
17
|
+
(not (syntax-error-p test-spec))
|
|
18
|
+
(not (timeout-p test-spec)))
|
|
19
|
+
:next implement
|
|
20
|
+
:on-violation write-tests)
|
|
21
|
+
(:phase implement
|
|
22
|
+
:requires test-spec change-plan
|
|
23
|
+
:produces patch
|
|
24
|
+
:next verify-green)
|
|
25
|
+
(:phase verify-green
|
|
26
|
+
:requires patch test-spec
|
|
27
|
+
:guard (and (passes-p test-spec patch)
|
|
28
|
+
(eq (status patch) :applied))
|
|
29
|
+
:next report
|
|
30
|
+
:on-violation implement)
|
|
31
|
+
(:phase report
|
|
32
|
+
:requires patch test-spec
|
|
33
|
+
:next :done))
|
|
Binary file
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"artifacts": {
|
|
3
|
+
"README.md": {
|
|
4
|
+
"bytes": 10748,
|
|
5
|
+
"sha256": "4b5d7c785121c865945f6379de31565c6aa9218f9d4333519ce3d450e85d0c55"
|
|
6
|
+
},
|
|
7
|
+
"bin/kiokuko-guardrail": {
|
|
8
|
+
"bytes": 414856,
|
|
9
|
+
"sha256": "673e9b26eda59ba18e217034c6502daa65a2ab10f22403685c4aaf42181631f0"
|
|
10
|
+
},
|
|
11
|
+
"protocols/coding-routine.lisp": {
|
|
12
|
+
"bytes": 948,
|
|
13
|
+
"sha256": "82b56af81d12a8cab8352b0825c913f00f73708b2339a9b567cc6f4d4e52da49"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"build_inputs": {
|
|
17
|
+
"cargo_sha256": "e951141cc55a6cd7b9876d187bd30a3720e6086b99413af95e3b8de1cdd72f14",
|
|
18
|
+
"cargo_version": "cargo 1.99.0 (5f94df478 2026-08-27)",
|
|
19
|
+
"command": [
|
|
20
|
+
"env",
|
|
21
|
+
"SOURCE_DATE_EPOCH=0",
|
|
22
|
+
"MACOSX_DEPLOYMENT_TARGET=13.0",
|
|
23
|
+
"LD_LIBRARY_PATH=RUST_TOOLCHAIN/lib",
|
|
24
|
+
"RUSTFLAGS=--remap-path-prefix=SOURCE=kiokuko-guardrail --remap-path-prefix=TEMP=build",
|
|
25
|
+
"LINKER=zig-0.17.0-cc-strip-target-x86_64-macos.13.0.0",
|
|
26
|
+
"cargo",
|
|
27
|
+
"build",
|
|
28
|
+
"--manifest-path",
|
|
29
|
+
"Cargo.toml",
|
|
30
|
+
"--locked",
|
|
31
|
+
"--offline",
|
|
32
|
+
"--release",
|
|
33
|
+
"--target",
|
|
34
|
+
"x86_64-apple-darwin"
|
|
35
|
+
],
|
|
36
|
+
"rustc_sha256": "f3834d26669b03f6855fa54bd2381443123e860167bc0c7a8dd137e5cf6e5e4f",
|
|
37
|
+
"rustc_version": "rustc 1.99.0 (b940084d7 2026-09-28)\nbinary: rustc\ncommit-hash: b940084d7eb6a299eb4bfeb8e34901bc051e7ac4\ncommit-date: 2026-09-28\nhost: x86_64-unknown-linux-gnu\nrelease: 1.99.0\nLLVM version: 23.1.1",
|
|
38
|
+
"source_date_epoch": 0,
|
|
39
|
+
"target": "x86_64-apple-darwin"
|
|
40
|
+
},
|
|
41
|
+
"package": "kiokuko-guardrail",
|
|
42
|
+
"schema": 1,
|
|
43
|
+
"scope": "Declared source/compiler/build inputs and artifact identity. This is not a signature, sandbox, or a claim of deterministic model inference or identical binaries across target operating systems.",
|
|
44
|
+
"source_sha256": "c835782d88444f03f9bce01106b75b9c071fa18543d51e7fcb754f403ba6deab",
|
|
45
|
+
"sources": {
|
|
46
|
+
"BOOTSTRAP.md": "b9d0db4c38561d6173e2396bfca979743c66fe64dc15f8c10931d5ae02800a95",
|
|
47
|
+
"Cargo.lock": "16f51b3ffc20349a69b4b580ea59d2354c9d496911c7e530509492d9b46ecb3a",
|
|
48
|
+
"Cargo.toml": "1cc0b8df18413f925841e6acddfe14a49f7e8dd4236660eb9d822f1ccdcc9d4e",
|
|
49
|
+
"README.md": "4b5d7c785121c865945f6379de31565c6aa9218f9d4333519ce3d450e85d0c55",
|
|
50
|
+
"examples/coding-routine.lisp": "82b56af81d12a8cab8352b0825c913f00f73708b2339a9b567cc6f4d4e52da49",
|
|
51
|
+
"scripts/package.py": "159b8cdda58b422a60aee95554eb0febc3b520d7ef5d5a4bac1cdd046a514e16",
|
|
52
|
+
"scripts/test.py": "d8ed547d0943f8b23838b146c6e1d31ad9004c525868d19a2fffafef67e6b6c9",
|
|
53
|
+
"src/digest.rs": "a46aa8ac0ba3f8e29e268a495723b6d49a4741399bb595c34a3d021dc295c800",
|
|
54
|
+
"src/eval.rs": "7742caeeac426783647363242d93845369c018b00528312573f1cdc668c22ec3",
|
|
55
|
+
"src/host.rs": "de9f34ad6ce8246e6f80cbf3d4f56bb07ed8043b17232135755a5e3ee5602cf5",
|
|
56
|
+
"src/lib.rs": "2f591de0e7520a313da9668491da106d904bb19ef2384c717e87cd06bac665a3",
|
|
57
|
+
"src/main.rs": "16a3a42d8338ca20e66173648c0a407b24724eeb1a4b3710c8a3b90b5aade10f",
|
|
58
|
+
"src/protocol.rs": "d9009f5977707141f3547902a07f2f2c5455e4b9516b01a9ba4eb22a82af2a39",
|
|
59
|
+
"src/reader.rs": "7bc1ff7aece72fc44ac43d5a207a3c8f2fd009eae41cb4b4dadb4eb9436d15f3",
|
|
60
|
+
"tests/cli.rs": "22955ba315007b4a18409b31439345eb84ce0a62b88658cf440d513b10811357",
|
|
61
|
+
"tests/digest.rs": "63a3a1b4963ef03260cae4ff9bfeed3596a445dc8df74ecc91b5750d3a6fa28d",
|
|
62
|
+
"tests/edge_contract.rs": "4f9c7b068db44e9beceb811ceac4a5e8d6cf7cda51eee5a2449f29ab0fa6ade9",
|
|
63
|
+
"tests/evaluator.rs": "a09c811494615b01e19ccef78491b8bbfee07fede8dcbee59f384fe59e145401",
|
|
64
|
+
"tests/packaging.rs": "61ae1bfed0d4f31748ce2af58953387045f4231370d46cb809f26e93aea1e033",
|
|
65
|
+
"tests/protocol.rs": "8f6b7ad5842f5b596efe8da01bba84f39fcd8d6426fde6932cb2a5cbb44d589f",
|
|
66
|
+
"tests/reader.rs": "249092f56768a6511dbb15825be55f4cf0105269cb9dba1d6f8169ff66d44ab5",
|
|
67
|
+
"tests/robustness.rs": "464c26addcf5188128d2e6eedd97cccccdb82ada0bc94a0648b77c8043118ba9"
|
|
68
|
+
},
|
|
69
|
+
"target": "x86_64-apple-darwin",
|
|
70
|
+
"version": "0.1.0"
|
|
71
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"artifacts": {
|
|
3
|
+
"README.md": {
|
|
4
|
+
"bytes": 10748,
|
|
5
|
+
"sha256": "4b5d7c785121c865945f6379de31565c6aa9218f9d4333519ce3d450e85d0c55"
|
|
6
|
+
},
|
|
7
|
+
"bin/kiokuko-guardrail": {
|
|
8
|
+
"bytes": 516792,
|
|
9
|
+
"sha256": "d262a712893945a1525dc9c8f19c806a44a832747879c1af8f6e33634b15636b"
|
|
10
|
+
},
|
|
11
|
+
"protocols/coding-routine.lisp": {
|
|
12
|
+
"bytes": 948,
|
|
13
|
+
"sha256": "82b56af81d12a8cab8352b0825c913f00f73708b2339a9b567cc6f4d4e52da49"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"build_inputs": {
|
|
17
|
+
"cargo_sha256": "e951141cc55a6cd7b9876d187bd30a3720e6086b99413af95e3b8de1cdd72f14",
|
|
18
|
+
"cargo_version": "cargo 1.99.0 (5f94df478 2026-08-27)",
|
|
19
|
+
"command": [
|
|
20
|
+
"env",
|
|
21
|
+
"SOURCE_DATE_EPOCH=0",
|
|
22
|
+
"RUSTFLAGS=--remap-path-prefix=SOURCE=kiokuko-guardrail --remap-path-prefix=TEMP=build",
|
|
23
|
+
"cargo",
|
|
24
|
+
"build",
|
|
25
|
+
"--manifest-path",
|
|
26
|
+
"Cargo.toml",
|
|
27
|
+
"--locked",
|
|
28
|
+
"--offline",
|
|
29
|
+
"--release",
|
|
30
|
+
"--target",
|
|
31
|
+
"x86_64-unknown-linux-musl"
|
|
32
|
+
],
|
|
33
|
+
"rustc_sha256": "f3834d26669b03f6855fa54bd2381443123e860167bc0c7a8dd137e5cf6e5e4f",
|
|
34
|
+
"rustc_version": "rustc 1.99.0 (b940084d7 2026-09-28)\nbinary: rustc\ncommit-hash: b940084d7eb6a299eb4bfeb8e34901bc051e7ac4\ncommit-date: 2026-09-28\nhost: x86_64-unknown-linux-gnu\nrelease: 1.99.0\nLLVM version: 23.1.1",
|
|
35
|
+
"source_date_epoch": 0,
|
|
36
|
+
"target": "x86_64-unknown-linux-musl"
|
|
37
|
+
},
|
|
38
|
+
"package": "kiokuko-guardrail",
|
|
39
|
+
"schema": 1,
|
|
40
|
+
"scope": "Declared source/compiler/build inputs and artifact identity. This is not a signature, sandbox, or a claim of deterministic model inference or identical binaries across target operating systems.",
|
|
41
|
+
"source_sha256": "c835782d88444f03f9bce01106b75b9c071fa18543d51e7fcb754f403ba6deab",
|
|
42
|
+
"sources": {
|
|
43
|
+
"BOOTSTRAP.md": "b9d0db4c38561d6173e2396bfca979743c66fe64dc15f8c10931d5ae02800a95",
|
|
44
|
+
"Cargo.lock": "16f51b3ffc20349a69b4b580ea59d2354c9d496911c7e530509492d9b46ecb3a",
|
|
45
|
+
"Cargo.toml": "1cc0b8df18413f925841e6acddfe14a49f7e8dd4236660eb9d822f1ccdcc9d4e",
|
|
46
|
+
"README.md": "4b5d7c785121c865945f6379de31565c6aa9218f9d4333519ce3d450e85d0c55",
|
|
47
|
+
"examples/coding-routine.lisp": "82b56af81d12a8cab8352b0825c913f00f73708b2339a9b567cc6f4d4e52da49",
|
|
48
|
+
"scripts/package.py": "159b8cdda58b422a60aee95554eb0febc3b520d7ef5d5a4bac1cdd046a514e16",
|
|
49
|
+
"scripts/test.py": "d8ed547d0943f8b23838b146c6e1d31ad9004c525868d19a2fffafef67e6b6c9",
|
|
50
|
+
"src/digest.rs": "a46aa8ac0ba3f8e29e268a495723b6d49a4741399bb595c34a3d021dc295c800",
|
|
51
|
+
"src/eval.rs": "7742caeeac426783647363242d93845369c018b00528312573f1cdc668c22ec3",
|
|
52
|
+
"src/host.rs": "de9f34ad6ce8246e6f80cbf3d4f56bb07ed8043b17232135755a5e3ee5602cf5",
|
|
53
|
+
"src/lib.rs": "2f591de0e7520a313da9668491da106d904bb19ef2384c717e87cd06bac665a3",
|
|
54
|
+
"src/main.rs": "16a3a42d8338ca20e66173648c0a407b24724eeb1a4b3710c8a3b90b5aade10f",
|
|
55
|
+
"src/protocol.rs": "d9009f5977707141f3547902a07f2f2c5455e4b9516b01a9ba4eb22a82af2a39",
|
|
56
|
+
"src/reader.rs": "7bc1ff7aece72fc44ac43d5a207a3c8f2fd009eae41cb4b4dadb4eb9436d15f3",
|
|
57
|
+
"tests/cli.rs": "22955ba315007b4a18409b31439345eb84ce0a62b88658cf440d513b10811357",
|
|
58
|
+
"tests/digest.rs": "63a3a1b4963ef03260cae4ff9bfeed3596a445dc8df74ecc91b5750d3a6fa28d",
|
|
59
|
+
"tests/edge_contract.rs": "4f9c7b068db44e9beceb811ceac4a5e8d6cf7cda51eee5a2449f29ab0fa6ade9",
|
|
60
|
+
"tests/evaluator.rs": "a09c811494615b01e19ccef78491b8bbfee07fede8dcbee59f384fe59e145401",
|
|
61
|
+
"tests/packaging.rs": "61ae1bfed0d4f31748ce2af58953387045f4231370d46cb809f26e93aea1e033",
|
|
62
|
+
"tests/protocol.rs": "8f6b7ad5842f5b596efe8da01bba84f39fcd8d6426fde6932cb2a5cbb44d589f",
|
|
63
|
+
"tests/reader.rs": "249092f56768a6511dbb15825be55f4cf0105269cb9dba1d6f8169ff66d44ab5",
|
|
64
|
+
"tests/robustness.rs": "464c26addcf5188128d2e6eedd97cccccdb82ada0bc94a0648b77c8043118ba9"
|
|
65
|
+
},
|
|
66
|
+
"target": "x86_64-unknown-linux-musl",
|
|
67
|
+
"version": "0.1.0"
|
|
68
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
-- The ledger run is the task. These columns do not replace execution outcomes.
|
|
2
|
+
ALTER TABLE ledger_runs ADD COLUMN task_state TEXT NOT NULL DEFAULT 'ToDo'
|
|
3
|
+
CHECK(task_state IN ('ToDo','Working','Pending','Done','Ignore'));
|
|
4
|
+
ALTER TABLE ledger_runs ADD COLUMN task_revision INTEGER NOT NULL DEFAULT 1 CHECK(task_revision > 0);
|
|
5
|
+
ALTER TABLE ledger_runs ADD COLUMN task_generation INTEGER NOT NULL DEFAULT 1 CHECK(task_generation > 0);
|
|
6
|
+
ALTER TABLE ledger_runs ADD COLUMN task_repository_root TEXT;
|
|
7
|
+
ALTER TABLE ledger_runs ADD COLUMN task_owner_session_id TEXT;
|
|
8
|
+
ALTER TABLE ledger_runs ADD COLUMN task_reason TEXT NOT NULL DEFAULT '';
|
|
9
|
+
ALTER TABLE ledger_runs ADD COLUMN task_evidence_json TEXT NOT NULL DEFAULT '[]' CHECK(json_valid(task_evidence_json));
|
|
10
|
+
ALTER TABLE ledger_runs ADD COLUMN task_resumed INTEGER NOT NULL DEFAULT 0 CHECK(task_resumed IN (0,1));
|
|
11
|
+
ALTER TABLE ledger_runs ADD COLUMN task_managed INTEGER NOT NULL DEFAULT 0 CHECK(task_managed IN (0,1));
|
|
12
|
+
ALTER TABLE ledger_runs ADD COLUMN task_pending_stop_json TEXT CHECK(task_pending_stop_json IS NULL OR json_valid(task_pending_stop_json));
|
|
13
|
+
ALTER TABLE ledger_runs ADD COLUMN task_unresolved_json TEXT CHECK(task_unresolved_json IS NULL OR json_valid(task_unresolved_json));
|
|
14
|
+
ALTER TABLE ledger_runs ADD COLUMN task_previous_outcome_json TEXT CHECK(task_previous_outcome_json IS NULL OR json_valid(task_previous_outcome_json));
|
|
15
|
+
UPDATE ledger_runs SET task_state=CASE status WHEN 'active' THEN 'Working' WHEN 'completed' THEN 'Done'
|
|
16
|
+
WHEN 'failed' THEN 'Pending' WHEN 'cancelled' THEN 'Pending' WHEN 'interrupted' THEN 'Pending' ELSE 'ToDo' END,
|
|
17
|
+
task_repository_root=COALESCE((SELECT repository_root FROM dsh_coding_workflows WHERE run_id=ledger_runs.run_id),
|
|
18
|
+
(SELECT repository_root FROM enno_contracts WHERE run_id=ledger_runs.run_id));
|
|
19
|
+
|
|
20
|
+
-- Evidence is host-observed provenance, never a second task-state store.
|
|
21
|
+
CREATE TABLE ledger_task_evidence (
|
|
22
|
+
run_id TEXT NOT NULL REFERENCES ledger_runs(run_id) ON DELETE CASCADE,
|
|
23
|
+
evidence_ref TEXT NOT NULL,
|
|
24
|
+
generation INTEGER NOT NULL CHECK(generation > 0),
|
|
25
|
+
kind TEXT NOT NULL CHECK(kind IN ('verification','stopped')),
|
|
26
|
+
verified INTEGER NOT NULL CHECK(verified IN (0,1)),
|
|
27
|
+
details_json TEXT NOT NULL CHECK(json_valid(details_json)),
|
|
28
|
+
PRIMARY KEY(run_id,evidence_ref)
|
|
29
|
+
);
|
|
30
|
+
CREATE TRIGGER ledger_task_execution_outcome AFTER UPDATE OF status ON ledger_runs
|
|
31
|
+
WHEN NEW.status <> OLD.status AND NEW.task_revision=OLD.task_revision
|
|
32
|
+
BEGIN
|
|
33
|
+
UPDATE ledger_runs SET task_state=CASE
|
|
34
|
+
WHEN task_pending_stop_json IS NOT NULL THEN task_state
|
|
35
|
+
WHEN task_state IN ('Done','Ignore') THEN task_state
|
|
36
|
+
WHEN NEW.status IN ('completed','failed','cancelled','interrupted') THEN 'Pending'
|
|
37
|
+
WHEN NEW.status='active' AND task_managed=0 AND COALESCE(json_extract(metadata_json,'$.taskStateExplicit'),0)<>1 THEN 'Working'
|
|
38
|
+
ELSE task_state END,
|
|
39
|
+
task_revision=task_revision+1,task_generation=task_generation+1,task_resumed=0
|
|
40
|
+
WHERE run_id=NEW.run_id;
|
|
41
|
+
END;
|
|
42
|
+
CREATE TRIGGER ledger_task_terminal_owner_release AFTER UPDATE OF task_state ON ledger_runs
|
|
43
|
+
WHEN NEW.task_state IN ('Done','Ignore')
|
|
44
|
+
BEGIN DELETE FROM dsh_execution_owners WHERE run_id=NEW.run_id; END;
|
|
45
|
+
CREATE INDEX idx_ledger_task_session_state ON ledger_runs(dsh_session_id,task_state,updated_at);
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
-- Source history is provenance, not another task authority. Current jobs remain run-keyed.
|
|
2
|
+
ALTER TABLE dsh_memory_finalizations ADD COLUMN source_epoch INTEGER NOT NULL DEFAULT 1 CHECK(source_epoch>0);
|
|
3
|
+
ALTER TABLE dsh_memory_finalizations ADD COLUMN source_outcome TEXT CHECK(source_outcome IN ('completed','failed','cancelled','interrupted'));
|
|
4
|
+
CREATE TABLE dsh_task_source_history (
|
|
5
|
+
run_id TEXT NOT NULL REFERENCES ledger_runs(run_id) ON DELETE CASCADE,
|
|
6
|
+
source_epoch INTEGER NOT NULL CHECK(source_epoch>0),
|
|
7
|
+
source_session_id TEXT NOT NULL,
|
|
8
|
+
original_session_id TEXT NOT NULL,
|
|
9
|
+
task_generation INTEGER NOT NULL,
|
|
10
|
+
next_owner_session_id TEXT NOT NULL,
|
|
11
|
+
operation_id TEXT NOT NULL,
|
|
12
|
+
reason TEXT NOT NULL,
|
|
13
|
+
boundary_json TEXT CHECK(boundary_json IS NULL OR json_valid(boundary_json)),
|
|
14
|
+
finalization_json TEXT CHECK(finalization_json IS NULL OR json_valid(finalization_json)),
|
|
15
|
+
review_state_json TEXT CHECK(review_state_json IS NULL OR json_valid(review_state_json)),
|
|
16
|
+
archived_at TEXT NOT NULL,
|
|
17
|
+
PRIMARY KEY(run_id,source_epoch)
|
|
18
|
+
);
|
|
19
|
+
CREATE TABLE dsh_task_source_entries (
|
|
20
|
+
run_id TEXT NOT NULL, source_epoch INTEGER NOT NULL,
|
|
21
|
+
entry_id TEXT NOT NULL REFERENCES entries(id), ordinal INTEGER NOT NULL, created_at TEXT NOT NULL,
|
|
22
|
+
PRIMARY KEY(run_id,source_epoch,ordinal), UNIQUE(run_id,source_epoch,entry_id),
|
|
23
|
+
FOREIGN KEY(run_id,source_epoch) REFERENCES dsh_task_source_history(run_id,source_epoch) ON DELETE CASCADE
|
|
24
|
+
);
|
|
25
|
+
CREATE TRIGGER dsh_task_source_history_immutable BEFORE UPDATE ON dsh_task_source_history
|
|
26
|
+
WHEN NOT (
|
|
27
|
+
NEW.run_id=OLD.run_id AND NEW.source_epoch=OLD.source_epoch AND NEW.source_session_id=OLD.source_session_id
|
|
28
|
+
AND NEW.original_session_id=OLD.original_session_id AND NEW.task_generation=OLD.task_generation
|
|
29
|
+
AND NEW.next_owner_session_id=OLD.next_owner_session_id AND NEW.operation_id=OLD.operation_id AND NEW.reason=OLD.reason
|
|
30
|
+
AND NEW.boundary_json IS OLD.boundary_json AND NEW.review_state_json IS OLD.review_state_json AND NEW.archived_at=OLD.archived_at
|
|
31
|
+
AND json_remove(NEW.finalization_json,'$.staged_capsule_json','$.staged_binding_hash') IS json_remove(OLD.finalization_json,'$.staged_capsule_json','$.staged_binding_hash')
|
|
32
|
+
AND json_extract(NEW.finalization_json,'$.staged_capsule_json') IS NULL
|
|
33
|
+
AND json_extract(NEW.finalization_json,'$.staged_binding_hash') IS NULL
|
|
34
|
+
AND EXISTS(SELECT 1 FROM dsh_task_source_entries e JOIN memory_forget_tombstones t ON t.entry_id=e.entry_id WHERE e.run_id=OLD.run_id AND e.source_epoch=OLD.source_epoch)
|
|
35
|
+
)
|
|
36
|
+
BEGIN SELECT RAISE(ABORT,'task source history is immutable'); END;
|
|
37
|
+
CREATE TRIGGER finalizer_source_epoch_immutable BEFORE UPDATE OF source_epoch ON dsh_memory_finalizations
|
|
38
|
+
BEGIN SELECT RAISE(ABORT,'finalizer source epoch is immutable'); END;
|
|
39
|
+
DROP TRIGGER dsh_run_log_boundaries_run_guard;
|
|
40
|
+
CREATE TRIGGER dsh_run_log_boundaries_run_guard BEFORE INSERT ON dsh_run_log_boundaries
|
|
41
|
+
BEGIN
|
|
42
|
+
SELECT CASE WHEN NOT EXISTS (SELECT 1 FROM ledger_runs r WHERE r.run_id=NEW.run_id AND r.workspace=NEW.workspace
|
|
43
|
+
AND COALESCE(r.task_owner_session_id,r.dsh_session_id)=NEW.dsh_session_id AND r.status IN ('intake','active'))
|
|
44
|
+
THEN RAISE(ABORT,'log boundary requires its active DSH run owner') END;
|
|
45
|
+
END;
|
|
46
|
+
DROP TRIGGER dsh_memory_finalizations_run_guard;
|
|
47
|
+
CREATE TRIGGER dsh_memory_finalizations_run_guard BEFORE INSERT ON dsh_memory_finalizations
|
|
48
|
+
BEGIN
|
|
49
|
+
SELECT CASE WHEN NOT EXISTS (SELECT 1 FROM ledger_runs r WHERE r.run_id=NEW.run_id AND r.workspace=NEW.workspace
|
|
50
|
+
AND COALESCE(r.task_owner_session_id,r.dsh_session_id)=NEW.dsh_session_id
|
|
51
|
+
AND (r.status='completed' OR r.status='failed' AND NEW.extraction_version=2
|
|
52
|
+
OR r.task_state IN ('Pending','Ignore') AND NEW.source_outcome IN ('failed','cancelled','interrupted') AND EXISTS(
|
|
53
|
+
SELECT 1 FROM ledger_task_evidence e JOIN json_each(r.task_evidence_json) proof ON proof.value=e.evidence_ref
|
|
54
|
+
WHERE e.run_id=r.run_id AND e.generation=r.task_generation-1 AND e.kind='stopped' AND e.verified=1)
|
|
55
|
+
OR r.task_state='Done' AND NEW.source_outcome='completed' AND EXISTS(
|
|
56
|
+
SELECT 1 FROM ledger_task_evidence e JOIN json_each(r.task_evidence_json) proof ON proof.value=e.evidence_ref
|
|
57
|
+
WHERE e.run_id=r.run_id AND e.generation=r.task_generation-1 AND e.kind='verification' AND e.verified=1)))
|
|
58
|
+
THEN RAISE(ABORT,'memory finalization requires its terminal DSH run owner') END;
|
|
59
|
+
SELECT CASE WHEN NOT EXISTS (SELECT 1 FROM dsh_run_log_boundaries b WHERE b.run_id=NEW.run_id AND b.workspace=NEW.workspace
|
|
60
|
+
AND b.dsh_session_id=NEW.dsh_session_id AND b.source_start_seq=NEW.source_start_seq)
|
|
61
|
+
THEN RAISE(ABORT,'memory finalization requires its bound DSH log start') END;
|
|
62
|
+
SELECT CASE WHEN NEW.source_epoch<>(SELECT COALESCE(MAX(source_epoch),0)+1 FROM dsh_task_source_history WHERE run_id=NEW.run_id)
|
|
63
|
+
THEN RAISE(ABORT,'memory finalization requires its current source epoch') END;
|
|
64
|
+
END;
|
|
65
|
+
|
|
66
|
+
-- Mutable delivery state for a fixed archived source range; the archival snapshot above stays immutable.
|
|
67
|
+
CREATE TABLE dsh_task_source_finalizations (
|
|
68
|
+
run_id TEXT NOT NULL, source_epoch INTEGER NOT NULL,
|
|
69
|
+
job_json TEXT NOT NULL CHECK(json_valid(job_json)),
|
|
70
|
+
PRIMARY KEY(run_id,source_epoch),
|
|
71
|
+
FOREIGN KEY(run_id,source_epoch) REFERENCES dsh_task_source_history(run_id,source_epoch) ON DELETE CASCADE,
|
|
72
|
+
CHECK(json_extract(job_json,'$.run_id')=run_id AND json_extract(job_json,'$.source_epoch')=source_epoch)
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
CREATE TRIGGER dsh_task_source_job_identity BEFORE UPDATE ON dsh_task_source_finalizations
|
|
76
|
+
WHEN NEW.run_id<>OLD.run_id OR NEW.source_epoch<>OLD.source_epoch
|
|
77
|
+
OR json_extract(NEW.job_json,'$.run_id') IS NOT json_extract(OLD.job_json,'$.run_id')
|
|
78
|
+
OR json_extract(NEW.job_json,'$.source_epoch') IS NOT json_extract(OLD.job_json,'$.source_epoch')
|
|
79
|
+
OR json_extract(NEW.job_json,'$.workspace') IS NOT json_extract(OLD.job_json,'$.workspace')
|
|
80
|
+
OR json_extract(NEW.job_json,'$.dsh_session_id') IS NOT json_extract(OLD.job_json,'$.dsh_session_id')
|
|
81
|
+
OR json_extract(NEW.job_json,'$.source_start_seq') IS NOT json_extract(OLD.job_json,'$.source_start_seq')
|
|
82
|
+
OR json_extract(NEW.job_json,'$.source_end_seq') IS NOT json_extract(OLD.job_json,'$.source_end_seq')
|
|
83
|
+
OR json_extract(NEW.job_json,'$.outcome') IS NOT json_extract(OLD.job_json,'$.outcome')
|
|
84
|
+
OR json_extract(NEW.job_json,'$.source_generation') IS NOT json_extract(OLD.job_json,'$.source_generation')
|
|
85
|
+
BEGIN SELECT RAISE(ABORT,'archived finalization source identity is immutable'); END;
|
|
86
|
+
|
|
87
|
+
CREATE TRIGGER finalizer_source_outcome_immutable BEFORE UPDATE OF source_outcome ON dsh_memory_finalizations
|
|
88
|
+
BEGIN SELECT RAISE(ABORT,'finalizer source outcome is immutable'); END;
|