create-agdf 0.20.2 → 0.30.0
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 +148 -191
- package/generated/.agdf/control/README.md +31 -110
- package/generated/.agdf/control/planned-urs.md +95 -0
- package/generated/.agdf/control/templates/RUN_STATE.md +15 -64
- package/generated/.agdf/control/templates/artefacts/UR.md +1 -1
- package/generated/.agents/plugins/marketplace.json +12 -0
- package/generated/.opencode/agdf-agent-router.md +3 -3
- package/generated/.opencode/agdf-interaction-locales.json +2668 -2682
- package/generated/.opencode/contracts/closeout.md +1 -1
- package/generated/.opencode/contracts/control-scaffold.md +63 -46
- package/generated/.opencode/contracts/gate-artifact-preparation.md +58 -48
- package/generated/.opencode/contracts/gate-transition.md +5 -6
- package/generated/.opencode/contracts/interaction.md +43 -126
- package/generated/.opencode/contracts/modes.md +4 -3
- package/generated/.opencode/contracts/prd-definition.md +6 -6
- package/generated/.opencode/contracts/quality.md +10 -2
- package/generated/.opencode/contracts/request-activation.md +9 -8
- package/generated/.opencode/contracts/sd-definition.md +3 -3
- package/generated/.opencode/contracts/task-target-resolution.md +24 -0
- package/generated/.opencode/contracts/tp-definition.md +1 -1
- package/generated/.opencode/contracts/ur-definition.md +41 -7
- package/generated/.opencode/skills/agdf-brownfield-analysis/SKILL.md +8 -5
- package/generated/.opencode/skills/agdf-clean-implementation-review/SKILL.md +3 -2
- package/generated/.opencode/skills/agdf-code-review/SKILL.md +5 -3
- package/generated/.opencode/skills/agdf-delivery-closeout/SKILL.md +3 -2
- package/generated/.opencode/skills/agdf-delivery-path-search/SKILL.md +3 -2
- package/generated/.opencode/skills/agdf-gate-check/SKILL.md +35 -31
- package/generated/.opencode/skills/agdf-prd-definition/SKILL.md +3 -2
- package/generated/.opencode/skills/agdf-qa-gate/SKILL.md +3 -2
- package/generated/.opencode/skills/agdf-release-or/SKILL.md +8 -5
- package/generated/.opencode/skills/agdf-sd-definition/SKILL.md +3 -2
- package/generated/.opencode/skills/agdf-task-plan-review/SKILL.md +3 -2
- package/generated/.opencode/skills/agdf-tp-definition/SKILL.md +3 -2
- package/generated/.opencode/skills/agdf-ur-definition/SKILL.md +12 -4
- package/generated/.opencode/skills/agdf-ux-intent-definition/SKILL.md +5 -4
- package/generated/plugins/agdf/.claude-plugin/plugin.json +3 -2
- package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
- package/generated/plugins/agdf/companion/assignment.mjs +65 -0
- package/generated/plugins/agdf/companion/companion.json +4 -0
- package/generated/plugins/agdf/companion/core.mjs +16 -0
- package/generated/plugins/agdf/companion/figure.mjs +137 -0
- package/generated/plugins/agdf/companion/gate-bar.mjs +54 -0
- package/generated/plugins/agdf/companion/hooks.json +3 -0
- package/generated/plugins/agdf/companion/locales.json +200 -0
- package/generated/plugins/agdf/companion/localization.mjs +89 -0
- package/generated/plugins/agdf/companion/notice.mjs +90 -0
- package/generated/plugins/agdf/companion/persistence.mjs +36 -0
- package/generated/plugins/agdf/companion/register.mjs +444 -0
- package/generated/plugins/agdf/companion/run-state.mjs +110 -0
- package/generated/plugins/agdf/companion/state.mjs +48 -0
- package/generated/plugins/agdf/companion/view.mjs +84 -0
- package/generated/plugins/agdf/control/README.md +31 -110
- package/generated/plugins/agdf/control/planned-urs.md +95 -0
- package/generated/plugins/agdf/control/templates/RUN_STATE.md +15 -64
- package/generated/plugins/agdf/control/templates/artefacts/UR.md +1 -1
- package/generated/plugins/agdf/mcp/server/README.md +119 -7
- package/generated/plugins/agdf/mcp/server/package.json +12 -7
- package/generated/plugins/agdf/mcp/server/src/generation-entry.js +3 -85
- package/generated/plugins/agdf/mcp/server/src/generation-protocol.js +2 -44
- package/generated/plugins/agdf/mcp/server/src/generation-runtime.js +94 -0
- package/generated/plugins/agdf/mcp/server/src/generation-thread-entry.js +8 -0
- package/generated/plugins/agdf/mcp/server/src/generation.js +64 -20
- package/generated/plugins/agdf/mcp/server/src/main.js +42 -10
- package/generated/plugins/agdf/mcp/server/src/server.js +24 -15
- package/generated/plugins/agdf/mcp/server/src/stdio-output.js +42 -0
- package/generated/plugins/agdf/mcp/server/src/worker-entry.js +2 -2
- package/generated/plugins/agdf/mcp/server/src/worker.js +53 -7
- package/generated/plugins/agdf/mcp/server/ui/cockpit.html +31 -31
- package/generated/plugins/agdf/mcp/server/ui/decision-manifest.json +3 -3
- package/generated/plugins/agdf/mcp/server/ui/decision.html +36 -36
- package/generated/plugins/agdf/mcp/server/ui/manifest.json +4 -4
- package/generated/plugins/agdf/meta/agdf-agent-router.md +3 -3
- package/generated/plugins/agdf/meta/agdf-defaults.json +9 -0
- package/generated/plugins/agdf/meta/agdf-defaults.schema.json +20 -0
- package/generated/plugins/agdf/meta/agdf-interaction-locales.json +2668 -2682
- package/generated/plugins/agdf/meta/agdf-mcp-capability.json +1 -1
- package/generated/plugins/agdf/meta/agdf-plugin.definition.json +8 -3
- package/generated/plugins/agdf/meta/contracts/closeout.md +1 -1
- package/generated/plugins/agdf/meta/contracts/control-scaffold.md +63 -46
- package/generated/plugins/agdf/meta/contracts/gate-artifact-preparation.md +58 -48
- package/generated/plugins/agdf/meta/contracts/gate-transition.md +5 -6
- package/generated/plugins/agdf/meta/contracts/interaction.md +43 -126
- package/generated/plugins/agdf/meta/contracts/modes.md +4 -3
- package/generated/plugins/agdf/meta/contracts/prd-definition.md +6 -6
- package/generated/plugins/agdf/meta/contracts/quality.md +10 -2
- package/generated/plugins/agdf/meta/contracts/request-activation.md +9 -8
- package/generated/plugins/agdf/meta/contracts/sd-definition.md +3 -3
- package/generated/plugins/agdf/meta/contracts/task-target-resolution.md +24 -0
- package/generated/plugins/agdf/meta/contracts/tp-definition.md +1 -1
- package/generated/plugins/agdf/meta/contracts/ur-definition.md +41 -7
- package/generated/plugins/agdf/meta/copilot-payload-baseline.json +3 -3
- package/generated/plugins/agdf/meta/distribution-profile-history.json +7 -0
- package/generated/plugins/agdf/runtime/agdf-session-check.js +25 -21
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-defaults.json +9 -0
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-defaults.schema.json +20 -0
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-interaction-locales.json +2668 -2682
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +8 -3
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/closeout.md +1 -1
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/control-scaffold.md +63 -46
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/gate-artifact-preparation.md +58 -48
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/gate-transition.md +5 -6
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/interaction.md +43 -126
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/modes.md +4 -3
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/prd-definition.md +6 -6
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/quality.md +10 -2
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/request-activation.md +9 -8
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/sd-definition.md +3 -3
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/task-target-resolution.md +24 -0
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/tp-definition.md +1 -1
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/ur-definition.md +41 -7
- package/generated/plugins/agdf/runtime/create-agdf/lib/cli/codex-document-command.js +195 -0
- package/generated/plugins/agdf/runtime/create-agdf/lib/cli/command-registry.js +82 -148
- package/generated/plugins/agdf/runtime/create-agdf/lib/cli/control-maintenance-command.js +8 -37
- package/generated/plugins/agdf/runtime/create-agdf/lib/cli/parse-args.js +98 -16
- package/generated/plugins/agdf/runtime/create-agdf/lib/cli/planned-command.js +55 -0
- package/generated/plugins/agdf/runtime/create-agdf/lib/cli/project-read-command.js +35 -0
- package/generated/plugins/agdf/runtime/create-agdf/lib/cli/run-command-aliases.js +116 -0
- package/generated/plugins/agdf/runtime/create-agdf/lib/cli/runtime-context.js +1 -59
- package/generated/plugins/agdf/runtime/create-agdf/lib/cli/validation-handlers.js +33 -103
- package/generated/plugins/agdf/runtime/create-agdf/lib/control-evaluation/git-observation.js +7 -5
- package/generated/plugins/agdf/runtime/create-agdf/lib/control-maintenance/startup.js +2 -2
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-decision-protocol.js +40 -0
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-dispatch-runtime.js +71 -306
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/facade-entry.js +3 -24
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/facade-owner-entry.js +31 -15
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/facade-runtime.js +29 -0
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/facade-thread-entry.js +11 -0
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/owner-client.js +79 -0
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/package.js +14 -80
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/plugin-runtime.js +29 -9
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/thread-owner.js +164 -0
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-owner-protocol.js +1 -0
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-protocol-runtime.js +308 -0
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-worker-runtime.js +152 -0
- package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/control-command-service.js +22 -7
- package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/control-context.js +8 -1
- package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/validator-application.js +2 -2
- package/generated/plugins/agdf/runtime/create-agdf/package.json +5 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/closeout-readiness.js +10 -2
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/decision-content-placeholder.js +9 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/decision-content-readiness.js +2 -7
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/definition-sources.js +3 -2
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/delivery-map.js +2 -12
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/doctor.js +162 -172
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-check.js +10 -9
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy-inputs.js +11 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy-pure.js +446 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy.js +3 -434
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/next-action.js +2 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/parent-reconciliation.js +2 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/qa-follow-up.js +2 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/required-files.js +9 -7
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/run-state-policy.js +1 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/run-state.js +15 -9
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/run-step-policy.js +2 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/run-work-summary.js +6 -4
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/shared-value.js +7 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/shared.js +5 -254
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/tp-planning.js +3 -2
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/ur-readiness.js +7 -2
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/verified-change.js +11 -9
- package/{runtime/core/lib/control-evaluation/backlog-vocabulary.js → generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/work-vocabulary.js} +2 -2
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/artifact-readiness.js +5 -3
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/authoring-inputs.js +110 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-archive.js +53 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-context.js +2 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-contract.js +11 -4
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-list.d.ts +10 -6
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-list.js +32 -41
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-session.js +8 -8
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-work.js +33 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit.js +75 -44
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/contract.js +124 -32
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/decision-session.js +53 -11
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/doctor-observation.js +91 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/project-operation-call.js +5 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/project-state.js +48 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/result.js +61 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/selection.js +9 -3
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/service.js +119 -67
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/compatibility.js +42 -132
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/contract.js +5 -5
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/presentation.js +27 -119
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/service.js +9 -37
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-read/cockpit-pool.js +25 -9
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-read/cockpit-worker.js +4 -3
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-read/doctor-reader.js +92 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-read/doctor-worker.js +11 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-read/fs.js +18 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-read/snapshot.js +68 -17
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/aggregate.js +3 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/approval-command.js +13 -10
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/approval-operations.js +10 -7
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/artefact-binding-proof.js +12 -20
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/artefact-bindings.js +10 -7
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/canonical-initialization.js +761 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/control-layout.js +183 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/decision-action-contract.js +10 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/decision-action-service.js +24 -3
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/decision-material-contract.js +2 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/evidence-bindings.js +7 -7
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/git-identity.js +86 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/index.js +0 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/input-resolution.js +99 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/planned-entry.js +273 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/planned-handoff.js +174 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/planned-inventory.js +90 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/planned-origin-reader.js +48 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/planned-origin.js +40 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/presentation-decision.js +12 -7
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/presentation-delivery.js +90 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/preview-render.js +5 -2
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/preview-review.js +3 -2
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/preview-snapshot.js +9 -6
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/recording-formats.js +12 -16
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-artefact-recording.js +54 -66
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-closure.js +343 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-contract.js +33 -250
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-schema.js +508 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-service.js +198 -34
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-create-command.js +60 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-identity.d.ts +14 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-identity.js +40 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-input-resolution.js +72 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-inventory-reader.js +31 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-inventory.js +179 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-material.js +211 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-mutation.js +51 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-operation-identity.js +2 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-operation-proof.js +7 -4
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-operation-status.js +20 -4
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-operations.js +70 -13
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-owned-outputs.js +21 -9
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation-envelope.js +25 -33
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation-render.js +8 -7
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation.js +45 -21
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-recording.js +10 -179
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision-boundary.js +7 -21
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision-history.js +23 -16
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision.js +84 -161
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-seal-compute.js +19 -44
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-seal.js +6 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-source-revisions.js +19 -18
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-document.js +110 -42
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-edits.js +13 -5
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-parser.js +14 -6
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-reader.js +27 -18
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-repository.js +112 -48
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-resolver.js +12 -15
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-writer.js +21 -377
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-step-pending.js +2 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-step-transaction.js +125 -114
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-steps.js +136 -248
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-store-inspection.js +14 -2
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-verified-change.js +81 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-work-summary-shape.d.ts +1 -0
- package/{runtime/core/lib/control-state/backlog-summary-shape.js → generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-work-summary-shape.js} +7 -19
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/delivery-continuation/service.js +5 -66
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/delivery-path-search/persistence.js +26 -8
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/delivery-path-search/state-adapter.js +1 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/index.js +14 -6
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog.js +3 -3
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/interaction-presentation.js +29 -11
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/mcp-input-hints.js +46 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/mcp-input-resolution.js +98 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/mcp-input-schema.js +15 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/mcp-resource-contract.js +1 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/mcp-tool-errors.js +31 -15
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/owned-file-lock.js +266 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/owner-placement.js +50 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/resources/canonical-init-plan.js +34 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/resources/configuration.js +92 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/resources/context.js +7 -11
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/resources/language-preference.js +59 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/runtime/mcp-owner-protocol.js +102 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/runtime/plugin-provenance.js +173 -18
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/compact-continuation.js +3 -3
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/contract.js +28 -9
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/delivery-intake.js +11 -5
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/delivery-run-assignment.js +6 -10
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/mcp-continuation.js +64 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/prd-definition.js +14 -5
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/sd-definition.js +2 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/service.js +49 -14
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/tp-definition.js +2 -1
- package/generated/plugins/agdf/runtime/runtime-manifest.json +2 -2
- package/generated/plugins/agdf/scripts/check-runtime-integrity.mjs +60 -42
- package/generated/plugins/agdf/scripts/instruction-footprint.mjs +5 -5
- package/generated/plugins/agdf/skills/brownfield-analysis/SKILL.md +8 -5
- package/generated/plugins/agdf/skills/clean-implementation-review/SKILL.md +3 -2
- package/generated/plugins/agdf/skills/code-review/SKILL.md +5 -3
- package/generated/plugins/agdf/skills/delivery-closeout/SKILL.md +3 -2
- package/generated/plugins/agdf/skills/delivery-path-search/SKILL.md +3 -2
- package/generated/plugins/agdf/skills/gate-check/SKILL.md +35 -31
- package/generated/plugins/agdf/skills/prd-definition/SKILL.md +3 -2
- package/generated/plugins/agdf/skills/qa-gate/SKILL.md +3 -2
- package/generated/plugins/agdf/skills/release-or/SKILL.md +8 -5
- package/generated/plugins/agdf/skills/sd-definition/SKILL.md +3 -2
- package/generated/plugins/agdf/skills/task-plan-review/SKILL.md +3 -2
- package/generated/plugins/agdf/skills/tp-definition/SKILL.md +3 -2
- package/generated/plugins/agdf/skills/ur-definition/SKILL.md +12 -4
- package/generated/plugins/agdf/skills/ux-intent-definition/SKILL.md +5 -4
- package/generated/plugins/agdf/submission/openai/availability.md +1 -1
- package/generated/plugins/agdf/submission/openai/capability-matrix.json +1 -1
- package/generated/plugins/agdf/submission/openai/release-notes.md +9 -1
- package/generated/plugins/agdf/submission/openai/reviewer-cases.json +1 -1
- package/generated/plugins/agdf-planning/.codex-plugin/plugin.json +40 -0
- package/generated/plugins/agdf-planning/README.md +21 -0
- package/generated/plugins/agdf-planning/assets/agdf-icon.svg +16 -0
- package/generated/plugins/agdf-planning/assets/agdf-logo.svg +16 -0
- package/generated/plugins/agdf-planning/meta/agdf-planning.definition.json +9 -0
- package/generated/plugins/agdf-planning/plugin.json +45 -0
- package/generated/plugins/agdf-planning/skills/planning/SKILL.md +56 -0
- package/generated/plugins/copilot/agdf/.agdf-payload-inventory.json +878 -475
- package/generated/plugins/copilot/agdf/control/README.md +31 -110
- package/generated/plugins/copilot/agdf/control/planned-urs.md +95 -0
- package/generated/plugins/copilot/agdf/control/templates/RUN_STATE.md +15 -64
- package/generated/plugins/copilot/agdf/control/templates/artefacts/UR.md +1 -1
- package/generated/plugins/copilot/agdf/mcp/server/README.md +119 -7
- package/generated/plugins/copilot/agdf/mcp/server/package.json +12 -7
- package/generated/plugins/copilot/agdf/mcp/server/src/generation-entry.js +3 -85
- package/generated/plugins/copilot/agdf/mcp/server/src/generation-protocol.js +2 -44
- package/generated/plugins/copilot/agdf/mcp/server/src/generation-runtime.js +94 -0
- package/generated/plugins/copilot/agdf/mcp/server/src/generation-thread-entry.js +8 -0
- package/generated/plugins/copilot/agdf/mcp/server/src/generation.js +64 -20
- package/generated/plugins/copilot/agdf/mcp/server/src/main.js +42 -10
- package/generated/plugins/copilot/agdf/mcp/server/src/server.js +24 -15
- package/generated/plugins/copilot/agdf/mcp/server/src/stdio-output.js +42 -0
- package/generated/plugins/copilot/agdf/mcp/server/src/worker-entry.js +2 -2
- package/generated/plugins/copilot/agdf/mcp/server/src/worker.js +53 -7
- package/generated/plugins/copilot/agdf/meta/agdf-agent-router.md +3 -3
- package/generated/plugins/copilot/agdf/meta/agdf-plugin.definition.json +8 -3
- package/generated/plugins/copilot/agdf/meta/distribution-profile-history.json +7 -0
- package/generated/plugins/copilot/agdf/plugin.json +1 -1
- package/generated/plugins/copilot/agdf/runtime/agdf-session-check.js +25 -21
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-defaults.json +9 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-defaults.schema.json +20 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-interaction-locales.json +2668 -2682
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +8 -3
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/closeout.md +1 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/control-scaffold.md +63 -46
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/gate-artifact-preparation.md +58 -48
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/gate-transition.md +5 -6
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/interaction.md +43 -126
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/modes.md +4 -3
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/prd-definition.md +6 -6
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/quality.md +10 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/request-activation.md +9 -8
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/sd-definition.md +3 -3
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/task-target-resolution.md +24 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/tp-definition.md +1 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/ur-definition.md +41 -7
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/codex-document-command.js +195 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/command-registry.js +82 -148
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/control-maintenance-command.js +8 -37
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/parse-args.js +98 -16
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/planned-command.js +55 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/project-read-command.js +35 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/run-command-aliases.js +116 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/runtime-context.js +1 -59
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/validation-handlers.js +33 -103
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/git-observation.js +7 -5
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-maintenance/startup.js +2 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-decision-protocol.js +40 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-dispatch-runtime.js +71 -306
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/facade-entry.js +3 -24
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/facade-owner-entry.js +31 -15
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/facade-runtime.js +29 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/facade-thread-entry.js +11 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/owner-client.js +79 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/package.js +14 -80
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/plugin-runtime.js +29 -9
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/thread-owner.js +164 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-owner-protocol.js +1 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-protocol-runtime.js +308 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-worker-runtime.js +152 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/control-command-service.js +22 -7
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/control-context.js +8 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/validator-application.js +2 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/package.json +5 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/closeout-readiness.js +10 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/decision-content-placeholder.js +9 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/decision-content-readiness.js +2 -7
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/definition-sources.js +3 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/delivery-map.js +2 -12
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/doctor.js +162 -172
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-check.js +10 -9
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy-inputs.js +11 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy-pure.js +446 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy.js +3 -434
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/next-action.js +2 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/parent-reconciliation.js +2 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/qa-follow-up.js +2 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/required-files.js +9 -7
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/run-state-policy.js +1 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/run-state.js +15 -9
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/run-step-policy.js +2 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/run-work-summary.js +6 -4
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/shared-value.js +7 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/shared.js +5 -254
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/tp-planning.js +3 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/ur-readiness.js +7 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/verified-change.js +11 -9
- package/generated/plugins/{agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/backlog-vocabulary.js → copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/work-vocabulary.js} +2 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/artifact-readiness.js +5 -3
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/authoring-inputs.js +110 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-archive.js +53 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/contract.js +124 -32
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/doctor-observation.js +91 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/project-operation-call.js +5 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/project-state.js +48 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/result.js +61 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/selection.js +9 -3
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/service.js +119 -67
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/compatibility.js +42 -132
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/contract.js +5 -5
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/presentation.js +27 -119
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/service.js +9 -37
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-read/cockpit-pool.js +121 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-read/doctor-reader.js +92 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-read/doctor-worker.js +11 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-read/fs.js +18 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-read/snapshot.js +68 -17
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/aggregate.js +3 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/approval-command.js +13 -10
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/approval-operations.js +10 -7
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/artefact-binding-proof.js +12 -20
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/artefact-bindings.js +10 -7
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/canonical-initialization.js +761 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/control-layout.js +183 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/decision-material-contract.js +2 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/evidence-bindings.js +7 -7
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/git-identity.js +86 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/index.js +0 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/input-resolution.js +99 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/planned-entry.js +273 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/planned-handoff.js +174 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/planned-inventory.js +90 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/planned-origin-reader.js +48 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/planned-origin.js +40 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/presentation-decision.js +12 -7
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/presentation-delivery.js +90 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/preview-render.js +5 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/preview-review.js +3 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/preview-snapshot.js +9 -6
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/recording-formats.js +12 -16
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-artefact-recording.js +54 -66
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-closure.js +343 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-contract.js +33 -250
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-schema.js +508 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-service.js +198 -34
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-create-command.js +60 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-identity.d.ts +14 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-identity.js +40 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-input-resolution.js +72 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-inventory-reader.js +31 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-inventory.js +179 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-material.js +211 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-mutation.js +51 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-operation-identity.js +2 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-operation-proof.js +7 -4
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-operation-status.js +20 -4
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-operations.js +70 -13
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-owned-outputs.js +21 -9
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation-envelope.js +25 -33
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation-render.js +8 -7
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation.js +45 -21
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-recording.js +10 -179
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision-boundary.js +7 -21
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision-history.js +23 -16
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision.js +84 -161
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-seal-compute.js +19 -44
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-seal.js +6 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-source-revisions.js +19 -18
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-document.js +110 -42
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-edits.js +13 -5
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-parser.js +14 -6
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-reader.js +27 -18
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-repository.js +112 -48
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-resolver.js +12 -15
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-writer.js +21 -377
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-step-pending.js +2 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-step-transaction.js +125 -114
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-steps.js +136 -248
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-store-inspection.js +14 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-verified-change.js +81 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-work-summary-shape.d.ts +1 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/{backlog-summary-shape.js → run-work-summary-shape.js} +7 -19
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/delivery-continuation/service.js +5 -66
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/delivery-path-search/persistence.js +26 -8
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/delivery-path-search/state-adapter.js +1 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/index.js +14 -6
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog.js +3 -3
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/interaction-presentation.js +29 -11
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/mcp-input-hints.js +46 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/mcp-input-resolution.js +98 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/mcp-input-schema.js +15 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/mcp-resource-contract.js +1 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/mcp-tool-errors.js +31 -15
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/owned-file-lock.js +266 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/owner-placement.js +50 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/resources/canonical-init-plan.js +34 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/resources/configuration.js +92 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/resources/context.js +7 -11
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/resources/language-preference.js +59 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/runtime/mcp-owner-protocol.js +102 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/runtime/plugin-provenance.js +173 -18
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/compact-continuation.js +3 -3
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/contract.js +28 -9
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/delivery-intake.js +11 -5
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/delivery-run-assignment.js +6 -10
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/mcp-continuation.js +64 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/prd-definition.js +14 -5
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/sd-definition.js +2 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/service.js +49 -14
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/tp-definition.js +2 -1
- package/generated/plugins/copilot/agdf/runtime/runtime-manifest.json +2 -2
- package/generated/plugins/copilot/agdf/skills/agdf-brownfield-analysis/SKILL.md +8 -5
- package/generated/plugins/copilot/agdf/skills/agdf-clean-implementation-review/SKILL.md +3 -2
- package/generated/plugins/copilot/agdf/skills/agdf-code-review/SKILL.md +5 -3
- package/generated/plugins/copilot/agdf/skills/agdf-delivery-closeout/SKILL.md +3 -2
- package/generated/plugins/copilot/agdf/skills/agdf-delivery-path-search/SKILL.md +3 -2
- package/generated/plugins/copilot/agdf/skills/agdf-gate-check/SKILL.md +35 -31
- package/generated/plugins/copilot/agdf/skills/agdf-interaction-locales.json +1 -1
- package/generated/plugins/copilot/agdf/skills/agdf-prd-definition/SKILL.md +3 -2
- package/generated/plugins/copilot/agdf/skills/agdf-qa-gate/SKILL.md +3 -2
- package/generated/plugins/copilot/agdf/skills/agdf-release-or/SKILL.md +8 -5
- package/generated/plugins/copilot/agdf/skills/agdf-sd-definition/SKILL.md +3 -2
- package/generated/plugins/copilot/agdf/skills/agdf-task-plan-review/SKILL.md +3 -2
- package/generated/plugins/copilot/agdf/skills/agdf-tp-definition/SKILL.md +3 -2
- package/generated/plugins/copilot/agdf/skills/agdf-ur-definition/SKILL.md +12 -4
- package/generated/plugins/copilot/agdf/skills/agdf-ux-intent-definition/SKILL.md +5 -4
- package/generated/plugins/copilot/agdf/skills/contracts/closeout.md +1 -1
- package/generated/plugins/copilot/agdf/skills/contracts/control-scaffold.md +63 -46
- package/generated/plugins/copilot/agdf/skills/contracts/gate-artifact-preparation.md +58 -48
- package/generated/plugins/copilot/agdf/skills/contracts/gate-transition.md +5 -6
- package/generated/plugins/copilot/agdf/skills/contracts/interaction.md +43 -126
- package/generated/plugins/copilot/agdf/skills/contracts/modes.md +4 -3
- package/generated/plugins/copilot/agdf/skills/contracts/prd-definition.md +6 -6
- package/generated/plugins/copilot/agdf/skills/contracts/quality.md +10 -2
- package/generated/plugins/copilot/agdf/skills/contracts/request-activation.md +9 -8
- package/generated/plugins/copilot/agdf/skills/contracts/sd-definition.md +3 -3
- package/generated/plugins/copilot/agdf/skills/contracts/task-target-resolution.md +24 -0
- package/generated/plugins/copilot/agdf/skills/contracts/tp-definition.md +1 -1
- package/generated/plugins/copilot/agdf/skills/contracts/ur-definition.md +41 -7
- package/generated/submissions/openai/agdf/.codex-plugin/plugin.json +1 -1
- package/generated/submissions/openai/agdf/meta/agdf-agent-router.md +3 -3
- package/generated/submissions/openai/agdf/meta/agdf-defaults.json +9 -0
- package/generated/submissions/openai/agdf/meta/agdf-defaults.schema.json +20 -0
- package/generated/submissions/openai/agdf/meta/agdf-interaction-locales.json +2668 -2682
- package/generated/submissions/openai/agdf/meta/agdf-plugin.definition.json +8 -3
- package/generated/submissions/openai/agdf/meta/contracts/closeout.md +1 -1
- package/generated/submissions/openai/agdf/meta/contracts/control-scaffold.md +63 -46
- package/generated/submissions/openai/agdf/meta/contracts/gate-artifact-preparation.md +58 -48
- package/generated/submissions/openai/agdf/meta/contracts/gate-transition.md +5 -6
- package/generated/submissions/openai/agdf/meta/contracts/interaction.md +43 -126
- package/generated/submissions/openai/agdf/meta/contracts/modes.md +4 -3
- package/generated/submissions/openai/agdf/meta/contracts/prd-definition.md +6 -6
- package/generated/submissions/openai/agdf/meta/contracts/quality.md +10 -2
- package/generated/submissions/openai/agdf/meta/contracts/request-activation.md +9 -8
- package/generated/submissions/openai/agdf/meta/contracts/sd-definition.md +3 -3
- package/generated/submissions/openai/agdf/meta/contracts/task-target-resolution.md +24 -0
- package/generated/submissions/openai/agdf/meta/contracts/tp-definition.md +1 -1
- package/generated/submissions/openai/agdf/meta/contracts/ur-definition.md +41 -7
- package/generated/submissions/openai/agdf/meta/copilot-payload-baseline.json +3 -3
- package/generated/submissions/openai/agdf/meta/distribution-profile-history.json +7 -0
- package/generated/submissions/openai/agdf/plugin.json +1 -1
- package/generated/submissions/openai/agdf/skills/brownfield-analysis/SKILL.md +8 -5
- package/generated/submissions/openai/agdf/skills/clean-implementation-review/SKILL.md +3 -2
- package/generated/submissions/openai/agdf/skills/code-review/SKILL.md +5 -3
- package/generated/submissions/openai/agdf/skills/delivery-closeout/SKILL.md +3 -2
- package/generated/submissions/openai/agdf/skills/delivery-path-search/SKILL.md +3 -2
- package/generated/submissions/openai/agdf/skills/gate-check/SKILL.md +35 -31
- package/generated/submissions/openai/agdf/skills/prd-definition/SKILL.md +3 -2
- package/generated/submissions/openai/agdf/skills/qa-gate/SKILL.md +3 -2
- package/generated/submissions/openai/agdf/skills/release-or/SKILL.md +8 -5
- package/generated/submissions/openai/agdf/skills/sd-definition/SKILL.md +3 -2
- package/generated/submissions/openai/agdf/skills/task-plan-review/SKILL.md +3 -2
- package/generated/submissions/openai/agdf/skills/tp-definition/SKILL.md +3 -2
- package/generated/submissions/openai/agdf/skills/ur-definition/SKILL.md +12 -4
- package/generated/submissions/openai/agdf/skills/ux-intent-definition/SKILL.md +5 -4
- package/generated/submissions/openai/agdf/submission/openai/availability.md +1 -1
- package/generated/submissions/openai/agdf/submission/openai/capability-matrix.json +1 -1
- package/generated/submissions/openai/agdf/submission/openai/inventory.json +49 -41
- package/generated/submissions/openai/agdf/submission/openai/listing.json +1 -1
- package/generated/submissions/openai/agdf/submission/openai/readiness.json +2 -2
- package/generated/submissions/openai/agdf/submission/openai/readiness.md +2 -2
- package/generated/submissions/openai/agdf/submission/openai/release-notes.md +9 -1
- package/generated/submissions/openai/agdf/submission/openai/reviewer-cases.json +1 -1
- package/lib/cli/application.js +31 -43
- package/lib/cli/codex-document-command.js +195 -0
- package/lib/cli/command-registry.js +82 -148
- package/lib/cli/control-maintenance-command.js +8 -37
- package/lib/cli/parse-args.js +98 -16
- package/lib/cli/planned-command.js +55 -0
- package/lib/cli/project-init-command.js +21 -0
- package/lib/cli/project-read-command.js +35 -0
- package/lib/cli/run-command-aliases.js +116 -0
- package/lib/cli/runtime-context.js +1 -59
- package/lib/cli/validation-handlers.js +33 -103
- package/lib/control-evaluation/git-observation.js +7 -5
- package/lib/control-maintenance/startup.js +2 -2
- package/lib/host-adapters/codex/plugin.js +48 -1
- package/lib/install-setup/contract.js +4 -4
- package/lib/install-setup/{control-migration.js → control-compatibility.js} +1 -2
- package/lib/install-setup/interaction.js +0 -1
- package/lib/install-setup/presentation.js +3 -4
- package/lib/install-setup/service.js +5 -18
- package/lib/installers/local-marketplace.js +262 -8
- package/lib/lifecycle/codex-startup-status.js +29 -0
- package/lib/lifecycle/presentation.js +6 -0
- package/lib/mcp-decision-protocol.js +40 -0
- package/lib/mcp-dispatch-runtime.js +71 -306
- package/lib/mcp-lifecycle/adapters/codex-origin-probe.js +28 -4
- package/lib/mcp-lifecycle/evidence.js +2 -1
- package/lib/mcp-lifecycle/facade-entry.js +3 -24
- package/lib/mcp-lifecycle/facade-owner-entry.js +31 -15
- package/lib/mcp-lifecycle/facade-runtime.js +29 -0
- package/lib/mcp-lifecycle/facade-thread-entry.js +11 -0
- package/lib/mcp-lifecycle/owner-client.js +79 -0
- package/lib/mcp-lifecycle/package.js +14 -80
- package/lib/mcp-lifecycle/plugin-runtime.js +29 -9
- package/lib/mcp-lifecycle/service.js +5 -4
- package/lib/mcp-lifecycle/thread-owner.js +164 -0
- package/lib/mcp-owner-protocol.js +1 -0
- package/lib/mcp-protocol-runtime.js +308 -0
- package/lib/mcp-worker-runtime.js +152 -0
- package/lib/runtime/control-command-service.js +22 -7
- package/lib/runtime/control-context.js +8 -1
- package/lib/runtime/validator-application.js +2 -2
- package/lib/scaffold/canonical-init.js +2 -691
- package/lib/scaffold/plan.js +9 -32
- package/lib/scaffold/presentation.js +2 -2
- package/lib/scaffold/write.js +6 -1
- package/package.json +6 -2
- package/runtime/core/lib/control-evaluation/closeout-readiness.js +10 -2
- package/runtime/core/lib/control-evaluation/decision-content-placeholder.js +9 -0
- package/runtime/core/lib/control-evaluation/decision-content-readiness.js +2 -7
- package/runtime/core/lib/control-evaluation/definition-sources.js +3 -2
- package/runtime/core/lib/control-evaluation/delivery-map.js +2 -12
- package/runtime/core/lib/control-evaluation/doctor.js +162 -172
- package/runtime/core/lib/control-evaluation/gate-check.js +10 -9
- package/runtime/core/lib/control-evaluation/gate-policy-inputs.js +11 -0
- package/runtime/core/lib/control-evaluation/gate-policy-pure.js +446 -0
- package/runtime/core/lib/control-evaluation/gate-policy.js +3 -434
- package/runtime/core/lib/control-evaluation/next-action.js +2 -0
- package/runtime/core/lib/control-evaluation/parent-reconciliation.js +2 -1
- package/runtime/core/lib/control-evaluation/qa-follow-up.js +2 -1
- package/runtime/core/lib/control-evaluation/required-files.js +9 -7
- package/runtime/core/lib/control-evaluation/run-state-policy.js +1 -1
- package/runtime/core/lib/control-evaluation/run-state.js +15 -9
- package/runtime/core/lib/control-evaluation/run-step-policy.js +2 -1
- package/runtime/core/lib/control-evaluation/run-work-summary.js +6 -4
- package/runtime/core/lib/control-evaluation/shared-value.js +7 -0
- package/runtime/core/lib/control-evaluation/shared.js +5 -254
- package/runtime/core/lib/control-evaluation/tp-planning.js +3 -2
- package/runtime/core/lib/control-evaluation/ur-readiness.js +7 -2
- package/runtime/core/lib/control-evaluation/verified-change.js +11 -9
- package/{generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/backlog-vocabulary.js → runtime/core/lib/control-evaluation/work-vocabulary.js} +2 -2
- package/runtime/core/lib/control-inspect/artifact-readiness.js +5 -3
- package/runtime/core/lib/control-inspect/authoring-inputs.js +110 -0
- package/runtime/core/lib/control-inspect/cockpit-archive.js +53 -0
- package/runtime/core/lib/control-inspect/cockpit-context.js +2 -1
- package/runtime/core/lib/control-inspect/cockpit-contract.js +11 -4
- package/runtime/core/lib/control-inspect/cockpit-list.d.ts +10 -6
- package/runtime/core/lib/control-inspect/cockpit-list.js +32 -41
- package/runtime/core/lib/control-inspect/cockpit-session.js +8 -8
- package/runtime/core/lib/control-inspect/cockpit-work.js +33 -0
- package/runtime/core/lib/control-inspect/cockpit.js +75 -44
- package/runtime/core/lib/control-inspect/contract.js +124 -32
- package/runtime/core/lib/control-inspect/decision-session.js +53 -11
- package/runtime/core/lib/control-inspect/doctor-observation.js +91 -0
- package/runtime/core/lib/control-inspect/project-operation-call.js +5 -0
- package/runtime/core/lib/control-inspect/project-state.js +48 -0
- package/runtime/core/lib/control-inspect/result.js +61 -0
- package/runtime/core/lib/control-inspect/selection.js +9 -3
- package/runtime/core/lib/control-inspect/service.js +119 -67
- package/runtime/core/lib/control-maintenance/compatibility.js +42 -132
- package/runtime/core/lib/control-maintenance/contract.js +5 -5
- package/runtime/core/lib/control-maintenance/presentation.js +27 -119
- package/runtime/core/lib/control-maintenance/service.js +9 -37
- package/runtime/core/lib/control-read/cockpit-pool.js +25 -9
- package/runtime/core/lib/control-read/cockpit-worker.js +4 -3
- package/runtime/core/lib/control-read/doctor-reader.js +92 -0
- package/runtime/core/lib/control-read/doctor-worker.js +11 -0
- package/runtime/core/lib/control-read/fs.js +18 -0
- package/runtime/core/lib/control-read/snapshot.js +68 -17
- package/runtime/core/lib/control-state/aggregate.js +3 -1
- package/runtime/core/lib/control-state/approval-command.js +13 -10
- package/runtime/core/lib/control-state/approval-operations.js +10 -7
- package/runtime/core/lib/control-state/artefact-binding-proof.js +12 -20
- package/runtime/core/lib/control-state/artefact-bindings.js +10 -7
- package/runtime/core/lib/control-state/canonical-initialization.js +761 -0
- package/runtime/core/lib/control-state/control-layout.js +183 -0
- package/runtime/core/lib/control-state/decision-action-contract.js +10 -1
- package/runtime/core/lib/control-state/decision-action-service.js +24 -3
- package/runtime/core/lib/control-state/decision-material-contract.js +2 -1
- package/runtime/core/lib/control-state/evidence-bindings.js +7 -7
- package/runtime/core/lib/control-state/git-identity.js +86 -0
- package/runtime/core/lib/control-state/index.js +0 -1
- package/runtime/core/lib/control-state/input-resolution.js +99 -0
- package/runtime/core/lib/control-state/planned-entry.js +273 -0
- package/runtime/core/lib/control-state/planned-handoff.js +174 -0
- package/runtime/core/lib/control-state/planned-inventory.js +90 -0
- package/runtime/core/lib/control-state/planned-origin-reader.js +48 -0
- package/runtime/core/lib/control-state/planned-origin.js +40 -0
- package/runtime/core/lib/control-state/presentation-decision.js +12 -7
- package/runtime/core/lib/control-state/presentation-delivery.js +90 -0
- package/runtime/core/lib/control-state/preview-render.js +5 -2
- package/runtime/core/lib/control-state/preview-review.js +3 -2
- package/runtime/core/lib/control-state/preview-snapshot.js +9 -6
- package/runtime/core/lib/control-state/recording-formats.js +12 -16
- package/runtime/core/lib/control-state/run-artefact-recording.js +54 -66
- package/runtime/core/lib/control-state/run-closure.js +343 -0
- package/runtime/core/lib/control-state/run-command-contract.js +33 -250
- package/runtime/core/lib/control-state/run-command-schema.js +508 -0
- package/runtime/core/lib/control-state/run-command-service.js +198 -34
- package/runtime/core/lib/control-state/run-create-command.js +60 -0
- package/runtime/core/lib/control-state/run-identity.d.ts +14 -0
- package/runtime/core/lib/control-state/run-identity.js +40 -0
- package/runtime/core/lib/control-state/run-input-resolution.js +72 -0
- package/runtime/core/lib/control-state/run-inventory-reader.js +31 -0
- package/runtime/core/lib/control-state/run-inventory.js +179 -0
- package/runtime/core/lib/control-state/run-material.js +211 -0
- package/runtime/core/lib/control-state/run-mutation.js +51 -0
- package/runtime/core/lib/control-state/run-operation-identity.js +2 -1
- package/runtime/core/lib/control-state/run-operation-proof.js +7 -4
- package/runtime/core/lib/control-state/run-operation-status.js +20 -4
- package/runtime/core/lib/control-state/run-operations.js +70 -13
- package/runtime/core/lib/control-state/run-owned-outputs.js +21 -9
- package/runtime/core/lib/control-state/run-presentation-envelope.js +25 -33
- package/runtime/core/lib/control-state/run-presentation-render.js +8 -7
- package/runtime/core/lib/control-state/run-presentation.js +45 -21
- package/runtime/core/lib/control-state/run-recording.js +10 -179
- package/runtime/core/lib/control-state/run-revision-boundary.js +7 -21
- package/runtime/core/lib/control-state/run-revision-history.js +23 -16
- package/runtime/core/lib/control-state/run-revision.js +84 -161
- package/runtime/core/lib/control-state/run-seal-compute.js +19 -44
- package/runtime/core/lib/control-state/run-seal.js +6 -1
- package/runtime/core/lib/control-state/run-source-revisions.js +19 -18
- package/runtime/core/lib/control-state/run-state-document.js +110 -42
- package/runtime/core/lib/control-state/run-state-edits.js +13 -5
- package/runtime/core/lib/control-state/run-state-parser.js +14 -6
- package/runtime/core/lib/control-state/run-state-reader.js +27 -18
- package/runtime/core/lib/control-state/run-state-repository.js +112 -48
- package/runtime/core/lib/control-state/run-state-resolver.js +12 -15
- package/runtime/core/lib/control-state/run-state-writer.js +21 -377
- package/runtime/core/lib/control-state/run-step-pending.js +2 -1
- package/runtime/core/lib/control-state/run-step-transaction.js +125 -114
- package/runtime/core/lib/control-state/run-steps.js +136 -248
- package/runtime/core/lib/control-state/run-store-inspection.js +14 -2
- package/runtime/core/lib/control-state/run-verified-change.js +81 -0
- package/runtime/core/lib/control-state/run-work-summary-shape.d.ts +1 -0
- package/{generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/backlog-summary-shape.js → runtime/core/lib/control-state/run-work-summary-shape.js} +7 -19
- package/runtime/core/lib/delivery-continuation/service.js +5 -66
- package/runtime/core/lib/delivery-path-search/persistence.js +26 -8
- package/runtime/core/lib/delivery-path-search/state-adapter.js +1 -1
- package/runtime/core/lib/index.js +14 -6
- package/runtime/core/lib/interaction-catalog.js +3 -3
- package/runtime/core/lib/interaction-presentation.js +29 -11
- package/runtime/core/lib/mcp-input-hints.js +46 -0
- package/runtime/core/lib/mcp-input-resolution.js +98 -0
- package/runtime/core/lib/mcp-input-schema.js +15 -0
- package/runtime/core/lib/mcp-resource-contract.js +1 -1
- package/runtime/core/lib/mcp-tool-errors.js +31 -15
- package/runtime/core/lib/owned-file-lock.js +266 -0
- package/runtime/core/lib/owner-placement.js +50 -0
- package/runtime/core/lib/resources/canonical-init-plan.js +34 -0
- package/runtime/core/lib/resources/configuration.js +92 -0
- package/runtime/core/lib/resources/context.js +7 -11
- package/runtime/core/lib/resources/language-preference.js +59 -0
- package/runtime/core/lib/runtime/mcp-owner-protocol.js +102 -0
- package/runtime/core/lib/runtime/plugin-provenance.js +173 -18
- package/runtime/core/lib/skill-dispatch/compact-continuation.js +3 -3
- package/runtime/core/lib/skill-dispatch/contract.js +28 -9
- package/runtime/core/lib/skill-dispatch/delivery-intake.js +11 -5
- package/runtime/core/lib/skill-dispatch/delivery-run-assignment.js +6 -10
- package/runtime/core/lib/skill-dispatch/mcp-continuation.js +64 -0
- package/runtime/core/lib/skill-dispatch/prd-definition.js +14 -5
- package/runtime/core/lib/skill-dispatch/sd-definition.js +2 -1
- package/runtime/core/lib/skill-dispatch/service.js +49 -14
- package/runtime/core/lib/skill-dispatch/tp-definition.js +2 -1
- package/generated/.agdf/control/templates/AGDF_RUN.md +0 -139
- package/generated/.agdf/control/templates/MASTER_BACKLOG.md +0 -39
- package/generated/plugins/agdf/control/templates/AGDF_RUN.md +0 -139
- package/generated/plugins/agdf/control/templates/MASTER_BACKLOG.md +0 -39
- package/generated/plugins/agdf/runtime/create-agdf/lib/control-maintenance/interaction.js +0 -28
- package/generated/plugins/agdf/runtime/create-agdf/lib/control-maintenance/repair.js +0 -4
- package/generated/plugins/agdf/runtime/create-agdf/lib/control-maintenance/service.js +0 -3
- package/generated/plugins/agdf/runtime/create-agdf/lib/control-state/run-recovery.js +0 -5
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-backlog.js +0 -135
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/interaction.js +0 -57
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/migration.js +0 -85
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/repair.js +0 -226
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/backlog-summary-shape.d.ts +0 -4
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/backlog-summary.js +0 -67
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/legacy-migration.js +0 -69
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/legacy-projection-reader.js +0 -38
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-backlog-writer.js +0 -80
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-backlog.js +0 -90
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-recovery.js +0 -296
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-relationship-correction.js +0 -74
- package/generated/plugins/copilot/agdf/control/templates/AGDF_RUN.md +0 -139
- package/generated/plugins/copilot/agdf/control/templates/MASTER_BACKLOG.md +0 -39
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-maintenance/interaction.js +0 -28
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-maintenance/repair.js +0 -4
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-maintenance/service.js +0 -3
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/run-recovery.js +0 -5
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/interaction.js +0 -57
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/migration.js +0 -85
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/repair.js +0 -226
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/backlog-summary-shape.d.ts +0 -4
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/backlog-summary.js +0 -67
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/legacy-migration.js +0 -69
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/legacy-projection-reader.js +0 -38
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-backlog-writer.js +0 -80
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-backlog.js +0 -90
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-recovery.js +0 -296
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-relationship-correction.js +0 -74
- package/lib/control-maintenance/interaction.js +0 -28
- package/lib/control-maintenance/repair.js +0 -4
- package/lib/control-maintenance/service.js +0 -3
- package/lib/control-state/run-recovery.js +0 -5
- package/lib/install-setup/control-repair.js +0 -1
- package/runtime/core/lib/control-inspect/cockpit-backlog.js +0 -135
- package/runtime/core/lib/control-maintenance/interaction.js +0 -57
- package/runtime/core/lib/control-maintenance/migration.js +0 -85
- package/runtime/core/lib/control-maintenance/repair.js +0 -226
- package/runtime/core/lib/control-state/backlog-summary-shape.d.ts +0 -4
- package/runtime/core/lib/control-state/backlog-summary.js +0 -67
- package/runtime/core/lib/control-state/legacy-migration.js +0 -69
- package/runtime/core/lib/control-state/legacy-projection-reader.js +0 -38
- package/runtime/core/lib/control-state/run-backlog-writer.js +0 -80
- package/runtime/core/lib/control-state/run-backlog.js +0 -90
- package/runtime/core/lib/control-state/run-recovery.js +0 -296
- package/runtime/core/lib/control-state/run-relationship-correction.js +0 -74
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { CURRENT_RUN_VERSION } from './run-identity.js';
|
|
2
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
3
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
4
|
+
import { existsSync, lstatSync, mkdirSync, readdirSync, unlinkSync, openSync, writeFileSync, fsyncSync, closeSync } from 'node:fs';
|
|
5
|
+
import { join, dirname } from 'node:path';
|
|
6
|
+
import { atomicWrite, fsyncDirectory, withOwnedFileLock } from '../owned-file-lock.js';
|
|
7
|
+
import { hasSymlinkComponent, containedRegularFile } from './contained-file.js';
|
|
8
|
+
import { exactObject, canonicalJson } from './approval-command-contract.js';
|
|
9
|
+
import { REVISION_ID_PATTERN } from './run-identity.js';
|
|
10
|
+
import { readContainedControlText } from '../control-read/snapshot.js';
|
|
11
|
+
import { currentInputResolution, isOriginalInputResolution, bindInputResolution, resolutionRecord, recordedInputResolution } from './input-resolution.js';
|
|
12
|
+
|
|
13
|
+
import { CURRENT_LAYOUT } from './run-identity.js';
|
|
14
|
+
export { CURRENT_LAYOUT } from './run-identity.js';
|
|
15
|
+
const CONFIG = '.agdf/control/config.json';
|
|
16
|
+
const MAINTENANCE = '.agdf/control/maintenance';
|
|
17
|
+
const CLAIMS = `${MAINTENANCE}/admission`;
|
|
18
|
+
const active = new AsyncLocalStorage();
|
|
19
|
+
export function markControlMutationEffect() {
|
|
20
|
+
const mutation = active.getStore();
|
|
21
|
+
if (mutation) mutation.effectStarted = true;
|
|
22
|
+
}
|
|
23
|
+
export const currentControlMutationId = () => active.getStore()?.operation_id ?? null;
|
|
24
|
+
// Git scope checks may exclude only the active owner's exact transient claims.
|
|
25
|
+
// Another operation's files, or replaced claim bytes, remain foreign evidence.
|
|
26
|
+
export function currentOwnedMutationClaimPaths(root) {
|
|
27
|
+
const mutation = active.getStore();
|
|
28
|
+
if (mutation?.root !== root) return [];
|
|
29
|
+
const claims = mutation.claim ? [{ path: mutation.claim.path, digest: hash(mutation.claim.text) }] : mutation.recoveryClaims ?? [];
|
|
30
|
+
return claims.map(claim => {
|
|
31
|
+
if (hash(read(root, claim.path, 4096)) !== claim.digest) fail('AGDF_CONTROL_ADMISSION_UNKNOWN');
|
|
32
|
+
return claim.path;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export function markControlMutationRollbackKnown(resource) {
|
|
36
|
+
const mutation = active.getStore();
|
|
37
|
+
if (mutation && (!resource || mutation.resource === resource)) mutation.effectStarted = false;
|
|
38
|
+
}
|
|
39
|
+
const hash = value => 'sha256:' + createHash('sha256').update(value).digest('hex');
|
|
40
|
+
const fail = code => { throw Error(code); };
|
|
41
|
+
|
|
42
|
+
function read(root, path, limit = 65536) {
|
|
43
|
+
if (hasSymlinkComponent(root, path) || containedRegularFile(root, path).status !== 'valid') fail('AGDF_CONTROL_PATH_INVALID');
|
|
44
|
+
return readContainedControlText(root, path, limit);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function readControlLayout(root, { live = false } = {}) {
|
|
48
|
+
const captured = currentInputResolution()?.configuration;
|
|
49
|
+
const original = !live && isOriginalInputResolution() && captured?.root === root && captured.control === 'active' ? captured : null;
|
|
50
|
+
const originalSnapshot = () => {
|
|
51
|
+
if (original.control_layout !== CURRENT_LAYOUT) fail('AGDF_CONTROL_LAYOUT_UNSUPPORTED');
|
|
52
|
+
return Object.freeze({ layout: CURRENT_LAYOUT, generation: original.config_digest, config: null });
|
|
53
|
+
};
|
|
54
|
+
let text, config;
|
|
55
|
+
try { text = read(root, CONFIG); config = JSON.parse(text.replace(/^\uFEFF/u, '')); }
|
|
56
|
+
catch (error) { if (original) return originalSnapshot(); if (error.message === 'AGDF_CONTROL_PATH_INVALID') throw error; fail('AGDF_CONTROL_LAYOUT_INVALID'); }
|
|
57
|
+
if (!config || typeof config !== 'object' || Array.isArray(config)) {
|
|
58
|
+
if (original) return originalSnapshot(); fail('AGDF_CONTROL_LAYOUT_INVALID');
|
|
59
|
+
}
|
|
60
|
+
if (config.control_layout !== CURRENT_LAYOUT) { if (original) return originalSnapshot(); fail('AGDF_CONTROL_LAYOUT_UNSUPPORTED'); }
|
|
61
|
+
return Object.freeze({ layout: CURRENT_LAYOUT, generation: original ? originalSnapshot().generation : hash(text), config });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function assertLayoutRunWrite(root, state) {
|
|
65
|
+
const layout = readControlLayout(root);
|
|
66
|
+
if (state.meta.control_state_version !== String(CURRENT_RUN_VERSION)) fail('AGDF_RUN_VERSION_UNSUPPORTED');
|
|
67
|
+
return layout;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function ensureDirectory(root, path) {
|
|
71
|
+
if (hasSymlinkComponent(root, path)) fail('AGDF_CONTROL_PATH_INVALID');
|
|
72
|
+
const file = join(root, path);
|
|
73
|
+
if (!existsSync(file)) {
|
|
74
|
+
try { mkdirSync(file, { mode: 0o700 }); fsyncDirectory(dirname(file)); }
|
|
75
|
+
catch (error) { if (error.code !== 'EEXIST') throw error; }
|
|
76
|
+
}
|
|
77
|
+
const stat = lstatSync(file);
|
|
78
|
+
if (!stat.isDirectory() || stat.isSymbolicLink()) fail('AGDF_CONTROL_PATH_INVALID');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function ensureAdmission(root) {
|
|
82
|
+
ensureDirectory(root, MAINTENANCE); ensureDirectory(root, CLAIMS);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function publishClaim(root, relative, text) {
|
|
86
|
+
// Exclusive publication cannot replace an unknown pre-existing claim.
|
|
87
|
+
const path = join(root, relative), fd = openSync(path, 'wx', 0o600);
|
|
88
|
+
try { writeFileSync(fd, text); fsyncSync(fd); } finally { closeSync(fd); }
|
|
89
|
+
fsyncDirectory(dirname(path));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function retireClaim(root, claim) {
|
|
93
|
+
if (read(root, claim.path, 4096) !== claim.text) fail('AGDF_CONTROL_ADMISSION_UNKNOWN');
|
|
94
|
+
unlinkSync(join(root, claim.path)); fsyncDirectory(join(root, CLAIMS));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Call after the resource lock, before publishing any product effect. Independent
|
|
98
|
+
// claims have no shared exclusive lock. Nested owners retain the outer admission.
|
|
99
|
+
export function withControlMutation(root, { resource, operation_id = null, checkpoint = () => {}, resume = false, proveOutcome } = {}, work) {
|
|
100
|
+
const inherited = active.getStore();
|
|
101
|
+
if (inherited?.root === root) return work(inherited.layout);
|
|
102
|
+
if (typeof resource !== 'string' || !resource || resource.length > 512) fail('AGDF_CONTROL_RESOURCE_INVALID');
|
|
103
|
+
if (operation_id !== null && !REVISION_ID_PATTERN.test(operation_id)) fail('AGDF_CONTROL_RESOURCE_INVALID');
|
|
104
|
+
ensureAdmission(root);
|
|
105
|
+
if (resume && operation_id && inspectMutationClaims(root, { strict: false }).some(row => row.resource === resource && row.operation_id === operation_id))
|
|
106
|
+
return withControlRecovery(root, { resource, operation_id, proveOutcome }, work);
|
|
107
|
+
const layout = readControlLayout(root);
|
|
108
|
+
checkpoint('before_claim');
|
|
109
|
+
const id = randomUUID(), path = `${CLAIMS}/${id}.json`;
|
|
110
|
+
const text = JSON.stringify({ schema_version: 1, id, resource, operation_id, generation: layout.generation, pid: process.pid }) + '\n';
|
|
111
|
+
const claim = { path, text };
|
|
112
|
+
publishClaim(root, path, text);
|
|
113
|
+
let admitted = false;
|
|
114
|
+
const mutation = { root, layout, claim, resource, operation_id, effectStarted: false };
|
|
115
|
+
try {
|
|
116
|
+
checkpoint('claim_published');
|
|
117
|
+
if (readControlLayout(root).generation !== layout.generation) fail('AGDF_CONTROL_MAINTENANCE_REQUIRED');
|
|
118
|
+
admitted = true;
|
|
119
|
+
checkpoint('admitted');
|
|
120
|
+
const result = active.run(mutation, () => work(layout));
|
|
121
|
+
if (result && typeof result.then === 'function') fail('AGDF_CONTROL_ASYNC_MUTATION_UNSUPPORTED');
|
|
122
|
+
const observed = result?.rejection ?? result;
|
|
123
|
+
if (mutation.effectStarted && (['recovery_required', 'effect_unknown'].includes(observed?.outcome)
|
|
124
|
+
|| /recovery_required|effect_unknown/u.test(observed?.reason ?? ''))) {
|
|
125
|
+
return { ...result, admission_claim: { path, digest: hash(text) } };
|
|
126
|
+
}
|
|
127
|
+
retireClaim(root, claim);
|
|
128
|
+
return result;
|
|
129
|
+
} catch (error) {
|
|
130
|
+
// Known rollback/rejection may retire. An uncertain transaction keeps its claim
|
|
131
|
+
// until the original operation is explicitly recovered and its outcome proven.
|
|
132
|
+
const uncertain = admitted && mutation.effectStarted;
|
|
133
|
+
if (uncertain) error.admission_claim = { path, digest: hash(text) };
|
|
134
|
+
else retireClaim(root, claim);
|
|
135
|
+
throw error;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function inspectMutationClaims(root, { strict = true } = {}) {
|
|
140
|
+
if (hasSymlinkComponent(root, CLAIMS)) fail('AGDF_CONTROL_PATH_INVALID');
|
|
141
|
+
if (!existsSync(join(root, CLAIMS))) return [];
|
|
142
|
+
if (!lstatSync(join(root, CLAIMS)).isDirectory()) fail('AGDF_CONTROL_PATH_INVALID');
|
|
143
|
+
const names = readdirSync(join(root, CLAIMS));
|
|
144
|
+
if (names.length > 4096) fail('AGDF_CONTROL_ADMISSION_UNKNOWN');
|
|
145
|
+
return names.sort().map(name => {
|
|
146
|
+
try {
|
|
147
|
+
if (!/^[0-9a-f-]{36}\.json$/u.test(name)) fail('AGDF_CONTROL_ADMISSION_UNKNOWN');
|
|
148
|
+
const path = `${CLAIMS}/${name}`, text = read(root, path, 4096);
|
|
149
|
+
let claim; try { claim = JSON.parse(text); } catch { fail('AGDF_CONTROL_ADMISSION_UNKNOWN'); }
|
|
150
|
+
if (!exactObject(claim, ['schema_version', 'id', 'resource', 'operation_id', 'generation', 'pid']) || claim.schema_version !== 1
|
|
151
|
+
|| !REVISION_ID_PATTERN.test(claim.id) || name !== `${claim.id}.json` || typeof claim.resource !== 'string'
|
|
152
|
+
|| !claim.resource || claim.resource.length > 512 || !/^sha256:[a-f0-9]{64}$/u.test(claim.generation)
|
|
153
|
+
|| claim.operation_id !== null && !REVISION_ID_PATTERN.test(claim.operation_id)
|
|
154
|
+
|| !Number.isSafeInteger(claim.pid) || claim.pid <= 0) fail('AGDF_CONTROL_ADMISSION_UNKNOWN');
|
|
155
|
+
return { ...claim, path, digest: hash(text) };
|
|
156
|
+
} catch (error) { if (strict) throw error; return null; }
|
|
157
|
+
}).filter(Boolean);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// An original admitted operation may finish while maintenance is draining it.
|
|
161
|
+
// This does not admit new effects: the caller holds its resource lock and must
|
|
162
|
+
// prove the original transaction's exact recorded or rolled-back outcome.
|
|
163
|
+
export function withControlRecovery(root, { resource, operation_id, proveOutcome }, work) {
|
|
164
|
+
if (!REVISION_ID_PATTERN.test(operation_id) || typeof proveOutcome !== 'function') fail('AGDF_CONTROL_ADMISSION_UNKNOWN');
|
|
165
|
+
const claims = inspectMutationClaims(root, { strict: false }).filter(row => row.resource === resource && row.operation_id === operation_id);
|
|
166
|
+
if (!claims.length) return withControlMutation(root, { resource, operation_id }, work);
|
|
167
|
+
const layout = readControlLayout(root);
|
|
168
|
+
if (claims.some(row => row.generation !== layout.generation)) fail('AGDF_CONTROL_ADMISSION_UNKNOWN');
|
|
169
|
+
const result = active.run({ root, layout, resource, operation_id, recoveryClaims: claims, effectStarted: false }, work);
|
|
170
|
+
if (result && typeof result.then === 'function' || proveOutcome(result) !== true) fail('AGDF_CONTROL_ADMISSION_UNKNOWN');
|
|
171
|
+
for (const claim of claims) retireRecoveredMutationClaim(root, { ...claim, proveOutcome: () => true });
|
|
172
|
+
return result;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// No timeout/liveness heuristic removes claims. The recovery owner supplies proof
|
|
176
|
+
// of the original operation's known outcome and the exact inspected claim bytes.
|
|
177
|
+
export function retireRecoveredMutationClaim(root, { path, digest, proveOutcome }) {
|
|
178
|
+
const observed = inspectMutationClaims(root, { strict: false }).find(row => row.path === path && row.digest === digest);
|
|
179
|
+
if (!observed || typeof proveOutcome !== 'function' || proveOutcome(observed) !== true) fail('AGDF_CONTROL_ADMISSION_UNKNOWN');
|
|
180
|
+
const text = read(root, path, 4096);
|
|
181
|
+
if (hash(text) !== digest) fail('AGDF_CONTROL_ADMISSION_UNKNOWN');
|
|
182
|
+
retireClaim(root, { path, text });
|
|
183
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { strictObject, schemaDiagnostics, RUN_COMMAND_LIMITS, RUN_COMMAND_GROUPS } from './run-command-
|
|
1
|
+
import { strictObject, schemaDiagnostics, RUN_COMMAND_LIMITS, RUN_COMMAND_GROUPS } from './run-command-schema.js';
|
|
2
2
|
import { REVISION_ID_PATTERN } from './run-identity.js';
|
|
3
3
|
import { canonicalJson, digest } from './approval-command-contract.js';
|
|
4
4
|
|
|
@@ -30,3 +30,12 @@ export function decisionActionDefinition(groups) {
|
|
|
30
30
|
inputSchema: decisionActionSchema(actions), _meta: { ui: { resourceUri: DECISION_UI_URI, visibility: ['app'] } } });
|
|
31
31
|
}
|
|
32
32
|
export const decisionActionRequestDigest = (binding, input) => digest(`agdf-app-decision/1\0${canonicalJson({ binding, input })}`);
|
|
33
|
+
|
|
34
|
+
export const DECISION_VIEW_SCHEMA = strictObject({ primary_target: { type: 'string', minLength: 1, maxLength: 4096 },
|
|
35
|
+
target_id: { type: 'string', pattern: '^sha256:[0-9a-f]{64}$' }, run_id: { type: 'string', pattern: '^[A-Za-z0-9_-]{1,128}$' },
|
|
36
|
+
expected_revision_id: uuid, gate: { enum: ['UR', 'PRD', 'SD', 'TP', 'QA', 'UAT'] }, presentation_id: uuid });
|
|
37
|
+
export const DECISION_VIEW_DEFINITION = Object.freeze({ name: 'agdf_decision_view',
|
|
38
|
+
description: 'Optional non-primary preview of a prepared decision. Display is unconfirmed until the bound live view is observed. Then call presentation.deliver; absent current-surface proof selects Markdown.',
|
|
39
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: false, openWorldHint: false }, inputSchema: DECISION_VIEW_SCHEMA,
|
|
40
|
+
_meta: { ui: { resourceUri: DECISION_UI_URI, visibility: ['model', 'app'] } } });
|
|
41
|
+
export function validateDecisionView(input) { return schemaDiagnostics(input, DECISION_VIEW_SCHEMA); }
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { createInputResolution, withInputResolution } from './input-resolution.js';
|
|
2
|
+
import { inspectRunInputResolution } from './run-input-resolution.js';
|
|
3
|
+
import { resolveConfiguration } from '../resources/configuration.js';
|
|
4
|
+
import { resources } from '../resources/context.js';
|
|
1
5
|
import { withLiveControlReads } from '../control-read/fs.js';
|
|
2
6
|
import { evaluateGateCheck } from '../control-evaluation/gate-check.js';
|
|
3
7
|
import { executeApprovalCommand } from './approval-command.js';
|
|
@@ -31,20 +35,37 @@ export function createDecisionActionService({ enabledGroups = Object.keys(RUN_CO
|
|
|
31
35
|
if (diagnostics.length) return { schema_version: '1', outcome: 'rejected', reason: 'decision_schema_invalid', diagnostics, authorizes: false };
|
|
32
36
|
if (!actions.includes(input.action)) return result('rejected', 'command_group_disabled');
|
|
33
37
|
if (!appOnlyMediationQualified) return result('rejected', 'app_only_mediation_not_qualified');
|
|
38
|
+
const target = resolveControlCommandTarget(root);
|
|
34
39
|
if (input.presentation_id !== binding.presentation_id || input.expected_revision_id !== binding.expected_revision_id
|
|
35
|
-
||
|
|
40
|
+
|| target.target_id !== binding.target_id) return result('rejected', 'decision_binding_invalid');
|
|
41
|
+
root = target.root;
|
|
36
42
|
const requestDigest = decisionActionRequestDigest(binding, input);
|
|
37
43
|
let dispatched = false;
|
|
38
44
|
try {
|
|
45
|
+
const publicInput = { schema_version: '1', assurance: 'cooperative_local', working_directory: root, primary_target: root,
|
|
46
|
+
target_source: 'explicit_target', target_id: binding.target_id, run_id: binding.run_id,
|
|
47
|
+
expected_revision_id: binding.expected_revision_id, operation_id: input.operation_id,
|
|
48
|
+
...(binding.presentation_language ? { presentation_language: binding.presentation_language } : {}),
|
|
49
|
+
command: { kind: input.action === 'approve' ? 'approval.record' : 'presentation_decision.record', payload: {} } };
|
|
50
|
+
const original = inspectRunInputResolution(root, publicInput);
|
|
51
|
+
if (original?.known && (!original.resolution || original.resolution.logical_digest !== requestDigest)) return result('rejected', 'operation_payload_conflict');
|
|
52
|
+
const configuration = original?.resolution?.configuration ?? resolveConfiguration(root, resources.defaults,
|
|
53
|
+
binding.presentation_language ? { chat_language: binding.presentation_language } : {});
|
|
54
|
+
// The private App facade already owns a request digest over the held binding
|
|
55
|
+
// and complete gesture, including its inert comment. Retain that identity;
|
|
56
|
+
// the common current resolution codec binds the same project preferences.
|
|
57
|
+
const resolution = original?.resolution ?? { ...createInputResolution(publicInput,
|
|
58
|
+
{ ...publicInput, presentation_language: configuration.values.chat_language }, configuration),
|
|
59
|
+
logical_digest: requestDigest, effective_digest: requestDigest };
|
|
39
60
|
checkpoint('before_dispatch'); dispatched = true;
|
|
40
|
-
const family = input.action === 'approve'
|
|
61
|
+
const family = withInputResolution(resolution, () => input.action === 'approve'
|
|
41
62
|
? executeApprovalCommand(root, { schema_version: '1', action: 'record_gate_approval', target_id: binding.target_id, run_id: binding.run_id,
|
|
42
63
|
expected_revision_id: binding.expected_revision_id, operation_id: input.operation_id, assurance: 'cooperative_local', gate: binding.gate,
|
|
43
64
|
presentation_id: binding.presentation_id, response: `Approval: ${binding.gate}` }, { evaluateGateCheck, packageVersion, checkpoint,
|
|
44
65
|
commandContext: { kind: 'approval.record', operation_id: input.operation_id, target_id: binding.target_id, request_digest: requestDigest } })
|
|
45
66
|
: recordRunPresentationDecision(root, { runId: binding.run_id, gate: binding.gate, revisionId: binding.expected_revision_id,
|
|
46
67
|
operationId: input.operation_id, presentationId: binding.presentation_id, action: input.action, comment: input.comment ?? '', requestDigest },
|
|
47
|
-
{ evaluateGateCheck, packageVersion, afterWrite: checkpoint });
|
|
68
|
+
{ evaluateGateCheck, packageVersion, afterWrite: checkpoint }), original?.known === true);
|
|
48
69
|
checkpoint('before_result');
|
|
49
70
|
return result(['accepted', 'recorded'].includes(family.outcome) ? 'accepted' : family.outcome === 'already_applied' ? 'already_applied'
|
|
50
71
|
: ['retryable_failure', 'recovery_required'].includes(family.outcome) ? 'effect_unknown' : 'rejected', family.reason, family);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { runDocumentPath } from './run-identity.js';
|
|
1
2
|
import { canonicalJson, digest, DIGEST_PATTERN } from './approval-command-contract.js';
|
|
2
3
|
|
|
3
4
|
export function validDecisionMaterial(sources, runId) {
|
|
4
5
|
return Array.isArray(sources) && sources.length > 0 && sources.length <= 12
|
|
5
6
|
&& new Set(sources.map(s => s?.type)).size === sources.length
|
|
6
7
|
&& sources.every(s => s && Object.keys(s).sort().join(',') === 'digest,path,type' && typeof s.type === 'string'
|
|
7
|
-
&& typeof s.path === 'string' && s.path.startsWith(
|
|
8
|
+
&& typeof s.path === 'string' && s.path.startsWith(`${runDocumentPath(runId, '')}/`)
|
|
8
9
|
&& !s.path.includes('..') && DIGEST_PATTERN.test(s.digest ?? ''));
|
|
9
10
|
}
|
|
10
11
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { runDocumentPath, runEvidencePath } from './run-identity.js';
|
|
1
2
|
import { createHash } from 'node:crypto';
|
|
2
3
|
import { canonicalJson, digest, exactObject, DIGEST_PATTERN, COOPERATIVE_ASSURANCE } from './approval-command-contract.js';
|
|
3
4
|
import { RUN_ID_PATTERN, REVISION_ID_PATTERN } from './run-identity.js';
|
|
4
5
|
import { isSafeControlRelativePath } from './contained-file.js';
|
|
5
6
|
|
|
6
7
|
export const EVIDENCE_PREREQUISITES = Object.freeze({
|
|
8
|
+
'Verified Change': ['UR'],
|
|
7
9
|
ur: [], route: ['UR'], 'Brownfield Review': ['UR'], 'UX Intent Definition': ['UR', 'Brownfield Review'],
|
|
8
10
|
'Brownfield Analysis': ['UR', 'PRD', 'SD', 'TP', 'Brownfield Review', 'UX Intent Definition'],
|
|
9
11
|
'CD+Tests': ['UR', 'PRD', 'SD', 'TP', 'Brownfield Analysis'],
|
|
@@ -13,21 +15,19 @@ export const EVIDENCE_PREREQUISITES = Object.freeze({
|
|
|
13
15
|
});
|
|
14
16
|
// Reviews a structured closeout requires (closeout-readiness.js). Gate order and late
|
|
15
17
|
// recording use the same list, so no route can be approved into an unclosable state.
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
export const reviewArtefactType = (state, step) => step === 'Clean Implementation Review' && !state.artefacts.get(step)?.path
|
|
19
|
-
&& state.artefacts.get('Clean Review')?.path ? 'Clean Review' : step;
|
|
18
|
+
export { STRUCTURED_REQUIRED_REVIEWS, reviewArtefactType } from "../control-evaluation/gate-policy-inputs.js";
|
|
19
|
+
import { STRUCTURED_REQUIRED_REVIEWS, reviewArtefactType } from "../control-evaluation/gate-policy-inputs.js";
|
|
20
20
|
// Reviews whose normalized findings closeout inspects; at OR they may be recorded again only
|
|
21
21
|
// to correct invalid rows (run-operation-proof.js, presentation-decision.js).
|
|
22
22
|
export const CORRECTABLE_REVIEWS = Object.freeze([...STRUCTURED_REQUIRED_REVIEWS, 'CR']);
|
|
23
23
|
export const evidenceSourceSetDigest = sources => digest(`agdf-operation-sources/1\0${canonicalJson(sources)}`);
|
|
24
24
|
export const canonicalEvidenceDigest = text => 'sha256:' + createHash('sha256').update(String(text).replace(/\r\n?/gu, '\n').replace(/^\uFEFF/u, '')).digest('hex');
|
|
25
25
|
const hash = value => typeof value === 'string' && DIGEST_PATTERN.test(value);
|
|
26
|
-
const ownPath = (value, runId) => isSafeControlRelativePath(value) && value.startsWith(
|
|
26
|
+
const ownPath = (value, runId) => isSafeControlRelativePath(value) && [runDocumentPath(runId, ''), runEvidencePath(runId, '')].some(prefix => value.startsWith(`${prefix}/`));
|
|
27
27
|
export function validEvidenceBinding(row) {
|
|
28
28
|
return exactObject(row, ['schema_version', 'run_id', 'operation_id', 'action', 'step', 'report', 'sources', 'source_set_digest', 'producer', 'assurance'])
|
|
29
|
-
&& row.schema_version === '1' && RUN_ID_PATTERN.test(row.run_id ?? '') && REVISION_ID_PATTERN.test(row.operation_id ?? '')
|
|
30
|
-
&& ['step.record', 'artefact.record'].includes(row.action) && Object.hasOwn(EVIDENCE_PREREQUISITES, row.step)
|
|
29
|
+
&& row.schema_version === (row.action === 'ur_draft.replace' ? '2' : '1') && RUN_ID_PATTERN.test(row.run_id ?? '') && REVISION_ID_PATTERN.test(row.operation_id ?? '')
|
|
30
|
+
&& ['step.record', 'ur_draft.replace', 'artefact.record'].includes(row.action) && (row.action !== 'ur_draft.replace' || row.step === 'ur') && Object.hasOwn(EVIDENCE_PREREQUISITES, row.step)
|
|
31
31
|
&& exactObject(row.report, ['path', 'digest']) && ownPath(row.report.path, row.run_id) && hash(row.report.digest)
|
|
32
32
|
&& Array.isArray(row.sources) && row.sources.length === EVIDENCE_PREREQUISITES[row.step].length
|
|
33
33
|
&& row.sources.every((s, i) => exactObject(s, ['type', 'path', 'digest', 'status']) && s.type === EVIDENCE_PREREQUISITES[row.step][i]
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { readFileSync, statSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { dirname, isAbsolute, join, resolve } from 'node:path';
|
|
4
|
+
|
|
5
|
+
// Pure read of the local Git identity for a cooperative confirmation statement. No child
|
|
6
|
+
// process, no include or includeIf directive; an identity found nowhere is recorded unknown.
|
|
7
|
+
// Precedence as in Git: repository config, then ~/.gitconfig, then the XDG config file.
|
|
8
|
+
const CONFIG_LIMIT = 1048576;
|
|
9
|
+
function readText(path) {
|
|
10
|
+
try { const stat = statSync(path); return stat.isFile() && stat.size <= CONFIG_LIMIT ? readFileSync(path, 'utf8') : null; } catch { return null; }
|
|
11
|
+
}
|
|
12
|
+
const isDirectory = path => { try { return statSync(path).isDirectory(); } catch { return false; } };
|
|
13
|
+
const isFile = path => { try { return statSync(path).isFile(); } catch { return false; } };
|
|
14
|
+
|
|
15
|
+
// The repository config of the nearest .git directory, or of a .git file's gitdir and its commondir.
|
|
16
|
+
function repositoryConfig(root) {
|
|
17
|
+
for (let directory = resolve(root); ; directory = dirname(directory)) {
|
|
18
|
+
const dotGit = join(directory, '.git');
|
|
19
|
+
let gitDir = isDirectory(dotGit) ? dotGit : null;
|
|
20
|
+
if (!gitDir && isFile(dotGit)) {
|
|
21
|
+
const target = readText(dotGit)?.match(/^gitdir:[ \t]*(.+?)[ \t]*\r?$/mu)?.[1];
|
|
22
|
+
if (target) gitDir = resolve(directory, target);
|
|
23
|
+
}
|
|
24
|
+
if (gitDir) {
|
|
25
|
+
const common = readText(join(gitDir, 'commondir'))?.trim();
|
|
26
|
+
return join(common ? resolve(gitDir, common) : gitDir, 'config');
|
|
27
|
+
}
|
|
28
|
+
if (dirname(directory) === directory) return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function gitConfigPaths(root, { env = process.env, home = homedir() } = {}) {
|
|
33
|
+
const xdg = env.XDG_CONFIG_HOME && isAbsolute(env.XDG_CONFIG_HOME) ? env.XDG_CONFIG_HOME : home ? join(home, '.config') : null;
|
|
34
|
+
return [repositoryConfig(root), home ? join(home, '.gitconfig') : null, xdg ? join(xdg, 'git', 'config') : null].filter(Boolean);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Value grammar: leading blanks skipped, double quotes group, \\ \" \n \t \b escapes,
|
|
38
|
+
// # or ; outside quotes start a comment, trailing blanks outside quotes are dropped.
|
|
39
|
+
function configValue(raw) {
|
|
40
|
+
let value = '', quoted = false, pending = '';
|
|
41
|
+
for (let i = 0; i < raw.length; i++) {
|
|
42
|
+
const char = raw[i];
|
|
43
|
+
if (char === '\\') {
|
|
44
|
+
const next = raw[++i];
|
|
45
|
+
value += pending + ({ n: '\n', t: '\t', b: '\b', '"': '"', '\\': '\\' }[next] ?? ''); pending = ''; continue;
|
|
46
|
+
}
|
|
47
|
+
if (char === '"') { value += pending; pending = ''; quoted = !quoted; continue; }
|
|
48
|
+
if (!quoted && (char === '#' || char === ';')) break;
|
|
49
|
+
if (!quoted && (char === ' ' || char === '\t')) { if (value) pending += char; continue; }
|
|
50
|
+
value += pending + char; pending = '';
|
|
51
|
+
}
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Last assignment within one file wins, as in Git; sections other than plain [user] are ignored.
|
|
56
|
+
export function parseGitIdentity(text) {
|
|
57
|
+
const found = {};
|
|
58
|
+
let section = null;
|
|
59
|
+
for (const rawLine of String(text ?? '').replace(/^/u, '').split(/\r?\n/u)) {
|
|
60
|
+
let line = rawLine.trim();
|
|
61
|
+
const header = line.match(/^\[([^\]"]+?)(?:\s+"(?:[^"\\]|\\.)*")?\]/u);
|
|
62
|
+
if (header) {
|
|
63
|
+
section = /\s+"/u.test(line.slice(0, header[0].length)) ? null : header[1].trim().toLowerCase();
|
|
64
|
+
line = line.slice(header[0].length).trim();
|
|
65
|
+
}
|
|
66
|
+
if (section !== 'user' || !line || line.startsWith('#') || line.startsWith(';')) continue;
|
|
67
|
+
const pair = line.match(/^([A-Za-z][A-Za-z0-9-]*)\s*=(.*)$/u);
|
|
68
|
+
const key = pair?.[1].toLowerCase();
|
|
69
|
+
if (key === 'name' || key === 'email') found[key] = configValue(pair[2]);
|
|
70
|
+
}
|
|
71
|
+
return found;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const clean = value => {
|
|
75
|
+
const text = String(value ?? '').replace(/[\u0000-\u001f\u007f]+/gu, ' ').replaceAll('|', '/').replace(/\s+/gu, ' ').trim().slice(0, 256).trim();
|
|
76
|
+
return text || null;
|
|
77
|
+
};
|
|
78
|
+
export function readGitIdentity(root, options = {}) {
|
|
79
|
+
const identity = {};
|
|
80
|
+
for (const path of gitConfigPaths(root, options)) {
|
|
81
|
+
const values = parseGitIdentity(readText(path));
|
|
82
|
+
for (const key of ['name', 'email']) if (!Object.hasOwn(identity, key) && Object.hasOwn(values, key)) identity[key] = clean(values[key]);
|
|
83
|
+
}
|
|
84
|
+
return identity.name || identity.email
|
|
85
|
+
? { name: identity.name ?? null, email: identity.email ?? null, statement: 'cooperative' } : { statement: 'unknown' };
|
|
86
|
+
}
|
|
@@ -2,7 +2,6 @@ export * from "./run-state-parser.js";
|
|
|
2
2
|
export * from "./run-state-repository.js";
|
|
3
3
|
export * from "./run-state-resolver.js";
|
|
4
4
|
export * from "./run-state-writer.js";
|
|
5
|
-
export * from "./legacy-migration.js";
|
|
6
5
|
export * from "./aggregate.js";
|
|
7
6
|
export * from "./gate-approval-validator.js";
|
|
8
7
|
export * from "./run-seal.js";
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { CURRENT_LAYOUT } from './run-identity.js';
|
|
2
|
+
// Shared representation, not a file owner or replay ledger. Existing operation
|
|
3
|
+
// families alone validate, persist and recover their versioned records.
|
|
4
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
5
|
+
import { isAbsolute } from 'node:path';
|
|
6
|
+
import { canonicalJson, exactObject, DIGEST_PATTERN } from './approval-command-contract.js';
|
|
7
|
+
import { runCommandRequestDigest } from './run-command-schema.js';
|
|
8
|
+
import { canonicalizeLanguageTag } from '../interaction-presentation.js';
|
|
9
|
+
|
|
10
|
+
const context = new AsyncLocalStorage();
|
|
11
|
+
const FORMAT = 'resolved/1';
|
|
12
|
+
const paths = ['presentation_language', 'working_directory', 'schema_version', 'assurance', 'variant', 'command.payload.route'];
|
|
13
|
+
const preferenceKeys = ['chat_language', 'artifact_language', 'presentation_route', 'gate_check_variant'];
|
|
14
|
+
const plain = value => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
15
|
+
const hash = value => typeof value === 'string' && DIGEST_PATTERN.test(value);
|
|
16
|
+
const tag = value => typeof value === 'string' && value.length > 0 && value.length <= 64 && canonicalizeLanguageTag(value) === value;
|
|
17
|
+
const get = (value, path) => path.split('.').reduce((v, key) => v?.[key], value);
|
|
18
|
+
function set(value, path, selected) {
|
|
19
|
+
const keys = path.split('.'); let parent = value;
|
|
20
|
+
for (const key of keys.slice(0, -1)) parent = parent[key];
|
|
21
|
+
parent[keys.at(-1)] = selected;
|
|
22
|
+
}
|
|
23
|
+
export const currentInputResolution = () => context.getStore()?.resolution ?? null;
|
|
24
|
+
export const isOriginalInputResolution = () => context.getStore()?.original === true;
|
|
25
|
+
export const withInputResolution = (resolution, action, original = false) => context.run({ resolution: resolution ?? null, original }, action);
|
|
26
|
+
export function createInputResolution(original, effective, configuration) {
|
|
27
|
+
return { schema_version: 1, logical_digest: runCommandRequestDigest(original), effective_digest: runCommandRequestDigest(effective),
|
|
28
|
+
operation_id: original.operation_id ?? null, kind: original.command?.kind ?? null,
|
|
29
|
+
fields: Object.fromEntries(paths.filter(path => get(original, path) === undefined && get(effective, path) !== undefined).map(path => [path, get(effective, path)])), configuration };
|
|
30
|
+
}
|
|
31
|
+
export function validInputResolution(value) {
|
|
32
|
+
if (!exactObject(value, ['schema_version', 'logical_digest', 'effective_digest', 'operation_id', 'kind', 'fields', 'configuration']) || value.schema_version !== 1
|
|
33
|
+
|| !(value.operation_id === null || typeof value.operation_id === 'string' && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u.test(value.operation_id))
|
|
34
|
+
|| !(value.kind === null || typeof value.kind === 'string' && /^[a-z_]+\.[a-z_]+$/u.test(value.kind) && value.kind.length <= 64)
|
|
35
|
+
|| !hash(value.logical_digest) || !hash(value.effective_digest) || !plain(value.fields) || !plain(value.configuration)
|
|
36
|
+
|| Buffer.byteLength(canonicalJson(value)) > 8192 || Object.keys(value.fields).some(key => !paths.includes(key))) return false;
|
|
37
|
+
const f = value.fields, c = value.configuration;
|
|
38
|
+
if (Object.hasOwn(f, 'presentation_language') && !tag(f.presentation_language)
|
|
39
|
+
|| Object.hasOwn(f, 'working_directory') && (typeof f.working_directory !== 'string' || !isAbsolute(f.working_directory) || f.working_directory.length > 4096)
|
|
40
|
+
|| Object.hasOwn(f, 'schema_version') && f.schema_version !== '1'
|
|
41
|
+
|| Object.hasOwn(f, 'assurance') && f.assurance !== 'cooperative_local'
|
|
42
|
+
|| Object.hasOwn(f, 'variant') && !['status-card', 'approval-envelope'].includes(f.variant)
|
|
43
|
+
|| Object.hasOwn(f, 'command.payload.route') && !['markdown', 'automatic', 'fallback'].includes(f['command.payload.route'])) return false;
|
|
44
|
+
if (!exactObject(c, ['root', 'control', 'config_digest', 'values', 'sources', 'defaults_digest', 'control_layout'])
|
|
45
|
+
|| (c.control === 'active' ? c.control_layout !== CURRENT_LAYOUT : c.control_layout !== null)
|
|
46
|
+
|| !(c.root === null || typeof c.root === 'string' && isAbsolute(c.root) && c.root.length <= 4096) || !['inactive', 'active'].includes(c.control)
|
|
47
|
+
|| !(c.config_digest === null || hash(c.config_digest)) || !hash(c.defaults_digest)
|
|
48
|
+
|| !exactObject(c.values, preferenceKeys) || !exactObject(c.sources, preferenceKeys)
|
|
49
|
+
|| !tag(c.values.chat_language) || !tag(c.values.artifact_language)
|
|
50
|
+
|| !['markdown', 'automatic', 'fallback'].includes(c.values.presentation_route)
|
|
51
|
+
|| ![null, 'status-card', 'approval-envelope'].includes(c.values.gate_check_variant)) return false;
|
|
52
|
+
if (c.control === 'active' && (c.root === null || c.config_digest === null)
|
|
53
|
+
|| c.control === 'inactive' && c.config_digest !== null
|
|
54
|
+
|| Object.hasOwn(f, 'presentation_language') && f.presentation_language !== c.values.chat_language
|
|
55
|
+
|| Object.hasOwn(f, 'variant') && f.variant !== c.values.gate_check_variant
|
|
56
|
+
|| Object.hasOwn(f, 'command.payload.route') && f['command.payload.route'] !== c.values.presentation_route) return false;
|
|
57
|
+
return preferenceKeys.every(key => {
|
|
58
|
+
const source = c.sources[key];
|
|
59
|
+
return exactObject(source, ['kind']) && source.kind === 'explicit'
|
|
60
|
+
|| exactObject(source, ['kind', 'path', 'digest']) && (source.kind === 'plugin' && source.path === 'meta/agdf-defaults.json'
|
|
61
|
+
&& source.digest === c.defaults_digest || source.kind === 'project' && source.path === '.agdf/control/config.json'
|
|
62
|
+
&& c.control === 'active' && source.digest === c.config_digest) && hash(source.digest);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
export function restoreResolvedInput(original, resolution) {
|
|
66
|
+
if (!validInputResolution(resolution) || runCommandRequestDigest(original) !== resolution.logical_digest) throw Error('AGDF_OPERATION_PAYLOAD_CONFLICT');
|
|
67
|
+
const effective = structuredClone(original);
|
|
68
|
+
for (const [path, value] of Object.entries(resolution.fields)) set(effective, path, value);
|
|
69
|
+
if (runCommandRequestDigest(effective) !== resolution.effective_digest) throw Error('AGDF_OPERATION_PAYLOAD_CONFLICT');
|
|
70
|
+
return effective;
|
|
71
|
+
}
|
|
72
|
+
export function bindInputResolution(record) {
|
|
73
|
+
const resolution = currentInputResolution();
|
|
74
|
+
// Dispatch/read inputs have no typed command UUID or command digest. Their
|
|
75
|
+
// per-call preferences may flow to rendering, never into a family receipt.
|
|
76
|
+
if (!resolution?.kind || !resolution.operation_id) throw Error('input_resolution_required');
|
|
77
|
+
if (!validInputResolution(resolution)) throw Error('input_resolution_invalid');
|
|
78
|
+
return { ...record, schema_version: FORMAT, input_resolution: { ...resolution, record_version: record.schema_version } };
|
|
79
|
+
}
|
|
80
|
+
export function resolutionRecord(record) {
|
|
81
|
+
if (record?.schema_version !== FORMAT) return null;
|
|
82
|
+
const { input_resolution: extension, ...body } = record;
|
|
83
|
+
if (!plain(extension)) return null;
|
|
84
|
+
const { record_version, ...resolution } = extension;
|
|
85
|
+
if (!['string', 'number'].includes(typeof record_version) || !validInputResolution(resolution)) return null;
|
|
86
|
+
// Pending journals retain the owning family's digest (approval/revision have
|
|
87
|
+
// their own domain digest). The committed receipt binds the full command and
|
|
88
|
+
// journal recovery cross-checks both retained resolutions below that owner.
|
|
89
|
+
const storedDigest = Object.hasOwn(body, 'old_run_digest') || body.kind === 'lifecycle_close.record'
|
|
90
|
+
? undefined : body.command_digest ?? body.operation?.request_digest ?? body.request_digest;
|
|
91
|
+
if (storedDigest !== undefined && storedDigest !== resolution.effective_digest) return null;
|
|
92
|
+
return { ...body, schema_version: record_version };
|
|
93
|
+
}
|
|
94
|
+
export const resolutionRecordVersion = record => resolutionRecord(record)?.schema_version;
|
|
95
|
+
export function recordedInputResolution(record) {
|
|
96
|
+
if (record?.schema_version !== FORMAT || !resolutionRecord(record)) return null;
|
|
97
|
+
const { record_version, ...resolution } = record.input_resolution;
|
|
98
|
+
return resolution;
|
|
99
|
+
}
|