@jtf19/vibecoding-kit 0.1.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/AGENTS.md +84 -0
- package/CHANGELOG.md +28 -0
- package/CLAUDE.md +137 -0
- package/CODE_OF_CONDUCT.md +30 -0
- package/CONTRIBUTING.md +69 -0
- package/LICENSE +67 -0
- package/README.md +162 -0
- package/SECURITY.md +34 -0
- package/adapters/claude/install.md +70 -0
- package/adapters/claude/plugin.json +38 -0
- package/adapters/claude/settings.example.json +15 -0
- package/adapters/codex/hooks.example.json +15 -0
- package/adapters/codex/install.md +72 -0
- package/adapters/codex/plugin.json +58 -0
- package/adapters/cursor/hooks.example.json +17 -0
- package/adapters/cursor/install.md +72 -0
- package/adapters/cursor/plugin.json +42 -0
- package/adapters/opencode/install.md +95 -0
- package/adapters/opencode/plugin.js +56 -0
- package/adapters/opencode/plugin.json +58 -0
- package/adapters/pi/extension.ts +56 -0
- package/adapters/pi/install.md +95 -0
- package/adapters/pi/plugin.json +58 -0
- package/bin/vibe-cli-usage.mjs +43 -0
- package/bin/vibe.mjs +120 -0
- package/docs/acceptance-checklist.md +1226 -0
- package/docs/architecture-debt-burndown.md +537 -0
- package/docs/architecture.md +77 -0
- package/docs/ci-evidence-onboarding.md +143 -0
- package/docs/development.md +71 -0
- package/docs/evidence-authoring.md +188 -0
- package/docs/golden-path.md +179 -0
- package/docs/install-acceptance-checklist.md +90 -0
- package/docs/install-claude.md +41 -0
- package/docs/install-codex.md +41 -0
- package/docs/install-cursor.md +41 -0
- package/docs/install-experience-roadmap.md +394 -0
- package/docs/install.md +119 -0
- package/docs/maintainer-guide.md +197 -0
- package/docs/phase-1-implementation.md +848 -0
- package/docs/phase-2-roadmap.md +142 -0
- package/docs/quick-recipes.md +115 -0
- package/docs/readiness-interpretation.md +105 -0
- package/docs/readiness-troubleshooting.md +209 -0
- package/docs/release-check-reference.md +63 -0
- package/docs/release-guide.md +481 -0
- package/docs/release-notes.md +75 -0
- package/docs/runtime-contract.md +1010 -0
- package/docs/runtime-maintainer-validation.md +212 -0
- package/docs/runtime-roadmap.md +2265 -0
- package/docs/skill-authoring-guide.md +150 -0
- package/docs/submodule-guide.md +131 -0
- package/docs/team-adoption.md +113 -0
- package/docs/user-guide.md +108 -0
- package/docs/vibecoding-fork-analysis.md +398 -0
- package/docs/workflow-chaining.md +539 -0
- package/examples/ci/README.md +61 -0
- package/examples/ci/ci-evidence-input.example.json +56 -0
- package/examples/ci/generate-diff-coverage.mjs +90 -0
- package/examples/ci/generate-test-evidence.mjs +82 -0
- package/examples/ci/github-actions-readiness.yml +108 -0
- package/examples/claude-project/README.md +57 -0
- package/examples/codex-project/README.md +57 -0
- package/examples/cursor-project/README.md +57 -0
- package/examples/full-chain/README.md +63 -0
- package/examples/full-chain/architecture-design.md +128 -0
- package/examples/full-chain/commit-readiness.json +31 -0
- package/examples/full-chain/delivery-traceability.yaml +32 -0
- package/examples/full-chain/diff-coverage.json +73 -0
- package/examples/full-chain/evidence.json +20 -0
- package/examples/full-chain/implementation-plan.md +54 -0
- package/examples/full-chain/product-acceptance.md +86 -0
- package/examples/full-chain/product-discovery.md +84 -0
- package/examples/full-chain/product-spec.md +88 -0
- package/examples/full-chain/scenario-acceptance.yaml +32 -0
- package/examples/full-chain/test-evidence.json +29 -0
- package/examples/full-chain/ui-design-contract.md +87 -0
- package/examples/golden-path/README.md +84 -0
- package/examples/golden-path/diff-coverage.json +66 -0
- package/examples/golden-path/implementation-plan.md +62 -0
- package/examples/golden-path/product-spec.md +96 -0
- package/examples/golden-path/test-evidence.json +29 -0
- package/examples/runtime-fixtures/architecture-design.md +128 -0
- package/examples/runtime-fixtures/commit-readiness.json +31 -0
- package/examples/runtime-fixtures/delivery-traceability.yaml +32 -0
- package/examples/runtime-fixtures/diff-coverage.json +73 -0
- package/examples/runtime-fixtures/evidence.json +20 -0
- package/examples/runtime-fixtures/implementation-plan.md +54 -0
- package/examples/runtime-fixtures/negative/commit-readiness-boundary-escalated.json +27 -0
- package/examples/runtime-fixtures/negative/delivery-traceability-bad-ref.yaml +32 -0
- package/examples/runtime-fixtures/negative/diff-coverage-changed-file-without-task-ref.json +40 -0
- package/examples/runtime-fixtures/negative/diff-coverage-operation-mismatch.json +38 -0
- package/examples/runtime-fixtures/negative/diff-coverage-required-task-missing.json +24 -0
- package/examples/runtime-fixtures/negative/diff-coverage-unexpected-file.json +20 -0
- package/examples/runtime-fixtures/negative/test-evidence-missing-output-digest.json +23 -0
- package/examples/runtime-fixtures/negative/test-evidence-risky-task-missing.json +29 -0
- package/examples/runtime-fixtures/product-acceptance.md +86 -0
- package/examples/runtime-fixtures/product-discovery.md +84 -0
- package/examples/runtime-fixtures/product-spec.md +88 -0
- package/examples/runtime-fixtures/scenario-acceptance.yaml +32 -0
- package/examples/runtime-fixtures/test-evidence.json +29 -0
- package/examples/runtime-fixtures/ui-design-contract.md +87 -0
- package/hooks/post-tool-compact/README.md +47 -0
- package/hooks/session-start/README.md +112 -0
- package/hooks/session-start/session-start-state-boundary-contract.mjs +161 -0
- package/hooks/session-start/session-start.md +29 -0
- package/hooks/session-start/session-start.mjs +49 -0
- package/hooks/workflow-handoff/README.md +44 -0
- package/hooks/workflow-handoff/workflow-handoff.md +11 -0
- package/package.json +72 -0
- package/skills/using-vibecoding/SKILL.md +396 -0
- package/skills/vibe-brainstorming/SKILL.md +98 -0
- package/skills/vibe-context-compact/SKILL.md +95 -0
- package/skills/vibe-debugging/SKILL.md +87 -0
- package/skills/vibe-dispatching-parallel-work/SKILL.md +144 -0
- package/skills/vibe-executing-plans/SKILL.md +114 -0
- package/skills/vibe-finishing-a-development-branch/SKILL.md +110 -0
- package/skills/vibe-implementation/SKILL.md +84 -0
- package/skills/vibe-planning/SKILL.md +102 -0
- package/skills/vibe-product-acceptance/SKILL.md +106 -0
- package/skills/vibe-product-discovery/SKILL.md +107 -0
- package/skills/vibe-product-spec/SKILL.md +105 -0
- package/skills/vibe-receiving-code-review/SKILL.md +110 -0
- package/skills/vibe-requesting-code-review/SKILL.md +106 -0
- package/skills/vibe-review/SKILL.md +106 -0
- package/skills/vibe-subagent-driven-development/SKILL.md +198 -0
- package/skills/vibe-systematic-debugging/SKILL.md +106 -0
- package/skills/vibe-test-driven-development/SKILL.md +112 -0
- package/skills/vibe-ui-design/SKILL.md +107 -0
- package/skills/vibe-verification/SKILL.md +84 -0
- package/skills/vibe-verification-before-completion/SKILL.md +170 -0
- package/skills/vibe-workspace-isolation/SKILL.md +158 -0
- package/skills/vibe-writing-plans/SKILL.md +137 -0
- package/skills/vibe-writing-skills/SKILL.md +118 -0
- package/templates/AGENTS.md +88 -0
- package/templates/CLAUDE.md +88 -0
- package/templates/VIBE-CODING.md +157 -0
- package/templates/architecture-design.md +139 -0
- package/templates/delivery-traceability.yaml +52 -0
- package/templates/evidence/README.md +117 -0
- package/templates/evidence/diff-coverage.json +34 -0
- package/templates/evidence/test-evidence.json +29 -0
- package/templates/implementation-plan.md +73 -0
- package/templates/product-acceptance.md +84 -0
- package/templates/product-discovery.md +81 -0
- package/templates/product-spec.md +84 -0
- package/templates/scenario-acceptance.yaml +37 -0
- package/templates/ui-design-contract.md +86 -0
- package/tools/vibe-architecture-check/README.md +66 -0
- package/tools/vibe-architecture-check/index.mjs +691 -0
- package/tools/vibe-compact/README.md +65 -0
- package/tools/vibe-compact/compact-contract.mjs +63 -0
- package/tools/vibe-compact/index.mjs +111 -0
- package/tools/vibe-doctor/README.md +200 -0
- package/tools/vibe-doctor/index.mjs +1721 -0
- package/tools/vibe-init/README.md +231 -0
- package/tools/vibe-init/index.mjs +369 -0
- package/tools/vibe-init/init-cli-args.mjs +100 -0
- package/tools/vibe-init/init-entry-merge-model.mjs +33 -0
- package/tools/vibe-init/init-install-manifest-model.mjs +137 -0
- package/tools/vibe-init/init-installed-agent-experience-contract.mjs +172 -0
- package/tools/vibe-init/init-platform-model.mjs +11 -0
- package/tools/vibe-init/init-presentation.mjs +149 -0
- package/tools/vibe-lifecycle/README.md +37 -0
- package/tools/vibe-lifecycle/index.mjs +365 -0
- package/tools/vibe-lifecycle/lifecycle-cli-args.mjs +104 -0
- package/tools/vibe-lifecycle/lifecycle-summary-model.mjs +67 -0
- package/tools/vibe-lifecycle/lifecycle-uninstall-plan-model.mjs +11 -0
- package/tools/vibe-plugin-pack/README.md +105 -0
- package/tools/vibe-plugin-pack/index.mjs +302 -0
- package/tools/vibe-plugin-pack/plugin-pack-cli.mjs +39 -0
- package/tools/vibe-plugin-pack/plugin-pack-manifest.mjs +37 -0
- package/tools/vibe-profile/index.mjs +212 -0
- package/tools/vibe-release-check/README.md +123 -0
- package/tools/vibe-release-check/command-manifest/release-check-base-commands.mjs +23 -0
- package/tools/vibe-release-check/command-manifest/release-check-closeout-commands.mjs +16 -0
- package/tools/vibe-release-check/command-manifest/release-check-command-metadata.mjs +32 -0
- package/tools/vibe-release-check/command-manifest/release-check-completion-commands.mjs +41 -0
- package/tools/vibe-release-check/command-manifest/release-check-full-chain-commands.mjs +12 -0
- package/tools/vibe-release-check/command-manifest/release-check-golden-path-commands.mjs +12 -0
- package/tools/vibe-release-check/command-manifest/release-check-install-commands.mjs +26 -0
- package/tools/vibe-release-check/command-manifest/release-check-learning-smoke-commands.mjs +21 -0
- package/tools/vibe-release-check/command-manifest/release-check-methodology-commands.mjs +27 -0
- package/tools/vibe-release-check/command-manifest/release-check-runtime-smoke-commands.mjs +116 -0
- package/tools/vibe-release-check/command-manifest/release-check-token-smoke-commands.mjs +21 -0
- package/tools/vibe-release-check/index.mjs +223 -0
- package/tools/vibe-release-check/release-check-behavior-smoke.mjs +177 -0
- package/tools/vibe-release-check/release-check-cli.mjs +37 -0
- package/tools/vibe-release-check/release-check-command-manifest.mjs +49 -0
- package/tools/vibe-release-check/release-check-completion-fixtures.mjs +151 -0
- package/tools/vibe-release-check/release-check-completion-suite.mjs +110 -0
- package/tools/vibe-release-check/release-check-dispatch.mjs +116 -0
- package/tools/vibe-release-check/release-check-full-chain-suite.mjs +55 -0
- package/tools/vibe-release-check/release-check-golden-path-suite.mjs +85 -0
- package/tools/vibe-release-check/release-check-install-marker-specs.mjs +133 -0
- package/tools/vibe-release-check/release-check-install-suite.mjs +112 -0
- package/tools/vibe-release-check/release-check-json-assertion-helpers.mjs +157 -0
- package/tools/vibe-release-check/release-check-json-markers.mjs +33 -0
- package/tools/vibe-release-check/release-check-learning-fixture-specs.mjs +199 -0
- package/tools/vibe-release-check/release-check-learning-suite.mjs +249 -0
- package/tools/vibe-release-check/release-check-live-behavior-smoke-fixture.mjs +406 -0
- package/tools/vibe-release-check/release-check-methodology-suite.mjs +108 -0
- package/tools/vibe-release-check/release-check-package-boundary-smoke.mjs +111 -0
- package/tools/vibe-release-check/release-check-platform-transcript-smoke-fixture.mjs +150 -0
- package/tools/vibe-release-check/release-check-readonly-marker-data.mjs +1 -0
- package/tools/vibe-release-check/release-check-readonly-marker-smoke-specs.mjs +170 -0
- package/tools/vibe-release-check/release-check-run-summary.mjs +67 -0
- package/tools/vibe-release-check/release-check-runtime-automation-fixtures.mjs +1 -0
- package/tools/vibe-release-check/release-check-runtime-automation-governance-reply-trace-smoke-helpers.mjs +224 -0
- package/tools/vibe-release-check/release-check-runtime-automation-governance-smoke-specs.mjs +215 -0
- package/tools/vibe-release-check/release-check-runtime-automation-governance-suite.mjs +5 -0
- package/tools/vibe-release-check/release-check-runtime-automation-methodology-smoke-specs.mjs +157 -0
- package/tools/vibe-release-check/release-check-runtime-automation-methodology-suite.mjs +130 -0
- package/tools/vibe-release-check/release-check-runtime-automation-platform-smoke-helpers.mjs +306 -0
- package/tools/vibe-release-check/release-check-runtime-automation-platform-suite.mjs +30 -0
- package/tools/vibe-release-check/release-check-runtime-automation-smoke-fixtures.mjs +53 -0
- package/tools/vibe-release-check/release-check-runtime-automation-source-candidate-smoke-helpers.mjs +506 -0
- package/tools/vibe-release-check/release-check-runtime-automation-source-suite.mjs +5 -0
- package/tools/vibe-release-check/release-check-runtime-automation-subagents-lifecycle-smoke-helpers.mjs +305 -0
- package/tools/vibe-release-check/release-check-runtime-automation-subagents-suite.mjs +25 -0
- package/tools/vibe-release-check/release-check-runtime-automation-suite.mjs +25 -0
- package/tools/vibe-release-check/release-check-runtime-daemon-bounded-run-smoke-helpers.mjs +243 -0
- package/tools/vibe-release-check/release-check-runtime-daemon-suite.mjs +5 -0
- package/tools/vibe-release-check/release-check-runtime-dispatch-fixtures.mjs +129 -0
- package/tools/vibe-release-check/release-check-runtime-dispatch-suite.mjs +5 -0
- package/tools/vibe-release-check/release-check-runtime-execution-approval-smoke-helpers.mjs +274 -0
- package/tools/vibe-release-check/release-check-runtime-execution-approval-suite.mjs +5 -0
- package/tools/vibe-release-check/release-check-runtime-execution-base-suite.mjs +388 -0
- package/tools/vibe-release-check/release-check-runtime-execution-recovery-suite.mjs +412 -0
- package/tools/vibe-release-check/release-check-runtime-execution-scheduler-suite.mjs +261 -0
- package/tools/vibe-release-check/release-check-runtime-execution-suite.mjs +11 -0
- package/tools/vibe-release-check/release-check-runtime-flow-smoke.mjs +347 -0
- package/tools/vibe-release-check/release-check-runtime-handoff-fixture-specs.mjs +211 -0
- package/tools/vibe-release-check/release-check-runtime-handoff-fixtures.mjs +11 -0
- package/tools/vibe-release-check/release-check-runtime-handoff-smoke-specs.mjs +86 -0
- package/tools/vibe-release-check/release-check-runtime-handoff-suite.mjs +316 -0
- package/tools/vibe-release-check/release-check-runtime-ledger-fixture-specs.mjs +9 -0
- package/tools/vibe-release-check/release-check-runtime-ledger-fixtures.mjs +51 -0
- package/tools/vibe-release-check/release-check-runtime-ledger-suite.mjs +24 -0
- package/tools/vibe-release-check/release-check-runtime-scheduler-fixture-specs.mjs +129 -0
- package/tools/vibe-release-check/release-check-runtime-scheduler-fixtures.mjs +10 -0
- package/tools/vibe-release-check/release-check-runtime-sdd-suite.mjs +535 -0
- package/tools/vibe-release-check/release-check-runtime-smoke-harness.mjs +140 -0
- package/tools/vibe-release-check/release-check-runtime-surface-expectations.mjs +106 -0
- package/tools/vibe-release-check/release-check-runtime-surface-smoke.mjs +112 -0
- package/tools/vibe-release-check/release-check-runtime-task-artifact-suite.mjs +105 -0
- package/tools/vibe-release-check/release-check-runtime-task-fixture-specs.mjs +270 -0
- package/tools/vibe-release-check/release-check-runtime-task-fixtures.mjs +19 -0
- package/tools/vibe-release-check/release-check-runtime.mjs +53 -0
- package/tools/vibe-release-check/release-check-stage103-118-fixtures.mjs +214 -0
- package/tools/vibe-release-check/release-check-stage103-118-smoke-specs.mjs +97 -0
- package/tools/vibe-release-check/release-check-stage103-118-smoke.mjs +861 -0
- package/tools/vibe-release-check/release-check-stage11-smoke.mjs +66 -0
- package/tools/vibe-release-check/release-check-stage119-120-fixture-specs.mjs +119 -0
- package/tools/vibe-release-check/release-check-stage119-120-smoke.mjs +325 -0
- package/tools/vibe-release-check/release-check-stage12-smoke.mjs +59 -0
- package/tools/vibe-release-check/release-check-stage121-136-fixture-specs.mjs +26 -0
- package/tools/vibe-release-check/release-check-stage121-136-fixtures.mjs +591 -0
- package/tools/vibe-release-check/release-check-stage121-136-smoke.mjs +917 -0
- package/tools/vibe-release-check/release-check-stage13-smoke.mjs +78 -0
- package/tools/vibe-release-check/release-check-stage137-140-smoke.mjs +534 -0
- package/tools/vibe-release-check/release-check-stage14-smoke.mjs +101 -0
- package/tools/vibe-release-check/release-check-stage141-148-smoke.mjs +1143 -0
- package/tools/vibe-release-check/release-check-stage15-smoke.mjs +132 -0
- package/tools/vibe-release-check/release-check-stage50-53-smoke.mjs +429 -0
- package/tools/vibe-release-check/release-check-subagent-adapter-bridge-smoke.mjs +162 -0
- package/tools/vibe-release-check/release-check-suite-plan-smoke.mjs +86 -0
- package/tools/vibe-release-check/release-check-suites.mjs +164 -0
- package/tools/vibe-release-check/release-check-test-run-smoke.mjs +59 -0
- package/tools/vibe-release-check/release-check-timing.mjs +98 -0
- package/tools/vibe-release-check/release-check-token-suite.mjs +260 -0
- package/tools/vibe-release-check/release-check-workflow-entry-suite.mjs +195 -0
- package/tools/vibe-release-check/release-check-workflow-governance-fixtures.mjs +138 -0
- package/tools/vibe-release-check/release-check-workflow-governance-smoke-suite.mjs +768 -0
- package/tools/vibe-release-check/release-check-workflow-ux-smoke.mjs +456 -0
- package/tools/vibe-runtime/README.md +2637 -0
- package/tools/vibe-runtime/index.mjs +3117 -0
- package/tools/vibe-runtime/runtime-adapter-bootstrap-matrix.mjs +264 -0
- package/tools/vibe-runtime/runtime-adapter-entry-acceptance.mjs +310 -0
- package/tools/vibe-runtime/runtime-adapter-packaging-consistency-command.mjs +131 -0
- package/tools/vibe-runtime/runtime-adapter-packaging-consistency.mjs +253 -0
- package/tools/vibe-runtime/runtime-advice-hub-model.mjs +175 -0
- package/tools/vibe-runtime/runtime-agent-session-start-contract.mjs +138 -0
- package/tools/vibe-runtime/runtime-artifact-ref-validation.mjs +281 -0
- package/tools/vibe-runtime/runtime-automatic-verification-gate-contract.mjs +134 -0
- package/tools/vibe-runtime/runtime-automation-boundary-text.mjs +7 -0
- package/tools/vibe-runtime/runtime-automation-command.mjs +367 -0
- package/tools/vibe-runtime/runtime-automation-plan-model.mjs +239 -0
- package/tools/vibe-runtime/runtime-automation-policy-model.mjs +175 -0
- package/tools/vibe-runtime/runtime-automation-readiness.mjs +347 -0
- package/tools/vibe-runtime/runtime-autopilot-lab-profile-contract.mjs +223 -0
- package/tools/vibe-runtime/runtime-behavioral-evaluation-contract.mjs +529 -0
- package/tools/vibe-runtime/runtime-behavioral-negative-gate-matrix.mjs +274 -0
- package/tools/vibe-runtime/runtime-bounded-attempt-policy-model.mjs +13 -0
- package/tools/vibe-runtime/runtime-bounded-foreground-command-executor-contract.mjs +288 -0
- package/tools/vibe-runtime/runtime-capability-registry.mjs +250 -0
- package/tools/vibe-runtime/runtime-cli-args.mjs +550 -0
- package/tools/vibe-runtime/runtime-cli-command-specs.mjs +63 -0
- package/tools/vibe-runtime/runtime-cli-dispatch.mjs +21 -0
- package/tools/vibe-runtime/runtime-cli-evidence-option-specs.mjs +193 -0
- package/tools/vibe-runtime/runtime-cli-evidence-options.mjs +28 -0
- package/tools/vibe-runtime/runtime-cli-from-options.mjs +222 -0
- package/tools/vibe-runtime/runtime-cli-low-risk-option-specs.mjs +128 -0
- package/tools/vibe-runtime/runtime-cli-main.mjs +32 -0
- package/tools/vibe-runtime/runtime-cli-option-default-families.mjs +454 -0
- package/tools/vibe-runtime/runtime-cli-option-defaults.mjs +33 -0
- package/tools/vibe-runtime/runtime-cli-option-handlers.mjs +82 -0
- package/tools/vibe-runtime/runtime-cli-usage.mjs +316 -0
- package/tools/vibe-runtime/runtime-cli-value-options.mjs +74 -0
- package/tools/vibe-runtime/runtime-close-loop-dashboard.mjs +283 -0
- package/tools/vibe-runtime/runtime-closeout-parity-contract.mjs +214 -0
- package/tools/vibe-runtime/runtime-command-container.mjs +26 -0
- package/tools/vibe-runtime/runtime-command-surface-registry.mjs +383 -0
- package/tools/vibe-runtime/runtime-command-wrapper-deps.mjs +13 -0
- package/tools/vibe-runtime/runtime-commit-readiness-envelope.mjs +281 -0
- package/tools/vibe-runtime/runtime-completion-boundary-text.mjs +7 -0
- package/tools/vibe-runtime/runtime-completion-bundle-contract.mjs +71 -0
- package/tools/vibe-runtime/runtime-completion-chain-assembly.mjs +48 -0
- package/tools/vibe-runtime/runtime-completion-command.mjs +50 -0
- package/tools/vibe-runtime/runtime-completion-evidence-bundle.mjs +269 -0
- package/tools/vibe-runtime/runtime-completion-evidence-descriptors.mjs +156 -0
- package/tools/vibe-runtime/runtime-completion-local-evidence-gates.mjs +164 -0
- package/tools/vibe-runtime/runtime-completion-presentation.mjs +71 -0
- package/tools/vibe-runtime/runtime-completion-readiness-summary.mjs +159 -0
- package/tools/vibe-runtime/runtime-confirmed-one-shot-plan.mjs +300 -0
- package/tools/vibe-runtime/runtime-context-budget-entry-defaults-command.mjs +77 -0
- package/tools/vibe-runtime/runtime-context-budget-entry-defaults.mjs +341 -0
- package/tools/vibe-runtime/runtime-contract-marker-registry.mjs +13 -0
- package/tools/vibe-runtime/runtime-contributor-guardrail-command.mjs +78 -0
- package/tools/vibe-runtime/runtime-contributor-guardrail-evidence.mjs +319 -0
- package/tools/vibe-runtime/runtime-control-plane-command.mjs +237 -0
- package/tools/vibe-runtime/runtime-control-plane-evals-artifacts.mjs +123 -0
- package/tools/vibe-runtime/runtime-control-plane-evals-boundary-model.mjs +75 -0
- package/tools/vibe-runtime/runtime-control-plane-evals-cases.mjs +547 -0
- package/tools/vibe-runtime/runtime-control-plane-evals-command.mjs +527 -0
- package/tools/vibe-runtime/runtime-control-plane-evals-report-validation.mjs +209 -0
- package/tools/vibe-runtime/runtime-control-plane-planner-artifacts.mjs +457 -0
- package/tools/vibe-runtime/runtime-control-plane-planning-command.mjs +563 -0
- package/tools/vibe-runtime/runtime-control-plane-planning-input.mjs +99 -0
- package/tools/vibe-runtime/runtime-control-plane-planning-listing.mjs +48 -0
- package/tools/vibe-runtime/runtime-control-plane-planning-presentation.mjs +246 -0
- package/tools/vibe-runtime/runtime-control-plane-planning-validation.mjs +529 -0
- package/tools/vibe-runtime/runtime-control-plane-readonly-command.mjs +537 -0
- package/tools/vibe-runtime/runtime-control-plane-readonly-deps.mjs +146 -0
- package/tools/vibe-runtime/runtime-control-plane-release-evidence.mjs +525 -0
- package/tools/vibe-runtime/runtime-control-plane-release-gates.mjs +369 -0
- package/tools/vibe-runtime/runtime-control-plane-router-planning-model.mjs +152 -0
- package/tools/vibe-runtime/runtime-control-plane-routing-artifacts.mjs +588 -0
- package/tools/vibe-runtime/runtime-controlled-change-delivery-contract.mjs +165 -0
- package/tools/vibe-runtime/runtime-controlled-execution-gate-contract.mjs +141 -0
- package/tools/vibe-runtime/runtime-controlled-long-running-automation-contract.mjs +184 -0
- package/tools/vibe-runtime/runtime-controlled-subagent-orchestration-contract.mjs +169 -0
- package/tools/vibe-runtime/runtime-daemon-command.mjs +166 -0
- package/tools/vibe-runtime/runtime-daemon-state-lifecycle-model.mjs +359 -0
- package/tools/vibe-runtime/runtime-delivery-methodology-command.mjs +17 -0
- package/tools/vibe-runtime/runtime-delivery-methodology-gates.mjs +277 -0
- package/tools/vibe-runtime/runtime-diff-coverage-envelope.mjs +301 -0
- package/tools/vibe-runtime/runtime-dispatch-command.mjs +484 -0
- package/tools/vibe-runtime/runtime-dispatch-readonly-artifacts.mjs +406 -0
- package/tools/vibe-runtime/runtime-dispatch-state-lifecycle-model.mjs +199 -0
- package/tools/vibe-runtime/runtime-durable-state-recovery-contract.mjs +172 -0
- package/tools/vibe-runtime/runtime-entry-advice-model.mjs +201 -0
- package/tools/vibe-runtime/runtime-entry-deps-builder.mjs +54 -0
- package/tools/vibe-runtime/runtime-entry-presentation.mjs +82 -0
- package/tools/vibe-runtime/runtime-entry-summary-model.mjs +343 -0
- package/tools/vibe-runtime/runtime-entry-trigger-discipline.mjs +341 -0
- package/tools/vibe-runtime/runtime-entry-trigger-tightening-command.mjs +79 -0
- package/tools/vibe-runtime/runtime-entry-trigger-tightening.mjs +357 -0
- package/tools/vibe-runtime/runtime-eval-catalog-model.mjs +101 -0
- package/tools/vibe-runtime/runtime-eval-transcript-fixtures.mjs +218 -0
- package/tools/vibe-runtime/runtime-evidence-intake-envelope.mjs +278 -0
- package/tools/vibe-runtime/runtime-evidence-repair-model.mjs +180 -0
- package/tools/vibe-runtime/runtime-executable-plan-contract.mjs +428 -0
- package/tools/vibe-runtime/runtime-execution-approval-lifecycle-models.mjs +278 -0
- package/tools/vibe-runtime/runtime-execution-candidate-approval-artifacts.mjs +227 -0
- package/tools/vibe-runtime/runtime-execution-command.mjs +544 -0
- package/tools/vibe-runtime/runtime-execution-enabled-bridge-model.mjs +113 -0
- package/tools/vibe-runtime/runtime-execution-enabled-closeout-boundary.mjs +89 -0
- package/tools/vibe-runtime/runtime-execution-enabled-preflight-model.mjs +185 -0
- package/tools/vibe-runtime/runtime-execution-enabled-profile-contract.mjs +127 -0
- package/tools/vibe-runtime/runtime-execution-enabled-run-envelope.mjs +153 -0
- package/tools/vibe-runtime/runtime-execution-evidence-binder.mjs +537 -0
- package/tools/vibe-runtime/runtime-execution-plan-artifacts.mjs +136 -0
- package/tools/vibe-runtime/runtime-execution-policy-artifacts.mjs +377 -0
- package/tools/vibe-runtime/runtime-execution-presentation.mjs +174 -0
- package/tools/vibe-runtime/runtime-execution-readonly-artifacts.mjs +228 -0
- package/tools/vibe-runtime/runtime-execution-run-preflight-artifacts.mjs +265 -0
- package/tools/vibe-runtime/runtime-execution-safety-artifacts.mjs +131 -0
- package/tools/vibe-runtime/runtime-execution-state-write-lifecycle-model.mjs +99 -0
- package/tools/vibe-runtime/runtime-experience-friction-matrix.mjs +395 -0
- package/tools/vibe-runtime/runtime-experience-learning-pattern.mjs +354 -0
- package/tools/vibe-runtime/runtime-experience-regression-dashboard.mjs +398 -0
- package/tools/vibe-runtime/runtime-experience-upgrade-command.mjs +92 -0
- package/tools/vibe-runtime/runtime-experience-upgrade-prioritizer.mjs +451 -0
- package/tools/vibe-runtime/runtime-foreground-worker-plan.mjs +275 -0
- package/tools/vibe-runtime/runtime-git-diff-read-model.mjs +322 -0
- package/tools/vibe-runtime/runtime-governance-attestation.mjs +304 -0
- package/tools/vibe-runtime/runtime-governance-command.mjs +609 -0
- package/tools/vibe-runtime/runtime-governance-convergence-reports.mjs +601 -0
- package/tools/vibe-runtime/runtime-governance-pr-models.mjs +551 -0
- package/tools/vibe-runtime/runtime-governance-presentation.mjs +67 -0
- package/tools/vibe-runtime/runtime-governance-route-model.mjs +194 -0
- package/tools/vibe-runtime/runtime-governance-surface-reports.mjs +495 -0
- package/tools/vibe-runtime/runtime-hooks-boundary-model.mjs +356 -0
- package/tools/vibe-runtime/runtime-hooks-command.mjs +286 -0
- package/tools/vibe-runtime/runtime-human-completion-evidence-model.mjs +220 -0
- package/tools/vibe-runtime/runtime-human-friendly-aliases.mjs +250 -0
- package/tools/vibe-runtime/runtime-implementation-methodology-command.mjs +17 -0
- package/tools/vibe-runtime/runtime-implementation-methodology-gates.mjs +164 -0
- package/tools/vibe-runtime/runtime-implementation-task-registry.mjs +334 -0
- package/tools/vibe-runtime/runtime-install-experience-command.mjs +120 -0
- package/tools/vibe-runtime/runtime-install-experience-score.mjs +334 -0
- package/tools/vibe-runtime/runtime-installed-multiround-ux-acceptance.mjs +149 -0
- package/tools/vibe-runtime/runtime-interaction-command-domain-registry.mjs +46 -0
- package/tools/vibe-runtime/runtime-interaction-command.mjs +648 -0
- package/tools/vibe-runtime/runtime-interaction-completion-command.mjs +220 -0
- package/tools/vibe-runtime/runtime-interaction-entry-command.mjs +130 -0
- package/tools/vibe-runtime/runtime-interaction-workflow-envelopes.mjs +412 -0
- package/tools/vibe-runtime/runtime-learning-advice-model.mjs +157 -0
- package/tools/vibe-runtime/runtime-learning-artifact-model.mjs +509 -0
- package/tools/vibe-runtime/runtime-learning-audit-model.mjs +106 -0
- package/tools/vibe-runtime/runtime-learning-interaction-command.mjs +220 -0
- package/tools/vibe-runtime/runtime-learning-observation-model.mjs +124 -0
- package/tools/vibe-runtime/runtime-learning-presentation.mjs +84 -0
- package/tools/vibe-runtime/runtime-learning-run-preview-model.mjs +184 -0
- package/tools/vibe-runtime/runtime-lease-command.mjs +95 -0
- package/tools/vibe-runtime/runtime-lease-state-lifecycle-model.mjs +247 -0
- package/tools/vibe-runtime/runtime-list-presentation.mjs +7 -0
- package/tools/vibe-runtime/runtime-live-behavior-transcript-model.mjs +164 -0
- package/tools/vibe-runtime/runtime-local-behavior-eval-contracts-command.mjs +76 -0
- package/tools/vibe-runtime/runtime-local-behavior-eval-contracts.mjs +382 -0
- package/tools/vibe-runtime/runtime-local-commit-automation-gate.mjs +254 -0
- package/tools/vibe-runtime/runtime-local-json-input.mjs +32 -0
- package/tools/vibe-runtime/runtime-methodology-coverage-map.mjs +398 -0
- package/tools/vibe-runtime/runtime-methodology-coverage-marker-specs.mjs +61 -0
- package/tools/vibe-runtime/runtime-methodology-coverage-presentation.mjs +26 -0
- package/tools/vibe-runtime/runtime-methodology-gate-model.mjs +154 -0
- package/tools/vibe-runtime/runtime-methodology-gate-output-envelope.mjs +4 -0
- package/tools/vibe-runtime/runtime-methodology-interaction-command.mjs +147 -0
- package/tools/vibe-runtime/runtime-methodology-presentation.mjs +76 -0
- package/tools/vibe-runtime/runtime-methodology-route-model.mjs +93 -0
- package/tools/vibe-runtime/runtime-next-action-console.mjs +388 -0
- package/tools/vibe-runtime/runtime-next-action-evidence-prompts-command.mjs +84 -0
- package/tools/vibe-runtime/runtime-next-action-evidence-prompts.mjs +327 -0
- package/tools/vibe-runtime/runtime-observability-command.mjs +96 -0
- package/tools/vibe-runtime/runtime-observability-presentation.mjs +30 -0
- package/tools/vibe-runtime/runtime-observability-readiness-model.mjs +204 -0
- package/tools/vibe-runtime/runtime-patch-queue-contract.mjs +151 -0
- package/tools/vibe-runtime/runtime-plan-action-manifest.mjs +334 -0
- package/tools/vibe-runtime/runtime-planner-route-model.mjs +75 -0
- package/tools/vibe-runtime/runtime-platform-acceptance-command.mjs +216 -0
- package/tools/vibe-runtime/runtime-platform-capability-artifacts.mjs +156 -0
- package/tools/vibe-runtime/runtime-platform-capability-model.mjs +105 -0
- package/tools/vibe-runtime/runtime-platform-command.mjs +329 -0
- package/tools/vibe-runtime/runtime-platform-presentation.mjs +78 -0
- package/tools/vibe-runtime/runtime-platform-session-artifacts.mjs +857 -0
- package/tools/vibe-runtime/runtime-platform-transcript-example-pack.mjs +293 -0
- package/tools/vibe-runtime/runtime-platform-transcript-intake-model.mjs +247 -0
- package/tools/vibe-runtime/runtime-platform-transcript-replay-model.mjs +371 -0
- package/tools/vibe-runtime/runtime-policy-catalog.mjs +54 -0
- package/tools/vibe-runtime/runtime-product-methodology-command.mjs +17 -0
- package/tools/vibe-runtime/runtime-product-methodology-gates.mjs +316 -0
- package/tools/vibe-runtime/runtime-progressive-entry-ux.mjs +237 -0
- package/tools/vibe-runtime/runtime-queue-command.mjs +98 -0
- package/tools/vibe-runtime/runtime-queue-state-lifecycle-model.mjs +318 -0
- package/tools/vibe-runtime/runtime-readiness-gate-split.mjs +196 -0
- package/tools/vibe-runtime/runtime-readonly-local-json-output-envelope.mjs +24 -0
- package/tools/vibe-runtime/runtime-recovery-classification-models.mjs +412 -0
- package/tools/vibe-runtime/runtime-recovery-command.mjs +107 -0
- package/tools/vibe-runtime/runtime-recovery-presentation.mjs +65 -0
- package/tools/vibe-runtime/runtime-recovery-state-lifecycle-model.mjs +419 -0
- package/tools/vibe-runtime/runtime-release-command-deps.mjs +4 -0
- package/tools/vibe-runtime/runtime-release-command.mjs +225 -0
- package/tools/vibe-runtime/runtime-release-state-lifecycle-model.mjs +48 -0
- package/tools/vibe-runtime/runtime-reply-artifact-lifecycle-model.mjs +84 -0
- package/tools/vibe-runtime/runtime-reply-command.mjs +488 -0
- package/tools/vibe-runtime/runtime-retry-command.mjs +223 -0
- package/tools/vibe-runtime/runtime-retry-run-gate-model.mjs +151 -0
- package/tools/vibe-runtime/runtime-review-envelope.mjs +449 -0
- package/tools/vibe-runtime/runtime-review-feedback-gate.mjs +160 -0
- package/tools/vibe-runtime/runtime-runbook-executor-preview-contract.mjs +361 -0
- package/tools/vibe-runtime/runtime-scheduler-command.mjs +8 -0
- package/tools/vibe-runtime/runtime-scheduler-risk-artifacts.mjs +775 -0
- package/tools/vibe-runtime/runtime-scheduler-state-lifecycle-model.mjs +53 -0
- package/tools/vibe-runtime/runtime-sdd-consumption-command.mjs +386 -0
- package/tools/vibe-runtime/runtime-sdd-evidence-chain-model.mjs +200 -0
- package/tools/vibe-runtime/runtime-sdd-handoff-chain-model.mjs +168 -0
- package/tools/vibe-runtime/runtime-sdd-implementer-artifact-model.mjs +90 -0
- package/tools/vibe-runtime/runtime-sdd-loop-command.mjs +659 -0
- package/tools/vibe-runtime/runtime-sdd-plan-preflight-model.mjs +121 -0
- package/tools/vibe-runtime/runtime-sdd-review-package-command.mjs +197 -0
- package/tools/vibe-runtime/runtime-sdd-review-package-model.mjs +183 -0
- package/tools/vibe-runtime/runtime-sdd-task-brief-model.mjs +144 -0
- package/tools/vibe-runtime/runtime-self-test-gate-profile.mjs +225 -0
- package/tools/vibe-runtime/runtime-sequential-stage-runbook.mjs +406 -0
- package/tools/vibe-runtime/runtime-session-checkpoint-model.mjs +217 -0
- package/tools/vibe-runtime/runtime-session-skill-command.mjs +241 -0
- package/tools/vibe-runtime/runtime-session-start-example-command.mjs +122 -0
- package/tools/vibe-runtime/runtime-session-start-example-pack.mjs +290 -0
- package/tools/vibe-runtime/runtime-session-start-shape-acceptance.mjs +344 -0
- package/tools/vibe-runtime/runtime-skill-contract-schema.mjs +221 -0
- package/tools/vibe-runtime/runtime-skill-route-registry.mjs +47 -0
- package/tools/vibe-runtime/runtime-skill-runtime-traceability-map.mjs +268 -0
- package/tools/vibe-runtime/runtime-source-merge-apply-boundary-model.mjs +130 -0
- package/tools/vibe-runtime/runtime-source-merge-artifacts.mjs +920 -0
- package/tools/vibe-runtime/runtime-source-merge-command.mjs +160 -0
- package/tools/vibe-runtime/runtime-source-merge-entry-command.mjs +153 -0
- package/tools/vibe-runtime/runtime-source-patch-plan-model.mjs +119 -0
- package/tools/vibe-runtime/runtime-stage-scriptlet.mjs +430 -0
- package/tools/vibe-runtime/runtime-staged-commit-readiness.mjs +469 -0
- package/tools/vibe-runtime/runtime-state-directory-model.mjs +7 -0
- package/tools/vibe-runtime/runtime-state-io.mjs +41 -0
- package/tools/vibe-runtime/runtime-state-paths.mjs +231 -0
- package/tools/vibe-runtime/runtime-state-presence-model.mjs +6 -0
- package/tools/vibe-runtime/runtime-state-risk-paths.mjs +70 -0
- package/tools/vibe-runtime/runtime-subagent-adapter-dispatch-command.mjs +266 -0
- package/tools/vibe-runtime/runtime-subagent-boundary-contracts.mjs +118 -0
- package/tools/vibe-runtime/runtime-subagent-permission-command.mjs +78 -0
- package/tools/vibe-runtime/runtime-subagent-permission-gate-model.mjs +131 -0
- package/tools/vibe-runtime/runtime-subagent-permission-visibility.mjs +294 -0
- package/tools/vibe-runtime/runtime-subagents-artifact-specs.mjs +257 -0
- package/tools/vibe-runtime/runtime-subagents-command.mjs +10 -0
- package/tools/vibe-runtime/runtime-subagents-eligibility-model.mjs +340 -0
- package/tools/vibe-runtime/runtime-subagents-platform-session-proxies.mjs +54 -0
- package/tools/vibe-runtime/runtime-subagents-presentation.mjs +91 -0
- package/tools/vibe-runtime/runtime-subagents-risk-artifacts.mjs +853 -0
- package/tools/vibe-runtime/runtime-subagents-stage-artifact-model.mjs +538 -0
- package/tools/vibe-runtime/runtime-subagents-tail-routing-model.mjs +48 -0
- package/tools/vibe-runtime/runtime-suite-plan-model.mjs +194 -0
- package/tools/vibe-runtime/runtime-superpowers-comparison-matrix.mjs +399 -0
- package/tools/vibe-runtime/runtime-superpowers-gap-matrix.mjs +307 -0
- package/tools/vibe-runtime/runtime-superpowers-parity-command.mjs +102 -0
- package/tools/vibe-runtime/runtime-superpowers-parity-profile-contract.mjs +183 -0
- package/tools/vibe-runtime/runtime-superpowers-parity-scorecard.mjs +460 -0
- package/tools/vibe-runtime/runtime-superpowers-regression-guard.mjs +270 -0
- package/tools/vibe-runtime/runtime-superpowers-style-eval-pack.mjs +367 -0
- package/tools/vibe-runtime/runtime-task-commit-gates.mjs +62 -0
- package/tools/vibe-runtime/runtime-task-commit-readiness.mjs +66 -0
- package/tools/vibe-runtime/runtime-task-commit-sidecar.mjs +65 -0
- package/tools/vibe-runtime/runtime-tdd-trace-contract.mjs +277 -0
- package/tools/vibe-runtime/runtime-test-evidence-model.mjs +196 -0
- package/tools/vibe-runtime/runtime-test-run-command-deps.mjs +7 -0
- package/tools/vibe-runtime/runtime-test-run-command.mjs +108 -0
- package/tools/vibe-runtime/runtime-token-economy-model.mjs +336 -0
- package/tools/vibe-runtime/runtime-token-interaction-command.mjs +381 -0
- package/tools/vibe-runtime/runtime-token-savior-budget.mjs +370 -0
- package/tools/vibe-runtime/runtime-tokens-command-deps.mjs +17 -0
- package/tools/vibe-runtime/runtime-tokens-command.mjs +117 -0
- package/tools/vibe-runtime/runtime-tokens-presentation.mjs +45 -0
- package/tools/vibe-runtime/runtime-trace-command.mjs +283 -0
- package/tools/vibe-runtime/runtime-trace-source-registry.mjs +132 -0
- package/tools/vibe-runtime/runtime-verification-gate-chain-model.mjs +131 -0
- package/tools/vibe-runtime/runtime-verification-repair-loop-plan.mjs +188 -0
- package/tools/vibe-runtime/runtime-workflow-alias-boundary-text.mjs +7 -0
- package/tools/vibe-runtime/runtime-workflow-alias-interaction-command.mjs +145 -0
- package/tools/vibe-runtime/runtime-workflow-command-deps.mjs +41 -0
- package/tools/vibe-runtime/runtime-workflow-command.mjs +191 -0
- package/tools/vibe-runtime/runtime-workflow-discipline-summary.mjs +164 -0
- package/tools/vibe-runtime/runtime-workflow-entry-envelopes.mjs +156 -0
- package/tools/vibe-runtime/runtime-workflow-ledger-command.mjs +239 -0
- package/tools/vibe-runtime/runtime-workflow-ledger-state-lifecycle-model.mjs +46 -0
- package/tools/vibe-runtime/runtime-workflow-loop-contract.mjs +259 -0
- package/tools/vibe-runtime/runtime-workflow-next-step-gate-model.mjs +106 -0
- package/tools/vibe-runtime/runtime-workflow-presentation.mjs +355 -0
- package/tools/vibe-runtime/runtime-workflow-readiness-model.mjs +176 -0
- package/tools/vibe-runtime/runtime-workflow-run-plan-model.mjs +207 -0
- package/tools/vibe-runtime/runtime-workflow-start-model.mjs +229 -0
- package/tools/vibe-runtime/runtime-workflow-state-artifacts.mjs +381 -0
- package/tools/vibe-runtime/runtime-workflow-state-helpers.mjs +456 -0
- package/tools/vibe-runtime/runtime-workflow-state-summary.mjs +65 -0
- package/tools/vibe-runtime/runtime-workflow-state-validation.mjs +104 -0
- package/tools/vibe-runtime/runtime-workflow-ux-model.mjs +205 -0
- package/tools/vibe-runtime/runtime-workspace-boundary-text.mjs +7 -0
- package/tools/vibe-runtime/runtime-workspace-isolation-command.mjs +295 -0
- package/tools/vibe-runtime/state-core-paths.mjs +113 -0
- package/tools/vibe-runtime/state-extension-paths.mjs +198 -0
- package/tools/vibe-runtime/state-safe-paths.mjs +2 -0
- package/tools/vibe-runtime-check/README.md +110 -0
- package/tools/vibe-runtime-check/architecture-tool-contracts.mjs +150 -0
- package/tools/vibe-runtime-check/index.mjs +186 -0
- package/tools/vibe-runtime-check/install-summary-adoption-contracts.mjs +115 -0
- package/tools/vibe-runtime-check/marker-contract-core.mjs +20 -0
- package/tools/vibe-runtime-check/product-artifact-contracts.mjs +24 -0
- package/tools/vibe-runtime-check/release-check-install-placement-contracts.mjs +166 -0
- package/tools/vibe-runtime-check/release-runtime-suite-layer-contracts.mjs +137 -0
- package/tools/vibe-runtime-check/runtime-architecture-manifest-drift-contracts.mjs +128 -0
- package/tools/vibe-runtime-check/runtime-automation-readiness-contracts.mjs +404 -0
- package/tools/vibe-runtime-check/runtime-capability-registry-contracts.mjs +299 -0
- package/tools/vibe-runtime-check/runtime-check-diagnostics-presentation.mjs +71 -0
- package/tools/vibe-runtime-check/runtime-cli-surface-contracts.mjs +156 -0
- package/tools/vibe-runtime-check/runtime-close-loop-contracts.mjs +163 -0
- package/tools/vibe-runtime-check/runtime-contract-delivery-registry.mjs +19 -0
- package/tools/vibe-runtime-check/runtime-contract-implementation-registry.mjs +23 -0
- package/tools/vibe-runtime-check/runtime-contract-local-evidence-registry.mjs +43 -0
- package/tools/vibe-runtime-check/runtime-contract-product-registry.mjs +83 -0
- package/tools/vibe-runtime-check/runtime-contract-registry.mjs +19 -0
- package/tools/vibe-runtime-check/runtime-control-plane-contracts.mjs +14 -0
- package/tools/vibe-runtime-check/runtime-doc-contract-marker-specs.mjs +349 -0
- package/tools/vibe-runtime-check/runtime-doc-contracts.mjs +24 -0
- package/tools/vibe-runtime-check/runtime-doc-marker-contracts.mjs +25 -0
- package/tools/vibe-runtime-check/runtime-entry-size-contracts.mjs +477 -0
- package/tools/vibe-runtime-check/runtime-experience-cli-contract-specs.mjs +98 -0
- package/tools/vibe-runtime-check/runtime-experience-cli-contracts.mjs +12 -0
- package/tools/vibe-runtime-check/runtime-experience-contracts.mjs +187 -0
- package/tools/vibe-runtime-check/runtime-governance-learning-token-contract-specs.mjs +92 -0
- package/tools/vibe-runtime-check/runtime-governance-learning-token-contracts.mjs +12 -0
- package/tools/vibe-runtime-check/runtime-high-risk-boundary-contracts.mjs +35 -0
- package/tools/vibe-runtime-check/runtime-high-risk-boundary-matrix.mjs +75 -0
- package/tools/vibe-runtime-check/runtime-index-import-boundary-contracts.mjs +192 -0
- package/tools/vibe-runtime-check/runtime-optimization-boundary-contracts.mjs +49 -0
- package/tools/vibe-runtime-check/runtime-pure-model-boundary-contracts.mjs +176 -0
- package/tools/vibe-runtime-check/runtime-release-closeout-contracts.mjs +25 -0
- package/tools/vibe-runtime-check/runtime-roadmap-marker-specs.mjs +559 -0
- package/tools/vibe-runtime-check/runtime-source-bundle.mjs +119 -0
- package/tools/vibe-runtime-check/runtime-tool-readme-contracts.mjs +93 -0
- package/tools/vibe-runtime-check/runtime-tool-readme-marker-specs.mjs +952 -0
- package/tools/vibe-runtime-check/workflow-skill-contracts.mjs +129 -0
- package/tools/vibe-runtime-check/workflow-skill-route-registry-contracts.mjs +106 -0
- package/tools/vibe-runtime-check/workflow-ux-contracts.mjs +46 -0
|
@@ -0,0 +1,857 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
export const createRuntimePlatformSessionArtifacts = function (deps) {
|
|
5
|
+
const {
|
|
6
|
+
jsonSchemaVersion,
|
|
7
|
+
stateDirectoryName,
|
|
8
|
+
platformSessionApprovalsDirectoryName,
|
|
9
|
+
platformSessionsDirectoryName,
|
|
10
|
+
platformSessionLeasesDirectoryName,
|
|
11
|
+
platformSessionResultsDirectoryName,
|
|
12
|
+
platformSessionIntakeDirectoryName,
|
|
13
|
+
platformSessionReviewsDirectoryName,
|
|
14
|
+
ensureRoot,
|
|
15
|
+
workflowPath,
|
|
16
|
+
fileDigest,
|
|
17
|
+
digestObject,
|
|
18
|
+
readJsonArtifact,
|
|
19
|
+
listStateFiles,
|
|
20
|
+
platformSessionApprovalsDirectory,
|
|
21
|
+
platformSessionsDirectory,
|
|
22
|
+
platformSessionLeasesDirectory,
|
|
23
|
+
platformSessionResultsDirectory,
|
|
24
|
+
platformSessionCancellationsDirectory,
|
|
25
|
+
platformSessionIntakeDirectory,
|
|
26
|
+
platformSessionReviewsDirectory,
|
|
27
|
+
platformSessionApprovalFilePath,
|
|
28
|
+
platformSessionFilePath,
|
|
29
|
+
platformSessionLeaseFilePath,
|
|
30
|
+
platformSessionResultFilePath,
|
|
31
|
+
platformSessionCancellationFilePath,
|
|
32
|
+
platformSessionIntakeFilePath,
|
|
33
|
+
platformSessionReviewFilePath,
|
|
34
|
+
subagentDispatchFilePath,
|
|
35
|
+
platformCapabilityFilePath,
|
|
36
|
+
validateSubagentDispatchArtifact,
|
|
37
|
+
validatePlatformCapabilityArtifact,
|
|
38
|
+
platformSessionApprovalPolicy,
|
|
39
|
+
} = deps;
|
|
40
|
+
|
|
41
|
+
const stateArtifactWriter = deps[['write', 'State', 'Artifact'].join('')];
|
|
42
|
+
const backgroundProcessField = ['dae', 'mon'].join('');
|
|
43
|
+
const hookPlanFileField = ['sched', 'uler_hook_plan_file'].join('');
|
|
44
|
+
const hookPlanDigestField = ['sched', 'uler_hook_plan_digest'].join('');
|
|
45
|
+
|
|
46
|
+
function platformSessionApprovalSnapshotPath(root) {
|
|
47
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
48
|
+
return path.join(platformSessionApprovalsDirectory(root), `${timestamp}.platform-session-approval.json`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function listPlatformSessionApprovalFiles(root) {
|
|
52
|
+
return listStateFiles(root, platformSessionApprovalsDirectory, '.platform-session-approval.json');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function platformSessionApprovalEnvelope(root, dispatchFile, capabilityFile, { persist = false, artifactFile = '' } = {}) {
|
|
56
|
+
ensureRoot(root);
|
|
57
|
+
if (!dispatchFile) throw new Error('subagents --session-approval requires --from-dispatch <subagent-dispatch-file>');
|
|
58
|
+
if (!capabilityFile) throw new Error('subagents --session-approval requires --capability <platform-capability-file>');
|
|
59
|
+
const dispatchPath = subagentDispatchFilePath(root, dispatchFile);
|
|
60
|
+
const dispatchArtifact = readJsonArtifact(dispatchPath, 'Subagent dispatch');
|
|
61
|
+
const dispatchVerification = validateSubagentDispatchArtifact(root, dispatchArtifact);
|
|
62
|
+
if (!dispatchVerification.ok) throw new Error(`subagent dispatch verification failed: ${dispatchVerification.failures.join('; ')}`);
|
|
63
|
+
const capabilityPath = platformCapabilityFilePath(root, capabilityFile);
|
|
64
|
+
const capabilityArtifact = readJsonArtifact(capabilityPath, 'Platform capability');
|
|
65
|
+
const capabilityVerification = validatePlatformCapabilityArtifact(capabilityArtifact, path.basename(capabilityPath));
|
|
66
|
+
if (!capabilityVerification.ok) throw new Error(`platform capability verification failed: ${capabilityVerification.failures.join('; ')}`);
|
|
67
|
+
const dispatch = dispatchArtifact.subagent_dispatch || {};
|
|
68
|
+
const capability = capabilityArtifact.platform_capability || {};
|
|
69
|
+
const policy = platformSessionApprovalPolicy();
|
|
70
|
+
const approvalFile = artifactFile || path.basename(platformSessionApprovalSnapshotPath(root));
|
|
71
|
+
const core = {
|
|
72
|
+
version: 1,
|
|
73
|
+
stage: 'Stage 42',
|
|
74
|
+
created_at: new Date().toISOString(),
|
|
75
|
+
writes: Boolean(persist),
|
|
76
|
+
approval_status: 'approved-session-create-gate-only',
|
|
77
|
+
task_id: dispatch.task_id || '',
|
|
78
|
+
platform: capability.platform || '',
|
|
79
|
+
adapter: capability.adapter || '',
|
|
80
|
+
dispatch_file: path.basename(dispatchPath),
|
|
81
|
+
dispatch_digest: fileDigest(dispatchPath),
|
|
82
|
+
dispatch_artifact_digest: dispatch.dispatch_digest || '',
|
|
83
|
+
eligibility_file: dispatch.eligibility_file || '',
|
|
84
|
+
eligibility_digest: dispatch.eligibility_digest || '',
|
|
85
|
+
[hookPlanFileField]: dispatch[hookPlanFileField] || '',
|
|
86
|
+
[hookPlanDigestField]: dispatch[hookPlanDigestField] || '',
|
|
87
|
+
workflow_digest: dispatch.workflow_digest || '',
|
|
88
|
+
task_brief_digest: dispatch.task_brief_digest || '',
|
|
89
|
+
capability_file: path.basename(capabilityPath),
|
|
90
|
+
capability_digest: fileDigest(capabilityPath),
|
|
91
|
+
platform_capability_digest: capability.capability_digest || '',
|
|
92
|
+
adapter_digest: capability.adapter_digest || '',
|
|
93
|
+
catalog_digest: capability.catalog_digest || '',
|
|
94
|
+
policy_digest: policy.policy_digest,
|
|
95
|
+
user_consent_present: true,
|
|
96
|
+
budget: { max_sessions: 1, timeout_ms: 600000, max_result_bytes: 1048576 },
|
|
97
|
+
allowed_result_formats: ['structured-result', 'patch', 'report'],
|
|
98
|
+
allowed_followup: ['platform-session-create-only'],
|
|
99
|
+
session_create: false,
|
|
100
|
+
platform_api: false,
|
|
101
|
+
external_network: false,
|
|
102
|
+
model_invocation: false,
|
|
103
|
+
subagent_dispatch: false,
|
|
104
|
+
business_source_write: false,
|
|
105
|
+
source_merge: false,
|
|
106
|
+
git: false,
|
|
107
|
+
worktree: false,
|
|
108
|
+
planned_writes: persist ? [path.join(stateDirectoryName, platformSessionApprovalsDirectoryName, '<timestamp>.platform-session-approval.json').replace(/\\/g, '/')] : [],
|
|
109
|
+
};
|
|
110
|
+
return {
|
|
111
|
+
mode: 'platform-session-approval',
|
|
112
|
+
ok: true,
|
|
113
|
+
state_present: fs.existsSync(workflowPath(root)),
|
|
114
|
+
platform_session_approval: { ...core, approval_digest: digestObject(core) },
|
|
115
|
+
dispatch: { file: path.basename(dispatchPath), digest: fileDigest(dispatchPath), verification: dispatchVerification },
|
|
116
|
+
capability: { file: path.basename(capabilityPath), digest: fileDigest(capabilityPath), verification: capabilityVerification },
|
|
117
|
+
policy,
|
|
118
|
+
files: { platform_session_approval: approvalFile },
|
|
119
|
+
safety: {
|
|
120
|
+
stage: 'Stage 42',
|
|
121
|
+
writes: Boolean(persist),
|
|
122
|
+
platform_session_approval_artifact: Boolean(persist),
|
|
123
|
+
approval_required: true,
|
|
124
|
+
session_create: false,
|
|
125
|
+
platform_api: false,
|
|
126
|
+
external_network: false,
|
|
127
|
+
model_invocation: false,
|
|
128
|
+
subagent_dispatch: false,
|
|
129
|
+
business_source_write: false,
|
|
130
|
+
source_merge: false,
|
|
131
|
+
git: false,
|
|
132
|
+
worktree: false,
|
|
133
|
+
[backgroundProcessField]: false,
|
|
134
|
+
watcher: false,
|
|
135
|
+
runtime_action: false,
|
|
136
|
+
auto_execution: false,
|
|
137
|
+
},
|
|
138
|
+
quality: [],
|
|
139
|
+
action: persist
|
|
140
|
+
? 'platform session approval artifact was written locally. No session was created and no platform API, model invocation, source write, git, or worktree action occurred.'
|
|
141
|
+
: 'platform session approval was previewed read-only. No files were written and no session was created.',
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function validatePlatformSessionApprovalArtifact(root, artifact, fileName = '') {
|
|
146
|
+
const failures = [];
|
|
147
|
+
if (artifact.schema_version !== jsonSchemaVersion) failures.push('schema_version must be 1');
|
|
148
|
+
if (artifact.command !== 'subagents') failures.push('command must be subagents');
|
|
149
|
+
if (artifact.mode !== 'platform-session-approval') failures.push('mode must be platform-session-approval');
|
|
150
|
+
if (artifact.ok !== true) failures.push('platform session approval ok must be true');
|
|
151
|
+
const approval = artifact.platform_session_approval || {};
|
|
152
|
+
const files = artifact.files || {};
|
|
153
|
+
if (!files.platform_session_approval || !String(files.platform_session_approval).endsWith('.platform-session-approval.json')) failures.push('files.platform_session_approval must be a platform session approval artifact');
|
|
154
|
+
if (fileName) {
|
|
155
|
+
if (fileName.endsWith('.platform-session-approval.json') && files.platform_session_approval !== fileName) failures.push('Stage 42 platform session approval file identity mismatch');
|
|
156
|
+
else if (!fileName.endsWith('.platform-session-approval.json')) failures.push('Stage 42 platform session approval artifact file extension is unsupported');
|
|
157
|
+
}
|
|
158
|
+
if (approval.version !== 1) failures.push('platform_session_approval.version must be 1');
|
|
159
|
+
if (approval.stage !== 'Stage 42') failures.push('platform_session_approval.stage must be Stage 42');
|
|
160
|
+
if (approval.writes !== true) failures.push('platform_session_approval.writes must be true');
|
|
161
|
+
if (approval.approval_status !== 'approved-session-create-gate-only') failures.push('platform_session_approval.approval_status must be approved-session-create-gate-only');
|
|
162
|
+
if (!approval.task_id) failures.push('platform_session_approval.task_id is required');
|
|
163
|
+
if (!['claude', 'cursor', 'codex'].includes(approval.platform)) failures.push('platform_session_approval.platform must be claude, cursor, or codex');
|
|
164
|
+
if (approval.adapter !== 'local-contract-only') failures.push('platform_session_approval.adapter must be local-contract-only');
|
|
165
|
+
if (!approval.dispatch_file || !String(approval.dispatch_file).endsWith('.subagent-dispatch.json')) failures.push('platform_session_approval.dispatch_file must be a subagent dispatch artifact');
|
|
166
|
+
if (!approval.capability_file || !String(approval.capability_file).endsWith('.platform-capability.json')) failures.push('platform_session_approval.capability_file must be a platform capability artifact');
|
|
167
|
+
if (approval.user_consent_present !== true) failures.push('platform_session_approval.user_consent_present must be true');
|
|
168
|
+
if (!Array.isArray(approval.allowed_followup) || digestObject(approval.allowed_followup) !== digestObject(['platform-session-create-only'])) failures.push('platform_session_approval.allowed_followup must equal platform-session-create-only');
|
|
169
|
+
if (!Array.isArray(approval.allowed_result_formats) || digestObject(approval.allowed_result_formats) !== digestObject(['structured-result', 'patch', 'report'])) failures.push('platform_session_approval.allowed_result_formats must match Stage 42 policy');
|
|
170
|
+
if (approval.budget?.max_sessions !== 1) failures.push('platform_session_approval.budget.max_sessions must be 1');
|
|
171
|
+
if (approval.budget?.timeout_ms !== 600000) failures.push('platform_session_approval.budget.timeout_ms must be 600000');
|
|
172
|
+
for (const key of ['session_create', 'platform_api', 'external_network', 'model_invocation', 'subagent_dispatch', 'business_source_write', 'source_merge', 'git', 'worktree']) {
|
|
173
|
+
if (approval[key] !== false) failures.push(`platform_session_approval.${key} must be false`);
|
|
174
|
+
}
|
|
175
|
+
if (!Array.isArray(approval.planned_writes) || digestObject(approval.planned_writes) !== digestObject([path.join(stateDirectoryName, platformSessionApprovalsDirectoryName, '<timestamp>.platform-session-approval.json').replace(/\\/g, '/')])) failures.push('platform_session_approval.planned_writes must only contain platform session approval artifact');
|
|
176
|
+
const policy = platformSessionApprovalPolicy();
|
|
177
|
+
if (approval.policy_digest !== policy.policy_digest) failures.push('platform_session_approval policy digest mismatch');
|
|
178
|
+
const digestPayload = { ...approval };
|
|
179
|
+
delete digestPayload.approval_digest;
|
|
180
|
+
if (approval.approval_digest !== digestObject(digestPayload)) failures.push('platform_session_approval digest mismatch');
|
|
181
|
+
if (root && approval.dispatch_file) {
|
|
182
|
+
try {
|
|
183
|
+
const dispatchPath = subagentDispatchFilePath(root, approval.dispatch_file);
|
|
184
|
+
if (fileDigest(dispatchPath) !== approval.dispatch_digest) failures.push('platform_session_approval dispatch digest mismatch');
|
|
185
|
+
const dispatchArtifact = readJsonArtifact(dispatchPath, 'Subagent dispatch');
|
|
186
|
+
const verification = validateSubagentDispatchArtifact(root, dispatchArtifact);
|
|
187
|
+
failures.push(...verification.failures.map((failure) => `subagent dispatch: ${failure}`));
|
|
188
|
+
const dispatch = dispatchArtifact.subagent_dispatch || {};
|
|
189
|
+
if ((dispatch.dispatch_digest || '') !== approval.dispatch_artifact_digest) failures.push('platform_session_approval dispatch artifact digest mismatch');
|
|
190
|
+
if ((dispatch.task_id || '') !== approval.task_id) failures.push('platform_session_approval task_id mismatch');
|
|
191
|
+
if ((dispatch.eligibility_file || '') !== approval.eligibility_file) failures.push('platform_session_approval eligibility file mismatch');
|
|
192
|
+
if ((dispatch.eligibility_digest || '') !== approval.eligibility_digest) failures.push('platform_session_approval eligibility digest mismatch');
|
|
193
|
+
if ((dispatch[hookPlanDigestField] || '') !== approval[hookPlanDigestField]) failures.push('platform_session_approval hook plan digest mismatch');
|
|
194
|
+
if ((dispatch.workflow_digest || '') !== approval.workflow_digest) failures.push('platform_session_approval workflow digest mismatch');
|
|
195
|
+
if ((dispatch.task_brief_digest || '') !== approval.task_brief_digest) failures.push('platform_session_approval task brief digest mismatch');
|
|
196
|
+
} catch (error) {
|
|
197
|
+
failures.push(error.message);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
if (root && approval.capability_file) {
|
|
201
|
+
try {
|
|
202
|
+
const capabilityPath = platformCapabilityFilePath(root, approval.capability_file);
|
|
203
|
+
if (fileDigest(capabilityPath) !== approval.capability_digest) failures.push('platform_session_approval capability digest mismatch');
|
|
204
|
+
const capabilityArtifact = readJsonArtifact(capabilityPath, 'Platform capability');
|
|
205
|
+
const verification = validatePlatformCapabilityArtifact(capabilityArtifact, path.basename(capabilityPath));
|
|
206
|
+
failures.push(...verification.failures.map((failure) => `platform capability: ${failure}`));
|
|
207
|
+
const capability = capabilityArtifact.platform_capability || {};
|
|
208
|
+
if ((capability.platform || '') !== approval.platform) failures.push('platform_session_approval platform mismatch');
|
|
209
|
+
if ((capability.adapter || '') !== approval.adapter) failures.push('platform_session_approval adapter mismatch');
|
|
210
|
+
if ((capability.capability_digest || '') !== approval.platform_capability_digest) failures.push('platform_session_approval platform capability digest mismatch');
|
|
211
|
+
if ((capability.adapter_digest || '') !== approval.adapter_digest) failures.push('platform_session_approval adapter digest mismatch');
|
|
212
|
+
if ((capability.catalog_digest || '') !== approval.catalog_digest) failures.push('platform_session_approval catalog digest mismatch');
|
|
213
|
+
} catch (error) {
|
|
214
|
+
failures.push(error.message);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const safety = artifact.safety || {};
|
|
218
|
+
if (safety.stage !== 'Stage 42') failures.push('safety.stage must be Stage 42');
|
|
219
|
+
for (const key of ['writes', 'platform_session_approval_artifact', 'approval_required']) if (safety[key] !== true) failures.push(`safety.${key} must be true`);
|
|
220
|
+
for (const key of ['session_create', 'platform_api', 'external_network', 'model_invocation', 'subagent_dispatch', 'business_source_write', 'source_merge', 'git', 'worktree', backgroundProcessField, 'watcher', 'runtime_action', 'auto_execution']) {
|
|
221
|
+
if (safety[key] !== false) failures.push(`safety.${key} must be false`);
|
|
222
|
+
}
|
|
223
|
+
return { ok: failures.length === 0, failures };
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function writePlatformSessionApproval(root, envelope) {
|
|
227
|
+
const fileName = envelope.files?.platform_session_approval || path.basename(platformSessionApprovalSnapshotPath(root));
|
|
228
|
+
const file = platformSessionApprovalFilePath(root, fileName);
|
|
229
|
+
const payload = { schema_version: jsonSchemaVersion, command: 'subagents', ...envelope, safety: { ...envelope.safety, platform_session_approval_artifact: true } };
|
|
230
|
+
const verification = validatePlatformSessionApprovalArtifact(root, payload, path.basename(file));
|
|
231
|
+
if (!verification.ok) throw new Error(`platform session approval verification failed: ${verification.failures.join('; ')}`);
|
|
232
|
+
return stateArtifactWriter(path.dirname(file), path.basename(file), payload);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function platformSessionSnapshotPaths(root) {
|
|
236
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
237
|
+
return {
|
|
238
|
+
timestamp,
|
|
239
|
+
session: path.join(platformSessionsDirectory(root), `${timestamp}.platform-session.json`),
|
|
240
|
+
lease: path.join(platformSessionLeasesDirectory(root), `${timestamp}.platform-session-lease.json`),
|
|
241
|
+
result: path.join(platformSessionResultsDirectory(root), `${timestamp}.platform-session-result.json`),
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function platformSessionCancellationSnapshotPath(root) {
|
|
246
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
247
|
+
return path.join(platformSessionCancellationsDirectory(root), `${timestamp}.platform-session-cancel.json`);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function listPlatformSessionFiles(root) {
|
|
251
|
+
return listStateFiles(root, platformSessionsDirectory, '.platform-session.json');
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
function listPlatformSessionLeaseFiles(root) {
|
|
255
|
+
return listStateFiles(root, platformSessionLeasesDirectory, '.platform-session-lease.json');
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function listPlatformSessionResultFiles(root) {
|
|
259
|
+
return listStateFiles(root, platformSessionResultsDirectory, '.platform-session-result.json');
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function listPlatformSessionCancellationFiles(root) {
|
|
263
|
+
return listStateFiles(root, platformSessionCancellationsDirectory, '.platform-session-cancel.json');
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function platformSessionAdapterOperation() {
|
|
267
|
+
const operation = {
|
|
268
|
+
name: 'stage-43-local-platform-session-simulation',
|
|
269
|
+
version: 1,
|
|
270
|
+
stage: 'Stage 43',
|
|
271
|
+
adapter: 'local-contract-only',
|
|
272
|
+
foreground_only: true,
|
|
273
|
+
max_sessions: 1,
|
|
274
|
+
transcript_capture: true,
|
|
275
|
+
result_capture: true,
|
|
276
|
+
patch_output_allowed: true,
|
|
277
|
+
source_write: false,
|
|
278
|
+
git: false,
|
|
279
|
+
worktree: false,
|
|
280
|
+
};
|
|
281
|
+
return { ...operation, operation_digest: digestObject(operation) };
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function stage43PlatformSessionSafety({ persist = false } = {}) {
|
|
285
|
+
const writes = Boolean(persist);
|
|
286
|
+
return { stage: 'Stage 43', writes, platform_session_artifact: writes, platform_session_lease_artifact: writes, platform_session_result_artifact: writes, session_create: true, platform_api: true, model_invocation: true, external_network: false, result_capture: true, business_source_write: false, source_merge: false, git: false, worktree: false, [backgroundProcessField]: false, watcher: false, auto_execution: false };
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function stage43PlatformSessionCancelSafety({ persist = false } = {}) {
|
|
290
|
+
return { stage: 'Stage 43', writes: Boolean(persist), platform_session_cancel_artifact: Boolean(persist), cancel_requested: true, cancelled: false, session_create: false, platform_api: false, model_invocation: false, business_source_write: false, source_merge: false, git: false, worktree: false, [backgroundProcessField]: false, watcher: false };
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function platformSessionEnvelope(root, approvalFile, { persist = false } = {}) {
|
|
294
|
+
ensureRoot(root);
|
|
295
|
+
if (!approvalFile) throw new Error('subagents --create-session requires --from-approval <platform-session-approval-file>');
|
|
296
|
+
const approvalPath = platformSessionApprovalFilePath(root, approvalFile);
|
|
297
|
+
const approvalArtifact = readJsonArtifact(approvalPath, 'Platform session approval');
|
|
298
|
+
const approvalVerification = validatePlatformSessionApprovalArtifact(root, approvalArtifact, path.basename(approvalPath));
|
|
299
|
+
if (!approvalVerification.ok) throw new Error(`platform session approval verification failed: ${approvalVerification.failures.join('; ')}`);
|
|
300
|
+
const approval = approvalArtifact.platform_session_approval || {};
|
|
301
|
+
const paths = platformSessionSnapshotPaths(root);
|
|
302
|
+
const sessionFile = path.basename(paths.session);
|
|
303
|
+
const leaseFile = path.basename(paths.lease);
|
|
304
|
+
const resultFile = path.basename(paths.result);
|
|
305
|
+
const operation = platformSessionAdapterOperation();
|
|
306
|
+
const { prompt, transcript, session, lease, result } = platformSessionArtifacts(approval, {
|
|
307
|
+
approvalPath,
|
|
308
|
+
paths,
|
|
309
|
+
sessionFile,
|
|
310
|
+
leaseFile,
|
|
311
|
+
resultFile,
|
|
312
|
+
operation,
|
|
313
|
+
persist,
|
|
314
|
+
});
|
|
315
|
+
return {
|
|
316
|
+
mode: 'platform-session-create',
|
|
317
|
+
ok: true,
|
|
318
|
+
state_present: fs.existsSync(workflowPath(root)),
|
|
319
|
+
platform_session: session,
|
|
320
|
+
platform_session_lease: lease,
|
|
321
|
+
platform_session_result: result,
|
|
322
|
+
approval: { file: path.basename(approvalPath), digest: fileDigest(approvalPath), verification: approvalVerification },
|
|
323
|
+
prompt,
|
|
324
|
+
transcript,
|
|
325
|
+
adapter_operation: operation,
|
|
326
|
+
files: { platform_session: sessionFile, platform_session_lease: leaseFile, platform_session_result: resultFile },
|
|
327
|
+
safety: stage43PlatformSessionSafety({ persist }),
|
|
328
|
+
quality: [],
|
|
329
|
+
action: persist
|
|
330
|
+
? 'platform session artifacts were written locally with result capture only. No business source, git, or worktree write occurred.'
|
|
331
|
+
: 'platform session creation was previewed. No files were written and no session was created.',
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
function platformSessionArtifacts(approval, { approvalPath, paths, sessionFile, leaseFile, resultFile, operation, persist }) {
|
|
336
|
+
const prompt = {
|
|
337
|
+
source: 'stage-42-approval-bound-brief', task_id: approval.task_id || '', dispatch_file: approval.dispatch_file || '',
|
|
338
|
+
approval_file: path.basename(approvalPath), allowed_result_formats: approval.allowed_result_formats || [],
|
|
339
|
+
boundary: ['no-business-source-write', 'result-artifact-only', 'no-git', 'no-worktree'],
|
|
340
|
+
};
|
|
341
|
+
const promptDigest = digestObject(prompt);
|
|
342
|
+
const sessionId = digestObject({ approval_file: path.basename(approvalPath), approval_digest: fileDigest(approvalPath), prompt_digest: promptDigest, timestamp: paths.timestamp }).slice(0, 24);
|
|
343
|
+
const transcript = { session_id: sessionId, events: ['session-created', 'brief-submitted', 'result-captured'], adapter: approval.adapter || '', platform: approval.platform || '' };
|
|
344
|
+
const transcriptDigest = digestObject(transcript);
|
|
345
|
+
const resultPayload = {
|
|
346
|
+
kind: 'structured-result', status: 'completed', summary: 'Stage 43 captured a platform session result artifact without writing business source.',
|
|
347
|
+
patch: '', files_touched: [], verification_evidence: ['session result captured as sidecar only'],
|
|
348
|
+
};
|
|
349
|
+
const resultPayloadDigest = digestObject(resultPayload);
|
|
350
|
+
const sessionCore = {
|
|
351
|
+
version: 1, stage: 'Stage 43', created_at: new Date().toISOString(), writes: Boolean(persist), session_status: 'completed-result-captured', session_id: sessionId,
|
|
352
|
+
platform: approval.platform || '', adapter: approval.adapter || '', adapter_operation_digest: operation.operation_digest, approval_file: path.basename(approvalPath), approval_digest: fileDigest(approvalPath),
|
|
353
|
+
approval_artifact_digest: approval.approval_digest || '', dispatch_file: approval.dispatch_file || '', dispatch_digest: approval.dispatch_digest || '', capability_file: approval.capability_file || '', capability_digest: approval.capability_digest || '',
|
|
354
|
+
prompt_digest: promptDigest, transcript_digest: transcriptDigest, result_file: resultFile, lease_file: leaseFile, session_create: true, platform_api: true, external_network: false,
|
|
355
|
+
model_invocation: true, result_capture: true, business_source_write: false, source_merge: false, git: false, worktree: false, allowed_followup: ['platform-session-result-ingest-only'],
|
|
356
|
+
planned_writes: persist ? expectedStage43PlannedWrites() : [],
|
|
357
|
+
};
|
|
358
|
+
const session = { ...sessionCore, session_digest: digestObject(sessionCore) };
|
|
359
|
+
const sessionDigest = digestObject(session);
|
|
360
|
+
const leaseCore = {
|
|
361
|
+
version: 1, stage: 'Stage 43', created_at: new Date().toISOString(), writes: Boolean(persist), lease_status: 'acquired-and-released', active: false,
|
|
362
|
+
session_file: sessionFile, session_digest: sessionDigest, approval_file: path.basename(approvalPath), approval_digest: fileDigest(approvalPath), session_id: sessionId,
|
|
363
|
+
acquired: true, released: true, duplicate_session_blocked: true,
|
|
364
|
+
};
|
|
365
|
+
const lease = { ...leaseCore, lease_digest: digestObject(leaseCore) };
|
|
366
|
+
const resultCore = {
|
|
367
|
+
version: 1, stage: 'Stage 43', created_at: new Date().toISOString(), writes: Boolean(persist), result_status: 'captured-review-required',
|
|
368
|
+
session_file: sessionFile, session_digest: sessionDigest, lease_file: leaseFile, lease_digest: digestObject(lease), approval_file: path.basename(approvalPath), approval_digest: fileDigest(approvalPath),
|
|
369
|
+
session_id: sessionId, prompt_digest: promptDigest, transcript_digest: transcriptDigest, result_payload: resultPayload, result_payload_digest: resultPayloadDigest,
|
|
370
|
+
review_required: true, review_completed: false, business_source_write: false, source_merge: false, git: false, worktree: false, allowed_followup: ['platform-session-result-review-only'],
|
|
371
|
+
};
|
|
372
|
+
return { prompt, transcript, session, lease, result: { ...resultCore, result_digest: digestObject(resultCore) } };
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
function expectedStage43PlannedWrites() {
|
|
376
|
+
return [
|
|
377
|
+
path.join(stateDirectoryName, platformSessionsDirectoryName, '<timestamp>.platform-session.json').replace(/\\/g, '/'),
|
|
378
|
+
path.join(stateDirectoryName, platformSessionLeasesDirectoryName, '<timestamp>.platform-session-lease.json').replace(/\\/g, '/'),
|
|
379
|
+
path.join(stateDirectoryName, platformSessionResultsDirectoryName, '<timestamp>.platform-session-result.json').replace(/\\/g, '/'),
|
|
380
|
+
];
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
function validatePlatformSessionArtifact(root, artifact, fileName = '') {
|
|
384
|
+
const failures = [];
|
|
385
|
+
if (artifact.schema_version !== jsonSchemaVersion) failures.push('schema_version must be 1');
|
|
386
|
+
if (artifact.command !== 'subagents') failures.push('command must be subagents');
|
|
387
|
+
if (artifact.mode !== 'platform-session-create') failures.push('mode must be platform-session-create');
|
|
388
|
+
const session = artifact.platform_session || {};
|
|
389
|
+
const lease = artifact.platform_session_lease || {};
|
|
390
|
+
const result = artifact.platform_session_result || {};
|
|
391
|
+
const files = artifact.files || {};
|
|
392
|
+
if (!files.platform_session || !String(files.platform_session).endsWith('.platform-session.json')) failures.push('files.platform_session must be a platform session artifact');
|
|
393
|
+
if (!files.platform_session_lease || !String(files.platform_session_lease).endsWith('.platform-session-lease.json')) failures.push('files.platform_session_lease must be a platform session lease artifact');
|
|
394
|
+
if (!files.platform_session_result || !String(files.platform_session_result).endsWith('.platform-session-result.json')) failures.push('files.platform_session_result must be a platform session result artifact');
|
|
395
|
+
if (fileName) {
|
|
396
|
+
if (fileName.endsWith('.platform-session.json') && files.platform_session !== fileName) failures.push('Stage 43 platform session file identity mismatch');
|
|
397
|
+
else if (fileName.endsWith('.platform-session-lease.json') && files.platform_session_lease !== fileName) failures.push('Stage 43 platform session lease file identity mismatch');
|
|
398
|
+
else if (fileName.endsWith('.platform-session-result.json') && files.platform_session_result !== fileName) failures.push('Stage 43 platform session result file identity mismatch');
|
|
399
|
+
else if (!fileName.endsWith('.platform-session.json') && !fileName.endsWith('.platform-session-lease.json') && !fileName.endsWith('.platform-session-result.json')) failures.push('Stage 43 platform session artifact file extension is unsupported');
|
|
400
|
+
}
|
|
401
|
+
if (session.version !== 1 || lease.version !== 1 || result.version !== 1) failures.push('Stage 43 artifact versions must be 1');
|
|
402
|
+
if (session.stage !== 'Stage 43' || lease.stage !== 'Stage 43' || result.stage !== 'Stage 43') failures.push('Stage 43 artifact stages must be Stage 43');
|
|
403
|
+
if (session.writes !== true || lease.writes !== true || result.writes !== true) failures.push('Stage 43 artifacts must be confirmed writes');
|
|
404
|
+
if (session.session_status !== 'completed-result-captured') failures.push('platform_session.session_status must be completed-result-captured');
|
|
405
|
+
if (lease.lease_status !== 'acquired-and-released' || lease.active !== false) failures.push('platform_session_lease must be acquired-and-released and inactive');
|
|
406
|
+
if (result.result_status !== 'captured-review-required') failures.push('platform_session_result.result_status must be captured-review-required');
|
|
407
|
+
if (!Array.isArray(session.allowed_followup) || digestObject(session.allowed_followup) !== digestObject(['platform-session-result-ingest-only'])) failures.push('platform_session.allowed_followup must equal platform-session-result-ingest-only');
|
|
408
|
+
if (!Array.isArray(result.allowed_followup) || digestObject(result.allowed_followup) !== digestObject(['platform-session-result-review-only'])) failures.push('platform_session_result.allowed_followup must equal platform-session-result-review-only');
|
|
409
|
+
if (!Array.isArray(session.planned_writes) || digestObject(session.planned_writes) !== digestObject(expectedStage43PlannedWrites())) failures.push('platform_session.planned_writes must match Stage 43 write whitelist');
|
|
410
|
+
for (const key of ['session_create', 'platform_api', 'model_invocation', 'result_capture']) if (session[key] !== true) failures.push(`platform_session.${key} must be true`);
|
|
411
|
+
for (const key of ['external_network', 'business_source_write', 'source_merge', 'git', 'worktree']) if (session[key] !== false) failures.push(`platform_session.${key} must be false`);
|
|
412
|
+
for (const key of ['business_source_write', 'source_merge', 'git', 'worktree']) if (result[key] !== false) failures.push(`platform_session_result.${key} must be false`);
|
|
413
|
+
if (result.review_required !== true || result.review_completed !== false) failures.push('platform_session_result must require incomplete review');
|
|
414
|
+
const sessionDigestPayload = { ...session };
|
|
415
|
+
delete sessionDigestPayload.session_digest;
|
|
416
|
+
if (session.session_digest !== digestObject(sessionDigestPayload)) failures.push('platform_session digest mismatch');
|
|
417
|
+
const sessionDigest = digestObject(session);
|
|
418
|
+
if (lease.session_digest !== sessionDigest || result.session_digest !== sessionDigest) failures.push('Stage 43 session digest binding mismatch');
|
|
419
|
+
const leaseDigestPayload = { ...lease };
|
|
420
|
+
delete leaseDigestPayload.lease_digest;
|
|
421
|
+
if (lease.lease_digest !== digestObject(leaseDigestPayload)) failures.push('platform_session_lease digest mismatch');
|
|
422
|
+
const leaseDigest = digestObject(lease);
|
|
423
|
+
if (result.lease_digest !== leaseDigest) failures.push('platform_session_result lease digest mismatch');
|
|
424
|
+
const resultPayloadDigest = digestObject(result.result_payload || {});
|
|
425
|
+
if (result.result_payload_digest !== resultPayloadDigest) failures.push('platform_session_result payload digest mismatch');
|
|
426
|
+
const resultDigestPayload = { ...result };
|
|
427
|
+
delete resultDigestPayload.result_digest;
|
|
428
|
+
if (result.result_digest !== digestObject(resultDigestPayload)) failures.push('platform_session_result digest mismatch');
|
|
429
|
+
const operation = platformSessionAdapterOperation();
|
|
430
|
+
if (session.adapter_operation_digest !== operation.operation_digest) failures.push('platform_session adapter operation digest mismatch');
|
|
431
|
+
if (root && session.approval_file) {
|
|
432
|
+
try {
|
|
433
|
+
const approvalPath = platformSessionApprovalFilePath(root, session.approval_file);
|
|
434
|
+
if (fileDigest(approvalPath) !== session.approval_digest) failures.push('platform_session approval digest mismatch');
|
|
435
|
+
const approvalArtifact = readJsonArtifact(approvalPath, 'Platform session approval');
|
|
436
|
+
const verification = validatePlatformSessionApprovalArtifact(root, approvalArtifact, path.basename(approvalPath));
|
|
437
|
+
failures.push(...verification.failures.map((failure) => `platform session approval: ${failure}`));
|
|
438
|
+
if ((approvalArtifact.platform_session_approval?.approval_digest || '') !== session.approval_artifact_digest) failures.push('platform_session approval artifact digest mismatch');
|
|
439
|
+
if ((approvalArtifact.platform_session_approval?.dispatch_file || '') !== session.dispatch_file) failures.push('platform_session dispatch file mismatch');
|
|
440
|
+
if ((approvalArtifact.platform_session_approval?.capability_file || '') !== session.capability_file) failures.push('platform_session capability file mismatch');
|
|
441
|
+
} catch (error) {
|
|
442
|
+
failures.push(error.message);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
const safety = artifact.safety || {};
|
|
446
|
+
if (safety.stage !== 'Stage 43') failures.push('safety.stage must be Stage 43');
|
|
447
|
+
for (const key of ['writes', 'platform_session_artifact', 'platform_session_lease_artifact', 'platform_session_result_artifact', 'session_create', 'platform_api', 'model_invocation', 'result_capture']) if (safety[key] !== true) failures.push(`safety.${key} must be true`);
|
|
448
|
+
for (const key of ['external_network', 'business_source_write', 'source_merge', 'git', 'worktree', backgroundProcessField, 'watcher', 'auto_execution']) if (safety[key] !== false) failures.push(`safety.${key} must be false`);
|
|
449
|
+
return { ok: failures.length === 0, failures };
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
function writePlatformSession(root, envelope) {
|
|
453
|
+
const sessionFile = platformSessionFilePath(root, envelope.files.platform_session);
|
|
454
|
+
const leaseFile = platformSessionLeaseFilePath(root, envelope.files.platform_session_lease);
|
|
455
|
+
const resultFile = platformSessionResultFilePath(root, envelope.files.platform_session_result);
|
|
456
|
+
const payload = { schema_version: jsonSchemaVersion, command: 'subagents', ...envelope, safety: { ...envelope.safety, platform_session_artifact: true, platform_session_lease_artifact: true, platform_session_result_artifact: true } };
|
|
457
|
+
const verification = validatePlatformSessionArtifact(root, payload, path.basename(sessionFile));
|
|
458
|
+
if (!verification.ok) throw new Error(`platform session verification failed: ${verification.failures.join('; ')}`);
|
|
459
|
+
stateArtifactWriter(path.dirname(sessionFile), path.basename(sessionFile), payload);
|
|
460
|
+
stateArtifactWriter(path.dirname(leaseFile), path.basename(leaseFile), payload);
|
|
461
|
+
stateArtifactWriter(path.dirname(resultFile), path.basename(resultFile), payload);
|
|
462
|
+
return { sessionFile, leaseFile, resultFile };
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
function platformSessionCancelEnvelope(root, sessionFile, { persist = false } = {}) {
|
|
466
|
+
ensureRoot(root);
|
|
467
|
+
const sessionPath = platformSessionFilePath(root, sessionFile);
|
|
468
|
+
const artifact = readJsonArtifact(sessionPath, 'Platform session');
|
|
469
|
+
const verification = validatePlatformSessionArtifact(root, artifact, path.basename(sessionPath));
|
|
470
|
+
if (!verification.ok) throw new Error(`platform session verification failed: ${verification.failures.join('; ')}`);
|
|
471
|
+
const cancelFile = path.basename(platformSessionCancellationSnapshotPath(root));
|
|
472
|
+
const cancelCore = {
|
|
473
|
+
version: 1,
|
|
474
|
+
stage: 'Stage 43',
|
|
475
|
+
created_at: new Date().toISOString(),
|
|
476
|
+
writes: Boolean(persist),
|
|
477
|
+
cancelled: false,
|
|
478
|
+
cancel_status: 'not-needed-session-already-terminal',
|
|
479
|
+
session_file: path.basename(sessionPath),
|
|
480
|
+
session_digest: fileDigest(sessionPath),
|
|
481
|
+
session_id: artifact.platform_session?.session_id || '',
|
|
482
|
+
source_mutation: false,
|
|
483
|
+
business_source_write: false,
|
|
484
|
+
source_merge: false,
|
|
485
|
+
git: false,
|
|
486
|
+
worktree: false,
|
|
487
|
+
allowed_followup: ['platform-session-result-ingest-only'],
|
|
488
|
+
};
|
|
489
|
+
const cancel = { ...cancelCore, cancel_digest: digestObject(cancelCore) };
|
|
490
|
+
return {
|
|
491
|
+
mode: 'platform-session-cancel',
|
|
492
|
+
ok: true,
|
|
493
|
+
state_present: fs.existsSync(workflowPath(root)),
|
|
494
|
+
platform_session_cancel: cancel,
|
|
495
|
+
session: { file: path.basename(sessionPath), digest: fileDigest(sessionPath), verification },
|
|
496
|
+
files: { platform_session_cancel: cancelFile },
|
|
497
|
+
safety: stage43PlatformSessionCancelSafety({ persist }),
|
|
498
|
+
quality: [],
|
|
499
|
+
action: persist
|
|
500
|
+
? 'platform session cancel artifact was written locally. Session was already terminal; no platform API, source, git, or worktree write occurred.'
|
|
501
|
+
: 'platform session cancel was audited. Session was already terminal; no files were written and no platform API call occurred.',
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
function validatePlatformSessionCancelArtifact(root, artifact, fileName = '') {
|
|
506
|
+
const failures = [];
|
|
507
|
+
if (artifact.schema_version !== jsonSchemaVersion) failures.push('schema_version must be 1');
|
|
508
|
+
if (artifact.command !== 'subagents') failures.push('command must be subagents');
|
|
509
|
+
if (artifact.mode !== 'platform-session-cancel') failures.push('mode must be platform-session-cancel');
|
|
510
|
+
const cancel = artifact.platform_session_cancel || {};
|
|
511
|
+
const files = artifact.files || {};
|
|
512
|
+
if (!files.platform_session_cancel || !String(files.platform_session_cancel).endsWith('.platform-session-cancel.json')) failures.push('files.platform_session_cancel must be a platform session cancellation artifact');
|
|
513
|
+
if (fileName) {
|
|
514
|
+
if (!fileName.endsWith('.platform-session-cancel.json')) failures.push('Stage 43 platform session cancel artifact file extension is unsupported');
|
|
515
|
+
else if (files.platform_session_cancel !== fileName) failures.push('Stage 43 platform session cancel file identity mismatch');
|
|
516
|
+
}
|
|
517
|
+
if (cancel.version !== 1) failures.push('platform_session_cancel.version must be 1');
|
|
518
|
+
if (cancel.stage !== 'Stage 43') failures.push('platform_session_cancel.stage must be Stage 43');
|
|
519
|
+
if (cancel.writes !== true) failures.push('platform_session_cancel.writes must be true');
|
|
520
|
+
if (cancel.cancelled !== false) failures.push('platform_session_cancel.cancelled must be false');
|
|
521
|
+
if (cancel.cancel_status !== 'not-needed-session-already-terminal') failures.push('platform_session_cancel.cancel_status must be not-needed-session-already-terminal');
|
|
522
|
+
if (!cancel.session_file || !String(cancel.session_file).endsWith('.platform-session.json')) failures.push('platform_session_cancel.session_file must be a platform session artifact');
|
|
523
|
+
if (!Array.isArray(cancel.allowed_followup) || digestObject(cancel.allowed_followup) !== digestObject(['platform-session-result-ingest-only'])) failures.push('platform_session_cancel.allowed_followup must equal platform-session-result-ingest-only');
|
|
524
|
+
for (const key of ['source_mutation', 'business_source_write', 'source_merge', 'git', 'worktree']) if (cancel[key] !== false) failures.push(`platform_session_cancel.${key} must be false`);
|
|
525
|
+
const cancelDigestPayload = { ...cancel };
|
|
526
|
+
delete cancelDigestPayload.cancel_digest;
|
|
527
|
+
if (cancel.cancel_digest !== digestObject(cancelDigestPayload)) failures.push('platform_session_cancel digest mismatch');
|
|
528
|
+
if (root && cancel.session_file) {
|
|
529
|
+
try {
|
|
530
|
+
const sessionPath = platformSessionFilePath(root, cancel.session_file);
|
|
531
|
+
if (fileDigest(sessionPath) !== cancel.session_digest) failures.push('platform_session_cancel session digest mismatch');
|
|
532
|
+
const sessionArtifact = readJsonArtifact(sessionPath, 'Platform session');
|
|
533
|
+
const verification = validatePlatformSessionArtifact(root, sessionArtifact, path.basename(sessionPath));
|
|
534
|
+
failures.push(...verification.failures.map((failure) => `platform session: ${failure}`));
|
|
535
|
+
if ((sessionArtifact.platform_session?.session_id || '') !== cancel.session_id) failures.push('platform_session_cancel session_id mismatch');
|
|
536
|
+
} catch (error) {
|
|
537
|
+
failures.push(error.message);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
const safety = artifact.safety || {};
|
|
541
|
+
if (safety.stage !== 'Stage 43') failures.push('safety.stage must be Stage 43');
|
|
542
|
+
for (const key of ['writes', 'platform_session_cancel_artifact', 'cancel_requested']) if (safety[key] !== true) failures.push(`safety.${key} must be true`);
|
|
543
|
+
for (const key of ['cancelled', 'session_create', 'platform_api', 'model_invocation', 'business_source_write', 'source_merge', 'git', 'worktree', backgroundProcessField, 'watcher']) if (safety[key] !== false) failures.push(`safety.${key} must be false`);
|
|
544
|
+
return { ok: failures.length === 0, failures };
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
function writePlatformSessionCancel(root, envelope) {
|
|
548
|
+
const file = platformSessionCancellationFilePath(root, envelope.files.platform_session_cancel);
|
|
549
|
+
const payload = { schema_version: jsonSchemaVersion, command: 'subagents', ...envelope, safety: { ...envelope.safety, platform_session_cancel_artifact: true } };
|
|
550
|
+
const verification = validatePlatformSessionCancelArtifact(root, payload, path.basename(file));
|
|
551
|
+
if (!verification.ok) throw new Error(`platform session cancel verification failed: ${verification.failures.join('; ')}`);
|
|
552
|
+
return stateArtifactWriter(path.dirname(file), path.basename(file), payload);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
function platformSessionIntakeSnapshotPath(root) {
|
|
556
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
557
|
+
return path.join(platformSessionIntakeDirectory(root), `${timestamp}.platform-session-intake.json`);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
function platformSessionReviewSnapshotPath(root) {
|
|
561
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
562
|
+
return path.join(platformSessionReviewsDirectory(root), `${timestamp}.platform-session-review.json`);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
function listPlatformSessionIntakeFiles(root) {
|
|
566
|
+
return listStateFiles(root, platformSessionIntakeDirectory, '.platform-session-intake.json');
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
function listPlatformSessionReviewFiles(root) {
|
|
570
|
+
return listStateFiles(root, platformSessionReviewsDirectory, '.platform-session-review.json');
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
function stage44Safety({ writes = false, intake = false, review = false } = {}) {
|
|
574
|
+
return {
|
|
575
|
+
stage: 'Stage 44',
|
|
576
|
+
writes: Boolean(writes),
|
|
577
|
+
platform_session_intake_artifact: Boolean(intake),
|
|
578
|
+
platform_session_review_artifact: Boolean(review),
|
|
579
|
+
result_ingestion: true,
|
|
580
|
+
review_gate: true,
|
|
581
|
+
session_create: false,
|
|
582
|
+
platform_api: false,
|
|
583
|
+
model_invocation: false,
|
|
584
|
+
business_source_write: false,
|
|
585
|
+
source_merge: false,
|
|
586
|
+
source_mutation: false,
|
|
587
|
+
forbidden_file_write: false,
|
|
588
|
+
git: false,
|
|
589
|
+
worktree: false,
|
|
590
|
+
[backgroundProcessField]: false,
|
|
591
|
+
watcher: false,
|
|
592
|
+
auto_execution: false,
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
function platformSessionResultIntakeEnvelope(root, resultFile, { persist = false, artifactFile = '' } = {}) {
|
|
597
|
+
ensureRoot(root);
|
|
598
|
+
const resultPath = platformSessionResultFilePath(root, resultFile);
|
|
599
|
+
const sessionArtifact = readJsonArtifact(resultPath, 'Platform session result');
|
|
600
|
+
const sessionVerification = validatePlatformSessionArtifact(root, sessionArtifact, path.basename(resultPath));
|
|
601
|
+
if (!sessionVerification.ok) throw new Error(`platform session verification failed: ${sessionVerification.failures.join('; ')}`);
|
|
602
|
+
const session = sessionArtifact.platform_session || {};
|
|
603
|
+
const result = sessionArtifact.platform_session_result || {};
|
|
604
|
+
const payload = result.result_payload || {};
|
|
605
|
+
const patchText = String(payload.patch || '');
|
|
606
|
+
const filesTouched = Array.isArray(payload.files_touched) ? payload.files_touched : [];
|
|
607
|
+
const evidence = Array.isArray(payload.verification_evidence) ? payload.verification_evidence : [];
|
|
608
|
+
const scopeChecks = [
|
|
609
|
+
{ id: 'session_result_verified', status: sessionVerification.ok ? 'passed' : 'blocked', evidence: [path.basename(resultPath)], blocked_reason: sessionVerification.ok ? '' : 'Stage 43 result verification failed' },
|
|
610
|
+
{ id: 'structured_result', status: payload.kind === 'structured-result' ? 'passed' : 'blocked', evidence: [`kind=${payload.kind || ''}`], blocked_reason: payload.kind === 'structured-result' ? '' : 'session result is not structured' },
|
|
611
|
+
{ id: 'patch_parseable', status: patchText === '' || patchText.startsWith('diff --git ') ? 'passed' : 'blocked', evidence: [patchText === '' ? 'empty patch accepted for Stage 44 review-only path' : 'git diff header present'], blocked_reason: patchText === '' || patchText.startsWith('diff --git ') ? '' : 'patch is not a bounded git diff' },
|
|
612
|
+
{ id: 'scope_not_exceeded', status: filesTouched.every((file) => typeof file === 'string' && !path.isAbsolute(file) && !file.includes('..') && !file.includes('\\')) ? 'passed' : 'blocked', evidence: filesTouched, blocked_reason: filesTouched.every((file) => typeof file === 'string' && !path.isAbsolute(file) && !file.includes('..') && !file.includes('\\')) ? '' : 'files_touched contains unsafe path' },
|
|
613
|
+
{ id: 'no_source_write_claim', status: result.business_source_write === false && result.source_merge === false && result.git === false && result.worktree === false ? 'passed' : 'blocked', evidence: ['business_source_write=false', 'source_merge=false', 'git=false', 'worktree=false'], blocked_reason: result.business_source_write === false && result.source_merge === false && result.git === false && result.worktree === false ? '' : 'session result claims source mutation' },
|
|
614
|
+
{ id: 'verification_evidence', status: evidence.length > 0 ? 'passed' : 'blocked', evidence, blocked_reason: evidence.length > 0 ? '' : 'session result evidence missing' },
|
|
615
|
+
];
|
|
616
|
+
const blockedReasons = scopeChecks.filter((check) => check.status !== 'passed').map((check) => `${check.id}: ${check.blocked_reason}`);
|
|
617
|
+
const intakeFile = artifactFile || path.basename(platformSessionIntakeSnapshotPath(root));
|
|
618
|
+
const core = {
|
|
619
|
+
version: 1,
|
|
620
|
+
stage: 'Stage 44',
|
|
621
|
+
created_at: new Date().toISOString(),
|
|
622
|
+
writes: Boolean(persist),
|
|
623
|
+
source_result_file: path.basename(resultPath),
|
|
624
|
+
source_result_digest: fileDigest(resultPath),
|
|
625
|
+
session_file: result.session_file || sessionArtifact.files?.platform_session || '',
|
|
626
|
+
session_digest: result.session_digest || '',
|
|
627
|
+
approval_file: result.approval_file || session.approval_file || '',
|
|
628
|
+
approval_digest: result.approval_digest || session.approval_digest || '',
|
|
629
|
+
prompt_digest: result.prompt_digest || session.prompt_digest || '',
|
|
630
|
+
transcript_digest: result.transcript_digest || session.transcript_digest || '',
|
|
631
|
+
result_payload_digest: result.result_payload_digest || '',
|
|
632
|
+
patch_digest: digestObject({ patch: patchText }),
|
|
633
|
+
files_touched: filesTouched,
|
|
634
|
+
intake_status: blockedReasons.length === 0 ? 'ingested-review-required' : 'blocked',
|
|
635
|
+
scope_checks: scopeChecks,
|
|
636
|
+
blocked_reasons: blockedReasons,
|
|
637
|
+
structured_result: payload.kind === 'structured-result',
|
|
638
|
+
patch_parseable: patchText === '' || patchText.startsWith('diff --git '),
|
|
639
|
+
forbidden_files_modified: false,
|
|
640
|
+
business_source_write: false,
|
|
641
|
+
source_merge: false,
|
|
642
|
+
git: false,
|
|
643
|
+
worktree: false,
|
|
644
|
+
review_required: true,
|
|
645
|
+
review_completed: false,
|
|
646
|
+
allowed_followup: ['source-change-candidate-only'],
|
|
647
|
+
planned_writes: persist ? [path.join(stateDirectoryName, platformSessionIntakeDirectoryName, '<timestamp>.platform-session-intake.json').replace(/\\/g, '/')] : [],
|
|
648
|
+
};
|
|
649
|
+
return {
|
|
650
|
+
mode: 'platform-session-result-ingestion',
|
|
651
|
+
ok: blockedReasons.length === 0,
|
|
652
|
+
state_present: fs.existsSync(workflowPath(root)),
|
|
653
|
+
platform_session_intake: { ...core, intake_digest: digestObject(core) },
|
|
654
|
+
source_result: { file: path.basename(resultPath), digest: fileDigest(resultPath), verification: sessionVerification },
|
|
655
|
+
files: { platform_session_intake: intakeFile },
|
|
656
|
+
safety: stage44Safety({ writes: persist, intake: persist }),
|
|
657
|
+
quality: blockedReasons,
|
|
658
|
+
action: persist
|
|
659
|
+
? 'platform session result intake artifact was written locally. No source, git, worktree, or merge write occurred.'
|
|
660
|
+
: 'platform session result intake was previewed read-only. No files were written and no result was merged.',
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
function validatePlatformSessionIntakeArtifact(root, artifact, fileName = '') {
|
|
665
|
+
const failures = [];
|
|
666
|
+
if (artifact.schema_version !== jsonSchemaVersion) failures.push('schema_version must be 1');
|
|
667
|
+
if (artifact.command !== 'subagents') failures.push('command must be subagents');
|
|
668
|
+
if (artifact.mode !== 'platform-session-result-ingestion') failures.push('mode must be platform-session-result-ingestion');
|
|
669
|
+
const intake = artifact.platform_session_intake || {};
|
|
670
|
+
const files = artifact.files || {};
|
|
671
|
+
if (!files.platform_session_intake || !String(files.platform_session_intake).endsWith('.platform-session-intake.json')) failures.push('files.platform_session_intake must be a platform session intake artifact');
|
|
672
|
+
if (fileName) {
|
|
673
|
+
if (!fileName.endsWith('.platform-session-intake.json')) failures.push('Stage 44 platform session intake artifact file extension is unsupported');
|
|
674
|
+
else if (files.platform_session_intake !== fileName) failures.push('Stage 44 platform session intake file identity mismatch');
|
|
675
|
+
}
|
|
676
|
+
if (intake.version !== 1) failures.push('platform_session_intake.version must be 1');
|
|
677
|
+
if (intake.stage !== 'Stage 44') failures.push('platform_session_intake.stage must be Stage 44');
|
|
678
|
+
if (intake.writes !== true) failures.push('platform_session_intake.writes must be true');
|
|
679
|
+
if (intake.intake_status !== 'ingested-review-required') failures.push('platform_session_intake.intake_status must be ingested-review-required');
|
|
680
|
+
if (!Array.isArray(intake.allowed_followup) || digestObject(intake.allowed_followup) !== digestObject(['source-change-candidate-only'])) failures.push('platform_session_intake.allowed_followup must equal source-change-candidate-only');
|
|
681
|
+
for (const key of ['forbidden_files_modified', 'business_source_write', 'source_merge', 'git', 'worktree', 'review_completed']) if (intake[key] !== false) failures.push(`platform_session_intake.${key} must be false`);
|
|
682
|
+
if (intake.review_required !== true) failures.push('platform_session_intake.review_required must be true');
|
|
683
|
+
if (!Array.isArray(intake.scope_checks)) failures.push('platform_session_intake.scope_checks must be an array');
|
|
684
|
+
if (!Array.isArray(intake.files_touched)) failures.push('platform_session_intake.files_touched must be an array');
|
|
685
|
+
const expectedWrites = [path.join(stateDirectoryName, platformSessionIntakeDirectoryName, '<timestamp>.platform-session-intake.json').replace(/\\/g, '/')];
|
|
686
|
+
if (!Array.isArray(intake.planned_writes) || digestObject(intake.planned_writes) !== digestObject(expectedWrites)) failures.push('platform_session_intake.planned_writes must only contain platform session intake artifact');
|
|
687
|
+
const digestPayload = { ...intake };
|
|
688
|
+
delete digestPayload.intake_digest;
|
|
689
|
+
if (intake.intake_digest !== digestObject(digestPayload)) failures.push('platform_session_intake digest mismatch');
|
|
690
|
+
if (root && intake.source_result_file) {
|
|
691
|
+
try {
|
|
692
|
+
const sourcePath = platformSessionResultFilePath(root, intake.source_result_file);
|
|
693
|
+
if (fileDigest(sourcePath) !== intake.source_result_digest) failures.push('platform_session_intake source result digest mismatch');
|
|
694
|
+
const source = readJsonArtifact(sourcePath, 'Platform session result');
|
|
695
|
+
const verification = validatePlatformSessionArtifact(root, source, path.basename(sourcePath));
|
|
696
|
+
failures.push(...verification.failures.map((failure) => `platform session result: ${failure}`));
|
|
697
|
+
const result = source.platform_session_result || {};
|
|
698
|
+
if ((result.session_digest || '') !== intake.session_digest) failures.push('platform_session_intake session digest mismatch');
|
|
699
|
+
if ((result.prompt_digest || '') !== intake.prompt_digest) failures.push('platform_session_intake prompt digest mismatch');
|
|
700
|
+
if ((result.transcript_digest || '') !== intake.transcript_digest) failures.push('platform_session_intake transcript digest mismatch');
|
|
701
|
+
if ((result.result_payload_digest || '') !== intake.result_payload_digest) failures.push('platform_session_intake result payload digest mismatch');
|
|
702
|
+
} catch (error) {
|
|
703
|
+
failures.push(error.message);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
const safety = artifact.safety || {};
|
|
707
|
+
if (safety.stage !== 'Stage 44') failures.push('safety.stage must be Stage 44');
|
|
708
|
+
for (const key of ['writes', 'platform_session_intake_artifact', 'result_ingestion', 'review_gate']) if (safety[key] !== true) failures.push(`safety.${key} must be true`);
|
|
709
|
+
for (const key of ['session_create', 'platform_api', 'model_invocation', 'business_source_write', 'source_merge', 'source_mutation', 'forbidden_file_write', 'git', 'worktree', backgroundProcessField, 'watcher', 'auto_execution']) if (safety[key] !== false) failures.push(`safety.${key} must be false`);
|
|
710
|
+
return { ok: failures.length === 0, failures };
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
function writePlatformSessionIntake(root, envelope) {
|
|
714
|
+
const file = platformSessionIntakeFilePath(root, envelope.files.platform_session_intake);
|
|
715
|
+
const payload = { schema_version: jsonSchemaVersion, command: 'subagents', ...envelope, safety: { ...envelope.safety, platform_session_intake_artifact: true } };
|
|
716
|
+
const verification = validatePlatformSessionIntakeArtifact(root, payload, path.basename(file));
|
|
717
|
+
if (!verification.ok) throw new Error(`platform session intake verification failed: ${verification.failures.join('; ')}`);
|
|
718
|
+
return stateArtifactWriter(path.dirname(file), path.basename(file), payload);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
function platformSessionReviewEnvelope(root, intakeFile, { persist = false, artifactFile = '' } = {}) {
|
|
722
|
+
ensureRoot(root);
|
|
723
|
+
const intakePath = platformSessionIntakeFilePath(root, intakeFile);
|
|
724
|
+
const intakeArtifact = readJsonArtifact(intakePath, 'Platform session intake');
|
|
725
|
+
const intakeVerification = validatePlatformSessionIntakeArtifact(root, intakeArtifact, path.basename(intakePath));
|
|
726
|
+
if (!intakeVerification.ok) throw new Error(`platform session intake verification failed: ${intakeVerification.failures.join('; ')}`);
|
|
727
|
+
const intake = intakeArtifact.platform_session_intake || {};
|
|
728
|
+
const checks = [
|
|
729
|
+
{ id: 'intake_verified', passed: intakeVerification.ok, evidence: [path.basename(intakePath)] },
|
|
730
|
+
{ id: 'structured_patch_scope', passed: intake.structured_result === true && intake.patch_parseable === true, evidence: [`files=${intake.files_touched?.length || 0}`] },
|
|
731
|
+
{ id: 'no_forbidden_source_claim', passed: intake.business_source_write === false && intake.source_merge === false && intake.git === false && intake.worktree === false, evidence: ['business_source_write=false', 'source_merge=false', 'git=false', 'worktree=false'] },
|
|
732
|
+
{ id: 'review_still_required', passed: intake.review_required === true && intake.review_completed === false, evidence: ['review_required=true', 'review_completed=false'] },
|
|
733
|
+
];
|
|
734
|
+
const blockedReasons = checks.filter((check) => !check.passed).map((check) => `${check.id}: failed`);
|
|
735
|
+
const reviewFile = artifactFile || path.basename(platformSessionReviewSnapshotPath(root));
|
|
736
|
+
const core = {
|
|
737
|
+
version: 1,
|
|
738
|
+
stage: 'Stage 44',
|
|
739
|
+
created_at: new Date().toISOString(),
|
|
740
|
+
writes: Boolean(persist),
|
|
741
|
+
intake_file: path.basename(intakePath),
|
|
742
|
+
intake_digest: fileDigest(intakePath),
|
|
743
|
+
source_result_file: intake.source_result_file || '',
|
|
744
|
+
source_result_digest: intake.source_result_digest || '',
|
|
745
|
+
session_file: intake.session_file || '',
|
|
746
|
+
session_digest: intake.session_digest || '',
|
|
747
|
+
approval_file: intake.approval_file || '',
|
|
748
|
+
approval_digest: intake.approval_digest || '',
|
|
749
|
+
patch_digest: intake.patch_digest || '',
|
|
750
|
+
files_touched: intake.files_touched || [],
|
|
751
|
+
review_status: blockedReasons.length === 0 ? 'review-gate-passed-source-candidate-required' : 'blocked',
|
|
752
|
+
checks,
|
|
753
|
+
blocked_reasons: blockedReasons,
|
|
754
|
+
business_source_write: false,
|
|
755
|
+
source_merge: false,
|
|
756
|
+
git: false,
|
|
757
|
+
worktree: false,
|
|
758
|
+
review_required: true,
|
|
759
|
+
review_completed: true,
|
|
760
|
+
allowed_followup: ['source-change-candidate-only'],
|
|
761
|
+
planned_writes: persist ? [path.join(stateDirectoryName, platformSessionReviewsDirectoryName, '<timestamp>.platform-session-review.json').replace(/\\/g, '/')] : [],
|
|
762
|
+
};
|
|
763
|
+
return {
|
|
764
|
+
mode: 'platform-session-review-gate',
|
|
765
|
+
ok: blockedReasons.length === 0,
|
|
766
|
+
state_present: fs.existsSync(workflowPath(root)),
|
|
767
|
+
platform_session_review: { ...core, review_digest: digestObject(core) },
|
|
768
|
+
platform_session_intake: { file: path.basename(intakePath), digest: fileDigest(intakePath), verification: intakeVerification },
|
|
769
|
+
files: { platform_session_review: reviewFile },
|
|
770
|
+
safety: stage44Safety({ writes: persist, review: persist }),
|
|
771
|
+
quality: blockedReasons,
|
|
772
|
+
action: persist
|
|
773
|
+
? 'platform session review gate artifact was written locally. No source, git, worktree, or merge write occurred.'
|
|
774
|
+
: 'platform session review gate was previewed read-only. No files were written and no result was merged.',
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
function validatePlatformSessionReviewArtifact(root, artifact, fileName = '') {
|
|
779
|
+
const failures = [];
|
|
780
|
+
if (artifact.schema_version !== jsonSchemaVersion) failures.push('schema_version must be 1');
|
|
781
|
+
if (artifact.command !== 'subagents') failures.push('command must be subagents');
|
|
782
|
+
if (artifact.mode !== 'platform-session-review-gate') failures.push('mode must be platform-session-review-gate');
|
|
783
|
+
const review = artifact.platform_session_review || {};
|
|
784
|
+
const files = artifact.files || {};
|
|
785
|
+
if (!files.platform_session_review || !String(files.platform_session_review).endsWith('.platform-session-review.json')) failures.push('files.platform_session_review must be a platform session review artifact');
|
|
786
|
+
if (fileName) {
|
|
787
|
+
if (!fileName.endsWith('.platform-session-review.json')) failures.push('Stage 44 platform session review artifact file extension is unsupported');
|
|
788
|
+
else if (files.platform_session_review !== fileName) failures.push('Stage 44 platform session review file identity mismatch');
|
|
789
|
+
}
|
|
790
|
+
if (review.version !== 1) failures.push('platform_session_review.version must be 1');
|
|
791
|
+
if (review.stage !== 'Stage 44') failures.push('platform_session_review.stage must be Stage 44');
|
|
792
|
+
if (review.writes !== true) failures.push('platform_session_review.writes must be true');
|
|
793
|
+
if (review.review_status !== 'review-gate-passed-source-candidate-required') failures.push('platform_session_review.review_status must be review-gate-passed-source-candidate-required');
|
|
794
|
+
if (!Array.isArray(review.allowed_followup) || digestObject(review.allowed_followup) !== digestObject(['source-change-candidate-only'])) failures.push('platform_session_review.allowed_followup must equal source-change-candidate-only');
|
|
795
|
+
for (const key of ['business_source_write', 'source_merge', 'git', 'worktree']) if (review[key] !== false) failures.push(`platform_session_review.${key} must be false`);
|
|
796
|
+
if (review.review_required !== true || review.review_completed !== true) failures.push('platform_session_review review flags mismatch');
|
|
797
|
+
const expectedWrites = [path.join(stateDirectoryName, platformSessionReviewsDirectoryName, '<timestamp>.platform-session-review.json').replace(/\\/g, '/')];
|
|
798
|
+
if (!Array.isArray(review.planned_writes) || digestObject(review.planned_writes) !== digestObject(expectedWrites)) failures.push('platform_session_review.planned_writes must only contain platform session review artifact');
|
|
799
|
+
const digestPayload = { ...review };
|
|
800
|
+
delete digestPayload.review_digest;
|
|
801
|
+
if (review.review_digest !== digestObject(digestPayload)) failures.push('platform_session_review digest mismatch');
|
|
802
|
+
if (root && review.intake_file) {
|
|
803
|
+
try {
|
|
804
|
+
const intakePath = platformSessionIntakeFilePath(root, review.intake_file);
|
|
805
|
+
if (fileDigest(intakePath) !== review.intake_digest) failures.push('platform_session_review intake digest mismatch');
|
|
806
|
+
const intakeArtifact = readJsonArtifact(intakePath, 'Platform session intake');
|
|
807
|
+
const verification = validatePlatformSessionIntakeArtifact(root, intakeArtifact, path.basename(intakePath));
|
|
808
|
+
failures.push(...verification.failures.map((failure) => `platform session intake: ${failure}`));
|
|
809
|
+
if ((intakeArtifact.platform_session_intake?.session_digest || '') !== review.session_digest) failures.push('platform_session_review session digest mismatch');
|
|
810
|
+
if ((intakeArtifact.platform_session_intake?.patch_digest || '') !== review.patch_digest) failures.push('platform_session_review patch digest mismatch');
|
|
811
|
+
} catch (error) {
|
|
812
|
+
failures.push(error.message);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
const safety = artifact.safety || {};
|
|
816
|
+
if (safety.stage !== 'Stage 44') failures.push('safety.stage must be Stage 44');
|
|
817
|
+
for (const key of ['writes', 'platform_session_review_artifact', 'result_ingestion', 'review_gate']) if (safety[key] !== true) failures.push(`safety.${key} must be true`);
|
|
818
|
+
for (const key of ['session_create', 'platform_api', 'model_invocation', 'business_source_write', 'source_merge', 'source_mutation', 'forbidden_file_write', 'git', 'worktree', backgroundProcessField, 'watcher', 'auto_execution']) if (safety[key] !== false) failures.push(`safety.${key} must be false`);
|
|
819
|
+
return { ok: failures.length === 0, failures };
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
function writePlatformSessionReview(root, envelope) {
|
|
823
|
+
const file = platformSessionReviewFilePath(root, envelope.files.platform_session_review);
|
|
824
|
+
const payload = { schema_version: jsonSchemaVersion, command: 'subagents', ...envelope, safety: { ...envelope.safety, platform_session_review_artifact: true } };
|
|
825
|
+
const verification = validatePlatformSessionReviewArtifact(root, payload, path.basename(file));
|
|
826
|
+
if (!verification.ok) throw new Error(`platform session review verification failed: ${verification.failures.join('; ')}`);
|
|
827
|
+
return stateArtifactWriter(path.dirname(file), path.basename(file), payload);
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
return {
|
|
831
|
+
platformSessionApprovalSnapshotPath,
|
|
832
|
+
listPlatformSessionApprovalFiles,
|
|
833
|
+
platformSessionApprovalEnvelope,
|
|
834
|
+
validatePlatformSessionApprovalArtifact,
|
|
835
|
+
writePlatformSessionApproval,
|
|
836
|
+
listPlatformSessionFiles,
|
|
837
|
+
listPlatformSessionLeaseFiles,
|
|
838
|
+
listPlatformSessionResultFiles,
|
|
839
|
+
listPlatformSessionCancellationFiles,
|
|
840
|
+
platformSessionEnvelope,
|
|
841
|
+
validatePlatformSessionArtifact,
|
|
842
|
+
writePlatformSession,
|
|
843
|
+
platformSessionCancelEnvelope,
|
|
844
|
+
validatePlatformSessionCancelArtifact,
|
|
845
|
+
writePlatformSessionCancel,
|
|
846
|
+
platformSessionIntakeSnapshotPath,
|
|
847
|
+
platformSessionReviewSnapshotPath,
|
|
848
|
+
listPlatformSessionIntakeFiles,
|
|
849
|
+
listPlatformSessionReviewFiles,
|
|
850
|
+
platformSessionResultIntakeEnvelope,
|
|
851
|
+
validatePlatformSessionIntakeArtifact,
|
|
852
|
+
writePlatformSessionIntake,
|
|
853
|
+
platformSessionReviewEnvelope,
|
|
854
|
+
validatePlatformSessionReviewArtifact,
|
|
855
|
+
writePlatformSessionReview,
|
|
856
|
+
};
|
|
857
|
+
};
|