@astrosheep/keiyaku 4.6.30 → 4.6.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/build/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/build/plugins/claude/skills/keiyaku/SKILL.md +12 -12
- package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +16 -16
- package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +14 -14
- package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +10 -10
- package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +15 -15
- package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +16 -16
- package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +21 -21
- package/build/plugins/codex/.codex-plugin/plugin.json +1 -1
- package/build/plugins/codex/skills/keiyaku/SKILL.md +12 -12
- package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +16 -16
- package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +14 -14
- package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +10 -10
- package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +15 -15
- package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +16 -16
- package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +21 -21
- package/build/plugins/opencode/package.json +1 -1
- package/build/plugins/opencode/skills/keiyaku/SKILL.md +12 -12
- package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +16 -16
- package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +14 -14
- package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +10 -10
- package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +15 -15
- package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +16 -16
- package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +21 -21
- package/build/plugins/pi/README.md +5 -5
- package/build/plugins/pi/akuma-tools.ts +17 -23
- package/build/skills/keiyaku/SKILL.md +12 -12
- package/build/skills/keiyaku-akuma/SKILL.md +16 -16
- package/build/skills/keiyaku-akuma/references/automation.md +14 -14
- package/build/skills/keiyaku-babysit/SKILL.md +10 -10
- package/build/skills/keiyaku-bind/SKILL.md +15 -15
- package/build/skills/keiyaku-debt/SKILL.md +16 -16
- package/build/skills/keiyaku-workflow/SKILL.md +21 -21
- package/build/src/akuma/akuma-call.d.ts +1 -1
- package/build/src/akuma/akuma-call.js +9 -9
- package/build/src/akuma/akuma-errors.d.ts +5 -5
- package/build/src/akuma/akuma-instance.d.ts +355 -12
- package/build/src/akuma/akuma-instance.js +20 -20
- package/build/src/akuma/akuma-observe.d.ts +11 -12
- package/build/src/akuma/akuma-observe.js +34 -26
- package/build/src/akuma/akuma-owner.d.ts +32 -11
- package/build/src/akuma/akuma-owner.js +35 -16
- package/build/src/akuma/akuma-probe.d.ts +3 -3
- package/build/src/akuma/akuma-probe.js +2 -2
- package/build/src/akuma/akuma-selection-execution.d.ts +985 -1
- package/build/src/akuma/akuma-selection-execution.js +42 -18
- package/build/src/akuma/akuma-stream.d.ts +2 -2
- package/build/src/akuma/akuma-stream.js +1 -1
- package/build/src/akuma/akuma-wait.d.ts +5 -5
- package/build/src/akuma/akuma-wait.js +52 -14
- package/build/src/akuma/akuma.d.ts +245 -271
- package/build/src/akuma/akuma.js +98 -46
- package/build/src/akuma/archetype.d.ts +19 -6
- package/build/src/akuma/archetype.js +25 -9
- package/build/src/akuma/body-launch.d.ts +2 -2
- package/build/src/akuma/body.js +4 -4
- package/build/src/akuma/call-initial-tell.d.ts +60 -44
- package/build/src/akuma/call-initial-tell.js +41 -2
- package/build/src/akuma/caller.d.ts +26 -17
- package/build/src/akuma/caller.js +22 -9
- package/build/src/akuma/coordinate.d.ts +9 -0
- package/build/src/akuma/coordinate.js +13 -0
- package/build/src/akuma/detached-body.js +2 -2
- package/build/src/akuma/dispatch-association.d.ts +4 -4
- package/build/src/akuma/dispatch-association.js +12 -3
- package/build/src/akuma/execution-instructions.js +2 -2
- package/build/src/akuma/heart/facts.d.ts +29 -7
- package/build/src/akuma/heart/facts.js +13 -0
- package/build/src/akuma/heart/index.d.ts +0 -3
- package/build/src/akuma/heart/index.js +3 -6
- package/build/src/akuma/heart/rows.js +2 -2
- package/build/src/akuma/heart/soul.js +5 -5
- package/build/src/akuma/identity.d.ts +17 -16
- package/build/src/akuma/identity.js +20 -19
- package/build/src/akuma/index.d.ts +1 -2
- package/build/src/akuma/lineage-cache.d.ts +4 -4
- package/build/src/akuma/lineage-cache.js +10 -10
- package/build/src/akuma/projection-read.d.ts +2 -5
- package/build/src/akuma/projection-read.js +34 -47
- package/build/src/akuma/projection.d.ts +659 -569
- package/build/src/akuma/projection.js +203 -94
- package/build/src/akuma/providers/acp/index.js +1 -1
- package/build/src/akuma/providers/execution-environment.d.ts +1 -3
- package/build/src/akuma/providers/execution-environment.js +0 -4
- package/build/src/akuma/publication.d.ts +2 -2
- package/build/src/akuma/publication.js +3 -3
- package/build/src/akuma/retention.js +2 -2
- package/build/src/akuma/selection-observation.d.ts +507 -43
- package/build/src/akuma/selection-observation.js +153 -1
- package/build/src/akuma/status-projection.d.ts +288 -0
- package/build/src/akuma/status-projection.js +154 -0
- package/build/src/akuma/turn-drive.js +0 -3
- package/build/src/alias/index.d.ts +9 -4
- package/build/src/alias/index.js +11 -9
- package/build/src/bounded-list.d.ts +8 -0
- package/build/src/bounded-list.js +9 -0
- package/build/src/cli/commands/akuma-grammar.d.ts +2 -2
- package/build/src/cli/commands/akuma-grammar.js +21 -21
- package/build/src/cli/commands/akuma.d.ts +1 -2
- package/build/src/cli/commands/akuma.js +115 -251
- package/build/src/cli/commands/contract-grammar.d.ts +4 -3
- package/build/src/cli/commands/contract-grammar.js +39 -22
- package/build/src/cli/commands/contract-help.d.ts +3 -1
- package/build/src/cli/commands/contract-help.js +4 -3
- package/build/src/cli/commands/contract.d.ts +6 -3
- package/build/src/cli/commands/contract.js +203 -434
- package/build/src/cli/commands/debt.d.ts +2 -3
- package/build/src/cli/commands/debt.js +101 -317
- package/build/src/cli/commands/report.js +11 -28
- package/build/src/cli/commands/whoami.d.ts +3 -43
- package/build/src/cli/commands/whoami.js +8 -121
- package/build/src/cli/coordinates.d.ts +4 -35
- package/build/src/cli/coordinates.js +13 -129
- package/build/src/cli/parse.d.ts +0 -6
- package/build/src/cli/parse.js +5 -48
- package/build/src/cli/render/akuma-activity.d.ts +31 -16
- package/build/src/cli/render/akuma-activity.js +157 -149
- package/build/src/cli/render/akuma-tool.d.ts +3 -6
- package/build/src/cli/render/akuma-tool.js +20 -14
- package/build/src/cli/render/akuma.d.ts +25 -26
- package/build/src/cli/render/akuma.js +100 -129
- package/build/src/cli/render/catalog.d.ts +4 -7
- package/build/src/cli/render/catalog.js +52 -99
- package/build/src/cli/render/contract-history.d.ts +3 -1
- package/build/src/cli/render/contract-history.js +140 -215
- package/build/src/cli/render/contract-observation.d.ts +43 -30
- package/build/src/cli/render/contract-observation.js +64 -31
- package/build/src/cli/render/contract-wait.js +6 -6
- package/build/src/cli/render/contract.d.ts +41 -6
- package/build/src/cli/render/contract.js +274 -370
- package/build/src/cli/render/debt.d.ts +9 -19
- package/build/src/cli/render/debt.js +120 -185
- package/build/src/cli/render/delivery-preview.d.ts +4 -3
- package/build/src/cli/render/delivery-preview.js +68 -96
- package/build/src/cli/render/kanshi-akuma.d.ts +4 -4
- package/build/src/cli/render/kanshi-akuma.js +70 -59
- package/build/src/cli/render/kanshi.d.ts +4 -4
- package/build/src/cli/render/kanshi.js +205 -221
- package/build/src/cli/render/marks.d.ts +11 -2
- package/build/src/cli/render/marks.js +13 -3
- package/build/src/cli/render/nuke.d.ts +3 -3
- package/build/src/cli/render/nuke.js +13 -16
- package/build/src/cli/render/receipt.d.ts +37 -43
- package/build/src/cli/render/receipt.js +313 -236
- package/build/src/cli/render/reconcile.d.ts +6 -4
- package/build/src/cli/render/reconcile.js +53 -137
- package/build/src/cli/render/refusal.d.ts +3 -2
- package/build/src/cli/render/refusal.js +73 -54
- package/build/src/cli/render/region.d.ts +11 -2
- package/build/src/cli/render/region.js +17 -23
- package/build/src/cli/render/settings.d.ts +0 -1
- package/build/src/cli/render/settings.js +8 -17
- package/build/src/cli/render/terminal.d.ts +2 -0
- package/build/src/cli/render/verbs.d.ts +4 -0
- package/build/src/cli/render/verbs.js +312 -0
- package/build/src/cli/render/whoami.d.ts +1 -1
- package/build/src/cli/render/whoami.js +24 -31
- package/build/src/cli/runtime.d.ts +3 -11
- package/build/src/cli/runtime.js +96 -79
- package/build/src/cli/scan.d.ts +1 -1
- package/build/src/cli/streams.js +1 -0
- package/build/src/contract-guidance.js +2 -2
- package/build/src/contract-worktree.d.ts +2 -15
- package/build/src/contract-worktree.js +19 -35
- package/build/src/core/facts/observation.d.ts +4 -5
- package/build/src/core/facts/observation.js +7 -9
- package/build/src/core/verbs/amend.d.ts +0 -1
- package/build/src/core/verbs/amend.js +3 -3
- package/build/src/core/verbs/bind.d.ts +0 -1
- package/build/src/core/verbs/bind.js +5 -5
- package/build/src/core/verbs/deliver.d.ts +3 -2
- package/build/src/core/verbs/deliver.js +2 -2
- package/build/src/core/verbs/placement.d.ts +0 -5
- package/build/src/core/verbs/placement.js +4 -6
- package/build/src/core/verbs/reintegrate.d.ts +0 -1
- package/build/src/core/verbs/reintegrate.js +2 -2
- package/build/src/debt/board.d.ts +132 -116
- package/build/src/debt/board.js +138 -94
- package/build/src/debt/catalog.d.ts +4 -4
- package/build/src/debt/catalog.js +2 -18
- package/build/src/debt/context.d.ts +15 -3
- package/build/src/debt/context.js +12 -1
- package/build/src/debt/created-observation.d.ts +5 -17
- package/build/src/debt/created-observation.js +14 -6
- package/build/src/debt/document.d.ts +20 -15
- package/build/src/debt/document.js +18 -1
- package/build/src/debt/index.d.ts +346 -23
- package/build/src/debt/index.js +68 -22
- package/build/src/debt/input.d.ts +2 -1
- package/build/src/debt/input.js +14 -0
- package/build/src/debt/lifecycle-operations.d.ts +2 -2
- package/build/src/debt/lifecycle-operations.js +14 -22
- package/build/src/debt/operation-types.d.ts +188 -66
- package/build/src/debt/operation-types.js +113 -1
- package/build/src/debt/operations.d.ts +11 -10
- package/build/src/debt/operations.js +46 -71
- package/build/src/debt/query.d.ts +14 -10
- package/build/src/debt/query.js +3 -12
- package/build/src/debt/store.d.ts +4 -2
- package/build/src/debt/store.js +8 -8
- package/build/src/debt/view.d.ts +0 -3
- package/build/src/debt/view.js +0 -4
- package/build/src/dispatch/index.d.ts +22 -5
- package/build/src/dispatch/index.js +46 -37
- package/build/src/git/admission.d.ts +2 -2
- package/build/src/git/admission.js +2 -1
- package/build/src/git/hooks.d.ts +14 -35
- package/build/src/git/hooks.js +45 -25
- package/build/src/git/integration.d.ts +6 -24
- package/build/src/git/integration.js +10 -16
- package/build/src/git/private-state-seat.d.ts +2 -2
- package/build/src/git/private-state-seat.js +2 -1
- package/build/src/git/reconcile.d.ts +17 -79
- package/build/src/git/reconcile.js +37 -52
- package/build/src/git/scratch.d.ts +3 -3
- package/build/src/git/scratch.js +4 -1
- package/build/src/git/target-placement.d.ts +23 -31
- package/build/src/git/target-placement.js +42 -27
- package/build/src/git/target.d.ts +2 -2
- package/build/src/git/target.js +2 -1
- package/build/src/git/tender.d.ts +7 -39
- package/build/src/git/tender.js +21 -54
- package/build/src/git/terminal-reconcile.js +15 -18
- package/build/src/git/terminal-seal.d.ts +2 -4
- package/build/src/git/terminal-seal.js +7 -33
- package/build/src/git/workspace.d.ts +65 -41
- package/build/src/git/workspace.js +45 -14
- package/build/src/identity/selector.d.ts +2 -0
- package/build/src/identity/selector.js +13 -3
- package/build/src/index.d.ts +48 -54
- package/build/src/index.js +31 -43
- package/build/src/kanshi/counts.d.ts +42 -8
- package/build/src/kanshi/counts.js +13 -2
- package/build/src/kanshi/index.d.ts +5 -5
- package/build/src/kanshi/index.js +4 -3
- package/build/src/kanshi/read.d.ts +489 -6
- package/build/src/kanshi/read.js +334 -483
- package/build/src/kanshi/report.d.ts +2504 -103
- package/build/src/kanshi/report.js +165 -1
- package/build/src/kanshi/select.d.ts +0 -8
- package/build/src/kanshi/select.js +20 -59
- package/build/src/library/address.d.ts +8 -8
- package/build/src/library/address.js +7 -7
- package/build/src/library/akuma-creation.d.ts +690 -84
- package/build/src/library/akuma-creation.js +202 -142
- package/build/src/library/akuma-retention.d.ts +2 -2
- package/build/src/library/akuma-retention.js +2 -2
- package/build/src/library/akumas.d.ts +10 -6
- package/build/src/library/akumas.js +24 -7
- package/build/src/library/bind.d.ts +28 -54
- package/build/src/library/bind.js +6 -4
- package/build/src/library/continuation.d.ts +197 -479
- package/build/src/library/continuation.js +40 -23
- package/build/src/library/contract-address.d.ts +6 -5
- package/build/src/library/contract-address.js +5 -7
- package/build/src/library/contract-composition.d.ts +18 -12
- package/build/src/library/contract-composition.js +55 -47
- package/build/src/library/contract-creation.d.ts +3 -2
- package/build/src/library/contract-creation.js +38 -32
- package/build/src/library/contract-execution.js +77 -38
- package/build/src/library/contract-outcomes.d.ts +1877 -27
- package/build/src/library/contract-outcomes.js +93 -10
- package/build/src/library/contract-settings.d.ts +2 -2
- package/build/src/library/contract-settings.js +18 -14
- package/build/src/library/contract-types.d.ts +238 -61
- package/build/src/library/contract-types.js +131 -1
- package/build/src/library/contract-wait.d.ts +38 -17
- package/build/src/library/contract-wait.js +40 -10
- package/build/src/library/delivery.d.ts +588 -36
- package/build/src/library/delivery.js +35 -27
- package/build/src/library/input.d.ts +1 -1
- package/build/src/library/input.js +1 -2
- package/build/src/library/invocation.d.ts +11 -7
- package/build/src/library/invocation.js +42 -51
- package/build/src/library/kei.d.ts +48 -0
- package/build/src/library/kei.js +256 -0
- package/build/src/library/keiyaku-attribution.d.ts +11 -0
- package/build/src/{cli/delivery-identity.js → library/keiyaku-attribution.js} +12 -1
- package/build/src/library/keiyaku-classify.d.ts +11 -0
- package/build/src/library/keiyaku-classify.js +146 -0
- package/build/src/library/keiyaku-coordinates.d.ts +31 -0
- package/build/src/library/keiyaku-coordinates.js +103 -0
- package/build/src/library/keiyaku-debt.d.ts +142 -0
- package/build/src/library/keiyaku-debt.js +188 -0
- package/build/src/library/keiyaku-identity.d.ts +58 -0
- package/build/src/library/keiyaku-identity.js +176 -0
- package/build/src/library/keiyaku-policy.d.ts +27 -0
- package/build/src/library/keiyaku-policy.js +44 -0
- package/build/src/library/keiyaku-status.d.ts +1487 -0
- package/build/src/library/keiyaku-status.js +92 -0
- package/build/src/library/keiyaku-verbs.d.ts +6774 -0
- package/build/src/library/keiyaku-verbs.js +458 -0
- package/build/src/library/keiyaku.d.ts +871 -38
- package/build/src/library/keiyaku.js +677 -127
- package/build/src/library/nuke.d.ts +22 -0
- package/build/src/library/nuke.js +4 -1
- package/build/src/library/outcome.d.ts +706 -692
- package/build/src/library/outcome.js +582 -167
- package/build/src/library/reconcile.d.ts +464 -116
- package/build/src/library/reconcile.js +174 -102
- package/build/src/library/refusal.d.ts +113 -577
- package/build/src/library/refusal.js +64 -51
- package/build/src/library/region.d.ts +5 -24
- package/build/src/library/region.js +6 -21
- package/build/src/library/selection.d.ts +181 -32
- package/build/src/library/selection.js +99 -64
- package/build/src/mcp/adapter.d.ts +11 -0
- package/build/src/mcp/adapter.js +106 -0
- package/build/src/mcp/help.d.ts +1 -0
- package/build/src/mcp/help.js +26 -0
- package/build/src/mcp/index.d.ts +2 -0
- package/build/src/mcp/index.js +37 -0
- package/build/src/plugin/public.d.ts +1 -1
- package/build/src/plugin/runtime.js +17 -14
- package/build/src/protocol/arc.d.ts +4 -1
- package/build/src/protocol/arc.js +7 -1
- package/build/src/protocol/attempt.d.ts +2 -3
- package/build/src/protocol/attempt.js +1 -10
- package/build/src/protocol/bind.d.ts +6 -7
- package/build/src/protocol/bind.js +9 -5
- package/build/src/protocol/completion.d.ts +448 -12
- package/build/src/protocol/completion.js +164 -26
- package/build/src/protocol/deliver.d.ts +26 -24
- package/build/src/protocol/deliver.js +24 -52
- package/build/src/protocol/delivery-preview.d.ts +97 -247
- package/build/src/protocol/delivery-preview.js +132 -128
- package/build/src/protocol/execution-observation.d.ts +146 -123
- package/build/src/protocol/execution-observation.js +9 -6
- package/build/src/protocol/intent.d.ts +9 -48
- package/build/src/protocol/intent.js +32 -46
- package/build/src/protocol/operations.d.ts +207 -505
- package/build/src/protocol/operations.js +81 -134
- package/build/src/protocol/placement.d.ts +0 -1
- package/build/src/protocol/placement.js +5 -2
- package/build/src/protocol/progress.d.ts +7 -97
- package/build/src/protocol/progress.js +7 -55
- package/build/src/protocol/read/observation.d.ts +13 -6
- package/build/src/protocol/read/observation.js +10 -9
- package/build/src/protocol/read/status.d.ts +464 -93
- package/build/src/protocol/read/status.js +372 -85
- package/build/src/protocol/reconcile.d.ts +2 -0
- package/build/src/protocol/reconcile.js +12 -11
- package/build/src/protocol/reintegrate.d.ts +0 -1
- package/build/src/protocol/reintegrate.js +4 -4
- package/build/src/protocol/result-leaves.d.ts +528 -0
- package/build/src/protocol/result-leaves.js +195 -0
- package/build/src/protocol/result-reasons.d.ts +129 -0
- package/build/src/protocol/result-reasons.js +87 -0
- package/build/src/protocol/review.d.ts +14 -11
- package/build/src/protocol/review.js +30 -14
- package/build/src/protocol/run.d.ts +4 -4
- package/build/src/protocol/run.js +4 -1
- package/build/src/protocol/verify.d.ts +359 -30
- package/build/src/protocol/verify.js +118 -28
- package/build/src/region.d.ts +26 -0
- package/build/src/region.js +28 -0
- package/build/src/runtime/proc/diagnostic.d.ts +11 -0
- package/build/src/runtime/proc/diagnostic.js +20 -0
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settings.d.ts +126 -32
- package/build/src/settings.js +107 -34
- package/build/src/settlement/settle.d.ts +29 -12
- package/build/src/settlement/settle.js +22 -15
- package/build/src/verification/declaration.d.ts +1 -3
- package/build/src/verification/declaration.js +2 -5
- package/build/src/verification/execution.d.ts +7 -19
- package/build/src/verification/execution.js +37 -16
- package/build/src/verification/observation.d.ts +13 -13
- package/build/src/verification/observation.js +9 -7
- package/build/src/world.d.ts +8 -0
- package/build/src/world.js +7 -0
- package/package.json +6 -5
- package/plugins/paseo/plugin/server/keiyaku.ts +13 -46
- package/plugins/paseo/plugin/server/message.ts +8 -30
- package/plugins/paseo/plugin/server/mirror.ts +16 -20
- package/plugins/paseo/plugin/server/provider.ts +1 -1
- package/plugins/paseo/plugin/server/sdk.ts +14 -6
- package/plugins/pi/README.md +5 -5
- package/plugins/pi/akuma-tools.ts +17 -23
- package/skills/keiyaku/SKILL.md +12 -12
- package/skills/keiyaku-akuma/SKILL.md +16 -16
- package/skills/keiyaku-akuma/references/automation.md +14 -14
- package/skills/keiyaku-babysit/SKILL.md +10 -10
- package/skills/keiyaku-bind/SKILL.md +15 -15
- package/skills/keiyaku-debt/SKILL.md +16 -16
- package/skills/keiyaku-workflow/SKILL.md +21 -21
- package/build/src/cli/actor.d.ts +0 -10
- package/build/src/cli/actor.js +0 -24
- package/build/src/cli/akuma-caller.d.ts +0 -3
- package/build/src/cli/akuma-caller.js +0 -31
- package/build/src/cli/delivery-identity.d.ts +0 -3
- package/build/src/cli/render/effects.d.ts +0 -26
- package/build/src/cli/render/effects.js +0 -41
- package/build/src/cli/selectors.d.ts +0 -10
- package/build/src/cli/selectors.js +0 -42
- package/build/src/markdown/diff.d.ts +0 -1
- package/build/src/markdown/diff.js +0 -4
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { boundedListLimit } from "../bounded-list.js";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import {
|
|
3
|
+
import { gateReportSchema } from "./result-leaves.js";
|
|
4
|
+
export { deliverDataSchema, gateSchema, verdictSchema, candidateContentChangeSchema, gateCurrentSchema, requirementIdSchema, requirementReportSchema, gateReportSchema, } from "./result-leaves.js";
|
|
5
|
+
import { contractIdSchema, snapshotIdSchema } from "../git/identity.js";
|
|
6
|
+
import { integrationPreparationRefusalSchema } from "../git/integration.js";
|
|
6
7
|
import { observeContractAt } from "../git/observe.js";
|
|
7
8
|
import { withGitReadObservation } from "../git/read-observation.js";
|
|
8
9
|
import { currentBranch, repositoryAt } from "../git/repository.js";
|
|
9
10
|
import { checkoutNotFollowableRefusalSchema } from "../git/target-placement.js";
|
|
11
|
+
export { checkoutNotFollowableRefusalSchema } from "../git/target-placement.js";
|
|
10
12
|
import { targetWorkspaceRefusalSchema } from "../git/target.js";
|
|
11
|
-
import { dirtyWorkspaceRefusalSchema,
|
|
12
|
-
import { conflictRecoverySchema, worktreeWorkspaceSchema } from "../git/workspace.js";
|
|
13
|
+
import { dirtyWorkspaceRefusalSchema, worktreeMissingRefusalSchema } from "../git/tender.js";
|
|
13
14
|
import { forkSourceMovedRefusalSchema, targetInputRefusalSchema } from "./bind.js";
|
|
14
15
|
import { admitIntent } from "./intent.js";
|
|
15
16
|
import { verificationRuntimeStopSchema } from "./intent.js";
|
|
@@ -19,168 +20,116 @@ import { readContractBoard, readContractCatalogue, readContractObservationAt, }
|
|
|
19
20
|
import { protocolTerminalSchema } from "./run.js";
|
|
20
21
|
export { changeIdSchema, contractIdSchema, snapshotIdSchema } from "../git/identity.js";
|
|
21
22
|
export { entryUlidSchema } from "./attempt.js";
|
|
22
|
-
export const gateSchema = z.string().transform((value, context) => {
|
|
23
|
-
try {
|
|
24
|
-
return gate(value);
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
context.addIssue({ code: "custom", message: "invalid gate" });
|
|
28
|
-
return z.NEVER;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
export const deliverDataSchema = z
|
|
32
|
-
.object({
|
|
33
|
-
note: z
|
|
34
|
-
.string()
|
|
35
|
-
.refine((value) => value.trim() !== "")
|
|
36
|
-
.optional(),
|
|
37
|
-
tenderSnapshot: snapshotIdSchema,
|
|
38
|
-
integration: z
|
|
39
|
-
.object({ predecessor: snapshotIdSchema, snapshot: snapshotIdSchema, changeId: changeIdSchema })
|
|
40
|
-
.strict(),
|
|
41
|
-
method: z.literal("squash"),
|
|
42
|
-
policy: z.object({ requireBranchesToBeUpToDate: z.boolean() }).strict(),
|
|
43
|
-
})
|
|
44
|
-
.strict();
|
|
45
|
-
export const verdictSchema = z.enum(["satisfied", "unsatisfied"]);
|
|
46
23
|
export const activeContractRefusalSchema = z
|
|
47
|
-
.object({ kind: z.enum(["contract-missing", "terminal"])
|
|
48
|
-
.strict()
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"contract-exists",
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"target-contract-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
24
|
+
.object({ kind: z.enum(["contract-missing", "terminal"]) })
|
|
25
|
+
.strict()
|
|
26
|
+
.readonly();
|
|
27
|
+
export const bindRefusalSchema = z.union([
|
|
28
|
+
z
|
|
29
|
+
.object({ kind: z.enum(["contract-exists", "invalid-after", "unknown-prerequisite"]) })
|
|
30
|
+
.strict()
|
|
31
|
+
.readonly(),
|
|
32
|
+
z
|
|
33
|
+
.object({
|
|
34
|
+
kind: z.enum(["target-contract-missing", "target-contract-terminal"]),
|
|
35
|
+
targetContractId: contractIdSchema,
|
|
36
|
+
})
|
|
37
|
+
.strict()
|
|
38
|
+
.readonly(),
|
|
39
|
+
]);
|
|
62
40
|
export const amendRefusalSchema = z
|
|
63
41
|
.object({
|
|
64
42
|
kind: z.enum(["contract-missing", "terminal", "terms-moved", "unknown-prerequisite", "cyclic-prerequisite"]),
|
|
65
|
-
contractId: contractIdSchema,
|
|
66
|
-
})
|
|
67
|
-
.strict();
|
|
68
|
-
export const deliverRefusalSchema = z
|
|
69
|
-
.object({
|
|
70
|
-
kind: z.enum([
|
|
71
|
-
"contract-missing",
|
|
72
|
-
"terminal",
|
|
73
|
-
"document-moved",
|
|
74
|
-
"target-contract-missing",
|
|
75
|
-
"target-contract-terminal",
|
|
76
|
-
"target-contract-self",
|
|
77
|
-
]),
|
|
78
|
-
contractId: contractIdSchema,
|
|
79
43
|
})
|
|
80
|
-
.strict()
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
.strict();
|
|
84
|
-
export const candidateContentChangeSchema = z
|
|
85
|
-
.object({
|
|
86
|
-
kind: z.literal("candidate-content-changed"),
|
|
87
|
-
target: z.string().optional(),
|
|
88
|
-
previousChange: changeIdSchema,
|
|
89
|
-
currentChange: changeIdSchema,
|
|
90
|
-
})
|
|
91
|
-
.strict();
|
|
92
|
-
export const gateCurrentSchema = z.union([
|
|
93
|
-
z.object({ kind: z.literal("missing") }).strict(),
|
|
44
|
+
.strict()
|
|
45
|
+
.readonly();
|
|
46
|
+
export const deliverRefusalSchema = z.union([
|
|
94
47
|
z
|
|
95
|
-
.object({ kind: z.
|
|
96
|
-
.strict()
|
|
48
|
+
.object({ kind: z.enum(["contract-missing", "terminal"]) })
|
|
49
|
+
.strict()
|
|
50
|
+
.readonly(),
|
|
97
51
|
z
|
|
98
|
-
.object({
|
|
99
|
-
.
|
|
52
|
+
.object({
|
|
53
|
+
kind: z.enum(["target-contract-missing", "target-contract-terminal"]),
|
|
54
|
+
targetContractId: contractIdSchema,
|
|
55
|
+
})
|
|
56
|
+
.strict()
|
|
57
|
+
.readonly(),
|
|
100
58
|
]);
|
|
101
|
-
export const
|
|
102
|
-
.
|
|
103
|
-
.
|
|
104
|
-
.
|
|
105
|
-
export const requirementReportSchema = z
|
|
106
|
-
.object({
|
|
107
|
-
requirement: requirementIdSchema,
|
|
108
|
-
current: gateCurrentSchema,
|
|
109
|
-
})
|
|
110
|
-
.strict();
|
|
111
|
-
export const gateReportSchema = z
|
|
112
|
-
.object({
|
|
113
|
-
gate: gateSchema,
|
|
114
|
-
requirements: z.array(requirementReportSchema).readonly(),
|
|
115
|
-
satisfied: z.boolean(),
|
|
116
|
-
current: gateCurrentSchema,
|
|
117
|
-
})
|
|
118
|
-
.strict();
|
|
59
|
+
export const verificationDeclarationRefusalSchema = z
|
|
60
|
+
.object({ kind: z.literal("verification-declaration-invalid") })
|
|
61
|
+
.strict()
|
|
62
|
+
.readonly();
|
|
119
63
|
export const verifyRefusalSchema = z.union([
|
|
120
|
-
z
|
|
64
|
+
z
|
|
65
|
+
.object({ kind: z.literal("verification-not-selected") })
|
|
66
|
+
.strict()
|
|
67
|
+
.readonly(),
|
|
121
68
|
z
|
|
122
69
|
.object({
|
|
123
70
|
kind: z.literal("verification-index-out-of-range"),
|
|
124
|
-
contractId: contractIdSchema,
|
|
125
|
-
index: z.number().int().positive(),
|
|
126
71
|
total: z.number().int().nonnegative(),
|
|
127
72
|
})
|
|
128
|
-
.strict()
|
|
73
|
+
.strict()
|
|
74
|
+
.readonly(),
|
|
129
75
|
]);
|
|
130
76
|
export const placementRefusalSchema = z.union([
|
|
131
77
|
z
|
|
132
78
|
.object({
|
|
133
|
-
kind: z.enum(["target-contract-missing", "target-contract-terminal"
|
|
134
|
-
|
|
79
|
+
kind: z.enum(["target-contract-missing", "target-contract-terminal"]),
|
|
80
|
+
targetContractId: contractIdSchema,
|
|
135
81
|
})
|
|
136
|
-
.strict()
|
|
82
|
+
.strict()
|
|
83
|
+
.readonly(),
|
|
137
84
|
targetWorkspaceRefusalSchema,
|
|
138
85
|
z
|
|
139
|
-
.object({ kind: z.enum(["contract-missing", "delivery-missing", "terminal"])
|
|
140
|
-
.strict()
|
|
86
|
+
.object({ kind: z.enum(["contract-missing", "delivery-missing", "terminal"]) })
|
|
87
|
+
.strict()
|
|
88
|
+
.readonly(),
|
|
141
89
|
z
|
|
142
90
|
.object({
|
|
143
91
|
kind: z.literal("gates-unsatisfied"),
|
|
144
|
-
contractId: contractIdSchema,
|
|
145
92
|
unmet: z.array(gateReportSchema).readonly(),
|
|
146
|
-
target: z.string().min(1).optional(),
|
|
147
93
|
})
|
|
148
|
-
.strict()
|
|
94
|
+
.strict()
|
|
95
|
+
.readonly(),
|
|
149
96
|
z
|
|
150
97
|
.object({
|
|
151
98
|
kind: z.literal("prerequisites-unsatisfied"),
|
|
152
|
-
contractId: contractIdSchema,
|
|
153
99
|
unmet: z
|
|
154
|
-
.array(z
|
|
100
|
+
.array(z
|
|
101
|
+
.object({ contractId: contractIdSchema, state: z.enum(["missing", "active", "abandoned"]) })
|
|
102
|
+
.strict()
|
|
103
|
+
.readonly())
|
|
155
104
|
.readonly(),
|
|
156
105
|
})
|
|
157
|
-
.strict()
|
|
106
|
+
.strict()
|
|
107
|
+
.readonly(),
|
|
158
108
|
]);
|
|
159
109
|
const mergeStatePresentRefusalSchema = z
|
|
160
|
-
.object({ kind: z.literal("merge-state-present"),
|
|
161
|
-
.strict()
|
|
110
|
+
.object({ kind: z.literal("merge-state-present"), worktreePath: z.string().min(1) })
|
|
111
|
+
.strict()
|
|
112
|
+
.readonly();
|
|
162
113
|
export const deliverConflictRefusalSchema = z
|
|
163
114
|
.object({
|
|
164
115
|
kind: z.literal("integration-failed"),
|
|
165
|
-
contractId: contractIdSchema,
|
|
166
116
|
reason: z.literal("conflict"),
|
|
167
117
|
targetHead: snapshotIdSchema,
|
|
168
118
|
conflictPaths: z.array(z.string().refine((value) => value.trim() !== "")).readonly(),
|
|
169
|
-
recovery: conflictRecoverySchema,
|
|
170
119
|
})
|
|
171
|
-
.strict()
|
|
120
|
+
.strict()
|
|
121
|
+
.readonly();
|
|
172
122
|
const targetMissingRefusalSchema = z
|
|
173
|
-
.object({ kind: z.literal("target-missing")
|
|
174
|
-
.strict()
|
|
123
|
+
.object({ kind: z.literal("target-missing") })
|
|
124
|
+
.strict()
|
|
125
|
+
.readonly();
|
|
175
126
|
export const deliveryPreparationRefusalSchema = z.union([
|
|
176
127
|
targetWorkspaceRefusalSchema,
|
|
177
128
|
targetMissingRefusalSchema,
|
|
178
129
|
worktreeMissingRefusalSchema,
|
|
179
130
|
dirtyWorkspaceRefusalSchema,
|
|
180
|
-
unmergedPathsRefusalSchema,
|
|
181
131
|
integrationPreparationRefusalSchema,
|
|
182
132
|
mergeStatePresentRefusalSchema,
|
|
183
|
-
checkoutNotFollowableRefusalSchema,
|
|
184
133
|
]);
|
|
185
134
|
export const intentRefusalSchema = z.union([
|
|
186
135
|
activeContractRefusalSchema,
|
|
@@ -209,8 +158,8 @@ export async function admitVoidIntent(input, payload, decide, options) {
|
|
|
209
158
|
return complete(await admitIntent(input.channel, input.scope, decisionInput, decide, options), undefined);
|
|
210
159
|
}
|
|
211
160
|
export const verificationStopSchema = z.union([
|
|
212
|
-
z.object({ refusal:
|
|
213
|
-
z.object({ retry: protocolTerminalSchema }).strict(),
|
|
161
|
+
z.object({ refusal: activeContractRefusalSchema }).strict().readonly(),
|
|
162
|
+
z.object({ retry: protocolTerminalSchema }).strict().readonly(),
|
|
214
163
|
verificationRuntimeStopSchema,
|
|
215
164
|
]);
|
|
216
165
|
export const placementStopSchema = z.union([
|
|
@@ -223,35 +172,36 @@ export const placementStopSchema = z.union([
|
|
|
223
172
|
targetMissingRefusalSchema,
|
|
224
173
|
]),
|
|
225
174
|
})
|
|
226
|
-
.strict()
|
|
227
|
-
|
|
175
|
+
.strict()
|
|
176
|
+
.readonly(),
|
|
177
|
+
z.object({ retry: protocolTerminalSchema }).strict().readonly(),
|
|
228
178
|
z
|
|
229
179
|
.object({
|
|
230
180
|
failure: z.literal("target-placement-failed"),
|
|
231
181
|
diagnostic: z.string().refine((value) => value.trim() !== ""),
|
|
232
182
|
})
|
|
233
|
-
.strict()
|
|
183
|
+
.strict()
|
|
184
|
+
.readonly(),
|
|
234
185
|
z
|
|
235
186
|
.object({
|
|
236
187
|
failure: z.literal("target-moved"),
|
|
237
|
-
contractId: contractIdSchema,
|
|
238
188
|
target: z.string().refine((value) => value.trim() !== ""),
|
|
239
189
|
integratedAt: snapshotIdSchema,
|
|
240
190
|
observed: snapshotIdSchema.nullable(),
|
|
241
|
-
attempts: z.number().int(),
|
|
242
191
|
observedTreeEqualsCandidate: z.boolean(),
|
|
243
192
|
})
|
|
244
|
-
.strict()
|
|
193
|
+
.strict()
|
|
194
|
+
.readonly(),
|
|
245
195
|
z
|
|
246
196
|
.object({
|
|
247
197
|
failure: z.literal("target-moved"),
|
|
248
|
-
contractId: contractIdSchema,
|
|
249
198
|
target: z.string().refine((value) => value.trim() !== ""),
|
|
250
199
|
expected: snapshotIdSchema,
|
|
251
200
|
observed: snapshotIdSchema.nullable(),
|
|
252
201
|
observedTreeEqualsCandidate: z.boolean(),
|
|
253
202
|
})
|
|
254
|
-
.strict()
|
|
203
|
+
.strict()
|
|
204
|
+
.readonly(),
|
|
255
205
|
]);
|
|
256
206
|
export function timestamp() {
|
|
257
207
|
return new Date().toISOString();
|
|
@@ -286,8 +236,8 @@ export function placementStop(result) {
|
|
|
286
236
|
if (result.kind === "placement-failed")
|
|
287
237
|
return { failure: "target-placement-failed", diagnostic: result.diagnostic };
|
|
288
238
|
if (result.kind === "target-moved") {
|
|
289
|
-
const {
|
|
290
|
-
return { failure: "target-moved",
|
|
239
|
+
const { target, expected, observed, observedTreeEqualsCandidate } = result;
|
|
240
|
+
return { failure: "target-moved", target, expected, observed, observedTreeEqualsCandidate };
|
|
291
241
|
}
|
|
292
242
|
return result.kind === "refused" ? { refusal: result.refusal } : { retry: result };
|
|
293
243
|
}
|
|
@@ -306,7 +256,7 @@ export async function contractsOperation(input) {
|
|
|
306
256
|
return withGitReadObservation(input.scope, input.channel, (observation) => readContractBoard(observation));
|
|
307
257
|
}
|
|
308
258
|
export async function contractCatalogueOperation(input) {
|
|
309
|
-
const limit = boundedListLimit(input.limit);
|
|
259
|
+
const limit = input.limit === undefined ? undefined : boundedListLimit(input.limit);
|
|
310
260
|
return withGitReadObservation(input.scope, input.channel, (observation) => readContractCatalogue(observation, limit));
|
|
311
261
|
}
|
|
312
262
|
export async function contractObservationOperation(input) {
|
|
@@ -327,6 +277,3 @@ export async function deliveryOperation(input) {
|
|
|
327
277
|
? state.delivery.data
|
|
328
278
|
: { ...state.delivery.data, integration: state.currentIntegration };
|
|
329
279
|
}
|
|
330
|
-
export async function deliveryDiffOperation(input) {
|
|
331
|
-
return await readDeliveryDiff(input.scope, input.integrationPredecessor, input.integrationSnapshot);
|
|
332
|
-
}
|
|
@@ -21,7 +21,6 @@ export async function observeIntegrationTargetMovement(repository, state) {
|
|
|
21
21
|
return undefined;
|
|
22
22
|
return {
|
|
23
23
|
kind: "target-moved",
|
|
24
|
-
contractId: state.id,
|
|
25
24
|
target: targetName(target),
|
|
26
25
|
expected: integration.predecessor,
|
|
27
26
|
observed,
|
|
@@ -72,7 +71,6 @@ async function runFencedPlacement(repository, input, protocol) {
|
|
|
72
71
|
if (observed !== target.expectedOid)
|
|
73
72
|
return {
|
|
74
73
|
kind: "target-moved",
|
|
75
|
-
contractId: input.contractId,
|
|
76
74
|
target: targetName(target.target),
|
|
77
75
|
expected: target.expectedOid,
|
|
78
76
|
observed,
|
|
@@ -112,6 +110,11 @@ async function runFencedPlacement(repository, input, protocol) {
|
|
|
112
110
|
return result;
|
|
113
111
|
if (preparedPhysical === undefined)
|
|
114
112
|
throw new Error("accepted placement has no prepared target checkout");
|
|
113
|
+
protocol.progress?.recordCompletion(input.contractId, {
|
|
114
|
+
integration: preparedPhysical.target.newOid,
|
|
115
|
+
predecessor: preparedPhysical.target.expectedOid,
|
|
116
|
+
target: targetName(preparedPhysical.target.target),
|
|
117
|
+
});
|
|
115
118
|
const physical = await followTargetPlacement(repository, preparedPhysical, (report) => protocol.progress?.recordPlacementPhysical(input.contractId, report));
|
|
116
119
|
protocol.progress?.recordPlacementPhysical(input.contractId, physical);
|
|
117
120
|
return { ...result, physical };
|
|
@@ -13,117 +13,27 @@ export type ContractCheckpoint = Readonly<{
|
|
|
13
13
|
journal: readonly JournalEntry[];
|
|
14
14
|
}>;
|
|
15
15
|
export declare function contractCheckpoint(input: ContractCheckpoint): ContractCheckpoint;
|
|
16
|
-
export declare const verificationCleanupFailureSchema: z.ZodObject<{
|
|
17
|
-
phase: z.ZodLiteral<"destroy">;
|
|
16
|
+
export declare const verificationCleanupFailureSchema: z.ZodReadonly<z.ZodObject<{
|
|
18
17
|
name: z.ZodString;
|
|
19
|
-
detail: z.ZodUnion<readonly [z.ZodObject<{
|
|
20
|
-
kind: z.ZodLiteral<"exit">;
|
|
21
|
-
code: z.ZodNumber;
|
|
22
|
-
stdout: z.ZodString;
|
|
23
|
-
stderr: z.ZodString;
|
|
24
|
-
truncated: z.ZodBoolean;
|
|
25
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
26
|
-
stdout: z.ZodOptional<z.ZodString>;
|
|
27
|
-
stderr: z.ZodOptional<z.ZodString>;
|
|
28
|
-
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
-
kind: z.ZodLiteral<"timeout">;
|
|
30
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
31
|
-
stdout: z.ZodOptional<z.ZodString>;
|
|
32
|
-
stderr: z.ZodOptional<z.ZodString>;
|
|
33
|
-
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
-
kind: z.ZodLiteral<"unknown-exit">;
|
|
35
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
36
|
-
kind: z.ZodLiteral<"spawn-error">;
|
|
37
|
-
diagnostic: z.ZodString;
|
|
38
|
-
}, z.core.$strict>]>;
|
|
39
|
-
}, z.core.$strict>;
|
|
40
|
-
export type VerificationCleanupFailure = z.infer<typeof verificationCleanupFailureSchema>;
|
|
41
|
-
export declare const executionCleanupSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
42
|
-
kind: z.ZodLiteral<"decode-channel-retirement">;
|
|
43
|
-
contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
|
|
44
18
|
diagnostic: z.ZodString;
|
|
45
|
-
}, z.core.$strict
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
snapshot: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>>;
|
|
49
|
-
requirement: z.ZodOptional<z.ZodString>;
|
|
50
|
-
index: z.ZodOptional<z.ZodNumber>;
|
|
51
|
-
failure: z.ZodObject<{
|
|
52
|
-
phase: z.ZodLiteral<"destroy">;
|
|
53
|
-
name: z.ZodString;
|
|
54
|
-
detail: z.ZodUnion<readonly [z.ZodObject<{
|
|
55
|
-
kind: z.ZodLiteral<"exit">;
|
|
56
|
-
code: z.ZodNumber;
|
|
57
|
-
stdout: z.ZodString;
|
|
58
|
-
stderr: z.ZodString;
|
|
59
|
-
truncated: z.ZodBoolean;
|
|
60
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
61
|
-
stdout: z.ZodOptional<z.ZodString>;
|
|
62
|
-
stderr: z.ZodOptional<z.ZodString>;
|
|
63
|
-
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
-
kind: z.ZodLiteral<"timeout">;
|
|
65
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
66
|
-
stdout: z.ZodOptional<z.ZodString>;
|
|
67
|
-
stderr: z.ZodOptional<z.ZodString>;
|
|
68
|
-
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
-
kind: z.ZodLiteral<"unknown-exit">;
|
|
70
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
71
|
-
kind: z.ZodLiteral<"spawn-error">;
|
|
72
|
-
diagnostic: z.ZodString;
|
|
73
|
-
}, z.core.$strict>]>;
|
|
74
|
-
}, z.core.$strict>;
|
|
75
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
76
|
-
kind: z.ZodLiteral<"worktree-leak">;
|
|
77
|
-
contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
|
|
78
|
-
snapshot: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>>;
|
|
79
|
-
requirement: z.ZodOptional<z.ZodString>;
|
|
80
|
-
index: z.ZodOptional<z.ZodNumber>;
|
|
81
|
-
leak: z.ZodObject<{
|
|
82
|
-
path: z.ZodOptional<z.ZodString>;
|
|
83
|
-
diagnostic: z.ZodString;
|
|
84
|
-
}, z.core.$strict>;
|
|
85
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
86
|
-
kind: z.ZodLiteral<"private-state-seat-close">;
|
|
87
|
-
contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
|
|
88
|
-
failure: z.ZodObject<{
|
|
89
|
-
kind: z.ZodLiteral<"private-state-seat-close-failed">;
|
|
90
|
-
diagnostic: z.ZodString;
|
|
91
|
-
}, z.core.$strict>;
|
|
92
|
-
}, z.core.$strict>]>;
|
|
93
|
-
export type ExecutionCleanup = z.infer<typeof executionCleanupSchema>;
|
|
94
|
-
export declare const executionStageSchema: z.ZodEnum<{
|
|
95
|
-
admission: "admission";
|
|
96
|
-
placement: "placement";
|
|
97
|
-
verification: "verification";
|
|
98
|
-
continuation: "continuation";
|
|
99
|
-
reconciliation: "reconciliation";
|
|
100
|
-
reintegration: "reintegration";
|
|
101
|
-
}>;
|
|
102
|
-
export type ExecutionStage = z.infer<typeof executionStageSchema>;
|
|
103
|
-
export declare const executionStopSchema: z.ZodObject<{
|
|
19
|
+
}, z.core.$strict>>;
|
|
20
|
+
export type VerificationCleanupFailure = z.infer<typeof verificationCleanupFailureSchema>;
|
|
21
|
+
export declare const executionStopSchema: z.ZodReadonly<z.ZodObject<{
|
|
104
22
|
kind: z.ZodLiteral<"execution-stopped">;
|
|
105
23
|
contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
|
|
106
|
-
stage: z.ZodEnum<{
|
|
107
|
-
admission: "admission";
|
|
108
|
-
placement: "placement";
|
|
109
|
-
verification: "verification";
|
|
110
|
-
continuation: "continuation";
|
|
111
|
-
reconciliation: "reconciliation";
|
|
112
|
-
reintegration: "reintegration";
|
|
113
|
-
}>;
|
|
114
24
|
reason: z.ZodEnum<{
|
|
115
25
|
failed: "failed";
|
|
116
26
|
cancelled: "cancelled";
|
|
117
27
|
}>;
|
|
118
28
|
diagnostic: z.ZodString;
|
|
119
|
-
}, z.core.$strict
|
|
29
|
+
}, z.core.$strict>>;
|
|
120
30
|
export type ExecutionStop = z.infer<typeof executionStopSchema>;
|
|
121
31
|
/** Only owner-declared operational classes and native system I/O failures are operational. */
|
|
122
32
|
export declare function isOperationalFailure(error: unknown): error is Error;
|
|
123
33
|
/** Cancellation is witnessed by this exact signal reason, not by a signal merely being aborted. */
|
|
124
34
|
export declare function isOperationalStop(error: unknown, signal?: AbortSignal): boolean;
|
|
125
35
|
/** Classify operational failures only; programming errors and corrupt authority still throw. */
|
|
126
|
-
export declare function executionStop(contractId: ContractId,
|
|
36
|
+
export declare function executionStop(contractId: ContractId, error: unknown, signal?: AbortSignal): ExecutionStop;
|
|
127
37
|
/** Physical residue and custodial residue a leading admission or reconciliation step reports. */
|
|
128
38
|
export type ProgressResidue = Readonly<{
|
|
129
39
|
physical?: ReconcileResult;
|
|
@@ -149,7 +59,7 @@ export interface ProtocolProgress {
|
|
|
149
59
|
requirement: string;
|
|
150
60
|
index: number;
|
|
151
61
|
}>): void;
|
|
152
|
-
recordVerificationCheck(contractId: ContractId, check: VerificationCheck): void;
|
|
62
|
+
recordVerificationCheck(contractId: ContractId, snapshot: SnapshotId, check: VerificationCheck): void;
|
|
153
63
|
recordStop(stop: ExecutionStop): void;
|
|
154
64
|
recordDeliveryPreview(contractId: ContractId, report: Partial<import("./delivery-preview.js").DeliveryPreviewReport>): void;
|
|
155
65
|
/** Current candidate conclusions, retained before the next await can fail. */
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { contractIdSchema
|
|
1
|
+
import { contractIdSchema } from "../git/identity.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { worktreeLeakSchema } from "../git/scratch.js";
|
|
4
|
-
import { privateStateSeatCloseLagSchema } from "../git/private-state-seat.js";
|
|
5
|
-
import { hookFailureSchema } from "../git/hooks.js";
|
|
6
3
|
import { AuthorityCorruptionError } from "../core/facts/errors.js";
|
|
7
4
|
import { GitPlumbingError } from "../git/process.js";
|
|
8
5
|
import { SqliteTransactionLockError } from "../coordination/sqlite-transaction-lock.js";
|
|
@@ -12,64 +9,20 @@ export function contractCheckpoint(input) {
|
|
|
12
9
|
}
|
|
13
10
|
export const verificationCleanupFailureSchema = z
|
|
14
11
|
.object({
|
|
15
|
-
phase: z.literal("destroy"),
|
|
16
12
|
name: z.string().refine((value) => value.trim() !== ""),
|
|
17
|
-
|
|
13
|
+
diagnostic: z.string().refine((value) => value.trim() !== ""),
|
|
18
14
|
})
|
|
19
|
-
.strict()
|
|
20
|
-
|
|
21
|
-
z
|
|
22
|
-
.object({
|
|
23
|
-
kind: z.literal("decode-channel-retirement"),
|
|
24
|
-
contractId: contractIdSchema,
|
|
25
|
-
diagnostic: z.string().min(1),
|
|
26
|
-
})
|
|
27
|
-
.strict(),
|
|
28
|
-
z
|
|
29
|
-
.object({
|
|
30
|
-
kind: z.literal("verification-cleanup"),
|
|
31
|
-
contractId: contractIdSchema,
|
|
32
|
-
snapshot: snapshotIdSchema.optional(),
|
|
33
|
-
requirement: z.string().min(1).optional(),
|
|
34
|
-
index: z.number().int().positive().optional(),
|
|
35
|
-
failure: verificationCleanupFailureSchema,
|
|
36
|
-
})
|
|
37
|
-
.strict(),
|
|
38
|
-
z
|
|
39
|
-
.object({
|
|
40
|
-
kind: z.literal("worktree-leak"),
|
|
41
|
-
contractId: contractIdSchema,
|
|
42
|
-
snapshot: snapshotIdSchema.optional(),
|
|
43
|
-
requirement: z.string().min(1).optional(),
|
|
44
|
-
index: z.number().int().positive().optional(),
|
|
45
|
-
leak: worktreeLeakSchema,
|
|
46
|
-
})
|
|
47
|
-
.strict(),
|
|
48
|
-
z
|
|
49
|
-
.object({
|
|
50
|
-
kind: z.literal("private-state-seat-close"),
|
|
51
|
-
contractId: contractIdSchema,
|
|
52
|
-
failure: privateStateSeatCloseLagSchema,
|
|
53
|
-
})
|
|
54
|
-
.strict(),
|
|
55
|
-
]);
|
|
56
|
-
export const executionStageSchema = z.enum([
|
|
57
|
-
"admission",
|
|
58
|
-
"verification",
|
|
59
|
-
"placement",
|
|
60
|
-
"reintegration",
|
|
61
|
-
"continuation",
|
|
62
|
-
"reconciliation",
|
|
63
|
-
]);
|
|
15
|
+
.strict()
|
|
16
|
+
.readonly();
|
|
64
17
|
export const executionStopSchema = z
|
|
65
18
|
.object({
|
|
66
19
|
kind: z.literal("execution-stopped"),
|
|
67
20
|
contractId: contractIdSchema,
|
|
68
|
-
stage: executionStageSchema,
|
|
69
21
|
reason: z.enum(["cancelled", "failed"]),
|
|
70
22
|
diagnostic: z.string().refine((value) => value.trim() !== ""),
|
|
71
23
|
})
|
|
72
|
-
.strict()
|
|
24
|
+
.strict()
|
|
25
|
+
.readonly();
|
|
73
26
|
/** Only owner-declared operational classes and native system I/O failures are operational. */
|
|
74
27
|
export function isOperationalFailure(error) {
|
|
75
28
|
if (!(error instanceof Error) ||
|
|
@@ -97,7 +50,7 @@ export function isOperationalStop(error, signal) {
|
|
|
97
50
|
return isOperationalFailure(error);
|
|
98
51
|
}
|
|
99
52
|
/** Classify operational failures only; programming errors and corrupt authority still throw. */
|
|
100
|
-
export function executionStop(contractId,
|
|
53
|
+
export function executionStop(contractId, error, signal) {
|
|
101
54
|
const cancelled = signal?.aborted === true &&
|
|
102
55
|
(error === signal.reason || error instanceof GitPlumbingError || error instanceof SqliteTransactionLockError);
|
|
103
56
|
if (!cancelled && !isOperationalFailure(error))
|
|
@@ -105,7 +58,6 @@ export function executionStop(contractId, stage, error, signal) {
|
|
|
105
58
|
return {
|
|
106
59
|
kind: "execution-stopped",
|
|
107
60
|
contractId,
|
|
108
|
-
stage,
|
|
109
61
|
reason: cancelled ? "cancelled" : "failed",
|
|
110
62
|
diagnostic: error instanceof Error ? error.message : String(error),
|
|
111
63
|
};
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type ContractState, type SnapshotId } from "../../core/facts/types.js";
|
|
1
3
|
import type { GitRepository } from "../../git/process.js";
|
|
2
|
-
import type {
|
|
3
|
-
export
|
|
4
|
-
kind: "target-checkout-retained"
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import type { ContractDetail } from "./status.js";
|
|
5
|
+
export declare const currentPhysicalIssueSchema: z.ZodReadonly<z.ZodObject<{
|
|
6
|
+
kind: z.ZodLiteral<"target-checkout-retained">;
|
|
7
|
+
}, z.core.$strict>>;
|
|
8
|
+
export type CurrentPhysicalIssue = z.output<typeof currentPhysicalIssueSchema>;
|
|
7
9
|
/** Selected-only pure projection of retained target checkout state. */
|
|
8
|
-
export declare function observeCurrentPhysicalIssue(repository: GitRepository, row:
|
|
10
|
+
export declare function observeCurrentPhysicalIssue(repository: GitRepository, row: Readonly<{
|
|
11
|
+
phase: ContractDetail["phase"];
|
|
12
|
+
target: ContractState["coordinates"]["target"];
|
|
13
|
+
delivery: ContractDetail["delivery"];
|
|
14
|
+
observedHead: SnapshotId | null;
|
|
15
|
+
}>, predecessor?: SnapshotId): Promise<CurrentPhysicalIssue | undefined>;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { resolveContractTarget } from "../../git/target.js";
|
|
1
|
+
import { z } from "zod";
|
|
3
2
|
import { registeredWorktrees } from "../../git/repository.js";
|
|
3
|
+
import { resolveContractTarget } from "../../git/target.js";
|
|
4
4
|
import { observeTargetCheckoutShape } from "../../git/target-placement.js";
|
|
5
|
+
export const currentPhysicalIssueSchema = z.strictObject({ kind: z.literal("target-checkout-retained") }).readonly();
|
|
5
6
|
/** Selected-only pure projection of retained target checkout state. */
|
|
6
|
-
export async function observeCurrentPhysicalIssue(repository, row) {
|
|
7
|
+
export async function observeCurrentPhysicalIssue(repository, row, predecessor) {
|
|
7
8
|
const target = row.target;
|
|
8
9
|
const delivery = row.delivery;
|
|
9
|
-
if (row.phase !== "claimed" || target ===
|
|
10
|
+
if (row.phase !== "claimed" || target === undefined || delivery === undefined || predecessor === undefined)
|
|
10
11
|
return undefined;
|
|
11
|
-
if (row.
|
|
12
|
+
if (row.observedHead !== delivery.integration)
|
|
12
13
|
return undefined;
|
|
13
14
|
let worktrees;
|
|
14
15
|
if (typeof target === "string") {
|
|
@@ -19,17 +20,17 @@ export async function observeCurrentPhysicalIssue(repository, row) {
|
|
|
19
20
|
else {
|
|
20
21
|
const resolved = await resolveContractTarget(repository, target.contractId, target);
|
|
21
22
|
if (resolved.kind === "refused")
|
|
22
|
-
return { kind: "target-checkout-retained"
|
|
23
|
+
return { kind: "target-checkout-retained" };
|
|
23
24
|
worktrees = [{ path: resolved.path }];
|
|
24
25
|
}
|
|
25
26
|
for (const worktree of worktrees) {
|
|
26
27
|
const shape = await observeTargetCheckoutShape(repository, {
|
|
27
28
|
path: worktree.path,
|
|
28
|
-
predecessor
|
|
29
|
-
candidate: delivery.integration
|
|
29
|
+
predecessor,
|
|
30
|
+
candidate: delivery.integration,
|
|
30
31
|
});
|
|
31
32
|
if (shape === "retained")
|
|
32
|
-
return { kind: "target-checkout-retained"
|
|
33
|
+
return { kind: "target-checkout-retained" };
|
|
33
34
|
}
|
|
34
35
|
return undefined;
|
|
35
36
|
}
|