@tea-agent/loop-agent 0.1.0-fe-test.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 +114 -0
- package/CHANGELOG.md +2283 -0
- package/README.md +177 -0
- package/bin/agent-worker.js +22 -0
- package/bin/loop-agent.js +57 -0
- package/dist/adapters/aimax.js +91 -0
- package/dist/adapters/context.js +32 -0
- package/dist/adapters/index.js +29 -0
- package/dist/adapters/loop-agent.js +192 -0
- package/dist/adapters/types.js +1 -0
- package/dist/application/context-usage/skill-resolution-stats.js +263 -0
- package/dist/application/dag/args.js +486 -0
- package/dist/application/dag/generate-task-dag.js +408 -0
- package/dist/application/dag/report-dag.js +14 -0
- package/dist/application/dag/run-dag.js +109 -0
- package/dist/application/dag/validate-dag.js +166 -0
- package/dist/application/evaluation/alias.js +184 -0
- package/dist/application/evaluation/budget.js +192 -0
- package/dist/application/evaluation/campaign-hash.js +47 -0
- package/dist/application/evaluation/campaign-matrix.js +372 -0
- package/dist/application/evaluation/campaign-scorecard.js +135 -0
- package/dist/application/evaluation/campaign.js +370 -0
- package/dist/application/evaluation/candidate-hash.js +75 -0
- package/dist/application/evaluation/candidate.js +69 -0
- package/dist/application/evaluation/corpus-hash.js +38 -0
- package/dist/application/evaluation/corpus.js +56 -0
- package/dist/application/evaluation/experiment.js +294 -0
- package/dist/application/evaluation/ignition.js +198 -0
- package/dist/application/evaluation/integrity-audit.js +162 -0
- package/dist/application/evaluation/outer-loop.js +132 -0
- package/dist/application/evaluation/pi-cell-executor.js +39 -0
- package/dist/application/evaluation/private-verifier.js +46 -0
- package/dist/application/evaluation/promotion-policy.js +151 -0
- package/dist/application/evaluation/proposer.js +98 -0
- package/dist/application/evaluation/replay.js +289 -0
- package/dist/application/evaluation/types.js +652 -0
- package/dist/application/loop/run-action.js +19 -0
- package/dist/application/task-lifecycle/advance.js +1204 -0
- package/dist/application/task-lifecycle/gates.js +130 -0
- package/dist/application/task-lifecycle/index.js +7 -0
- package/dist/application/task-lifecycle/observe.js +424 -0
- package/dist/application/task-lifecycle/plan-transitions.js +251 -0
- package/dist/application/task-lifecycle/recommendations.js +180 -0
- package/dist/application/task-lifecycle/record.js +73 -0
- package/dist/application/task-lifecycle/types.js +1 -0
- package/dist/build-stamp.json +6 -0
- package/dist/cli/catalog.js +24 -0
- package/dist/cli/command-definitions.js +659 -0
- package/dist/cli/help.js +56 -0
- package/dist/cli/index.js +5 -0
- package/dist/cli/program.js +647 -0
- package/dist/cli/router.js +13 -0
- package/dist/cli/update/init-surface-notifier.js +167 -0
- package/dist/cli/update/notifier.js +117 -0
- package/dist/cli/update/npm-client.js +151 -0
- package/dist/cli/update/policy.js +92 -0
- package/dist/cli/update/runtime-activity.js +29 -0
- package/dist/cli/update/state.js +68 -0
- package/dist/cli-governance/active-residue-check.js +38 -0
- package/dist/cli.js +57 -0
- package/dist/commands/client-recovery.js +1373 -0
- package/dist/commands/closeout.js +13 -0
- package/dist/commands/coverage-audit.js +14 -0
- package/dist/commands/coverage-report.js +50 -0
- package/dist/commands/cursor-prompt.js +182 -0
- package/dist/commands/dag-approve.js +142 -0
- package/dist/commands/dag-final-verification.js +76 -0
- package/dist/commands/dag-init-hybrid.js +57 -0
- package/dist/commands/dag-reconcile-run.js +5 -0
- package/dist/commands/dag-reconcile-tasks.js +51 -0
- package/dist/commands/dag-reject.js +91 -0
- package/dist/commands/dag-report.js +76 -0
- package/dist/commands/dag-request-interrupt.js +20 -0
- package/dist/commands/dag-rerun-task.js +19 -0
- package/dist/commands/dag-rerun.js +111 -0
- package/dist/commands/dag-resume.js +35 -0
- package/dist/commands/dag-run-task.js +12 -0
- package/dist/commands/dag-validate.js +20 -0
- package/dist/commands/dag-workflow-compile.js +91 -0
- package/dist/commands/dag-workflow-plan.js +130 -0
- package/dist/commands/dag-workflow-validate.js +66 -0
- package/dist/commands/delegate.js +130 -0
- package/dist/commands/docs-archive.js +5 -0
- package/dist/commands/docs-audit.js +6 -0
- package/dist/commands/doctor.js +283 -0
- package/dist/commands/eval.js +1398 -0
- package/dist/commands/examples.js +90 -0
- package/dist/commands/goal.js +92 -0
- package/dist/commands/handoff-check.js +5 -0
- package/dist/commands/harvest.js +44 -0
- package/dist/commands/import-prd.js +81 -0
- package/dist/commands/init-upgrade.js +3085 -0
- package/dist/commands/init.js +3630 -0
- package/dist/commands/inspect.js +11 -0
- package/dist/commands/instructions.js +223 -0
- package/dist/commands/knowledge.js +162 -0
- package/dist/commands/loop-benchmark.js +72 -0
- package/dist/commands/loop.js +251 -0
- package/dist/commands/new-task.js +5 -0
- package/dist/commands/operator.js +44 -0
- package/dist/commands/pi-prompt.js +174 -0
- package/dist/commands/pi-reuse-benchmark.js +153 -0
- package/dist/commands/plan-list.js +5 -0
- package/dist/commands/plan.js +50 -0
- package/dist/commands/promote-run.js +29 -0
- package/dist/commands/reference-index.js +16 -0
- package/dist/commands/run-dag-progress.js +123 -0
- package/dist/commands/run-dag.js +22 -0
- package/dist/commands/spine.js +38 -0
- package/dist/commands/stats.js +113 -0
- package/dist/commands/status.js +57 -0
- package/dist/commands/study-init.js +192 -0
- package/dist/commands/task-advance.js +366 -0
- package/dist/commands/task-contract.js +269 -0
- package/dist/commands/task-source-prepare.js +479 -0
- package/dist/commands/task-status.js +133 -0
- package/dist/commands/workflow.js +259 -0
- package/dist/commands/worktree-create.js +31 -0
- package/dist/commands/worktree-list.js +5 -0
- package/dist/commands/worktree-remove.js +26 -0
- package/dist/executors/config-core.js +5 -0
- package/dist/executors/config.js +2 -0
- package/dist/executors/dag-pi-executor.js +1277 -0
- package/dist/executors/dag-static-executor.js +42 -0
- package/dist/executors/dag.js +3 -0
- package/dist/executors/index.js +6 -0
- package/dist/executors/model-routing.js +71 -0
- package/dist/executors/pi-defaults.js +9 -0
- package/dist/executors/pi-event-serializer.js +65 -0
- package/dist/executors/pi-executor.js +981 -0
- package/dist/executors/pi-playwright-cli-tool.js +1006 -0
- package/dist/executors/pi-prompt-transport.js +198 -0
- package/dist/executors/pi-reuse-benchmark.js +316 -0
- package/dist/executors/pi-runtime-reuse.js +29 -0
- package/dist/executors/pi-sdk-executor.js +722 -0
- package/dist/executors/pi-sdk.js +1 -0
- package/dist/executors/pi-writer-tool-policy.js +266 -0
- package/dist/executors/pi.js +3 -0
- package/dist/executors/playwright-cli-launcher.js +63 -0
- package/dist/executors/process-tree.js +33 -0
- package/dist/executors/shell-executor.js +3055 -0
- package/dist/executors/shell-presets.js +99 -0
- package/dist/executors/shell-verification.js +262 -0
- package/dist/executors/shell-write-guard.js +543 -0
- package/dist/executors/shell.js +3 -0
- package/dist/executors/static.js +1 -0
- package/dist/governance/checks.js +437 -0
- package/dist/governance/document-index-closure.js +164 -0
- package/dist/governance/exec-plans.js +549 -0
- package/dist/governance/harness.js +9 -0
- package/dist/governance/index.js +3 -0
- package/dist/governance/manifest-types.js +254 -0
- package/dist/governance/manifest.js +2 -0
- package/dist/governance/path-guard.js +69 -0
- package/dist/governance/path-guards.js +2 -0
- package/dist/governance/profiles.js +3 -0
- package/dist/governance/requirement-coverage.js +425 -0
- package/dist/governance/skill-safety.js +135 -0
- package/dist/governance/spine-audit.js +155 -0
- package/dist/infrastructure/evaluation/alias-store.js +199 -0
- package/dist/infrastructure/evaluation/campaign-store.js +154 -0
- package/dist/infrastructure/evaluation/candidate-store.js +439 -0
- package/dist/infrastructure/evaluation/corpus-store.js +181 -0
- package/dist/infrastructure/evaluation/experiment-store.js +124 -0
- package/dist/infrastructure/evaluation/ignition-store.js +82 -0
- package/dist/infrastructure/evaluation/private-verifier-store.js +145 -0
- package/dist/infrastructure/evaluation/proposer-store.js +78 -0
- package/dist/infrastructure/evaluation/store.js +40 -0
- package/dist/infrastructure/harness/active-residue-policy.js +73 -0
- package/dist/infrastructure/harness/artifact-store.js +72 -0
- package/dist/infrastructure/harness/atomic-write.js +50 -0
- package/dist/infrastructure/harness/completed-facts-guard.js +40 -0
- package/dist/infrastructure/harness/loop-action-store.js +20 -0
- package/dist/infrastructure/harness/loop-store.js +41 -0
- package/dist/infrastructure/harness/one-shot-run-store.js +94 -0
- package/dist/infrastructure/harness/task-store.js +108 -0
- package/dist/records/closeout.js +2 -0
- package/dist/records/harvest.js +215 -0
- package/dist/records/index.js +3 -0
- package/dist/records/one-shot-runs.js +386 -0
- package/dist/records/promotion.js +200 -0
- package/dist/shared/artifacts-core.js +107 -0
- package/dist/shared/artifacts.js +2 -0
- package/dist/shared/context-files.js +32 -0
- package/dist/shared/context.js +2 -0
- package/dist/shared/copy-dir.js +17 -0
- package/dist/shared/git-progress.js +172 -0
- package/dist/shared/index.js +5 -0
- package/dist/shared/logger.js +17 -0
- package/dist/shared/one-shot-prompt-args.js +98 -0
- package/dist/shared/openspec-spec.js +125 -0
- package/dist/shared/operator/capabilities.js +2659 -0
- package/dist/shared/operator/command-lifecycle.js +94 -0
- package/dist/shared/operator/envelope.js +59 -0
- package/dist/shared/operator/index.js +5 -0
- package/dist/shared/operator/registry.js +38 -0
- package/dist/shared/operator/types.js +5 -0
- package/dist/shared/output-truncation.js +37 -0
- package/dist/shared/package-metadata.js +530 -0
- package/dist/shared/path-refs.js +31 -0
- package/dist/shared/pi-retry-settings.js +23 -0
- package/dist/shared/playwright-cli-command-policy.js +41 -0
- package/dist/shared/preview.js +39 -0
- package/dist/shared/prompts.js +26 -0
- package/dist/shared/reference-context.js +264 -0
- package/dist/shared/resilient-git.js +133 -0
- package/dist/shared/runtime-activity.js +6 -0
- package/dist/shared/timeout-policy.js +24 -0
- package/dist/shared/timeout.js +1 -0
- package/dist/shared/types.js +5 -0
- package/dist/sidecars/cursor-prompt/executor.js +428 -0
- package/dist/sidecars/cursor-prompt/index.js +3 -0
- package/dist/sidecars/cursor-prompt/stream.js +121 -0
- package/dist/task/config-types.js +235 -0
- package/dist/task/config.js +2 -0
- package/dist/task/contract/adopt.js +166 -0
- package/dist/task/contract/apply.js +326 -0
- package/dist/task/contract/canonicalize.js +60 -0
- package/dist/task/contract/constants.js +30 -0
- package/dist/task/contract/diff.js +177 -0
- package/dist/task/contract/hash.js +42 -0
- package/dist/task/contract/import-revision.js +96 -0
- package/dist/task/contract/index.js +17 -0
- package/dist/task/contract/journal.js +155 -0
- package/dist/task/contract/lock.js +153 -0
- package/dist/task/contract/observe.js +296 -0
- package/dist/task/contract/paths.js +19 -0
- package/dist/task/contract/project.js +185 -0
- package/dist/task/contract/recover.js +312 -0
- package/dist/task/contract/request-ledger.js +37 -0
- package/dist/task/contract/schema.js +153 -0
- package/dist/task/contract/transaction.js +160 -0
- package/dist/task/contract/types.js +1 -0
- package/dist/task/contract/validate-draft.js +106 -0
- package/dist/task/dag-source-paths.js +50 -0
- package/dist/task/delegate.js +208 -0
- package/dist/task/frontend-preflight.js +131 -0
- package/dist/task/frontend-project-capability.js +570 -0
- package/dist/task/goal-audit.js +51 -0
- package/dist/task/goal-policy.js +8 -0
- package/dist/task/goal.js +3 -0
- package/dist/task/ids.js +1 -0
- package/dist/task/index.js +12 -0
- package/dist/task/lifecycle.js +1 -0
- package/dist/task/operator/capabilities.js +6 -0
- package/dist/task/operator/envelope.js +2 -0
- package/dist/task/operator/index.js +5 -0
- package/dist/task/operator/registry.js +2 -0
- package/dist/task/operator/types.js +1 -0
- package/dist/task/paths.js +1 -0
- package/dist/task/read-model.js +140 -0
- package/dist/task/runtime.js +708 -0
- package/dist/task/source-prepare/artifact-meta.js +137 -0
- package/dist/task/source-prepare/build-draft.js +232 -0
- package/dist/task/source-prepare/completeness.js +248 -0
- package/dist/task/source-prepare/index.js +10 -0
- package/dist/task/source-prepare/parse-intent.js +496 -0
- package/dist/task/source-prepare/path-policy.js +197 -0
- package/dist/task/source-prepare/placeholder-paths.js +77 -0
- package/dist/task/source-prepare/prepare.js +920 -0
- package/dist/task/source-prepare/reference-integrity.js +290 -0
- package/dist/task/source-prepare/semantic-intake.js +717 -0
- package/dist/task/source-prepare/types.js +7 -0
- package/dist/task/source-references.js +228 -0
- package/dist/task/source-state.js +1 -0
- package/dist/task/state.js +41 -0
- package/dist/task/subagent-guidance.js +1 -0
- package/dist/task/task-demand-routing.js +443 -0
- package/dist/task/workflow-state-types.js +92 -0
- package/dist/task/worktree-cleanup.js +140 -0
- package/dist/task/worktree.js +388 -0
- package/dist/verification/maven/cache.js +142 -0
- package/dist/verification/maven/index.js +120 -0
- package/dist/verification/maven/plan-commands.js +421 -0
- package/dist/verification/maven/pom-static.js +136 -0
- package/dist/verification/maven/scope-resolve.js +153 -0
- package/dist/verification/maven/stale.js +130 -0
- package/dist/verification/maven/types.js +23 -0
- package/dist/verification/maven/workspace-graph.js +322 -0
- package/dist/worker/cli.js +957 -0
- package/dist/worker/closeout/apply.js +73 -0
- package/dist/worker/closeout/preview.js +30 -0
- package/dist/worker/console/app-data.js +316 -0
- package/dist/worker/console/chat/artifact-card.js +30 -0
- package/dist/worker/console/chat/assistant-content.js +121 -0
- package/dist/worker/console/chat/chat-event-store.js +981 -0
- package/dist/worker/console/chat/chat-ui-policy.js +25 -0
- package/dist/worker/console/chat/compaction-errors.js +64 -0
- package/dist/worker/console/chat/composer-draft-store.js +45 -0
- package/dist/worker/console/chat/context-panel.js +54 -0
- package/dist/worker/console/chat/contract-apply-receipt-store.js +174 -0
- package/dist/worker/console/chat/explore-tools.js +299 -0
- package/dist/worker/console/chat/human-gate-card.js +45 -0
- package/dist/worker/console/chat/interview-adapter.js +149 -0
- package/dist/worker/console/chat/mcp-inventory.js +221 -0
- package/dist/worker/console/chat/model-resolver.js +215 -0
- package/dist/worker/console/chat/operation-card.js +92 -0
- package/dist/worker/console/chat/pi-console-config.js +376 -0
- package/dist/worker/console/chat/pi-runtime.js +2446 -0
- package/dist/worker/console/chat/repo-browser.js +140 -0
- package/dist/worker/console/chat/repo-walk.js +125 -0
- package/dist/worker/console/chat/resource-loader.js +59 -0
- package/dist/worker/console/chat/resource-preferences-store.js +152 -0
- package/dist/worker/console/chat/routes.js +3137 -0
- package/dist/worker/console/chat/runtime-context.js +102 -0
- package/dist/worker/console/chat/runtime-selection.js +96 -0
- package/dist/worker/console/chat/semantic-activity.js +489 -0
- package/dist/worker/console/chat/session-store.js +484 -0
- package/dist/worker/console/chat/shortcuts.js +217 -0
- package/dist/worker/console/chat/tool-adapter.js +131 -0
- package/dist/worker/console/chat/tool-preview.js +247 -0
- package/dist/worker/console/chat/tools.js +212 -0
- package/dist/worker/console/chat/turn-execution-registry.js +82 -0
- package/dist/worker/console/chat/turn-process.js +346 -0
- package/dist/worker/console/chat/usage.js +165 -0
- package/dist/worker/console/chat/workspace-landing.js +103 -0
- package/dist/worker/console/dag-confirmation.js +347 -0
- package/dist/worker/console/dag-execution-receipt.js +393 -0
- package/dist/worker/console/doctor.js +230 -0
- package/dist/worker/console/draft-store.js +158 -0
- package/dist/worker/console/harness-pi-model-matrix.js +137 -0
- package/dist/worker/console/human-gate-token.js +130 -0
- package/dist/worker/console/index.js +17 -0
- package/dist/worker/console/inspect-split.js +82 -0
- package/dist/worker/console/interview/assessment.js +67 -0
- package/dist/worker/console/interview/grill-me.js +277 -0
- package/dist/worker/console/interview/session.js +100 -0
- package/dist/worker/console/interview/tools.js +109 -0
- package/dist/worker/console/loopback.js +16 -0
- package/dist/worker/console/mutation-gate-receipt-store.js +184 -0
- package/dist/worker/console/night-aux-ticker.js +146 -0
- package/dist/worker/console/observe-health-match.js +179 -0
- package/dist/worker/console/observe-link.js +42 -0
- package/dist/worker/console/open-browser.js +134 -0
- package/dist/worker/console/operation-run-facts.js +190 -0
- package/dist/worker/console/operation-runner.js +353 -0
- package/dist/worker/console/operation-sse.js +184 -0
- package/dist/worker/console/operation-store.js +169 -0
- package/dist/worker/console/operation-wait.js +355 -0
- package/dist/worker/console/operator-actions.js +3768 -0
- package/dist/worker/console/operator-selection.js +105 -0
- package/dist/worker/console/operator-surface-health.js +24 -0
- package/dist/worker/console/operator-user-error.js +45 -0
- package/dist/worker/console/pi-readiness.js +288 -0
- package/dist/worker/console/prd-identity.js +102 -0
- package/dist/worker/console/prd-intake-bridge.js +441 -0
- package/dist/worker/console/prd-reference-discovery.js +124 -0
- package/dist/worker/console/recovery-cta.js +320 -0
- package/dist/worker/console/recovery-error-copy.js +198 -0
- package/dist/worker/console/recovery-selection.js +107 -0
- package/dist/worker/console/repo-fingerprint.js +35 -0
- package/dist/worker/console/resolve-dag-run-for-task.js +115 -0
- package/dist/worker/console/resource-loader.js +95 -0
- package/dist/worker/console/routes.js +475 -0
- package/dist/worker/console/security.js +170 -0
- package/dist/worker/console/server.js +357 -0
- package/dist/worker/console/sibling-controller.js +33 -0
- package/dist/worker/console/static/assets/abnfDiagram-N423BO3Z-BmOEx0gA.js +1 -0
- package/dist/worker/console/static/assets/arc-BGiVVe8b.js +1 -0
- package/dist/worker/console/static/assets/architectureDiagram-T3A2C74G-nDdu4rgJ.js +36 -0
- package/dist/worker/console/static/assets/blockDiagram-VBNYF7ZC-Bb5u0BWf.js +132 -0
- package/dist/worker/console/static/assets/c4Diagram-5PPSVZJV-BlhC0j94.js +10 -0
- package/dist/worker/console/static/assets/channel-Tl-FkUqr.js +1 -0
- package/dist/worker/console/static/assets/chunk-2GRJ4B5K-Ai8_qQXI.js +1 -0
- package/dist/worker/console/static/assets/chunk-2Q5K7J3B-B9gyCjqX.js +1 -0
- package/dist/worker/console/static/assets/chunk-5RXB4S5H-Bzbj3zGH.js +231 -0
- package/dist/worker/console/static/assets/chunk-5VM5RSS4-BT415PvT.js +15 -0
- package/dist/worker/console/static/assets/chunk-6Q2QTUOP-D_A5_5QL.js +88 -0
- package/dist/worker/console/static/assets/chunk-GF5L2VYU-srJkaP3f.js +206 -0
- package/dist/worker/console/static/assets/chunk-JWPE2WC7-UYGvEP4l.js +1 -0
- package/dist/worker/console/static/assets/chunk-KBJHAD2P-B8luBrrz.js +1 -0
- package/dist/worker/console/static/assets/chunk-RYQCIY6F-DN7wXZSq.js +1 -0
- package/dist/worker/console/static/assets/chunk-XXDRQBXY-DXKyMuKS.js +1 -0
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-BaehtRk4.js +1 -0
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-BaehtRk4.js +1 -0
- package/dist/worker/console/static/assets/cose-bilkent-JH36ORCC-dqvoynXj.js +1 -0
- package/dist/worker/console/static/assets/cynefin-VYW2F7L2--PcyL34A.js +166 -0
- package/dist/worker/console/static/assets/cynefinDiagram-MW4NZA55-DvWs_hTY.js +62 -0
- package/dist/worker/console/static/assets/cytoscape.esm-yzknjiTM.js +321 -0
- package/dist/worker/console/static/assets/dagre-VZM6K2ZE-DxeIxbyO.js +4 -0
- package/dist/worker/console/static/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/worker/console/static/assets/diagram-7IWD3JNH-DPCG61Of.js +30 -0
- package/dist/worker/console/static/assets/diagram-B4RE2ZJO-CmuU50-U.js +3 -0
- package/dist/worker/console/static/assets/diagram-LBJQPF4R-B61XLD_v.js +24 -0
- package/dist/worker/console/static/assets/diagram-Q27KOJAE-BB7HTRRY.js +24 -0
- package/dist/worker/console/static/assets/diagram-UB23O5K3-DvkboAIp.js +41 -0
- package/dist/worker/console/static/assets/ebnfDiagram-BXEA7PRR-BdJ_y1fL.js +1 -0
- package/dist/worker/console/static/assets/erDiagram-JOGREHBK-9bUBZTRi.js +85 -0
- package/dist/worker/console/static/assets/flowDiagram-UKHOOZJN-Dw4L4RBa.js +156 -0
- package/dist/worker/console/static/assets/ganttDiagram-PKOTCBZU-Jr82N_QP.js +292 -0
- package/dist/worker/console/static/assets/gitGraphDiagram-DS77QQ5N-DAz9wFLr.js +106 -0
- package/dist/worker/console/static/assets/graph-DOmOIIwC.js +1 -0
- package/dist/worker/console/static/assets/index-B7Y-0g3J.css +1 -0
- package/dist/worker/console/static/assets/index-DkCrqaYg.js +325 -0
- package/dist/worker/console/static/assets/infoDiagram-6WML65LV-CBB5Np7y.js +2 -0
- package/dist/worker/console/static/assets/init-Gi6I4Gst.js +1 -0
- package/dist/worker/console/static/assets/ishikawaDiagram-WSZJBQD7-D8IOp94y.js +70 -0
- package/dist/worker/console/static/assets/journeyDiagram-NVQOT4AX-Dgd3AHGG.js +139 -0
- package/dist/worker/console/static/assets/kanban-definition-27J2QSJJ-BmYOxLE9.js +89 -0
- package/dist/worker/console/static/assets/layout-D-LzfAck.js +1 -0
- package/dist/worker/console/static/assets/linear-DfYTEF6J.js +1 -0
- package/dist/worker/console/static/assets/map-DxJ2ADlA.js +1 -0
- package/dist/worker/console/static/assets/mermaid.core-BjuFPRqa.js +308 -0
- package/dist/worker/console/static/assets/mindmap-definition-FAOFIHXS-CLyUViGd.js +96 -0
- package/dist/worker/console/static/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/worker/console/static/assets/pegDiagram-VL7TDLO6-BvX2Di4-.js +1 -0
- package/dist/worker/console/static/assets/pieDiagram-7S7Q4E2Y-BFj0_OLv.js +39 -0
- package/dist/worker/console/static/assets/quadrantDiagram-CIZ2JOQS-BIUrD_hx.js +7 -0
- package/dist/worker/console/static/assets/railroadDiagram-AXF67PYL-CHBB48fj.js +1 -0
- package/dist/worker/console/static/assets/requirementDiagram-LRYGKXZP-sJrYw2Sf.js +84 -0
- package/dist/worker/console/static/assets/sankeyDiagram-W5VNT64P-BzHH6fPR.js +40 -0
- package/dist/worker/console/static/assets/sequenceDiagram-SI44F4Z6-7QCnelCt.js +162 -0
- package/dist/worker/console/static/assets/sizeCapture-X5ZJPWSS-sDYSxn72.js +1 -0
- package/dist/worker/console/static/assets/stateDiagram-OKZ733FA-XpiUdwzm.js +1 -0
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-eEhq2A8Y.js +1 -0
- package/dist/worker/console/static/assets/swimlanes-SLNWSIFB-DvqgNPzD.js +2 -0
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-la8AC7fo.js +8 -0
- package/dist/worker/console/static/assets/timeline-definition-Z64GVDOM-2TyOYNx0.js +120 -0
- package/dist/worker/console/static/assets/vennDiagram-T6HMQDX7-B-nM6wM2.js +34 -0
- package/dist/worker/console/static/assets/wardleyDiagram-T6FBY63Y-B86wPdbr.js +78 -0
- package/dist/worker/console/static/assets/xychartDiagram-ELKLHX3M-Dr1C4AQz.js +7 -0
- package/dist/worker/console/static/favicon.svg +37 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/worker/console/static/index.html +15 -0
- package/dist/worker/console/static-src/app/console-types.js +184 -0
- package/dist/worker/console/static-src/app/useConsoleShell.js +101 -0
- package/dist/worker/console/static-src/app/useOperatorActions.js +324 -0
- package/dist/worker/console/static-src/app/usePrdImport.js +172 -0
- package/dist/worker/console/static-src/app/useRecoveryActions.js +289 -0
- package/dist/worker/console/static-src/app/useRecoveryConsole.js +425 -0
- package/dist/worker/console/static-src/app/useTaskWizard.js +296 -0
- package/dist/worker/console/static-src/chat-markdown-security.js +38 -0
- package/dist/worker/console/static-src/chat-view-types.js +2 -0
- package/dist/worker/console/static-src/night/night-types.js +24 -0
- package/dist/worker/console/static-src/night/useNightBoard.js +94 -0
- package/dist/worker/console/static-src/night/useNightWizard.js +171 -0
- package/dist/worker/console/static-src/night-prepare-result.js +118 -0
- package/dist/worker/console/static-src/operator-chat/activity-journey.js +125 -0
- package/dist/worker/console/static-src/operator-chat/activity-rail-presentation.js +73 -0
- package/dist/worker/console/static-src/operator-chat/activity-references.js +20 -0
- package/dist/worker/console/static-src/operator-chat/chat-sse-events.js +420 -0
- package/dist/worker/console/static-src/operator-chat/format.js +71 -0
- package/dist/worker/console/static-src/operator-chat/landing-density.js +23 -0
- package/dist/worker/console/static-src/operator-chat/mutation-gate.js +45 -0
- package/dist/worker/console/static-src/operator-chat/refs.js +86 -0
- package/dist/worker/console/static-src/operator-chat/resource-auto-invocation.js +91 -0
- package/dist/worker/console/static-src/operator-chat/resource-diagnostics.js +204 -0
- package/dist/worker/console/static-src/operator-chat/runtime-snapshot-store.js +257 -0
- package/dist/worker/console/static-src/operator-chat/session-title-watcher.js +128 -0
- package/dist/worker/console/static-src/operator-chat/sidebar-split.js +90 -0
- package/dist/worker/console/static-src/operator-chat/slash-palette-layout.js +24 -0
- package/dist/worker/console/static-src/operator-chat/slash-palette-nav.js +141 -0
- package/dist/worker/console/static-src/operator-chat/spatial-overlay.js +38 -0
- package/dist/worker/console/static-src/operator-chat/tools-catalog.js +77 -0
- package/dist/worker/console/static-src/operator-chat/turn-stream-controller.js +690 -0
- package/dist/worker/console/static-src/operator-chat/turn-submission.js +158 -0
- package/dist/worker/console/static-src/operator-chat/types.js +1 -0
- package/dist/worker/console/static-src/operator-chat/useActivityRailTransition.js +59 -0
- package/dist/worker/console/static-src/operator-chat/useChatSessions.js +495 -0
- package/dist/worker/console/static-src/operator-chat/useChatStream.js +780 -0
- package/dist/worker/console/static-src/operator-chat/useChatThread.js +280 -0
- package/dist/worker/console/static-src/operator-chat/useComposer.js +257 -0
- package/dist/worker/console/static-src/operator-chat/useInterview.js +108 -0
- package/dist/worker/console/static-src/operator-chat/useOverlayFocus.js +84 -0
- package/dist/worker/console/static-src/operator-chat/useRepoBrowser.js +148 -0
- package/dist/worker/console/static-src/operator-chat/useRuntimeControls.js +358 -0
- package/dist/worker/console/static-src/operator-chat/useRuntimeSnapshot.js +196 -0
- package/dist/worker/console/static-src/operator-chat/useWorkspaceLayout.js +58 -0
- package/dist/worker/console/static-src/operator-chat/workspace-layout-mode.js +35 -0
- package/dist/worker/console/static-src/prd-file-import.js +218 -0
- package/dist/worker/console/vite.config.js +27 -0
- package/dist/worker/console/workflow-kinds.js +46 -0
- package/dist/worker/delivery/final-verification.js +302 -0
- package/dist/worker/delivery/git-transaction.js +497 -0
- package/dist/worker/delivery/package.js +537 -0
- package/dist/worker/delivery/verification-bundle.js +544 -0
- package/dist/worker/feature/acceptance-policy.js +227 -0
- package/dist/worker/feature/advance.js +301 -0
- package/dist/worker/feature/decision-loader.js +99 -0
- package/dist/worker/feature/discover.js +14 -0
- package/dist/worker/feature/doctor.js +223 -0
- package/dist/worker/feature/fullstack-validate.js +337 -0
- package/dist/worker/feature/next-action.js +140 -0
- package/dist/worker/feature/profile-schema.js +47 -0
- package/dist/worker/feature/ready-plan-projection.js +82 -0
- package/dist/worker/feature/reducer.js +137 -0
- package/dist/worker/feature/review.js +678 -0
- package/dist/worker/feature/run.js +390 -0
- package/dist/worker/feature/scaffold.js +812 -0
- package/dist/worker/feature/types.js +1 -0
- package/dist/worker/follow-up/approve.js +273 -0
- package/dist/worker/follow-up/factory.js +234 -0
- package/dist/worker/follow-up/paths.js +25 -0
- package/dist/worker/follow-up/policy.js +26 -0
- package/dist/worker/follow-up/schema.js +93 -0
- package/dist/worker/follow-up/store.js +96 -0
- package/dist/worker/loop-agent/command-result.js +1 -0
- package/dist/worker/loop-agent/controller-protocol.js +143 -0
- package/dist/worker/loop-agent/loop-agent-client.js +489 -0
- package/dist/worker/loop-agent/parse-json.js +14 -0
- package/dist/worker/materialize/harness-task-lifecycle-probe.js +126 -0
- package/dist/worker/materialize/harness-task-lineage.js +220 -0
- package/dist/worker/materialize/harness-task-materializer.js +648 -0
- package/dist/worker/metrics/projector.js +139 -0
- package/dist/worker/observability/dag-execution-trajectory.js +591 -0
- package/dist/worker/observability/event-history.js +216 -0
- package/dist/worker/observability/event-store.js +83 -0
- package/dist/worker/observability/events.js +79 -0
- package/dist/worker/observability/interrupt-eligibility.js +264 -0
- package/dist/worker/observability/progress-composite.js +34 -0
- package/dist/worker/observability/read-model.js +2499 -0
- package/dist/worker/observability/snapshot-store.js +43 -0
- package/dist/worker/observability/types.js +1 -0
- package/dist/worker/observe/dag-node-execution-output.js +180 -0
- package/dist/worker/observe/dag-run-artifacts.js +90 -0
- package/dist/worker/observe/health.js +58 -0
- package/dist/worker/observe/night-jobs.js +104 -0
- package/dist/worker/observe/node-input.js +441 -0
- package/dist/worker/observe/paths.js +174 -0
- package/dist/worker/observe/routes.js +1077 -0
- package/dist/worker/observe/server.js +117 -0
- package/dist/worker/observe/spec-evidence.js +398 -0
- package/dist/worker/observe/static/api.js +117 -0
- package/dist/worker/observe/static/app.js +169 -0
- package/dist/worker/observe/static/constants.js +182 -0
- package/dist/worker/observe/static/copy.js +67 -0
- package/dist/worker/observe/static/custom-select.js +567 -0
- package/dist/worker/observe/static/dag-edge-routing.js +368 -0
- package/dist/worker/observe/static/dag-helpers.js +161 -0
- package/dist/worker/observe/static/dag-history-labels.js +95 -0
- package/dist/worker/observe/static/dag-layout.d.ts +36 -0
- package/dist/worker/observe/static/dag-layout.js +163 -0
- package/dist/worker/observe/static/dag-model.js +145 -0
- package/dist/worker/observe/static/dom.js +220 -0
- package/dist/worker/observe/static/favicon.svg +37 -0
- package/dist/worker/observe/static/format-pool.d.ts +71 -0
- package/dist/worker/observe/static/format-pool.js +153 -0
- package/dist/worker/observe/static/format.js +347 -0
- package/dist/worker/observe/static/index.html +409 -0
- package/dist/worker/observe/static/kpi.js +78 -0
- package/dist/worker/observe/static/markdown-render.js +124 -0
- package/dist/worker/observe/static/operator-chrome.css +517 -0
- package/dist/worker/observe/static/operator-chrome.d.ts +83 -0
- package/dist/worker/observe/static/operator-chrome.js +623 -0
- package/dist/worker/observe/static/relations.js +133 -0
- package/dist/worker/observe/static/router.js +156 -0
- package/dist/worker/observe/static/run-processing.js +148 -0
- package/dist/worker/observe/static/shell-chrome.js +65 -0
- package/dist/worker/observe/static/state.js +496 -0
- package/dist/worker/observe/static/styles.css +3567 -0
- package/dist/worker/observe/static/views/batch.js +227 -0
- package/dist/worker/observe/static/views/dag-graph.js +508 -0
- package/dist/worker/observe/static/views/dag-inspector.js +1722 -0
- package/dist/worker/observe/static/views/dag-trajectory.js +313 -0
- package/dist/worker/observe/static/views/dag.js +483 -0
- package/dist/worker/observe/static/views/dags.js +877 -0
- package/dist/worker/observe/static/views/dashboard.js +747 -0
- package/dist/worker/observe/static/views/failures.js +143 -0
- package/dist/worker/observe/static/views/feature.js +492 -0
- package/dist/worker/observe/static/views/night.js +201 -0
- package/dist/worker/observe/static/views/pool.js +708 -0
- package/dist/worker/observe/static/views/run.js +453 -0
- package/dist/worker/observe/static/views/session-timeline.js +771 -0
- package/dist/worker/observe/static/views/shell.js +7 -0
- package/dist/worker/observe/static/views/task.js +315 -0
- package/dist/worker/observe/static/views/timeline.js +163 -0
- package/dist/worker/outcomes/adapters.js +153 -0
- package/dist/worker/outcomes/declared-artifacts.js +103 -0
- package/dist/worker/outcomes/evidence-tokens.js +29 -0
- package/dist/worker/outcomes/gate.js +40 -0
- package/dist/worker/outcomes/projector.js +227 -0
- package/dist/worker/outcomes/registry.js +1 -0
- package/dist/worker/outcomes/store.js +131 -0
- package/dist/worker/outcomes/types.js +79 -0
- package/dist/worker/pool/attempt-identity.js +41 -0
- package/dist/worker/pool/attempt-lease.js +184 -0
- package/dist/worker/pool/attempt-transition.js +210 -0
- package/dist/worker/pool/begin-attempt-with-lease.js +26 -0
- package/dist/worker/pool/begin-attempt.js +35 -0
- package/dist/worker/pool/doctor.js +165 -0
- package/dist/worker/pool/failure-routing.js +182 -0
- package/dist/worker/pool/migrate-state.js +303 -0
- package/dist/worker/pool/reconcile.js +285 -0
- package/dist/worker/pool/recovery-decision.js +163 -0
- package/dist/worker/pool/run-owner-store.js +126 -0
- package/dist/worker/pool/run-store.js +360 -0
- package/dist/worker/pool/runtime-reconcile-inventory.js +127 -0
- package/dist/worker/pool/state-projection.js +57 -0
- package/dist/worker/pool/types.js +17 -0
- package/dist/worker/pool/validation.js +144 -0
- package/dist/worker/preflight.js +157 -0
- package/dist/worker/profile-mapping.js +76 -0
- package/dist/worker/progress-reporter.js +63 -0
- package/dist/worker/report/morning-report.js +155 -0
- package/dist/worker/repos/repo-resolver.js +23 -0
- package/dist/worker/run-task/execute-prepared-task.js +178 -0
- package/dist/worker/run-task/run-task.js +912 -0
- package/dist/worker/runner/run-ready.js +561 -0
- package/dist/worker/runner/single-task-attempt.js +176 -0
- package/dist/worker/scheduler/admission.js +547 -0
- package/dist/worker/scheduler/auto-followup.js +99 -0
- package/dist/worker/scheduler/cli.js +644 -0
- package/dist/worker/scheduler/clock-install/darwin-launchd.js +238 -0
- package/dist/worker/scheduler/clock-install/linux-systemd-user.js +224 -0
- package/dist/worker/scheduler/clock-install/types.js +1 -0
- package/dist/worker/scheduler/clock-install/win32-schtasks.js +227 -0
- package/dist/worker/scheduler/clock-install.js +284 -0
- package/dist/worker/scheduler/clock.js +420 -0
- package/dist/worker/scheduler/dispatcher.js +503 -0
- package/dist/worker/scheduler/doctor.js +431 -0
- package/dist/worker/scheduler/evidence.js +170 -0
- package/dist/worker/scheduler/git-base.js +90 -0
- package/dist/worker/scheduler/index.js +25 -0
- package/dist/worker/scheduler/lease.js +114 -0
- package/dist/worker/scheduler/lifecycle.js +348 -0
- package/dist/worker/scheduler/lock.js +80 -0
- package/dist/worker/scheduler/morning-window.js +191 -0
- package/dist/worker/scheduler/night-git-finalizer.js +114 -0
- package/dist/worker/scheduler/night-harvest.js +412 -0
- package/dist/worker/scheduler/paths.js +92 -0
- package/dist/worker/scheduler/prepared-attempt-recovery.js +471 -0
- package/dist/worker/scheduler/recovery.js +277 -0
- package/dist/worker/scheduler/reservation.js +146 -0
- package/dist/worker/scheduler/retry.js +199 -0
- package/dist/worker/scheduler/scheduler-loop.js +272 -0
- package/dist/worker/scheduler/store.js +275 -0
- package/dist/worker/scheduler/traceability.js +54 -0
- package/dist/worker/scheduler/trigger.js +258 -0
- package/dist/worker/scheduler/types.js +369 -0
- package/dist/worker/scheduler/workspace-adapter.js +128 -0
- package/dist/worker/task-graph/acceptance-schema.js +40 -0
- package/dist/worker/task-graph/ready-planner.js +267 -0
- package/dist/worker/task-graph/ready-queue.js +23 -0
- package/dist/worker/task-graph/task-graph-schema.js +59 -0
- package/dist/worker/task-graph/types.js +1 -0
- package/dist/worker/task-graph/validate.js +293 -0
- package/dist/worker/task-spec/complexity-mapping.js +8 -0
- package/dist/worker/task-spec/schema.js +125 -0
- package/dist/worker/task-spec/types.js +1 -0
- package/dist/worker/task-spec/validate.js +391 -0
- package/dist/worker/task-spec/workflow-routing.js +149 -0
- package/dist/workflows/dag/authoring.js +8 -0
- package/dist/workflows/dag/authority-surface.js +138 -0
- package/dist/workflows/dag/backend-test-analysis-contract.js +507 -0
- package/dist/workflows/dag/backend-test-case-coverage-analysis.js +1985 -0
- package/dist/workflows/dag/backend-test-case-manifest.js +638 -0
- package/dist/workflows/dag/backend-test-classification-contract.js +38 -0
- package/dist/workflows/dag/backend-test-contract-envelope.js +205 -0
- package/dist/workflows/dag/backend-test-coverage-contract.js +202 -0
- package/dist/workflows/dag/backend-test-execution-contract.js +715 -0
- package/dist/workflows/dag/backend-test-gap-fill.js +205 -0
- package/dist/workflows/dag/backend-test-intake-context.js +178 -0
- package/dist/workflows/dag/backend-test-layout.js +133 -0
- package/dist/workflows/dag/backend-test-markdown-workflow.js +1984 -0
- package/dist/workflows/dag/backend-test-module-stem.js +26 -0
- package/dist/workflows/dag/backend-test-pytest-collection.js +859 -0
- package/dist/workflows/dag/backend-test-result-contract.js +1030 -0
- package/dist/workflows/dag/backend-test-scenario-param.js +1670 -0
- package/dist/workflows/dag/backend-test-scenario-partitions.js +249 -0
- package/dist/workflows/dag/backend-test-semantic-review-contract.js +36 -0
- package/dist/workflows/dag/backend-test-stability-contract.js +57 -0
- package/dist/workflows/dag/backend-test-writer-completeness.js +1058 -0
- package/dist/workflows/dag/budget-enforcement.js +67 -0
- package/dist/workflows/dag/canvas-observer.js +474 -0
- package/dist/workflows/dag/context-policy.js +137 -0
- package/dist/workflows/dag/contract-output-registry.js +14 -0
- package/dist/workflows/dag/contract-validator-registrations.js +10 -0
- package/dist/workflows/dag/controller-identity.js +104 -0
- package/dist/workflows/dag/convergence/controller.js +596 -0
- package/dist/workflows/dag/decision-envelope.js +557 -0
- package/dist/workflows/dag/decision-evidence.js +153 -0
- package/dist/workflows/dag/decision-gates.js +1 -0
- package/dist/workflows/dag/dynamic-runtime/condition.js +48 -0
- package/dist/workflows/dag/dynamic-runtime/loop-until.js +161 -0
- package/dist/workflows/dag/dynamic-runtime/map.js +435 -0
- package/dist/workflows/dag/dynamic-runtime/reduction.js +72 -0
- package/dist/workflows/dag/dynamic-runtime/shared.js +203 -0
- package/dist/workflows/dag/event-observer.js +132 -0
- package/dist/workflows/dag/executor-registry.js +23 -0
- package/dist/workflows/dag/facts.js +4 -0
- package/dist/workflows/dag/failure-category.js +118 -0
- package/dist/workflows/dag/failure-routing.js +105 -0
- package/dist/workflows/dag/final-verification.js +180 -0
- package/dist/workflows/dag/frontend-implementation-contract.js +1911 -0
- package/dist/workflows/dag/frontend-lint-baseline.js +474 -0
- package/dist/workflows/dag/frontend-plan-render.js +90 -0
- package/dist/workflows/dag/frontend-prewrite-gate.js +1011 -0
- package/dist/workflows/dag/frontend-project-capability.js +1 -0
- package/dist/workflows/dag/frontend-recovery-plan.js +73 -0
- package/dist/workflows/dag/frontend-recovery-root-manifest.js +123 -0
- package/dist/workflows/dag/frontend-recovery-run.js +539 -0
- package/dist/workflows/dag/frontend-repair.js +541 -0
- package/dist/workflows/dag/frontend-review-context.js +116 -0
- package/dist/workflows/dag/frontend-risk.js +161 -0
- package/dist/workflows/dag/frontend-test-case-checklist.js +343 -0
- package/dist/workflows/dag/frontend-test-case-manifest.js +104 -0
- package/dist/workflows/dag/frontend-test-case-quality.js +105 -0
- package/dist/workflows/dag/frontend-test-html-report.js +174 -0
- package/dist/workflows/dag/frontend-test-l5-report.js +177 -0
- package/dist/workflows/dag/frontend-test-result-contract.js +487 -0
- package/dist/workflows/dag/frontend-verification-trace.js +275 -0
- package/dist/workflows/dag/frontend-worktree-diff.js +201 -0
- package/dist/workflows/dag/frontend-writer-recovery.js +106 -0
- package/dist/workflows/dag/frontend-writer-rollback.js +821 -0
- package/dist/workflows/dag/governance-constants.js +5 -0
- package/dist/workflows/dag/governance-profile.js +413 -0
- package/dist/workflows/dag/index.js +6 -0
- package/dist/workflows/dag/init-hybrid.js +7345 -0
- package/dist/workflows/dag/interrupt-request.js +559 -0
- package/dist/workflows/dag/knowledge-curator.js +165 -0
- package/dist/workflows/dag/l5-report-metrics.js +33 -0
- package/dist/workflows/dag/lifecycle.js +855 -0
- package/dist/workflows/dag/liveness-policy.js +251 -0
- package/dist/workflows/dag/node-execution.js +1081 -0
- package/dist/workflows/dag/observer-compose.js +52 -0
- package/dist/workflows/dag/output-protocol.js +356 -0
- package/dist/workflows/dag/project-governance-context.js +514 -0
- package/dist/workflows/dag/prompt-source.js +88 -0
- package/dist/workflows/dag/prompt.js +348 -0
- package/dist/workflows/dag/reconcile-run.js +145 -0
- package/dist/workflows/dag/reconcile-tasks.js +404 -0
- package/dist/workflows/dag/recovery-recommendation.js +329 -0
- package/dist/workflows/dag/repair-artifact.js +363 -0
- package/dist/workflows/dag/report.js +1229 -0
- package/dist/workflows/dag/rerun-plan.js +614 -0
- package/dist/workflows/dag/rerun-run.js +556 -0
- package/dist/workflows/dag/rerun-task.js +370 -0
- package/dist/workflows/dag/retry-policy.js +263 -0
- package/dist/workflows/dag/run-store.js +41 -0
- package/dist/workflows/dag/runner.js +1069 -0
- package/dist/workflows/dag/runtime-contract.js +87 -0
- package/dist/workflows/dag/runtime.js +5 -0
- package/dist/workflows/dag/scheduler.js +497 -0
- package/dist/workflows/dag/sdd-embedded.js +128 -0
- package/dist/workflows/dag/skill-instructions.js +478 -0
- package/dist/workflows/dag/skill-snapshot.js +553 -0
- package/dist/workflows/dag/skills.js +41 -0
- package/dist/workflows/dag/spec.js +3 -0
- package/dist/workflows/dag/task-contract-binding.js +138 -0
- package/dist/workflows/dag/task-demand-routing.js +1 -0
- package/dist/workflows/dag/topo.js +30 -0
- package/dist/workflows/dag/types.js +1145 -0
- package/dist/workflows/dag/upstream-artifacts.js +98 -0
- package/dist/workflows/dag/validate.js +998 -0
- package/dist/workflows/dag/workspace-checkpoint.js +186 -0
- package/dist/workflows/dynamic/artifacts.js +65 -0
- package/dist/workflows/dynamic/compile.js +371 -0
- package/dist/workflows/dynamic/compileTypes.js +1 -0
- package/dist/workflows/dynamic/errors.js +5 -0
- package/dist/workflows/dynamic/index.js +7 -0
- package/dist/workflows/dynamic/profiles.js +156 -0
- package/dist/workflows/dynamic/spec.js +115 -0
- package/dist/workflows/dynamic/validate.js +275 -0
- package/dist/workflows/loop/actions/dag-action.js +129 -0
- package/dist/workflows/loop/actions/pi-review.js +267 -0
- package/dist/workflows/loop/actions/shared.js +157 -0
- package/dist/workflows/loop/actions/shell-verify.js +82 -0
- package/dist/workflows/loop/actions/types.js +1 -0
- package/dist/workflows/loop/actions/workflow-action.js +255 -0
- package/dist/workflows/loop/actions.js +160 -0
- package/dist/workflows/loop/benchmark.js +510 -0
- package/dist/workflows/loop/closeout.js +135 -0
- package/dist/workflows/loop/context.js +47 -0
- package/dist/workflows/loop/events.js +26 -0
- package/dist/workflows/loop/hash.js +32 -0
- package/dist/workflows/loop/index.js +8 -0
- package/dist/workflows/loop/paths.js +17 -0
- package/dist/workflows/loop/policy/auto-policy.js +112 -0
- package/dist/workflows/loop/policy/path-patterns.js +13 -0
- package/dist/workflows/loop/rounds.js +81 -0
- package/dist/workflows/loop/signals.js +52 -0
- package/dist/workflows/loop/state.js +116 -0
- package/dist/workflows/loop/templates.js +54 -0
- package/dist/workflows/loop/types.js +28 -0
- package/docs/README.md +82 -0
- package/docs/architecture/README.md +35 -0
- package/docs/architecture/dag-execution.md +165 -0
- package/docs/architecture/evolution.md +108 -0
- package/docs/architecture/facts-and-state.md +74 -0
- package/docs/architecture/runtime-boundaries.md +226 -0
- package/docs/architecture/system-overview.md +100 -0
- package/docs/architecture/worker-and-feature.md +122 -0
- package/docs/governance/README.md +18 -0
- package/docs/governance/harness-methodology-debugging.md +177 -0
- package/docs/governance/harness-methodology-tdd.md +130 -0
- package/docs/governance/harness-methodology-verification.md +27 -0
- package/docs/init-surface.manifest.json +358 -0
- package/docs/operations/README.md +15 -0
- package/docs/operations/local-development-environment.md +77 -0
- package/docs/skills/README.md +7 -0
- package/docs/skills/vetted-skill-registry.md +49 -0
- package/docs/templates/README.md +67 -0
- package/docs/templates/adr.md +60 -0
- package/docs/templates/agent-dag-authority-surface-audit.prompt.md +94 -0
- package/docs/templates/agent-dag-decision-envelope.schema.json +213 -0
- package/docs/templates/agent-dag-decision-gate-dogfood-report.md +117 -0
- package/docs/templates/agent-dag-decision-gate.prompt.md +246 -0
- package/docs/templates/agent-dag-process-supervisor.prompt.md +98 -0
- package/docs/templates/agent-dag-report.schema.json +473 -0
- package/docs/templates/agent-dag-review-verdict.prompt.md +68 -0
- package/docs/templates/agent-dag.base.json +190 -0
- package/docs/templates/agent-dag.final-verification.json +185 -0
- package/docs/templates/agent-dag.schema.json +590 -0
- package/docs/templates/agent-dag.supervised-implementation.json +640 -0
- package/docs/templates/agent-worker-production-readiness-checklist.md +47 -0
- package/docs/templates/backend-test-analysis.schema.json +37 -0
- package/docs/templates/backend-test-case-manifest.schema.json +223 -0
- package/docs/templates/backend-test-dag.classify.prompt.md +75 -0
- package/docs/templates/backend-test-dag.generate-pytest.prompt.md +41 -0
- package/docs/templates/backend-test-dag.json +671 -0
- package/docs/templates/backend-test-dag.retrospect.prompt.md +165 -0
- package/docs/templates/backend-test-dag.review-cases.prompt.md +36 -0
- package/docs/templates/backend-test-execution.schema.json +138 -0
- package/docs/templates/backend-test-result.schema.json +99 -0
- package/docs/templates/branch-merge-report.md +115 -0
- package/docs/templates/evaluation/agents-map-slim-v1.candidate.json +9 -0
- package/docs/templates/evaluation/agents-map-slim-v1.md +87 -0
- package/docs/templates/evaluation/agents-map-verbose-v0.candidate.json +9 -0
- package/docs/templates/evaluation/agents-map-verbose-v0.md +153 -0
- package/docs/templates/evaluation/campaign-budget-v1.json +12 -0
- package/docs/templates/evaluation/campaign-dogfood-v0.json +24 -0
- package/docs/templates/evaluation/campaign-evidence-v1.json +44 -0
- package/docs/templates/evaluation/context-policy-baseline-v1.json +17 -0
- package/docs/templates/evaluation/context-policy-role-specialized-v1.json +28 -0
- package/docs/templates/evaluation/corpus-dogfood-v0.manifest.json +118 -0
- package/docs/templates/evaluation/matrix-dag-dry-run-v1.json +21 -0
- package/docs/templates/evaluation/matrix-fixture-v1.json +10 -0
- package/docs/templates/evaluation/private-verifier-dogfood-v0.json +16 -0
- package/docs/templates/exec-plan.md +66 -0
- package/docs/templates/feature-spec.md +53 -0
- package/docs/templates/frontend-design-contract.md +68 -0
- package/docs/templates/frontend-eval/fixtures/failures/01-type-build-error.md +17 -0
- package/docs/templates/frontend-eval/fixtures/failures/02-unit-component-test-fail.md +16 -0
- package/docs/templates/frontend-eval/fixtures/failures/03-fixture-schema-drift.md +16 -0
- package/docs/templates/frontend-eval/fixtures/failures/04-missing-loading-empty-error-state.md +16 -0
- package/docs/templates/frontend-eval/fixtures/failures/05-forbidden-write-writeset-expansion.md +16 -0
- package/docs/templates/frontend-eval/fixtures/failures/06-unapproved-dependency-add.md +16 -0
- package/docs/templates/frontend-eval/fixtures/failures/07-mock-production-on.md +21 -0
- package/docs/templates/frontend-eval/fixtures/functional/01-simple-component-style.md +29 -0
- package/docs/templates/frontend-eval/fixtures/functional/02-form-validation.md +28 -0
- package/docs/templates/frontend-eval/fixtures/functional/03-list-detail-page.md +28 -0
- package/docs/templates/frontend-eval/fixtures/functional/04-api-mock.md +29 -0
- package/docs/templates/frontend-eval/fixtures/functional/05-permission-auth-gated-ui.md +27 -0
- package/docs/templates/frontend-eval/fixtures/functional/06-ssr-server-client-boundary.md +28 -0
- package/docs/templates/frontend-eval/fixtures/functional/07-shared-public-component-api.md +28 -0
- package/docs/templates/frontend-eval/fixtures/functional/08-pure-local-no-remote.md +27 -0
- package/docs/templates/frontend-eval/metrics.md +138 -0
- package/docs/templates/frontend-eval/smoke-targets.md +53 -0
- package/docs/templates/frontend-implementation-contract.schema.json +35 -0
- package/docs/templates/frontend-task-constraints.md +62 -0
- package/docs/templates/frontend-task-requirement.md +104 -0
- package/docs/templates/frontend-test-case-checklist.md +44 -0
- package/docs/templates/frontend-test-case.example.md +143 -0
- package/docs/templates/frontend-test-dag.generate-cases.prompt.md +63 -0
- package/docs/templates/frontend-test-dag.json +409 -0
- package/docs/templates/frontend-test-dag.retrieve-context.prompt.md +21 -0
- package/docs/templates/frontend-test-dag.retrospect.prompt.md +5 -0
- package/docs/templates/frontend-test-dag.review-cases.prompt.md +5 -0
- package/docs/templates/frontend-test-dag.review-execution.prompt.md +3 -0
- package/docs/templates/frontend-test-standard-scenarios.v1.json +159 -0
- package/docs/templates/harness.schema.json +351 -0
- package/docs/templates/hybrid-dag.json +188 -0
- package/docs/templates/init-evolution-review.md +35 -0
- package/docs/templates/init-managed-agents.md +157 -0
- package/docs/templates/interactive-ui-round2-experiment.md +66 -0
- package/docs/templates/knowledge-graph-bootstrap-dag.json +118 -0
- package/docs/templates/knowledge-sync-dag.json +178 -0
- package/docs/templates/knowledge-sync-draft.schema.json +71 -0
- package/docs/templates/product-line/AGENTS.md +9 -0
- package/docs/templates/product-line/README.md +42 -0
- package/docs/templates/product-line/acceptance.yaml +23 -0
- package/docs/templates/product-line/closeout.yaml +9 -0
- package/docs/templates/product-line/design.md +13 -0
- package/docs/templates/product-line/feature-scaffold-batch.example.yaml +31 -0
- package/docs/templates/product-line/feature.yaml +11 -0
- package/docs/templates/product-line/links.md +10 -0
- package/docs/templates/product-line/requirement.md +17 -0
- package/docs/templates/product-line/scaffold-samples/README.md +36 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/acceptance.yaml +16 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/design.md +14 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/feature.yaml +14 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/requirement.md +6 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/tasks/BE-IMPL-001.yaml +83 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/tasks/task-graph.yaml +14 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/acceptance.yaml +18 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/design.md +18 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/feature.yaml +14 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/requirement.md +6 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/tasks/BE-IMPL-001.yaml +84 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/tasks/CONTRACT-001.yaml +84 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/tasks/FE-IMPL-001.yaml +86 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/tasks/task-graph.yaml +40 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/acceptance.yaml +16 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/design.md +14 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/feature.yaml +14 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/requirement.md +6 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/tasks/FE-IMPL-001.yaml +85 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/tasks/task-graph.yaml +14 -0
- package/docs/templates/product-line/task-graph.yaml +23 -0
- package/docs/templates/product-line/task.yaml +68 -0
- package/docs/templates/product-line/test-plan.md +7 -0
- package/docs/templates/production-readiness-checklist.md +57 -0
- package/docs/templates/progress-log.md +27 -0
- package/docs/templates/project-start-checklist.md +9 -0
- package/docs/templates/qa-report.md +48 -0
- package/docs/templates/sprint-contract.md +29 -0
- package/docs/templates/worker-dogfood-evidence.md +80 -0
- package/docs/templates/worker-dogfood-setup.md +68 -0
- package/examples/decision-gate-agent-dag.json +177 -0
- package/examples/example-dag.json +46 -0
- package/examples/hybrid-loop-agent-dag.json +189 -0
- package/examples/l5-report-coms-process-definition.html +322 -0
- package/examples/l5-report-demo.html +79 -0
- package/harness.json +90 -0
- package/package.json +98 -0
- package/scripts/kb-bootstrap-init-skeleton.sh +241 -0
- package/scripts/kb-graph-incremental-prepare.mjs +386 -0
- package/scripts/kb-graph-materialize.mjs +105 -0
- package/scripts/kb-graph-promote.mjs +164 -0
- package/scripts/kb-query.mjs +554 -0
- package/skills/agent-worker/SKILL.md +48 -0
- package/skills/agent-worker/references/agent-worker-operator.md +159 -0
- package/skills/ai-engineering-context/SKILL.md +48 -0
- package/skills/analyze-product-dependencies/SKILL.md +108 -0
- package/skills/analyze-product-dependencies/references/api-documentation-schema.md +35 -0
- package/skills/analyze-product-dependencies/references/dependency-analysis-schema.md +38 -0
- package/skills/analyze-product-dependencies/references/example.md +76 -0
- package/skills/analyze-product-dependencies/references/forward-test-cases.md +110 -0
- package/skills/analyze-product-dependencies/references/input-contract.md +34 -0
- package/skills/analyze-product-dependencies/references/kb-integration.md +64 -0
- package/skills/analyze-product-dependencies/references/scouting-rules.md +76 -0
- package/skills/analyze-product-dependencies/scripts/test-validators.mjs +460 -0
- package/skills/analyze-product-dependencies/scripts/validate-api-documentation.mjs +194 -0
- package/skills/analyze-product-dependencies/scripts/validate-dependency-analysis.mjs +200 -0
- package/skills/analyze-product-dependencies/scripts/validate-product-requirement-input.mjs +90 -0
- package/skills/analyze-product-dependencies/scripts/validation-helpers.mjs +138 -0
- package/skills/analyze-product-requirements/SKILL.md +145 -0
- package/skills/analyze-product-requirements/references/acceptance-criteria.md +87 -0
- package/skills/analyze-product-requirements/references/clarification-and-knowledge.md +70 -0
- package/skills/analyze-product-requirements/references/example.md +104 -0
- package/skills/analyze-product-requirements/references/forward-test-cases.md +144 -0
- package/skills/analyze-product-requirements/references/kb-integration.md +56 -0
- package/skills/analyze-product-requirements/references/product-analysis-schema.md +41 -0
- package/skills/analyze-product-requirements/references/product-requirement-schema.md +42 -0
- package/skills/analyze-product-requirements/references/requirement-clarification-schema.md +66 -0
- package/skills/analyze-product-requirements/scripts/compute-source-identity.mjs +35 -0
- package/skills/analyze-product-requirements/scripts/test-validators.mjs +501 -0
- package/skills/analyze-product-requirements/scripts/validate-product-analysis.mjs +100 -0
- package/skills/analyze-product-requirements/scripts/validate-product-requirement.mjs +109 -0
- package/skills/analyze-product-requirements/scripts/validate-requirement-clarification.mjs +109 -0
- package/skills/analyze-product-requirements/scripts/validation-helpers.mjs +175 -0
- package/skills/browser-tools/SKILL.md +196 -0
- package/skills/browser-tools/browser-content.js +103 -0
- package/skills/browser-tools/browser-cookies.js +35 -0
- package/skills/browser-tools/browser-eval.js +53 -0
- package/skills/browser-tools/browser-hn-scraper.js +108 -0
- package/skills/browser-tools/browser-nav.js +44 -0
- package/skills/browser-tools/browser-pick.js +162 -0
- package/skills/browser-tools/browser-screenshot.js +34 -0
- package/skills/browser-tools/browser-start.js +86 -0
- package/skills/browser-tools/package-lock.json +2556 -0
- package/skills/browser-tools/package.json +19 -0
- package/skills/code-review-core/SKILL.md +20 -0
- package/skills/codebase-scout/SKILL.md +19 -0
- package/skills/frontend-bounded-implement/SKILL.md +53 -0
- package/skills/frontend-design-review/SKILL.md +79 -0
- package/skills/frontend-design-review/references/review-checklist.md +43 -0
- package/skills/frontend-implementation/SKILL.md +52 -0
- package/skills/frontend-implementation/references/code-standards.md +33 -0
- package/skills/frontend-implementation/references/design-spec.md +56 -0
- package/skills/frontend-implementation/references/node-contracts.md +31 -0
- package/skills/frontend-review/SKILL.md +55 -0
- package/skills/frontend-review/references/review-findings.md +50 -0
- package/skills/frontend-verification/SKILL.md +61 -0
- package/skills/frontend-verification/references/verification-checklist.md +48 -0
- package/skills/grill-me/SKILL.md +10 -0
- package/skills/grill-with-docs/SKILL.md +80 -0
- package/skills/grill-with-docs/adr-format.md +58 -0
- package/skills/grill-with-docs/context-format.md +52 -0
- package/skills/init-capability-evolution/SKILL.md +70 -0
- package/skills/local-jacoco-coverage/SKILL.md +281 -0
- package/skills/local-jacoco-coverage/references/requirement-to-source-mapping.md +85 -0
- package/skills/local-jacoco-coverage/references/runtime-alignment.md +106 -0
- package/skills/local-jacoco-coverage/scripts/run-coverage-analysis.sh +148 -0
- package/skills/local-jacoco-coverage/scripts/start-jacoco-agent.sh +110 -0
- package/skills/loop-agent/SKILL.md +68 -0
- package/skills/loop-agent/references/README.md +67 -0
- package/skills/loop-agent/references/command-reference.md +645 -0
- package/skills/loop-agent/references/docs-converge.md +126 -0
- package/skills/loop-agent/references/harness-policy.md +289 -0
- package/skills/loop-agent/references/hybrid-dag.md +245 -0
- package/skills/loop-agent/references/learned/README.md +21 -0
- package/skills/loop-agent/references/long-running-loop.md +57 -0
- package/skills/loop-agent/references/model-routing.md +45 -0
- package/skills/loop-agent/references/multi-worktree.md +54 -0
- package/skills/loop-agent/references/one-shot-runs.md +84 -0
- package/skills/loop-agent/references/orchestrator-and-interventions.md +175 -0
- package/skills/loop-agent/references/pi-prompt.md +23 -0
- package/skills/loop-agent/references/pi-subagent-assisted-mode.md +84 -0
- package/skills/loop-agent/references/post-implementation-and-patterns.md +54 -0
- package/skills/loop-agent/references/source-and-plan-practice.md +169 -0
- package/skills/loop-agent/references/task-workflow.md +104 -0
- package/skills/loop-agent/references/verification-and-failure-handling.md +148 -0
- package/skills/playwright-cli/SKILL.md +93 -0
- package/skills/playwright-cli/references/element-attributes.md +23 -0
- package/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/skills/playwright-cli/references/request-mocking.md +87 -0
- package/skills/playwright-cli/references/running-code.md +241 -0
- package/skills/playwright-cli/references/session-management.md +225 -0
- package/skills/playwright-cli/references/storage-state.md +275 -0
- package/skills/playwright-cli/references/test-generation.md +433 -0
- package/skills/playwright-cli/references/tracing.md +5 -0
- package/skills/playwright-cli/references/video-recording.md +5 -0
- package/skills/playwright-cli-case-generator/SKILL.md +108 -0
- package/skills/requesting-code-review/SKILL.md +101 -0
- package/skills/requesting-code-review/code-reviewer.md +168 -0
- package/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/skills/systematic-debugging/SKILL.md +312 -0
- package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/skills/systematic-debugging/find-polluter.sh +63 -0
- package/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/skills/systematic-debugging/test-academic.md +14 -0
- package/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/skills/test-driven-development/SKILL.md +27 -0
- package/skills/using-git-worktrees/SKILL.md +215 -0
- package/skills/verification-before-completion/SKILL.md +154 -0
- package/skills/webapp-testing/SKILL.md +19 -0
|
@@ -0,0 +1,1145 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { isOpenspecSpecFilePath } from "../../shared/openspec-spec.js";
|
|
3
|
+
import { campaignBudgetSchema, } from "../../application/evaluation/budget.js";
|
|
4
|
+
import { assertDagPromptSourceRule } from "./prompt-source.js";
|
|
5
|
+
import { dagRetryPolicySchema } from "./retry-policy.js";
|
|
6
|
+
import { dagLivenessPolicySchema, } from "./liveness-policy.js";
|
|
7
|
+
import { dagOutputProtocolSchema } from "./output-protocol.js";
|
|
8
|
+
export const dagComplexitySchema = z.enum(["HIGH", "MED", "LOW"]);
|
|
9
|
+
export const dagNodeExecutorSchema = z.enum(["pi", "shell", "static"]);
|
|
10
|
+
export const CURSOR_DAG_EXECUTOR_REMOVED_ERROR = 'executor "cursor" is no longer supported; regenerate the DAG with Pi-only writers (implement-pi / repair-pi)';
|
|
11
|
+
export const CURSOR_EXECUTOR_MODELS_REMOVED_ERROR = "executorModels.cursor is no longer supported; use executorModels.pi only";
|
|
12
|
+
export const dagToolProfileSchema = z.enum(["read-only", "write"]);
|
|
13
|
+
/** Static command capabilities only; tasks cannot inject executables or shell prefixes. */
|
|
14
|
+
export const dagCommandCapabilitySchema = z.enum(["playwright-cli"]);
|
|
15
|
+
export const dagCommandPolicySchema = z.discriminatedUnion("mode", [
|
|
16
|
+
z.object({ mode: z.literal("deny") }).strict(),
|
|
17
|
+
z
|
|
18
|
+
.object({
|
|
19
|
+
mode: z.literal("capability-allowlist"),
|
|
20
|
+
capabilities: z.array(dagCommandCapabilitySchema).min(1),
|
|
21
|
+
})
|
|
22
|
+
.strict(),
|
|
23
|
+
]);
|
|
24
|
+
/** Undefined / omitted commandPolicy is treated as deny by executors and validators. */
|
|
25
|
+
export function resolveDagCommandPolicy(policy) {
|
|
26
|
+
return policy ?? { mode: "deny" };
|
|
27
|
+
}
|
|
28
|
+
export function dagCommandPolicyAllows(policy, capability) {
|
|
29
|
+
const resolved = resolveDagCommandPolicy(policy);
|
|
30
|
+
if (resolved.mode !== "capability-allowlist")
|
|
31
|
+
return false;
|
|
32
|
+
return resolved.capabilities.includes(capability);
|
|
33
|
+
}
|
|
34
|
+
export const dagOutputModeSchema = z.enum(["default", "structured-required"]);
|
|
35
|
+
export const dagShellPresetSchema = z.enum(["loop-agent-standard-verify"]);
|
|
36
|
+
export const dagVerifyQuotaSchema = z.enum(["1", "3", "full"]);
|
|
37
|
+
export const dagVerifyStrategySchema = z
|
|
38
|
+
.object({
|
|
39
|
+
intermediateQuota: dagVerifyQuotaSchema.optional(),
|
|
40
|
+
finalQuota: z.literal("full").optional().default("full"),
|
|
41
|
+
focusedCommandSource: z.literal("adapter").optional().default("adapter"),
|
|
42
|
+
})
|
|
43
|
+
.optional();
|
|
44
|
+
export const dagShellVerifyEvidenceSchema = z.object({
|
|
45
|
+
phase: z.enum(["intermediate", "final"]),
|
|
46
|
+
quota: dagVerifyQuotaSchema,
|
|
47
|
+
commandSource: z.enum(["adapter", "inline"]),
|
|
48
|
+
commandCount: z.number().int().nonnegative(),
|
|
49
|
+
commandLabels: z.array(z.string()).default([]),
|
|
50
|
+
commandTexts: z.array(z.string()).default([]),
|
|
51
|
+
/** Semantic command identities in the same deterministic order as commandTexts. */
|
|
52
|
+
canonicalKeys: z.array(z.string()).default([]),
|
|
53
|
+
/** Commands merged into a retained semantic command, keyed by canonical identity. */
|
|
54
|
+
mergedCommands: z
|
|
55
|
+
.array(z.object({
|
|
56
|
+
canonicalKey: z.string(),
|
|
57
|
+
keptLabel: z.string(),
|
|
58
|
+
mergedLabels: z.array(z.string()),
|
|
59
|
+
/** Retained timeout after semantic duplicates merge, or null when unspecified. */
|
|
60
|
+
effectiveTimeoutMs: z.number().int().positive().nullable(),
|
|
61
|
+
}))
|
|
62
|
+
.default([]),
|
|
63
|
+
/** Commands omitted only because a retained aggregate is known to cover them. */
|
|
64
|
+
coveredCommands: z
|
|
65
|
+
.array(z.object({ aggregateLabel: z.string(), coveredLabel: z.string() }))
|
|
66
|
+
.default([]),
|
|
67
|
+
/** Why a command was retained or deferred from the intermediate verify node. */
|
|
68
|
+
selectionReasons: z.array(z.string()).default([]),
|
|
69
|
+
/** Non-executing generation-time cwd/local-script validation evidence. */
|
|
70
|
+
preflight: z
|
|
71
|
+
.array(z.object({ label: z.string(), status: z.enum(["ok", "future-delivery-script"]) }))
|
|
72
|
+
.default([]),
|
|
73
|
+
/** Effective timeout applied independently to each shell command. */
|
|
74
|
+
commandTimeoutMs: z.number().int().positive().optional(),
|
|
75
|
+
/** Worst-case serial budget: commandCount * commandTimeoutMs. */
|
|
76
|
+
totalTimeoutBudgetMs: z.number().int().nonnegative().optional(),
|
|
77
|
+
finalFullRequired: z.boolean().optional(),
|
|
78
|
+
});
|
|
79
|
+
export const dagRepairArtifactGateSchema = z.object({
|
|
80
|
+
fromNodeId: z
|
|
81
|
+
.string()
|
|
82
|
+
.regex(/^[a-z][a-z0-9-]*$/, "fromNodeId must be kebab-case"),
|
|
83
|
+
/**
|
|
84
|
+
* Explicit reference to the governed Pi repair writer this gate feeds.
|
|
85
|
+
* New generated supervised DAGs must set this. Legacy DAGs without it are
|
|
86
|
+
* only accepted when a unique safe downstream Pi writer can be derived.
|
|
87
|
+
*/
|
|
88
|
+
repairNodeId: z
|
|
89
|
+
.string()
|
|
90
|
+
.regex(/^[a-z][a-z0-9-]*$/, "repairNodeId must be kebab-case")
|
|
91
|
+
.optional(),
|
|
92
|
+
});
|
|
93
|
+
export const DAG_RUNTIME_CONTRACT_SCHEMA_VERSION = 1;
|
|
94
|
+
export const DAG_AGENT_RUNTIME_PI_ONLY = "pi-only";
|
|
95
|
+
export const DAG_REPAIR_WRITER_PROTOCOL_EXPLICIT_NODE_V1 = "explicit-node-v1";
|
|
96
|
+
export const dagRuntimeContractSchema = z.object({
|
|
97
|
+
schemaVersion: z.literal(DAG_RUNTIME_CONTRACT_SCHEMA_VERSION),
|
|
98
|
+
agentRuntime: z.literal(DAG_AGENT_RUNTIME_PI_ONLY),
|
|
99
|
+
repairWriterProtocol: z.literal(DAG_REPAIR_WRITER_PROTOCOL_EXPLICIT_NODE_V1),
|
|
100
|
+
/**
|
|
101
|
+
* Optional minimum controller version for diagnosis / fail-below. Capability
|
|
102
|
+
* fields above are primary; semver is only used for guidance when the
|
|
103
|
+
* controller is otherwise compatible.
|
|
104
|
+
*/
|
|
105
|
+
minimumControllerVersion: z
|
|
106
|
+
.string()
|
|
107
|
+
.regex(/^\d+\.\d+\.\d+([-+].+)?$/, "minimumControllerVersion must be semver")
|
|
108
|
+
.optional(),
|
|
109
|
+
});
|
|
110
|
+
export const dagVerdictGateSchema = z.object({
|
|
111
|
+
fromNodeId: z
|
|
112
|
+
.string()
|
|
113
|
+
.regex(/^[a-z][a-z0-9-]*$/, "fromNodeId must be kebab-case"),
|
|
114
|
+
/**
|
|
115
|
+
* Optional fallback node ids when the primary `fromNodeId` JSON is absent
|
|
116
|
+
* (e.g. exclusive condition branch skip). Tried in order after primary.
|
|
117
|
+
* Prefer listing the post-revision / final reviewer first when both may exist.
|
|
118
|
+
*/
|
|
119
|
+
fallbackFromNodeIds: z
|
|
120
|
+
.array(z
|
|
121
|
+
.string()
|
|
122
|
+
.regex(/^[a-z][a-z0-9-]*$/, "fallbackFromNodeIds must be kebab-case"))
|
|
123
|
+
.optional(),
|
|
124
|
+
accept: z.array(z.string().min(1)).min(1),
|
|
125
|
+
routingAccept: z.array(z.string().min(1)).optional(),
|
|
126
|
+
source: z.enum(["verdict-line", "json-review-verdict"]).optional(),
|
|
127
|
+
lineMode: z.enum(["first-non-empty", "first-verdict-line"]).optional(),
|
|
128
|
+
label: z.string().min(1).optional(),
|
|
129
|
+
});
|
|
130
|
+
export const dagRequirementCoverageGateSchema = z.object({
|
|
131
|
+
fromNodeIds: z
|
|
132
|
+
.array(z.string().regex(/^[a-z][a-z0-9-]*$/, "fromNodeIds must be kebab-case"))
|
|
133
|
+
.min(1),
|
|
134
|
+
fallbackFromNodeIds: z
|
|
135
|
+
.array(z
|
|
136
|
+
.string()
|
|
137
|
+
.regex(/^[a-z][a-z0-9-]*$/, "fallbackFromNodeIds must be kebab-case"))
|
|
138
|
+
.min(1)
|
|
139
|
+
.optional(),
|
|
140
|
+
requiredIds: z
|
|
141
|
+
.array(z
|
|
142
|
+
.string()
|
|
143
|
+
.regex(/^(?:REQ|BR|AC)-[A-Z0-9]+(?:-[A-Z0-9]+)*$/, "requiredIds must use REQ-*, BR-*, or AC-* identifiers"))
|
|
144
|
+
.min(1),
|
|
145
|
+
label: z.string().min(1).optional(),
|
|
146
|
+
});
|
|
147
|
+
export const dagJsonArtifactSchemaIdSchema = z.enum([
|
|
148
|
+
"backend-test-analysis-v1",
|
|
149
|
+
"backend-test-analysis-v2",
|
|
150
|
+
"backend-test-execution-v1",
|
|
151
|
+
"backend-test-result-v1",
|
|
152
|
+
"backend-test-classification-v1",
|
|
153
|
+
"backend-test-semantic-review-v1",
|
|
154
|
+
"backend-test-case-manifest-v1",
|
|
155
|
+
"frontend-implementation-contract-v1",
|
|
156
|
+
"frontend-test-result-v1",
|
|
157
|
+
]);
|
|
158
|
+
export const dagJsonArtifactGateSchema = z.object({
|
|
159
|
+
fromNodeId: z.string().regex(/^[a-z][a-z0-9-]*$/),
|
|
160
|
+
fallbackFromNodeIds: z
|
|
161
|
+
.array(z
|
|
162
|
+
.string()
|
|
163
|
+
.regex(/^[a-z][a-z0-9-]*$/, "fallbackFromNodeIds must be kebab-case"))
|
|
164
|
+
.min(1)
|
|
165
|
+
.optional(),
|
|
166
|
+
schemaId: dagJsonArtifactSchemaIdSchema,
|
|
167
|
+
artifactName: z.string().regex(/^[a-z0-9][a-z0-9._-]*\.json$/),
|
|
168
|
+
outputDir: z.string().regex(/^[a-z0-9][a-z0-9._-]*$/),
|
|
169
|
+
junitRelativePath: z.string().min(1).optional(),
|
|
170
|
+
});
|
|
171
|
+
const dagFrontendNodeIdSchema = z
|
|
172
|
+
.string()
|
|
173
|
+
.regex(/^[a-z][a-z0-9-]*$/, "frontend node id must be kebab-case");
|
|
174
|
+
const openspecCandidatePathSchema = z
|
|
175
|
+
.string()
|
|
176
|
+
.refine((candidate) => !candidate.includes("\\") && isOpenspecSpecFilePath(candidate), "openspec candidate must be a repo-relative supported file under openspec/schemas/, openspec/project-specs/, or ai_workspace/");
|
|
177
|
+
export const dagFrontendPrewriteGateSchema = z.object({
|
|
178
|
+
schemaVersion: z.literal(1),
|
|
179
|
+
planFromNodeId: dagFrontendNodeIdSchema,
|
|
180
|
+
planFallbackFromNodeIds: z.array(dagFrontendNodeIdSchema).default([]),
|
|
181
|
+
reviewFromNodeId: dagFrontendNodeIdSchema,
|
|
182
|
+
reviewFallbackFromNodeIds: z.array(dagFrontendNodeIdSchema).default([]),
|
|
183
|
+
requiredRequirementIds: z
|
|
184
|
+
.array(z.string().regex(/^(?:REQ|BR|AC)-[A-Z0-9]+(?:-[A-Z0-9]+)*$/))
|
|
185
|
+
.default([]),
|
|
186
|
+
allowedMockStrategies: z
|
|
187
|
+
.array(z.enum(["native", "browser-intercept", "request-adapter", "not-needed"]))
|
|
188
|
+
.min(1),
|
|
189
|
+
/** Frozen Mock verification command labels the DAG will actually execute. */
|
|
190
|
+
mockCommandLabels: z.array(z.string()).default([]),
|
|
191
|
+
artifactName: z.string().regex(/^[a-z0-9][a-z0-9._-]*\.json$/),
|
|
192
|
+
outputDir: z.string().regex(/^[a-z0-9][a-z0-9._-]*$/),
|
|
193
|
+
requireSourceFreshness: z.literal(true),
|
|
194
|
+
implementationWriteSet: z.array(z.string().min(1)).min(1).optional(),
|
|
195
|
+
openspecCandidatePaths: z.array(openspecCandidatePathSchema).default([]),
|
|
196
|
+
/**
|
|
197
|
+
* Generation-frozen component/theme specification bucket. Derived from
|
|
198
|
+
* `designEvidence.classified.component ∪ theme ∪ rule.components` at DAG
|
|
199
|
+
* generation. When non-empty and the canonical contract has UI-visible
|
|
200
|
+
* work, the prewrite gate requires a non-empty `uiComponentChoices` and
|
|
201
|
+
* cross-checks each `specReference.path` against this set + the effective
|
|
202
|
+
* plan openspec-citations block. Legacy DAGs without this field keep the
|
|
203
|
+
* field-absent semantics (component-choices-missing is not enforced).
|
|
204
|
+
*/
|
|
205
|
+
componentSpecCandidatePaths: z.array(openspecCandidatePathSchema).optional(),
|
|
206
|
+
/**
|
|
207
|
+
* OpenSpec gate policy. Omitted on legacy DAGs: the runtime treats
|
|
208
|
+
* undefined as scan-strict so pre-existing full-read semantics are
|
|
209
|
+
* preserved. Generation always writes it explicitly for new DAGs.
|
|
210
|
+
*/
|
|
211
|
+
openspecPolicy: z.enum(["cited", "scan-strict"]).optional(),
|
|
212
|
+
/**
|
|
213
|
+
* When true, the effective plan node (planFromNodeId when it is selected
|
|
214
|
+
* over the fallback) emits an RFC 7386 merge-patch delta instead of a full
|
|
215
|
+
* contract. The gate applies it on the original contract node
|
|
216
|
+
* (planFallbackFromNodeIds[0]) before analysis/materialization. Legacy DAGs
|
|
217
|
+
* without this field keep full-contract semantics.
|
|
218
|
+
*/
|
|
219
|
+
revisionPatch: z.boolean().optional(),
|
|
220
|
+
/**
|
|
221
|
+
* Deterministically rendered plan.md artifact name (same outputDir as the
|
|
222
|
+
* contract). Defaults to frontend-plan.md at runtime.
|
|
223
|
+
*/
|
|
224
|
+
planMdArtifactName: z
|
|
225
|
+
.string()
|
|
226
|
+
.regex(/^[a-z0-9][a-z0-9._-]*\.md$/)
|
|
227
|
+
.optional(),
|
|
228
|
+
/**
|
|
229
|
+
* Generation-frozen candidate source metadata (diagnostic). cited mode
|
|
230
|
+
* candidates are declared ∪ taskSourceCited; scan-strict candidates are
|
|
231
|
+
* scanStrict (auto-discovered designEvidence.normativePaths).
|
|
232
|
+
*/
|
|
233
|
+
openspecCandidateSources: z
|
|
234
|
+
.object({
|
|
235
|
+
declared: z.array(openspecCandidatePathSchema).default([]),
|
|
236
|
+
taskSourceCited: z.array(openspecCandidatePathSchema).default([]),
|
|
237
|
+
scanStrict: z.array(openspecCandidatePathSchema).default([]),
|
|
238
|
+
})
|
|
239
|
+
.optional(),
|
|
240
|
+
});
|
|
241
|
+
export const dagFrontendLintBaselineSchema = z
|
|
242
|
+
.object({
|
|
243
|
+
schemaVersion: z.literal(1),
|
|
244
|
+
lintCommands: z.array(z.string().min(1)).min(1),
|
|
245
|
+
lintEvidence: dagShellVerifyEvidenceSchema,
|
|
246
|
+
})
|
|
247
|
+
.strict();
|
|
248
|
+
export const dagFrontendVerificationBundleSchema = z
|
|
249
|
+
.object({
|
|
250
|
+
schemaVersion: z.literal(1),
|
|
251
|
+
mockCommands: z.array(z.string()).default([]),
|
|
252
|
+
lintCommands: z.array(z.string().min(1)).optional(),
|
|
253
|
+
staticCommands: z.array(z.string()).min(1),
|
|
254
|
+
behaviorCommands: z.array(z.string()).default([]),
|
|
255
|
+
mockEvidence: dagShellVerifyEvidenceSchema.optional(),
|
|
256
|
+
lintEvidence: dagShellVerifyEvidenceSchema.optional(),
|
|
257
|
+
staticEvidence: dagShellVerifyEvidenceSchema,
|
|
258
|
+
behaviorEvidence: dagShellVerifyEvidenceSchema,
|
|
259
|
+
lintBaselineNodeId: dagFrontendNodeIdSchema.optional(),
|
|
260
|
+
writerNodeIds: z.array(dagFrontendNodeIdSchema).optional(),
|
|
261
|
+
mode: z.enum(["initial", "repair"]),
|
|
262
|
+
})
|
|
263
|
+
.superRefine((bundle, context) => {
|
|
264
|
+
const groups = [
|
|
265
|
+
["mock", bundle.mockCommands, bundle.mockEvidence],
|
|
266
|
+
["lint", bundle.lintCommands ?? [], bundle.lintEvidence],
|
|
267
|
+
["static", bundle.staticCommands, bundle.staticEvidence],
|
|
268
|
+
["behavior", bundle.behaviorCommands, bundle.behaviorEvidence],
|
|
269
|
+
];
|
|
270
|
+
for (const [name, commands, evidence] of groups) {
|
|
271
|
+
if ((name === "mock" || name === "lint") &&
|
|
272
|
+
commands.length === 0 &&
|
|
273
|
+
!evidence)
|
|
274
|
+
continue;
|
|
275
|
+
if (!evidence) {
|
|
276
|
+
context.addIssue({
|
|
277
|
+
code: z.ZodIssueCode.custom,
|
|
278
|
+
path: [`${name}Evidence`],
|
|
279
|
+
message: `${name} evidence is required when commands are configured`,
|
|
280
|
+
});
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
if (evidence.commandCount !== commands.length) {
|
|
284
|
+
context.addIssue({
|
|
285
|
+
code: z.ZodIssueCode.custom,
|
|
286
|
+
path: [`${name}Evidence`, "commandCount"],
|
|
287
|
+
message: `${name} commandCount must match commands`,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
if (evidence.commandLabels.length !== commands.length) {
|
|
291
|
+
context.addIssue({
|
|
292
|
+
code: z.ZodIssueCode.custom,
|
|
293
|
+
path: [`${name}Evidence`, "commandLabels"],
|
|
294
|
+
message: `${name} commandLabels must match commands`,
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
if (evidence.commandTexts.length !== commands.length ||
|
|
298
|
+
evidence.commandTexts.some((command, index) => command !== commands[index])) {
|
|
299
|
+
context.addIssue({
|
|
300
|
+
code: z.ZodIssueCode.custom,
|
|
301
|
+
path: [`${name}Evidence`, "commandTexts"],
|
|
302
|
+
message: `${name} commandTexts must exactly match commands`,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
if (new Set(evidence.commandLabels).size !==
|
|
306
|
+
evidence.commandLabels.length ||
|
|
307
|
+
evidence.commandLabels.some((label) => !label.trim())) {
|
|
308
|
+
context.addIssue({
|
|
309
|
+
code: z.ZodIssueCode.custom,
|
|
310
|
+
path: [`${name}Evidence`, "commandLabels"],
|
|
311
|
+
message: `${name} commandLabels must be non-empty and unique`,
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if ((bundle.lintCommands?.length ?? 0) > 0) {
|
|
316
|
+
if (!bundle.lintBaselineNodeId) {
|
|
317
|
+
context.addIssue({
|
|
318
|
+
code: z.ZodIssueCode.custom,
|
|
319
|
+
path: ["lintBaselineNodeId"],
|
|
320
|
+
message: "lintBaselineNodeId is required when lintCommands are present",
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
if (!bundle.writerNodeIds || bundle.writerNodeIds.length === 0) {
|
|
324
|
+
context.addIssue({
|
|
325
|
+
code: z.ZodIssueCode.custom,
|
|
326
|
+
path: ["writerNodeIds"],
|
|
327
|
+
message: "writerNodeIds are required when lintCommands are present",
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
export const dagFrontendReviewContextSchema = z.object({
|
|
333
|
+
schemaVersion: z.literal(1),
|
|
334
|
+
requireBaseline: z.literal(true),
|
|
335
|
+
});
|
|
336
|
+
export const ENV_VAR_NAME_PATTERN = /^[A-Z_][A-Z0-9_]*$/;
|
|
337
|
+
export const dagVersionSchema = z
|
|
338
|
+
.union([z.literal(1), z.literal(2), z.literal(3), z.literal(4)])
|
|
339
|
+
.default(1);
|
|
340
|
+
/** DagSpec v4 binding to managed TaskContractRefV1 (design §5.3.10). */
|
|
341
|
+
export const dagTaskContractBindingSchema = z
|
|
342
|
+
.object({
|
|
343
|
+
schemaVersion: z.literal(1),
|
|
344
|
+
taskId: z.string().min(1),
|
|
345
|
+
revision: z.number().int().nonnegative(),
|
|
346
|
+
projectionVersion: z.literal(1),
|
|
347
|
+
canonicalizerVersion: z.literal(1),
|
|
348
|
+
taskConfigSchemaVersion: z.literal(1),
|
|
349
|
+
canonicalHash: z
|
|
350
|
+
.string()
|
|
351
|
+
.regex(/^[a-f0-9]{64}$/, "canonicalHash must be lowercase hex"),
|
|
352
|
+
taskConfigSha256: z
|
|
353
|
+
.string()
|
|
354
|
+
.regex(/^[a-f0-9]{64}$/, "taskConfigSha256 must be lowercase hex"),
|
|
355
|
+
})
|
|
356
|
+
.strict();
|
|
357
|
+
export const dagRoleSchema = z.enum([
|
|
358
|
+
"planner",
|
|
359
|
+
"scout",
|
|
360
|
+
"implementer",
|
|
361
|
+
"reviewer",
|
|
362
|
+
"supervisor",
|
|
363
|
+
"verifier",
|
|
364
|
+
"closeout",
|
|
365
|
+
]);
|
|
366
|
+
export const dagWritePolicySchema = z.enum([
|
|
367
|
+
"read-only",
|
|
368
|
+
"docs-only",
|
|
369
|
+
"exclusive",
|
|
370
|
+
"none",
|
|
371
|
+
]);
|
|
372
|
+
/** Git/post-diff write guard intensity for exclusive Pi writers. */
|
|
373
|
+
export const dagWriteGuardPolicySchema = z.enum(["full", "tools-only"]);
|
|
374
|
+
/**
|
|
375
|
+
* Fail-closed outcome/diff consistency contract for bounded Pi writers.
|
|
376
|
+
* The writer must begin with IMPLEMENTATION_OUTCOME: changed,
|
|
377
|
+
* already-satisfied, or blocked; the executor checks it against the
|
|
378
|
+
* run-attributed diff. Declared before the dynamic child schema so the
|
|
379
|
+
* child writerOutcomePolicy optional field can reuse it without a TDZ.
|
|
380
|
+
*/
|
|
381
|
+
export const dagWriterOutcomePolicySchema = z
|
|
382
|
+
.object({
|
|
383
|
+
type: z.literal("implementation-outcome-v1"),
|
|
384
|
+
/** Generation writers may forbid already-satisfied/no-diff completion. */
|
|
385
|
+
requireChangedFiles: z.boolean().optional(),
|
|
386
|
+
})
|
|
387
|
+
.strict();
|
|
388
|
+
export const contextPolicyIdSchema = z.enum([
|
|
389
|
+
"baseline-v1",
|
|
390
|
+
"role-specialized-v1",
|
|
391
|
+
]);
|
|
392
|
+
export const dagDefaultsSchema = z
|
|
393
|
+
.object({
|
|
394
|
+
executor: dagNodeExecutorSchema.optional(),
|
|
395
|
+
model: z.string().optional(),
|
|
396
|
+
piBackend: z.enum(["sdk-first", "cli-only"]).optional(),
|
|
397
|
+
contextProfile: z.string().optional(),
|
|
398
|
+
/** Eval Lab ContextPolicy seam; default baseline-v1 when omitted. */
|
|
399
|
+
contextPolicyId: contextPolicyIdSchema.optional(),
|
|
400
|
+
skills: z.array(z.string()).optional(),
|
|
401
|
+
writePolicy: dagWritePolicySchema.optional(),
|
|
402
|
+
/** Adaptive liveness thresholds for Pi node supervision. */
|
|
403
|
+
livenessPolicy: dagLivenessPolicySchema,
|
|
404
|
+
})
|
|
405
|
+
.optional();
|
|
406
|
+
export const dagNodeStatusSchema = z.enum([
|
|
407
|
+
"PENDING",
|
|
408
|
+
"RUNNING",
|
|
409
|
+
"FINISHED",
|
|
410
|
+
"ERROR",
|
|
411
|
+
"SKIPPED",
|
|
412
|
+
]);
|
|
413
|
+
export const dagBackendTestPipelineSchema = z.enum([
|
|
414
|
+
"contracts",
|
|
415
|
+
"semantic-initial",
|
|
416
|
+
"execute-parse-initial",
|
|
417
|
+
"classification-result-context",
|
|
418
|
+
"markdown-environment",
|
|
419
|
+
"markdown-cases",
|
|
420
|
+
"markdown-collection-assess",
|
|
421
|
+
"markdown-collection-effective",
|
|
422
|
+
"markdown-traceability",
|
|
423
|
+
"markdown-scenario-param",
|
|
424
|
+
"markdown-execute-html",
|
|
425
|
+
"markdown-manifest",
|
|
426
|
+
"markdown-report",
|
|
427
|
+
"ingest-backend-test-gap",
|
|
428
|
+
]);
|
|
429
|
+
export const dagFrontendBrowserToolPreflightSchema = z.object({}).strict();
|
|
430
|
+
export const dagFrontendTestEvidenceValidationSchema = z.object({}).strict();
|
|
431
|
+
export const dagFrontendTestCaseChecklistSchema = z.object({}).strict();
|
|
432
|
+
export const dagFrontendTestHtmlReportSchema = z.object({}).strict();
|
|
433
|
+
/**
|
|
434
|
+
* Combined checklist + manifest materialization gate (lean frontend-test DAG).
|
|
435
|
+
* Runs the mechanical frontend case checklist first, then atomically
|
|
436
|
+
* materializes testcase/frontend/cases/manifest.json from manifest.draft.json.
|
|
437
|
+
* Stdout is exactly one final JSON line {cases}.
|
|
438
|
+
*/
|
|
439
|
+
export const dagFrontendTestCaseManifestSchema = z
|
|
440
|
+
.object({
|
|
441
|
+
maxCases: z.number().int().min(1).optional(),
|
|
442
|
+
declaredAcIds: z.array(z.string()).optional(),
|
|
443
|
+
})
|
|
444
|
+
.strict();
|
|
445
|
+
/**
|
|
446
|
+
* Combined evidence validation + result materialization gate (lean frontend-test DAG).
|
|
447
|
+
* Runs deterministic evidence validation first (advisory on missing/malformed,
|
|
448
|
+
* hard-fail on path escape), then materializes frontend-test-result-v1.
|
|
449
|
+
*/
|
|
450
|
+
export const dagFrontendTestResultFinalizeSchema = z
|
|
451
|
+
.object({
|
|
452
|
+
declaredAcIds: z.array(z.string()).optional(),
|
|
453
|
+
})
|
|
454
|
+
.strict();
|
|
455
|
+
/**
|
|
456
|
+
* Combined reports gate (lean frontend-test DAG). Renders the deterministic
|
|
457
|
+
* frontend L-5 dashboard (when l5 is true, the default) and then the main
|
|
458
|
+
* frontend-test Markdown + self-contained HTML report from frontend-test-result-v1.
|
|
459
|
+
*/
|
|
460
|
+
export const dagFrontendTestReportsSchema = z
|
|
461
|
+
.object({
|
|
462
|
+
l5: z.boolean().optional(),
|
|
463
|
+
})
|
|
464
|
+
.strict();
|
|
465
|
+
export const dagFinalWriteSetApprovalGateSchema = z
|
|
466
|
+
.object({
|
|
467
|
+
writerNodeId: z
|
|
468
|
+
.string()
|
|
469
|
+
.regex(/^[a-z][a-z0-9-]*$/, "writerNodeId must be kebab-case"),
|
|
470
|
+
})
|
|
471
|
+
.strict();
|
|
472
|
+
export const dagMavenWorkspaceManifestSchema = z.object({
|
|
473
|
+
files: z.array(z.object({
|
|
474
|
+
path: z.string(),
|
|
475
|
+
size: z.number(),
|
|
476
|
+
mtimeMs: z.number(),
|
|
477
|
+
})),
|
|
478
|
+
directories: z.array(z.object({
|
|
479
|
+
path: z.string(),
|
|
480
|
+
entryNames: z.array(z.string()),
|
|
481
|
+
})),
|
|
482
|
+
});
|
|
483
|
+
export const dagMavenVerificationPlanSchema = z.object({
|
|
484
|
+
schemaVersion: z.number().int().positive(),
|
|
485
|
+
plannerVersion: z.string().min(1),
|
|
486
|
+
fingerprint: z.string().min(1),
|
|
487
|
+
inputDigest: z.string().min(1),
|
|
488
|
+
targets: z.array(z.object({
|
|
489
|
+
pomPath: z.string().min(1),
|
|
490
|
+
artifactId: z.string().min(1),
|
|
491
|
+
reactorRootPomPath: z.string().min(1).optional(),
|
|
492
|
+
moduleCoordinate: z.string().min(1).optional(),
|
|
493
|
+
})),
|
|
494
|
+
commandDigests: z.array(z.string()),
|
|
495
|
+
plannedCommands: z.array(z.object({
|
|
496
|
+
label: z.string(),
|
|
497
|
+
args: z.array(z.string()),
|
|
498
|
+
})),
|
|
499
|
+
workspaceManifest: dagMavenWorkspaceManifestSchema.optional(),
|
|
500
|
+
shellCommandDigests: z.array(z.string()).optional(),
|
|
501
|
+
});
|
|
502
|
+
export const dagShellConfigSchema = z.object({
|
|
503
|
+
commands: z.array(z.string()).default([]),
|
|
504
|
+
preset: dagShellPresetSchema.optional(),
|
|
505
|
+
verdictGate: dagVerdictGateSchema.optional(),
|
|
506
|
+
projectGovernanceGate: z
|
|
507
|
+
.object({
|
|
508
|
+
contextPath: z.literal(".runtime/project-governance-context.json"),
|
|
509
|
+
})
|
|
510
|
+
.strict()
|
|
511
|
+
.optional(),
|
|
512
|
+
requirementCoverageGate: dagRequirementCoverageGateSchema.optional(),
|
|
513
|
+
jsonArtifactGate: dagJsonArtifactGateSchema.optional(),
|
|
514
|
+
frontendPrewriteGate: dagFrontendPrewriteGateSchema.optional(),
|
|
515
|
+
frontendLintBaseline: dagFrontendLintBaselineSchema.optional(),
|
|
516
|
+
frontendVerificationBundle: dagFrontendVerificationBundleSchema.optional(),
|
|
517
|
+
frontendReviewContext: dagFrontendReviewContextSchema.optional(),
|
|
518
|
+
frontendTestCaseChecklist: dagFrontendTestCaseChecklistSchema.optional(),
|
|
519
|
+
frontendBrowserToolPreflight: dagFrontendBrowserToolPreflightSchema.optional(),
|
|
520
|
+
frontendTestEvidenceValidation: dagFrontendTestEvidenceValidationSchema.optional(),
|
|
521
|
+
finalWriteSetApprovalGate: dagFinalWriteSetApprovalGateSchema.optional(),
|
|
522
|
+
frontendTestL5Report: z.object({}).strict().optional(),
|
|
523
|
+
frontendTestHtmlReport: dagFrontendTestHtmlReportSchema.optional(),
|
|
524
|
+
frontendTestCaseManifest: dagFrontendTestCaseManifestSchema.optional(),
|
|
525
|
+
frontendTestResultFinalize: dagFrontendTestResultFinalizeSchema.optional(),
|
|
526
|
+
frontendTestReports: dagFrontendTestReportsSchema.optional(),
|
|
527
|
+
backendTestPipeline: dagBackendTestPipelineSchema.optional(),
|
|
528
|
+
/** JaCoCo coverage collection for backend-test (Java services). When set, node 7 dumps coverage over TCP from a JaCoCo tcpserver agent and feeds it to the L-5 dashboard. */
|
|
529
|
+
jacocoCoverage: z
|
|
530
|
+
.object({
|
|
531
|
+
/** JaCoCo tcpserver endpoint, e.g. "host:6300". */
|
|
532
|
+
endpoint: z.string().min(1),
|
|
533
|
+
/** Absolute path to jacococli.jar on this machine, used to convert .exec → jacoco.xml. */
|
|
534
|
+
cliJarPath: z.string().min(1),
|
|
535
|
+
/** Business package filter passed to JaCoCo includes, e.g. "com.example.*". Defaults to "*". */
|
|
536
|
+
includes: z.string().min(1).optional().default("*"),
|
|
537
|
+
/** TCP connect timeout in ms. Defaults to 5000. */
|
|
538
|
+
connectTimeoutMs: z.number().int().positive().optional().default(5000),
|
|
539
|
+
})
|
|
540
|
+
.strict()
|
|
541
|
+
.optional(),
|
|
542
|
+
verifyEvidence: dagShellVerifyEvidenceSchema.optional(),
|
|
543
|
+
repairArtifactGate: dagRepairArtifactGateSchema.optional(),
|
|
544
|
+
/** fail (default): any nonzero command fails the node. record: finish node FINISHED with failure facts for downstream assess/repair. */
|
|
545
|
+
nonZeroExitPolicy: z.enum(["fail", "record"]).optional(),
|
|
546
|
+
/**
|
|
547
|
+
* When true/omitted, stop after the first failed command (runtime default true).
|
|
548
|
+
* When false, continue executing remaining commands and aggregate failures.
|
|
549
|
+
* Optional on the schema so existing shell literals stay valid; executor applies default.
|
|
550
|
+
*/
|
|
551
|
+
failFast: z.boolean().optional(),
|
|
552
|
+
envAllowlist: z.array(z.string()).optional(),
|
|
553
|
+
timeoutMs: z.number().optional(),
|
|
554
|
+
cwd: z.string().optional(),
|
|
555
|
+
/** Frozen Maven verification plan; shell executor re-checks fingerprint before running. */
|
|
556
|
+
mavenVerificationPlan: dagMavenVerificationPlanSchema.optional(),
|
|
557
|
+
});
|
|
558
|
+
export const dagStaticConfigSchema = z.object({
|
|
559
|
+
resultMarkdown: z.string().min(1),
|
|
560
|
+
status: z.enum(["success", "error"]).optional(),
|
|
561
|
+
});
|
|
562
|
+
export const dagDynamicExpansionChildTaskSchema = z.object({
|
|
563
|
+
executor: dagNodeExecutorSchema.default("pi"),
|
|
564
|
+
role: dagRoleSchema.optional(),
|
|
565
|
+
skills: z.array(z.string()).optional(),
|
|
566
|
+
complexity: dagComplexitySchema.default("LOW"),
|
|
567
|
+
subtaskPromptTemplate: z.string().min(1),
|
|
568
|
+
outputContract: z.string().optional(),
|
|
569
|
+
staticResultTemplate: z.string().optional(),
|
|
570
|
+
toolProfile: dagToolProfileSchema.optional(),
|
|
571
|
+
commandPolicy: dagCommandPolicySchema.optional(),
|
|
572
|
+
writePolicy: dagWritePolicySchema.optional(),
|
|
573
|
+
allowedPaths: z.array(z.string()).optional().default([]),
|
|
574
|
+
forbiddenPaths: z.array(z.string()).optional().default([]),
|
|
575
|
+
writeSet: z.array(z.string()).optional(),
|
|
576
|
+
/**
|
|
577
|
+
* Materialized-child pass-through fields for bounded Pi writer children
|
|
578
|
+
* (backend-test md/pytest case sharding). All optional so legacy
|
|
579
|
+
* read-only/frontend map children (which never set these) keep parsing.
|
|
580
|
+
*/
|
|
581
|
+
writerOutcomePolicy: dagWriterOutcomePolicySchema.optional(),
|
|
582
|
+
writeGuardPolicy: dagWriteGuardPolicySchema.optional(),
|
|
583
|
+
retryPolicy: dagRetryPolicySchema.optional(),
|
|
584
|
+
});
|
|
585
|
+
export const dagDynamicExpansionSchema = z.object({
|
|
586
|
+
type: z.enum(["map_agent", "verify_agent"]),
|
|
587
|
+
workflowNodeId: z
|
|
588
|
+
.string()
|
|
589
|
+
.regex(/^[a-z][a-z0-9-]*$/, "workflowNodeId must be kebab-case"),
|
|
590
|
+
itemsFrom: z.string().min(1),
|
|
591
|
+
itemName: z.string().min(1).default("item"),
|
|
592
|
+
maxItems: z.number().int().positive(),
|
|
593
|
+
maxExpandedNodes: z.number().int().positive(),
|
|
594
|
+
workspaceTemplate: z.string().min(1).optional(),
|
|
595
|
+
childIdPrefix: z
|
|
596
|
+
.string()
|
|
597
|
+
.regex(/^[a-z][a-z0-9-]*$/, "childIdPrefix must be kebab-case"),
|
|
598
|
+
childTask: dagDynamicExpansionChildTaskSchema,
|
|
599
|
+
tokenBudget: z
|
|
600
|
+
.object({
|
|
601
|
+
maxTokensPerCase: z.number().int().positive().optional(),
|
|
602
|
+
maxTotalTokens: z.number().int().positive().optional(),
|
|
603
|
+
})
|
|
604
|
+
.optional(),
|
|
605
|
+
/**
|
|
606
|
+
* When true, any child blocked by the aggregate token budget fails the map
|
|
607
|
+
* barrier instead of being retained as a case-level blocked outcome.
|
|
608
|
+
* Backend-test enables this because partial Markdown/pytest module sets are
|
|
609
|
+
* invalid generation assets; frontend-test keeps the default false.
|
|
610
|
+
*/
|
|
611
|
+
failOnTokenBudgetExhaustion: z.boolean().optional(),
|
|
612
|
+
/**
|
|
613
|
+
* When true, map child ERROR/auth/timeout is recorded as case-level
|
|
614
|
+
* failed/blocked evidence and the map barrier still succeeds (frontend-test).
|
|
615
|
+
* Default false: any non-budget child failure fails the map aggregate
|
|
616
|
+
* (sharded migration and other map_agent workflows).
|
|
617
|
+
*/
|
|
618
|
+
tolerateChildFailures: z.boolean().optional(),
|
|
619
|
+
});
|
|
620
|
+
export const dagDynamicReductionSchema = z.object({
|
|
621
|
+
type: z.literal("verified_findings_report"),
|
|
622
|
+
workflowNodeId: z
|
|
623
|
+
.string()
|
|
624
|
+
.regex(/^[a-z][a-z0-9-]*$/, "workflowNodeId must be kebab-case"),
|
|
625
|
+
findingsFrom: z.string().min(1),
|
|
626
|
+
verificationsFrom: z.string().min(1),
|
|
627
|
+
refutedFindingsArtifactName: z
|
|
628
|
+
.string()
|
|
629
|
+
.min(1)
|
|
630
|
+
.default("refuted-findings.json"),
|
|
631
|
+
});
|
|
632
|
+
export const dagDynamicConditionSchema = z.object({
|
|
633
|
+
workflowNodeId: z
|
|
634
|
+
.string()
|
|
635
|
+
.regex(/^[a-z][a-z0-9-]*$/, "workflowNodeId must be kebab-case"),
|
|
636
|
+
cases: z.array(z.object({
|
|
637
|
+
when: z.string().min(1),
|
|
638
|
+
then: z
|
|
639
|
+
.string()
|
|
640
|
+
.regex(/^[a-z][a-z0-9-]*$/, "then must be a kebab-case task id"),
|
|
641
|
+
})),
|
|
642
|
+
default: z
|
|
643
|
+
.string()
|
|
644
|
+
.regex(/^[a-z][a-z0-9-]*$/, "default must be a kebab-case task id")
|
|
645
|
+
.optional(),
|
|
646
|
+
});
|
|
647
|
+
export const dagDynamicLoopBodyTaskSchema = z.object({
|
|
648
|
+
id: z.string().regex(/^[a-z][a-z0-9-]*$/, "body task id must be kebab-case"),
|
|
649
|
+
dependsOn: z.array(z.string()).default([]),
|
|
650
|
+
executor: dagNodeExecutorSchema.default("pi"),
|
|
651
|
+
role: dagRoleSchema.optional(),
|
|
652
|
+
skills: z.array(z.string()).optional(),
|
|
653
|
+
complexity: dagComplexitySchema.default("LOW"),
|
|
654
|
+
subtaskPromptTemplate: z.string().min(1),
|
|
655
|
+
outputContract: z.string().optional(),
|
|
656
|
+
staticResultTemplate: z.string().optional(),
|
|
657
|
+
toolProfile: dagToolProfileSchema.optional(),
|
|
658
|
+
commandPolicy: dagCommandPolicySchema.optional(),
|
|
659
|
+
writePolicy: dagWritePolicySchema.optional(),
|
|
660
|
+
allowedPaths: z.array(z.string()).optional().default([]),
|
|
661
|
+
forbiddenPaths: z.array(z.string()).optional().default([]),
|
|
662
|
+
writeSet: z.array(z.string()).optional(),
|
|
663
|
+
});
|
|
664
|
+
export const dagDynamicLoopUntilSchema = z.object({
|
|
665
|
+
workflowNodeId: z
|
|
666
|
+
.string()
|
|
667
|
+
.regex(/^[a-z][a-z0-9-]*$/, "workflowNodeId must be kebab-case"),
|
|
668
|
+
maxIterations: z.number().int().positive(),
|
|
669
|
+
stopWhenAny: z.array(z.string().min(1)).default([]),
|
|
670
|
+
bodyTasks: z.array(dagDynamicLoopBodyTaskSchema).min(1),
|
|
671
|
+
});
|
|
672
|
+
export const dagDecisionGateModeSchema = z.enum([
|
|
673
|
+
"record-only",
|
|
674
|
+
"pause-on-human",
|
|
675
|
+
]);
|
|
676
|
+
export const dagDecisionGateSchema = z.object({
|
|
677
|
+
enabled: z.boolean(),
|
|
678
|
+
schemaVersion: z.literal(1).optional(),
|
|
679
|
+
mode: dagDecisionGateModeSchema.optional().default("record-only"),
|
|
680
|
+
});
|
|
681
|
+
/**
|
|
682
|
+
* The final supervised audit is the sole runtime write authority for its
|
|
683
|
+
* writer. `allowedPaths` remains a ceiling; it is never a writer fallback.
|
|
684
|
+
*/
|
|
685
|
+
export const dagFinalWriteSetApprovalBindingSchema = z
|
|
686
|
+
.object({
|
|
687
|
+
schemaVersion: z.literal(1),
|
|
688
|
+
writerNodeId: z
|
|
689
|
+
.string()
|
|
690
|
+
.regex(/^[a-z][a-z0-9-]*$/, "writerNodeId must be kebab-case"),
|
|
691
|
+
approvalSourceNodeId: z
|
|
692
|
+
.string()
|
|
693
|
+
.regex(/^[a-z][a-z0-9-]*$/, "approvalSourceNodeId must be kebab-case"),
|
|
694
|
+
auditedPlanNodeId: z
|
|
695
|
+
.string()
|
|
696
|
+
.regex(/^[a-z][a-z0-9-]*$/, "auditedPlanNodeId must be kebab-case"),
|
|
697
|
+
})
|
|
698
|
+
.strict();
|
|
699
|
+
export const dagConvergenceSpecSchema = z
|
|
700
|
+
.object({
|
|
701
|
+
enabled: z.boolean().optional().default(false),
|
|
702
|
+
maxPasses: z.number().int().positive().optional().default(3),
|
|
703
|
+
stopOnVerdictPass: z.boolean().optional().default(true),
|
|
704
|
+
stopOnHardVerifyPass: z.boolean().optional().default(true),
|
|
705
|
+
pauseOnRegression: z.boolean().optional().default(true),
|
|
706
|
+
chainNodeIds: z.array(z.string()).optional(),
|
|
707
|
+
})
|
|
708
|
+
.optional();
|
|
709
|
+
/**
|
|
710
|
+
* Schema ids that may opt a node into producing-node structured contract
|
|
711
|
+
* self-validation. Validators are registered in the contract output registry
|
|
712
|
+
* (src/workflows/dag/contract-output-registry.ts).
|
|
713
|
+
*/
|
|
714
|
+
export const structuredContractOutputSchemaIds = [
|
|
715
|
+
"frontend-implementation-contract-v1",
|
|
716
|
+
"frontend-implementation-contract-plan-patch-v1",
|
|
717
|
+
"frontend-implementation-contract-revision-patch-v1",
|
|
718
|
+
];
|
|
719
|
+
export const dagTaskSchema = z.object({ id: z.string().regex(/^[a-z][a-z0-9-]*$/, "task id must be kebab-case"),
|
|
720
|
+
depends_on: z.array(z.string()).default([]),
|
|
721
|
+
/**
|
|
722
|
+
* How SKIPPED upstreams affect readiness.
|
|
723
|
+
* - all (default): any SKIPPED/ERROR dependency blocks (cascade exclusive branches)
|
|
724
|
+
* - all-or-condition-skip: condition-branch SKIPPED tips count as soft; node runs when
|
|
725
|
+
* every dep is FINISHED or soft condition-skip and at least one is FINISHED (OR-join)
|
|
726
|
+
*/
|
|
727
|
+
dependsPolicy: z.enum(["all", "all-or-condition-skip"]).optional(),
|
|
728
|
+
/**
|
|
729
|
+
* Explicit opt-in: upstream node ids whose ERROR terminal state, or whose
|
|
730
|
+
* failure-derived SKIPPED state, this read-only node may consume as settled
|
|
731
|
+
* failure evidence. Validation
|
|
732
|
+
* restricts this to read-only Pi recovery/diagnosis/closeout nodes; writers,
|
|
733
|
+
* shell verifiers, hard gates, and dynamic/decision nodes remain fail-closed.
|
|
734
|
+
* Every id must also appear in depends_on.
|
|
735
|
+
*/
|
|
736
|
+
failureAwareDependsOn: z.array(z.string()).optional(),
|
|
737
|
+
/** Execute only when this fail-closed condition resolves true after dependencies settle. */
|
|
738
|
+
runIf: z.string().min(1).optional(),
|
|
739
|
+
complexity: dagComplexitySchema,
|
|
740
|
+
subtask_prompt: z.string().min(1),
|
|
741
|
+
subtask_prompt_source: z
|
|
742
|
+
.object({
|
|
743
|
+
type: z.literal("markdown"),
|
|
744
|
+
path: z.string().min(1),
|
|
745
|
+
sha256: z.string().min(1),
|
|
746
|
+
})
|
|
747
|
+
.optional(),
|
|
748
|
+
executor: dagNodeExecutorSchema.optional().default("pi"),
|
|
749
|
+
role: dagRoleSchema.optional(),
|
|
750
|
+
skills: z.array(z.string()).optional(),
|
|
751
|
+
toolProfile: dagToolProfileSchema.optional(),
|
|
752
|
+
/** Default deny: file write (toolProfile=write) does not grant command execution. */
|
|
753
|
+
commandPolicy: dagCommandPolicySchema.optional(),
|
|
754
|
+
writePolicy: dagWritePolicySchema.optional(),
|
|
755
|
+
writeSet: z.array(z.string()).optional(),
|
|
756
|
+
piStep: z.string().optional(),
|
|
757
|
+
shell: dagShellConfigSchema.optional(),
|
|
758
|
+
static: dagStaticConfigSchema.optional(),
|
|
759
|
+
outputContract: z.string().optional(),
|
|
760
|
+
outputMode: dagOutputModeSchema.optional(),
|
|
761
|
+
firstProtocolLine: z.string().min(1).optional(),
|
|
762
|
+
/**
|
|
763
|
+
* Machine-readable output protocol (phase 1: first-line-enum).
|
|
764
|
+
* When set with retryOnInvalid, protocol-invalid failures may auto-retry
|
|
765
|
+
* on safe read-only Pi nodes before the node becomes ERROR.
|
|
766
|
+
*/
|
|
767
|
+
outputProtocol: dagOutputProtocolSchema.optional(),
|
|
768
|
+
/**
|
|
769
|
+
* Node-level structured contract self-check: after the Pi output is
|
|
770
|
+
* produced, validate it against the named contract schema at the node so
|
|
771
|
+
* schema/typo/null violations become invalid-output (retryable on the node)
|
|
772
|
+
* instead of failing later at a downstream deterministic gate. Validators
|
|
773
|
+
* are resolved via the contract output registry keyed by schemaId.
|
|
774
|
+
*/
|
|
775
|
+
structuredContractOutput: z
|
|
776
|
+
.object({
|
|
777
|
+
schemaId: z.enum(structuredContractOutputSchemaIds),
|
|
778
|
+
retryOnInvalid: z.boolean().default(true),
|
|
779
|
+
/**
|
|
780
|
+
* Optional deterministic base object for patch-producing structured
|
|
781
|
+
* nodes. The frontend plan patch validator applies the model delta to
|
|
782
|
+
* this run-owned skeleton before strict contract validation.
|
|
783
|
+
*/
|
|
784
|
+
skeleton: z.record(z.string(), z.unknown()).optional(),
|
|
785
|
+
})
|
|
786
|
+
.strict()
|
|
787
|
+
.superRefine((value, ctx) => {
|
|
788
|
+
if (value.schemaId ===
|
|
789
|
+
"frontend-implementation-contract-plan-patch-v1" &&
|
|
790
|
+
!value.skeleton) {
|
|
791
|
+
ctx.addIssue({
|
|
792
|
+
code: "custom",
|
|
793
|
+
message: "frontend plan patch output requires a runtime skeleton",
|
|
794
|
+
path: ["skeleton"],
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
})
|
|
798
|
+
.optional(),
|
|
799
|
+
/**
|
|
800
|
+
* Fail-closed outcome/diff consistency contract for bounded Pi writers.
|
|
801
|
+
* The writer must begin with IMPLEMENTATION_OUTCOME: changed,
|
|
802
|
+
* already-satisfied, or blocked; the executor checks it against the
|
|
803
|
+
* run-attributed diff.
|
|
804
|
+
*/
|
|
805
|
+
writerOutcomePolicy: dagWriterOutcomePolicySchema.optional(),
|
|
806
|
+
/** full (default): git baseline + post-diff write-guard. tools-only: keep tool sandbox, skip git baseline/post-diff hard fail (frontend-test). */
|
|
807
|
+
writeGuardPolicy: dagWriteGuardPolicySchema.optional(),
|
|
808
|
+
/** Required for supervised writers that consume a final audited writeSet. */
|
|
809
|
+
finalWriteSetApproval: dagFinalWriteSetApprovalBindingSchema.optional(),
|
|
810
|
+
/** Runtime-only authorization facts injected after final approval validation. */
|
|
811
|
+
resolvedFinalWriteSetApproval: z
|
|
812
|
+
.object({
|
|
813
|
+
approvalDigest: z.string().regex(/^[a-f0-9]{64}$/),
|
|
814
|
+
approvalSourceNodeId: z.string().min(1),
|
|
815
|
+
})
|
|
816
|
+
.strict()
|
|
817
|
+
.optional(),
|
|
818
|
+
/**
|
|
819
|
+
* Explicit opt-in for the deterministic project governance context resolver
|
|
820
|
+
* (AGENTS.md chain + referenced code standards). Only tasks that set this
|
|
821
|
+
* to `true` receive a `<project_governance_context>` prompt section and
|
|
822
|
+
* closeout-blocking gate behavior. Never inferred from role/name.
|
|
823
|
+
*/
|
|
824
|
+
governanceStandardReview: z.boolean().optional(),
|
|
825
|
+
allowedPaths: z.array(z.string()).optional().default([]),
|
|
826
|
+
forbiddenPaths: z.array(z.string()).optional().default([]),
|
|
827
|
+
decisionGate: dagDecisionGateSchema.optional(),
|
|
828
|
+
retryPolicy: dagRetryPolicySchema.optional(),
|
|
829
|
+
/** Optional per-node adaptive liveness override (merged over defaults). */
|
|
830
|
+
livenessPolicy: dagLivenessPolicySchema,
|
|
831
|
+
dynamicExpansion: dagDynamicExpansionSchema.optional(),
|
|
832
|
+
dynamicReduction: dagDynamicReductionSchema.optional(),
|
|
833
|
+
dynamicCondition: dagDynamicConditionSchema.optional(),
|
|
834
|
+
dynamicLoopUntil: dagDynamicLoopUntilSchema.optional(),
|
|
835
|
+
});
|
|
836
|
+
export const dagModelsSchema = z
|
|
837
|
+
.object({
|
|
838
|
+
HIGH: z.string().optional(),
|
|
839
|
+
MED: z.string().optional(),
|
|
840
|
+
LOW: z.string().optional(),
|
|
841
|
+
})
|
|
842
|
+
.partial();
|
|
843
|
+
export const dagExecutorModelsSchema = z
|
|
844
|
+
.object({
|
|
845
|
+
pi: dagModelsSchema.optional(),
|
|
846
|
+
})
|
|
847
|
+
.strict();
|
|
848
|
+
export const dagOutputLanguageSchema = z.enum(["zh-CN", "en"]);
|
|
849
|
+
export const DEFAULT_DAG_OUTPUT_LANGUAGE = "zh-CN";
|
|
850
|
+
export const dagEvaluationBindingSchema = z
|
|
851
|
+
.object({
|
|
852
|
+
campaignId: z.string().min(1),
|
|
853
|
+
candidateId: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/),
|
|
854
|
+
bundleHash: z.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
855
|
+
seed: z.number().int().nonnegative(),
|
|
856
|
+
split: z.enum(["public", "private", "held_out"]).optional(),
|
|
857
|
+
taskRef: z.string().min(1).optional(),
|
|
858
|
+
})
|
|
859
|
+
.strict();
|
|
860
|
+
/** Eval Lab Campaign Budget (W3.4); enforced by runner ledger when mode=hard. */
|
|
861
|
+
export const dagBudgetSchema = campaignBudgetSchema;
|
|
862
|
+
export const dagSourceBindingSchema = z.object({
|
|
863
|
+
schemaVersion: z.literal(1),
|
|
864
|
+
taskId: z.string().min(1),
|
|
865
|
+
sources: z
|
|
866
|
+
.array(z.object({
|
|
867
|
+
kind: z.enum(["requirement", "constraint", "reference"]),
|
|
868
|
+
path: z.string().min(1),
|
|
869
|
+
sha256: z
|
|
870
|
+
.string()
|
|
871
|
+
.regex(/^[a-f0-9]{64}$/, "sha256 must be lowercase hex"),
|
|
872
|
+
}))
|
|
873
|
+
.min(1),
|
|
874
|
+
requirementIds: z.array(z.string().regex(/^(?:REQ|BR|AC)-[A-Z0-9]+(?:-[A-Z0-9]+)*$/)),
|
|
875
|
+
});
|
|
876
|
+
export const dagSpecSchema = z
|
|
877
|
+
.object({
|
|
878
|
+
version: dagVersionSchema,
|
|
879
|
+
title: z.string().min(1),
|
|
880
|
+
runtimeContract: dagRuntimeContractSchema.optional(),
|
|
881
|
+
evaluation: dagEvaluationBindingSchema.optional(),
|
|
882
|
+
/** Optional hard/record-only budget; requires version 3 or 4. */
|
|
883
|
+
budget: dagBudgetSchema.optional(),
|
|
884
|
+
sourceBinding: dagSourceBindingSchema.optional(),
|
|
885
|
+
/** v4 managed Task Contract binding; only valid on version 4. */
|
|
886
|
+
taskContractBinding: dagTaskContractBindingSchema.optional(),
|
|
887
|
+
/** Frozen backend-test artifact layout (plan A); absent = historical default testcase/ layout. */
|
|
888
|
+
backendTestLayout: z
|
|
889
|
+
.object({
|
|
890
|
+
testRoot: z.string(),
|
|
891
|
+
markdownRel: z.string(),
|
|
892
|
+
scriptRel: z.string(),
|
|
893
|
+
markdownDir: z.string(),
|
|
894
|
+
scriptDir: z.string(),
|
|
895
|
+
readmePath: z.string(),
|
|
896
|
+
isDefault: z.boolean(),
|
|
897
|
+
})
|
|
898
|
+
.optional(),
|
|
899
|
+
/** Bound user shared-setup document (plan B); absent = no shared setup references expected. */
|
|
900
|
+
backendTestSharedSetup: z
|
|
901
|
+
.object({
|
|
902
|
+
path: z.string(),
|
|
903
|
+
readPath: z.string(),
|
|
904
|
+
sha256: z.string(),
|
|
905
|
+
})
|
|
906
|
+
.optional(),
|
|
907
|
+
outputLanguage: dagOutputLanguageSchema.optional(),
|
|
908
|
+
objective: z.string().optional(),
|
|
909
|
+
successCriteria: z.array(z.string()).optional(),
|
|
910
|
+
globalConstraints: z.array(z.string()).optional(),
|
|
911
|
+
convergence: dagConvergenceSpecSchema,
|
|
912
|
+
verifyStrategy: dagVerifyStrategySchema,
|
|
913
|
+
defaults: dagDefaultsSchema,
|
|
914
|
+
skillsByRole: z.record(z.string(), z.array(z.string())).optional(),
|
|
915
|
+
executorModels: dagExecutorModelsSchema.optional(),
|
|
916
|
+
/** Generation-time advisories surfaced as machine-visible warnings. */
|
|
917
|
+
advisories: z.array(z.string()).optional(),
|
|
918
|
+
tasks: z.array(dagTaskSchema).min(1),
|
|
919
|
+
})
|
|
920
|
+
.superRefine((spec, ctx) => {
|
|
921
|
+
const supportsV3Fields = spec.version === 3 || spec.version === 4;
|
|
922
|
+
if (spec.evaluation && !supportsV3Fields) {
|
|
923
|
+
ctx.addIssue({
|
|
924
|
+
code: z.ZodIssueCode.custom,
|
|
925
|
+
message: "evaluation requires DagSpec version 3 or 4",
|
|
926
|
+
path: ["evaluation"],
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
if (spec.budget && !supportsV3Fields) {
|
|
930
|
+
ctx.addIssue({
|
|
931
|
+
code: z.ZodIssueCode.custom,
|
|
932
|
+
message: "budget requires DagSpec version 3 or 4",
|
|
933
|
+
path: ["budget"],
|
|
934
|
+
});
|
|
935
|
+
}
|
|
936
|
+
if (spec.runtimeContract && !supportsV3Fields) {
|
|
937
|
+
ctx.addIssue({
|
|
938
|
+
code: z.ZodIssueCode.custom,
|
|
939
|
+
message: "runtimeContract requires DagSpec version 3 or 4",
|
|
940
|
+
path: ["version"],
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
if (supportsV3Fields && !spec.runtimeContract) {
|
|
944
|
+
ctx.addIssue({
|
|
945
|
+
code: z.ZodIssueCode.custom,
|
|
946
|
+
message: `DagSpec version ${spec.version} requires runtimeContract`,
|
|
947
|
+
path: ["runtimeContract"],
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
if (spec.taskContractBinding && spec.version !== 4) {
|
|
951
|
+
ctx.addIssue({
|
|
952
|
+
code: z.ZodIssueCode.custom,
|
|
953
|
+
message: "taskContractBinding requires DagSpec version 4",
|
|
954
|
+
path: ["taskContractBinding"],
|
|
955
|
+
});
|
|
956
|
+
}
|
|
957
|
+
if (spec.version === 4) {
|
|
958
|
+
if (!spec.sourceBinding) {
|
|
959
|
+
ctx.addIssue({
|
|
960
|
+
code: z.ZodIssueCode.custom,
|
|
961
|
+
message: "DagSpec version 4 requires sourceBinding",
|
|
962
|
+
path: ["sourceBinding"],
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
if (!spec.taskContractBinding) {
|
|
966
|
+
ctx.addIssue({
|
|
967
|
+
code: z.ZodIssueCode.custom,
|
|
968
|
+
message: "DagSpec version 4 requires taskContractBinding",
|
|
969
|
+
path: ["taskContractBinding"],
|
|
970
|
+
});
|
|
971
|
+
}
|
|
972
|
+
if (!spec.runtimeContract) {
|
|
973
|
+
ctx.addIssue({
|
|
974
|
+
code: z.ZodIssueCode.custom,
|
|
975
|
+
message: "DagSpec version 4 requires runtimeContract",
|
|
976
|
+
path: ["runtimeContract"],
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
// Catch raw cursor keys that Zod .strict() on nested objects already rejects when parsed
|
|
981
|
+
// via parseDagSpec; this refine covers typed object construction paths.
|
|
982
|
+
const models = spec.executorModels;
|
|
983
|
+
if (models && "cursor" in models) {
|
|
984
|
+
ctx.addIssue({
|
|
985
|
+
code: z.ZodIssueCode.custom,
|
|
986
|
+
message: CURSOR_EXECUTOR_MODELS_REMOVED_ERROR,
|
|
987
|
+
path: ["executorModels", "cursor"],
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
});
|
|
991
|
+
export const FRONTEND_RECOVERY_STATE_SCHEMA_VERSION = 1;
|
|
992
|
+
export const FRONTEND_RECOVERY_RESULT_SCHEMA_VERSION = 1;
|
|
993
|
+
/**
|
|
994
|
+
* Frontend candidate-continuation recovery phase (decision B, phase-3 subset).
|
|
995
|
+
* Phase 3a parents converge first, so `rollback-pending` is not produced and
|
|
996
|
+
* was removed by AC-1; the phase starts at `child-staging` and ends at
|
|
997
|
+
* `settled`.
|
|
998
|
+
*/
|
|
999
|
+
export const frontendRecoveryPhaseSchema = z.enum([
|
|
1000
|
+
"child-staging",
|
|
1001
|
+
"child-activating",
|
|
1002
|
+
"child-running",
|
|
1003
|
+
"settled",
|
|
1004
|
+
]);
|
|
1005
|
+
/**
|
|
1006
|
+
* Single-writer recovery intent/lineage stored on `DagRunState`. The parent run
|
|
1007
|
+
* owns the authoritative copy and advances it via revision-guarded CAS writes;
|
|
1008
|
+
* the child carries a frozen lineage snapshot so the activation gate can prove
|
|
1009
|
+
* it is the reserved child of a child-running parent.
|
|
1010
|
+
*
|
|
1011
|
+
* Invariants: `attemptIndex ∈ {0,1}`; `continuationCount ∈ {0,1}`; a child's
|
|
1012
|
+
* `recoveryRootRunId` always equals the root runId; `revision` is the CAS
|
|
1013
|
+
* pre-comparison counter. `revision` monotonicity is enforced at runtime by the
|
|
1014
|
+
* runner's `(existing?.revision ?? 0) + 1` CAS write (the schema only bounds it
|
|
1015
|
+
* non-negative). `childRunId` may be absent through `child-activating` and must
|
|
1016
|
+
* be non-empty from `child-running` onward.
|
|
1017
|
+
*/
|
|
1018
|
+
export const frontendRecoveryStateSchema = z
|
|
1019
|
+
.object({
|
|
1020
|
+
schemaVersion: z.literal(FRONTEND_RECOVERY_STATE_SCHEMA_VERSION),
|
|
1021
|
+
phase: frontendRecoveryPhaseSchema,
|
|
1022
|
+
requestId: z.string().min(1),
|
|
1023
|
+
recoveryRootRunId: z.string().min(1),
|
|
1024
|
+
parentRunId: z.string().min(1),
|
|
1025
|
+
childRunId: z.string().min(1).optional(),
|
|
1026
|
+
attemptId: z.string().min(1),
|
|
1027
|
+
attemptIndex: z.number().int().min(0).max(1),
|
|
1028
|
+
continuationCount: z.number().int().min(0).max(1),
|
|
1029
|
+
/** Node id of the reset-closure root: frontend-plan-pi /
|
|
1030
|
+
* frontend-plan-revision-pi / frontend-prewrite-gate-shell /
|
|
1031
|
+
* frontend-implement-pi (writer partial write). */
|
|
1032
|
+
failureSource: z.string().min(1).optional(),
|
|
1033
|
+
revision: z.number().int().nonnegative(),
|
|
1034
|
+
})
|
|
1035
|
+
.strict()
|
|
1036
|
+
.superRefine((value, ctx) => {
|
|
1037
|
+
const requiresChild = value.phase === "child-running" || value.phase === "settled";
|
|
1038
|
+
if (requiresChild && !value.childRunId) {
|
|
1039
|
+
ctx.addIssue({
|
|
1040
|
+
code: z.ZodIssueCode.custom,
|
|
1041
|
+
message: `phase ${value.phase} requires a non-empty childRunId`,
|
|
1042
|
+
path: ["childRunId"],
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1045
|
+
});
|
|
1046
|
+
export const frontendRecoveryOutcomeSchema = z.enum([
|
|
1047
|
+
"none",
|
|
1048
|
+
"recovered",
|
|
1049
|
+
"candidate-contract-invalid",
|
|
1050
|
+
"prewrite-blocked",
|
|
1051
|
+
"repair-exhausted",
|
|
1052
|
+
"auto-recovery-blocked",
|
|
1053
|
+
]);
|
|
1054
|
+
export const frontendRecoveryOriginSchema = z
|
|
1055
|
+
.object({
|
|
1056
|
+
kind: z.enum(["frontend-prewrite-gate", "frontend-writer"]),
|
|
1057
|
+
parentRunId: z.string().min(1),
|
|
1058
|
+
childRunId: z.string().min(1).optional(),
|
|
1059
|
+
requestId: z.string().min(1),
|
|
1060
|
+
failedNodeId: z.string(),
|
|
1061
|
+
})
|
|
1062
|
+
.strict();
|
|
1063
|
+
export const frontendRecoveryFailureClassSchema = z
|
|
1064
|
+
.object({
|
|
1065
|
+
code: z.enum([
|
|
1066
|
+
"candidate-contract-invalid",
|
|
1067
|
+
"prewrite-blocked",
|
|
1068
|
+
"staging-failed",
|
|
1069
|
+
"writer-transient-partial-write",
|
|
1070
|
+
]),
|
|
1071
|
+
classification: z.string(),
|
|
1072
|
+
reason: z.string(),
|
|
1073
|
+
})
|
|
1074
|
+
.strict();
|
|
1075
|
+
export const frontendRecoveryEvidenceRefSchema = z
|
|
1076
|
+
.object({
|
|
1077
|
+
runId: z.string().min(1),
|
|
1078
|
+
relativePath: z.string().min(1),
|
|
1079
|
+
sha256: z.string().min(1),
|
|
1080
|
+
})
|
|
1081
|
+
.strict();
|
|
1082
|
+
/**
|
|
1083
|
+
* Terminal frontend recovery result. `failureClass` is absent for `none`,
|
|
1084
|
+
* `recovered` and `auto-recovery-blocked` outcomes. The schema intentionally
|
|
1085
|
+
* stays permissive (failureClass optional, evidenceRefs may be empty) so it
|
|
1086
|
+
* accepts the runner's actual phase-3a products, which do not always carry a
|
|
1087
|
+
* failure class or evidence reference.
|
|
1088
|
+
*/
|
|
1089
|
+
export const frontendRecoveryResultSchema = z
|
|
1090
|
+
.object({
|
|
1091
|
+
schemaVersion: z.literal(FRONTEND_RECOVERY_RESULT_SCHEMA_VERSION),
|
|
1092
|
+
outcome: frontendRecoveryOutcomeSchema,
|
|
1093
|
+
origin: frontendRecoveryOriginSchema,
|
|
1094
|
+
failureClass: frontendRecoveryFailureClassSchema.optional(),
|
|
1095
|
+
evidenceRefs: z.array(frontendRecoveryEvidenceRefSchema),
|
|
1096
|
+
})
|
|
1097
|
+
.strict();
|
|
1098
|
+
export const DEFAULT_DAG_EXECUTOR_MODELS = {
|
|
1099
|
+
pi: {
|
|
1100
|
+
LOW: "gpt-5.3-codex-spark",
|
|
1101
|
+
MED: "gpt-5.5",
|
|
1102
|
+
HIGH: "gpt-5.5",
|
|
1103
|
+
},
|
|
1104
|
+
};
|
|
1105
|
+
export const DEFAULT_DAG_PI_MODELS = DEFAULT_DAG_EXECUTOR_MODELS.pi;
|
|
1106
|
+
export const LEGACY_TOP_LEVEL_MODELS_ERROR = 'top-level "models" is no longer supported; use "executorModels"';
|
|
1107
|
+
export function parseDagSpec(raw) {
|
|
1108
|
+
assertDagPromptSourceRule(raw, { allowMarkdown: false });
|
|
1109
|
+
if (typeof raw === "object" && raw !== null && "models" in raw) {
|
|
1110
|
+
throw new Error(LEGACY_TOP_LEVEL_MODELS_ERROR);
|
|
1111
|
+
}
|
|
1112
|
+
if (typeof raw === "object" && raw !== null) {
|
|
1113
|
+
const obj = raw;
|
|
1114
|
+
const executorModels = obj.executorModels;
|
|
1115
|
+
if (typeof executorModels === "object" &&
|
|
1116
|
+
executorModels !== null &&
|
|
1117
|
+
"cursor" in executorModels) {
|
|
1118
|
+
throw new Error(CURSOR_EXECUTOR_MODELS_REMOVED_ERROR);
|
|
1119
|
+
}
|
|
1120
|
+
const tasks = obj.tasks;
|
|
1121
|
+
if (Array.isArray(tasks)) {
|
|
1122
|
+
for (const task of tasks) {
|
|
1123
|
+
if (typeof task === "object" &&
|
|
1124
|
+
task !== null &&
|
|
1125
|
+
task.executor === "cursor") {
|
|
1126
|
+
throw new Error(CURSOR_DAG_EXECUTOR_REMOVED_ERROR);
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
const defaults = obj.defaults;
|
|
1131
|
+
if (typeof defaults === "object" &&
|
|
1132
|
+
defaults !== null &&
|
|
1133
|
+
defaults.executor === "cursor") {
|
|
1134
|
+
throw new Error(CURSOR_DAG_EXECUTOR_REMOVED_ERROR);
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
return dagSpecSchema.parse(raw);
|
|
1138
|
+
}
|
|
1139
|
+
export function resolveModelForTask(task, executorModels) {
|
|
1140
|
+
if (task.executor === "shell" || task.executor === "static") {
|
|
1141
|
+
return undefined;
|
|
1142
|
+
}
|
|
1143
|
+
return (executorModels?.[task.executor]?.[task.complexity] ??
|
|
1144
|
+
DEFAULT_DAG_EXECUTOR_MODELS[task.executor][task.complexity]);
|
|
1145
|
+
}
|