@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,998 @@
|
|
|
1
|
+
import { DEFAULT_DAG_EXECUTOR_MODELS, ENV_VAR_NAME_PATTERN, dagCommandPolicyAllows, resolveDagCommandPolicy, } from "./types.js";
|
|
2
|
+
import { resolveShellCommands } from "../../executors/shell-executor.js";
|
|
3
|
+
import { pathMatchesPattern } from "../../shared/git-progress.js";
|
|
4
|
+
import { resolveRepairTaskForGate } from "./repair-artifact.js";
|
|
5
|
+
import { topoSortToRanks } from "./topo.js";
|
|
6
|
+
import { isSafeReadOnlyPiRetryCandidate, isWriterEmptyDiffRetryCandidate, isWriterTransportRetryCandidate, INCOMPLETE_WRITE_SET_RETRY_CATEGORY, WRITER_CLEAN_TIMEOUT_RETRY_CATEGORY, WRITER_EMPTY_DIFF_RETRY_CATEGORY, } from "./retry-policy.js";
|
|
7
|
+
import { isBackendTestCompletenessRetryCandidate } from "./backend-test-writer-completeness.js";
|
|
8
|
+
const GOVERNANCE_WARNING_TYPES = new Set([
|
|
9
|
+
"read-only-missing-artifacts-forbidden",
|
|
10
|
+
"read-only-prompt-mentions-artifact-writes",
|
|
11
|
+
"shell-dag-active-check-repo-without-env",
|
|
12
|
+
"shell-verdict-gate-summary-md-source",
|
|
13
|
+
"shell-verdict-gate-grep-pattern",
|
|
14
|
+
"shell-verdict-gate-multi-command-state",
|
|
15
|
+
"shell-verdict-gate-handwritten-inline",
|
|
16
|
+
"orphan-writer-source-binding",
|
|
17
|
+
"advisory",
|
|
18
|
+
]);
|
|
19
|
+
const ROOT_ARTIFACT_PATH_PROBES = [
|
|
20
|
+
"artifacts/修改记录.md",
|
|
21
|
+
"artifacts/验证结果.md",
|
|
22
|
+
"artifacts/_probe_.md",
|
|
23
|
+
];
|
|
24
|
+
const ARTIFACT_WRITE_SIGNAL_PATTERNS = [
|
|
25
|
+
"artifacts/",
|
|
26
|
+
"修改记录.md",
|
|
27
|
+
"验证结果.md",
|
|
28
|
+
];
|
|
29
|
+
function isGovernanceWarning(issue) {
|
|
30
|
+
return GOVERNANCE_WARNING_TYPES.has(issue.type);
|
|
31
|
+
}
|
|
32
|
+
export function collectGovernanceWarnings(issues) {
|
|
33
|
+
return issues.filter(isGovernanceWarning);
|
|
34
|
+
}
|
|
35
|
+
function collectBlockingIssues(issues, options = {}) {
|
|
36
|
+
const nonAdvisory = issues.filter((issue) => issue.type !== "advisory");
|
|
37
|
+
if (options.strictGovernance) {
|
|
38
|
+
return nonAdvisory;
|
|
39
|
+
}
|
|
40
|
+
return nonAdvisory.filter((issue) => !isGovernanceWarning(issue));
|
|
41
|
+
}
|
|
42
|
+
function normalizePath(value) {
|
|
43
|
+
return value.replace(/\\/g, "/").replace(/^\.\//, "");
|
|
44
|
+
}
|
|
45
|
+
function probePathsForWriteSetEntry(entry) {
|
|
46
|
+
const normalized = normalizePath(entry);
|
|
47
|
+
if (!normalized.includes("*")) {
|
|
48
|
+
return [normalized];
|
|
49
|
+
}
|
|
50
|
+
const concrete = normalized
|
|
51
|
+
.replace(/\/\*\*$/, "/_probe_")
|
|
52
|
+
.replace(/\*\*$/, "_probe_")
|
|
53
|
+
.replace(/\*/g, "_");
|
|
54
|
+
return Array.from(new Set([normalized, concrete]));
|
|
55
|
+
}
|
|
56
|
+
function writeSetEntryWithinAllowed(entry, allowedPaths) {
|
|
57
|
+
const probes = probePathsForWriteSetEntry(entry);
|
|
58
|
+
return probes.some((probe) => allowedPaths.some((allowed) => pathMatchesPattern(probe, allowed)));
|
|
59
|
+
}
|
|
60
|
+
function writeSetEntryHitsForbidden(entry, forbiddenPaths) {
|
|
61
|
+
const probes = probePathsForWriteSetEntry(entry);
|
|
62
|
+
return probes.some((probe) => forbiddenPaths.some((forbidden) => pathMatchesPattern(probe, forbidden)));
|
|
63
|
+
}
|
|
64
|
+
function forbiddenPathsExcludeRootArtifacts(forbiddenPaths) {
|
|
65
|
+
return ROOT_ARTIFACT_PATH_PROBES.some((probe) => forbiddenPaths.some((forbidden) => pathMatchesPattern(probe, forbidden)));
|
|
66
|
+
}
|
|
67
|
+
function promptMentionsRootArtifactWrite(prompt) {
|
|
68
|
+
const lower = prompt.toLowerCase();
|
|
69
|
+
for (const signal of ARTIFACT_WRITE_SIGNAL_PATTERNS) {
|
|
70
|
+
const normalizedSignal = signal.toLowerCase();
|
|
71
|
+
const index = lower.indexOf(normalizedSignal);
|
|
72
|
+
if (index === -1)
|
|
73
|
+
continue;
|
|
74
|
+
const context = lower.slice(Math.max(0, index - 48), index + 96);
|
|
75
|
+
const negated = /(do not|don't|must not|should not|禁止|不得|不要|不应).{0,48}(write|edit|modify|create|update|artifacts|修改记录|验证结果)/i.test(context) ||
|
|
76
|
+
/不(改|写|更新|创建|编辑).{0,48}(artifacts|修改记录|验证结果)/i.test(context);
|
|
77
|
+
if (negated)
|
|
78
|
+
continue;
|
|
79
|
+
const hasWriteVerb = /(write|update|create|edit|modify|save|append|record|output).{0,64}(artifacts|修改记录|验证结果)/i.test(context) ||
|
|
80
|
+
/(artifacts|修改记录|验证结果).{0,64}(write|update|create|edit|modify|save|append|record|output)/i.test(context) ||
|
|
81
|
+
/(写入|写|更新|修改|保存|追加|记录|输出).{0,64}(artifacts|修改记录|验证结果)/i.test(context) ||
|
|
82
|
+
/(artifacts|修改记录|验证结果).{0,64}(写入|写|更新|修改|保存|追加|记录|输出)/i.test(context);
|
|
83
|
+
if (hasWriteVerb) {
|
|
84
|
+
return signal;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
function shellCommandRunsCheckRepo(command) {
|
|
90
|
+
return /(^|[\s/])check-repo\.sh(\s|$)|(^|\s)bash\s+scripts\/check-repo\.sh(\s|$)/.test(command);
|
|
91
|
+
}
|
|
92
|
+
function shellCommandSetsActiveDagEnv(command) {
|
|
93
|
+
return /(^|[^A-Za-z0-9_])HARNESS_ALLOW_ACTIVE_DAG_RUNS=1(\s|;|&&|$)/.test(command);
|
|
94
|
+
}
|
|
95
|
+
function shellCommandUsesSummaryMdVerdictSource(command) {
|
|
96
|
+
return (/result\.summary\.md/.test(command) &&
|
|
97
|
+
(/\bVERDICT\b/i.test(command) ||
|
|
98
|
+
/\.harness\/dag-runs\/active/.test(command) ||
|
|
99
|
+
/\bgate\b/i.test(command)));
|
|
100
|
+
}
|
|
101
|
+
function shellCommandUsesGrepVerdictSearch(command) {
|
|
102
|
+
return (/\bgrep\b/.test(command) &&
|
|
103
|
+
(/\bVERDICT\b/.test(command) || /grep.*VERDICT|VERDICT.*grep/.test(command)));
|
|
104
|
+
}
|
|
105
|
+
function shellCommandReadsActiveOrCurrentRunJson(command) {
|
|
106
|
+
return (/\.harness\/dag-runs\/active/.test(command) ||
|
|
107
|
+
/\bHARNESS_DAG_RUN_DIR\b/.test(command) ||
|
|
108
|
+
/find\s+\.harness\/dag-runs\/active/.test(command));
|
|
109
|
+
}
|
|
110
|
+
function shellCommandUsesVerdictJsonParser(command) {
|
|
111
|
+
return (/assistantText\s*\?\?\s*raw\.stdout/.test(command) ||
|
|
112
|
+
/raw\.assistantText\s*\|\|\s*raw\.stdout/.test(command) ||
|
|
113
|
+
/raw\.assistantText\s*\?\?\s*raw\.stdout/.test(command) ||
|
|
114
|
+
/assistantText\s*\|\|\s*raw\.stdout/.test(command) ||
|
|
115
|
+
/assistantText\s*\|\|\s*stdout/.test(command));
|
|
116
|
+
}
|
|
117
|
+
function shellCommandLooksLikeHandWrittenVerdictGate(command) {
|
|
118
|
+
return (shellCommandReadsActiveOrCurrentRunJson(command) &&
|
|
119
|
+
(/\bVERDICT\b/i.test(command) ||
|
|
120
|
+
shellCommandUsesVerdictJsonParser(command)));
|
|
121
|
+
}
|
|
122
|
+
function shellCommandsLookLikeMultiCommandVerdictGate(commands) {
|
|
123
|
+
if (commands.length <= 1)
|
|
124
|
+
return false;
|
|
125
|
+
const combined = commands.join("\n");
|
|
126
|
+
return (shellCommandReadsActiveOrCurrentRunJson(combined) &&
|
|
127
|
+
(/\bVERDICT\b/i.test(combined) ||
|
|
128
|
+
shellCommandUsesVerdictJsonParser(combined)));
|
|
129
|
+
}
|
|
130
|
+
function validateVerdictGateConfig(task, spec, issues) {
|
|
131
|
+
const verdictGate = task.shell?.verdictGate;
|
|
132
|
+
if (!verdictGate) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (task.executor !== "shell") {
|
|
136
|
+
issues.push({
|
|
137
|
+
type: "invalid-verdict-gate-config",
|
|
138
|
+
message: `task ${task.id} shell.verdictGate requires executor=shell`,
|
|
139
|
+
});
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const upstreamIds = new Set(task.depends_on);
|
|
143
|
+
const sourceNodeIds = [
|
|
144
|
+
verdictGate.fromNodeId,
|
|
145
|
+
...(verdictGate.fallbackFromNodeIds ?? []),
|
|
146
|
+
];
|
|
147
|
+
for (const sourceId of sourceNodeIds) {
|
|
148
|
+
if (!upstreamIds.has(sourceId)) {
|
|
149
|
+
issues.push({
|
|
150
|
+
type: "invalid-verdict-gate-config",
|
|
151
|
+
message: `task ${task.id} shell.verdictGate source "${sourceId}" must appear in depends_on`,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
const upstreamTask = spec.tasks.find((candidate) => candidate.id === sourceId);
|
|
155
|
+
if (upstreamTask && upstreamTask.executor === "shell") {
|
|
156
|
+
issues.push({
|
|
157
|
+
type: "invalid-verdict-gate-config",
|
|
158
|
+
message: `task ${task.id} shell.verdictGate source "${sourceId}" must reference a non-shell upstream verdict node`,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
for (const accepted of verdictGate.accept) {
|
|
163
|
+
if (accepted.trim().length === 0) {
|
|
164
|
+
issues.push({
|
|
165
|
+
type: "invalid-verdict-gate-config",
|
|
166
|
+
message: `task ${task.id} shell.verdictGate.accept entries must be non-empty`,
|
|
167
|
+
});
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function validateRepairArtifactGateConfig(task, spec, issues) {
|
|
173
|
+
const repairArtifactGate = task.shell?.repairArtifactGate;
|
|
174
|
+
if (!repairArtifactGate)
|
|
175
|
+
return;
|
|
176
|
+
if (task.executor !== "shell") {
|
|
177
|
+
issues.push({
|
|
178
|
+
type: "invalid-repair-artifact-gate-config",
|
|
179
|
+
message: `task ${task.id} shell.repairArtifactGate requires executor=shell`,
|
|
180
|
+
});
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
const upstreamIds = new Set(task.depends_on);
|
|
184
|
+
if (!upstreamIds.has(repairArtifactGate.fromNodeId)) {
|
|
185
|
+
issues.push({
|
|
186
|
+
type: "invalid-repair-artifact-gate-config",
|
|
187
|
+
message: `task ${task.id} shell.repairArtifactGate.fromNodeId "${repairArtifactGate.fromNodeId}" must appear in depends_on`,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
const upstream = spec.tasks.find((candidate) => candidate.id === repairArtifactGate.fromNodeId);
|
|
191
|
+
if (upstream && upstream.executor === "shell") {
|
|
192
|
+
issues.push({
|
|
193
|
+
type: "invalid-repair-artifact-gate-config",
|
|
194
|
+
message: `task ${task.id} shell.repairArtifactGate.fromNodeId "${repairArtifactGate.fromNodeId}" must reference a non-shell upstream artifact node`,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
const resolution = resolveRepairTaskForGate({
|
|
198
|
+
tasks: spec.tasks,
|
|
199
|
+
gateTask: task,
|
|
200
|
+
});
|
|
201
|
+
if (!resolution.ok) {
|
|
202
|
+
issues.push({
|
|
203
|
+
type: "invalid-repair-artifact-gate-config",
|
|
204
|
+
message: `task ${task.id} ${resolution.reason}`,
|
|
205
|
+
});
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
const hardVerifyCandidates = spec.tasks.filter((candidate) => candidate.depends_on.includes(resolution.repairTask.id) &&
|
|
209
|
+
candidate.executor === "shell" &&
|
|
210
|
+
candidate.role === "verifier" &&
|
|
211
|
+
candidate.shell?.verifyEvidence?.phase === "final" &&
|
|
212
|
+
candidate.shell.verifyEvidence.quota === "full" &&
|
|
213
|
+
candidate.shell.verifyEvidence.finalFullRequired === true);
|
|
214
|
+
if (hardVerifyCandidates.length !== 1) {
|
|
215
|
+
issues.push({
|
|
216
|
+
type: "invalid-repair-artifact-gate-config",
|
|
217
|
+
message: hardVerifyCandidates.length === 0
|
|
218
|
+
? `task ${task.id} repair node "${resolution.repairTask.id}" must have one direct downstream final/full hard verification shell node with finalFullRequired=true`
|
|
219
|
+
: `task ${task.id} repair node "${resolution.repairTask.id}" has multiple hard verification shell nodes (${hardVerifyCandidates.map((candidate) => candidate.id).join(", ")})`,
|
|
220
|
+
});
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const hardVerify = hardVerifyCandidates[0];
|
|
224
|
+
const descendantIds = new Set();
|
|
225
|
+
const queue = [hardVerify.id];
|
|
226
|
+
while (queue.length > 0) {
|
|
227
|
+
const parentId = queue.shift();
|
|
228
|
+
for (const candidate of spec.tasks) {
|
|
229
|
+
if (candidate.depends_on.includes(parentId) &&
|
|
230
|
+
!descendantIds.has(candidate.id)) {
|
|
231
|
+
descendantIds.add(candidate.id);
|
|
232
|
+
queue.push(candidate.id);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
const reviewCandidates = spec.tasks.filter((candidate) => descendantIds.has(candidate.id) &&
|
|
237
|
+
candidate.executor === "pi" &&
|
|
238
|
+
candidate.role === "reviewer" &&
|
|
239
|
+
!candidate.decisionGate?.enabled &&
|
|
240
|
+
candidate.writePolicy === "read-only" &&
|
|
241
|
+
((candidate.outputContract?.includes("VERDICT:") ?? false) ||
|
|
242
|
+
candidate.outputProtocol?.type === "json-review-verdict") &&
|
|
243
|
+
// Format recovery / write-set format-repair nodes also emit VERDICT but
|
|
244
|
+
// are not the primary content review after hard verification.
|
|
245
|
+
!/(?:-format-repair-pi|-verdict-recovery-pi)$/.test(candidate.id));
|
|
246
|
+
if (reviewCandidates.length !== 1) {
|
|
247
|
+
issues.push({
|
|
248
|
+
type: "invalid-repair-artifact-gate-config",
|
|
249
|
+
message: reviewCandidates.length === 0
|
|
250
|
+
? `task ${task.id} hard verification node "${hardVerify.id}" must reach one read-only Pi reviewer with a VERDICT or JSON review output contract`
|
|
251
|
+
: `task ${task.id} hard verification node "${hardVerify.id}" has multiple Pi reviewer nodes (${reviewCandidates.map((candidate) => candidate.id).join(", ")})`,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
function validateRequirementCoverageGateConfig(task, spec, issues) {
|
|
256
|
+
const gate = task.shell?.requirementCoverageGate;
|
|
257
|
+
if (!gate)
|
|
258
|
+
return;
|
|
259
|
+
if (task.executor !== "shell") {
|
|
260
|
+
issues.push({ type: "invalid-requirement-coverage-gate-config", message: `task ${task.id} shell.requirementCoverageGate requires executor=shell` });
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
if (gate.fallbackFromNodeIds?.length && gate.fromNodeIds.length !== 1) {
|
|
264
|
+
issues.push({
|
|
265
|
+
type: "invalid-requirement-coverage-gate-config",
|
|
266
|
+
message: `task ${task.id} shell.requirementCoverageGate with fallbackFromNodeIds requires exactly one fromNodeIds entry`,
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
const dependencyIds = new Set(task.depends_on);
|
|
270
|
+
const sourceNodeIds = [
|
|
271
|
+
...gate.fromNodeIds,
|
|
272
|
+
...(gate.fallbackFromNodeIds ?? []),
|
|
273
|
+
];
|
|
274
|
+
for (const fromNodeId of new Set(sourceNodeIds)) {
|
|
275
|
+
if (!dependencyIds.has(fromNodeId)) {
|
|
276
|
+
issues.push({ type: "invalid-requirement-coverage-gate-config", message: `task ${task.id} shell.requirementCoverageGate source "${fromNodeId}" must appear in depends_on` });
|
|
277
|
+
}
|
|
278
|
+
const upstream = spec.tasks.find((candidate) => candidate.id === fromNodeId);
|
|
279
|
+
if (upstream?.executor === "shell") {
|
|
280
|
+
issues.push({ type: "invalid-requirement-coverage-gate-config", message: `task ${task.id} shell.requirementCoverageGate source "${fromNodeId}" must be a non-shell node` });
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
function validateShellVerdictGateGovernance(task, commands, issues) {
|
|
285
|
+
if (task.executor !== "shell") {
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
const explicitCommands = (task.shell?.commands ?? []).filter((command) => command.trim().length > 0);
|
|
289
|
+
for (const command of commands) {
|
|
290
|
+
if (shellCommandUsesSummaryMdVerdictSource(command)) {
|
|
291
|
+
issues.push({
|
|
292
|
+
type: "shell-verdict-gate-summary-md-source",
|
|
293
|
+
message: `task ${task.id} shell command reads result.summary.md for verdict gating; use shell.verdictGate and canonical <fromNodeId>.json instead`,
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
if (shellCommandUsesGrepVerdictSearch(command)) {
|
|
297
|
+
issues.push({
|
|
298
|
+
type: "shell-verdict-gate-grep-pattern",
|
|
299
|
+
message: `task ${task.id} shell command uses grep-based VERDICT search; use shell.verdictGate with exact accept matching instead`,
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
if (shellCommandsLookLikeMultiCommandVerdictGate(explicitCommands)) {
|
|
304
|
+
issues.push({
|
|
305
|
+
type: "shell-verdict-gate-multi-command-state",
|
|
306
|
+
message: `task ${task.id} spreads verdict gate state across multiple shell.commands entries; use shell.verdictGate so the gate is a single command`,
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
if (!task.shell?.verdictGate &&
|
|
310
|
+
explicitCommands.some(shellCommandLooksLikeHandWrittenVerdictGate)) {
|
|
311
|
+
issues.push({
|
|
312
|
+
type: "shell-verdict-gate-handwritten-inline",
|
|
313
|
+
message: `task ${task.id} uses fragile inline verdict gate shell; prefer shell.verdictGate with fromNodeId and accept`,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
function writeSetEntriesOverlap(a, b) {
|
|
318
|
+
if (pathMatchesPattern(a, b) || pathMatchesPattern(b, a)) {
|
|
319
|
+
return true;
|
|
320
|
+
}
|
|
321
|
+
const probesA = probePathsForWriteSetEntry(a);
|
|
322
|
+
const probesB = probePathsForWriteSetEntry(b);
|
|
323
|
+
return probesA.some((probeA) => probesB.some((probeB) => probeA === probeB ||
|
|
324
|
+
pathMatchesPattern(probeA, b) ||
|
|
325
|
+
pathMatchesPattern(probeB, a)));
|
|
326
|
+
}
|
|
327
|
+
function shouldValidateWritePolicy(spec, task) {
|
|
328
|
+
return (spec.version >= 2 ||
|
|
329
|
+
task.writePolicy !== undefined ||
|
|
330
|
+
task.writeSet !== undefined);
|
|
331
|
+
}
|
|
332
|
+
function resolveWritePolicy(task, spec) {
|
|
333
|
+
return task.writePolicy ?? spec.defaults?.writePolicy;
|
|
334
|
+
}
|
|
335
|
+
function validateTaskWritePolicy(task, spec, issues) {
|
|
336
|
+
if (!shouldValidateWritePolicy(spec, task)) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
const writePolicy = resolveWritePolicy(task, spec);
|
|
340
|
+
const writeSet = task.writeSet ?? [];
|
|
341
|
+
const allowedPaths = task.allowedPaths ?? [];
|
|
342
|
+
const forbiddenPaths = task.forbiddenPaths ?? [];
|
|
343
|
+
if (writePolicy === "read-only") {
|
|
344
|
+
if (!forbiddenPathsExcludeRootArtifacts(forbiddenPaths)) {
|
|
345
|
+
issues.push({
|
|
346
|
+
type: "read-only-missing-artifacts-forbidden",
|
|
347
|
+
message: `task ${task.id} is read-only but forbiddenPaths does not exclude artifacts/**; root artifacts are not per-node scratchpads`,
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
const artifactWriteSignal = promptMentionsRootArtifactWrite(task.subtask_prompt);
|
|
351
|
+
if (artifactWriteSignal) {
|
|
352
|
+
issues.push({
|
|
353
|
+
type: "read-only-prompt-mentions-artifact-writes",
|
|
354
|
+
message: `task ${task.id} is read-only but subtask_prompt mentions root artifact write target "${artifactWriteSignal}"; return findings in node output instead`,
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
if (writePolicy === "exclusive" && writeSet.length === 0) {
|
|
359
|
+
issues.push({
|
|
360
|
+
type: "missing-write-set",
|
|
361
|
+
message: `task ${task.id} (exclusive) requires a non-empty writeSet`,
|
|
362
|
+
});
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
if (writeSet.length === 0) {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
for (const entry of writeSet) {
|
|
369
|
+
const normalizedEntry = entry.trim().replace(/\\/g, "/").replace(/^\.\//, "");
|
|
370
|
+
if (writePolicy === "exclusive" &&
|
|
371
|
+
(normalizedEntry === "**" ||
|
|
372
|
+
normalizedEntry === "./**" ||
|
|
373
|
+
normalizedEntry === "*")) {
|
|
374
|
+
issues.push({
|
|
375
|
+
type: "write-set-unbounded",
|
|
376
|
+
message: `task ${task.id} writeSet entry "${entry}" is unbounded; exclusive writers must use concrete paths or limited globs`,
|
|
377
|
+
});
|
|
378
|
+
continue;
|
|
379
|
+
}
|
|
380
|
+
if (forbiddenPaths.length > 0 &&
|
|
381
|
+
writeSetEntryHitsForbidden(entry, forbiddenPaths)) {
|
|
382
|
+
issues.push({
|
|
383
|
+
type: "write-set-forbidden",
|
|
384
|
+
message: `task ${task.id} writeSet entry "${entry}" matches forbiddenPaths`,
|
|
385
|
+
});
|
|
386
|
+
continue;
|
|
387
|
+
}
|
|
388
|
+
if (allowedPaths.length > 0 &&
|
|
389
|
+
!writeSetEntryWithinAllowed(entry, allowedPaths)) {
|
|
390
|
+
issues.push({
|
|
391
|
+
type: "write-set-out-of-scope",
|
|
392
|
+
message: `task ${task.id} writeSet entry "${entry}" is outside allowedPaths`,
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
function validateSameRankWriteSetConflicts(spec, ranks, issues) {
|
|
398
|
+
const taskById = new Map(spec.tasks.map((task) => [task.id, task]));
|
|
399
|
+
for (const rank of ranks) {
|
|
400
|
+
const exclusiveWriters = rank
|
|
401
|
+
.map((id) => taskById.get(id))
|
|
402
|
+
.filter((task) => {
|
|
403
|
+
if (!task)
|
|
404
|
+
return false;
|
|
405
|
+
if (!shouldValidateWritePolicy(spec, task))
|
|
406
|
+
return false;
|
|
407
|
+
return resolveWritePolicy(task, spec) === "exclusive";
|
|
408
|
+
});
|
|
409
|
+
for (let i = 0; i < exclusiveWriters.length; i += 1) {
|
|
410
|
+
for (let j = i + 1; j < exclusiveWriters.length; j += 1) {
|
|
411
|
+
const left = exclusiveWriters[i];
|
|
412
|
+
const right = exclusiveWriters[j];
|
|
413
|
+
const leftSet = left.writeSet ?? [];
|
|
414
|
+
const rightSet = right.writeSet ?? [];
|
|
415
|
+
for (const leftEntry of leftSet) {
|
|
416
|
+
for (const rightEntry of rightSet) {
|
|
417
|
+
if (writeSetEntriesOverlap(leftEntry, rightEntry)) {
|
|
418
|
+
issues.push({
|
|
419
|
+
type: "write-set-overlap",
|
|
420
|
+
message: `tasks ${left.id} and ${right.id} have overlapping writeSet entries at same rank: "${leftEntry}" and "${rightEntry}"`,
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
function isAgentTask(task) {
|
|
430
|
+
return task?.executor === "pi";
|
|
431
|
+
}
|
|
432
|
+
function validateSameRankAgentAttributionRisks(spec, ranks, issues) {
|
|
433
|
+
const taskById = new Map(spec.tasks.map((task) => [task.id, task]));
|
|
434
|
+
for (const rank of ranks) {
|
|
435
|
+
const agentTasks = rank.map((id) => taskById.get(id)).filter(isAgentTask);
|
|
436
|
+
const hasExclusiveWriter = agentTasks.some((task) => resolveWritePolicy(task, spec) === "exclusive");
|
|
437
|
+
if (!hasExclusiveWriter)
|
|
438
|
+
continue;
|
|
439
|
+
for (const task of agentTasks) {
|
|
440
|
+
const policy = resolveWritePolicy(task, spec) ?? "read-only";
|
|
441
|
+
if (policy === "read-only" || policy === "none") {
|
|
442
|
+
issues.push({
|
|
443
|
+
type: "same-rank-writer-attribution-risk",
|
|
444
|
+
message: `same rank mixes read-only ${task.executor} task ${task.id} with a write-capable agent; add depends_on or run serially to avoid write attribution risk`,
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
function validateShellTaskConfig(task, spec, issues) {
|
|
451
|
+
if (task.executor !== "shell") {
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
const shell = task.shell;
|
|
455
|
+
if (!shell) {
|
|
456
|
+
issues.push({
|
|
457
|
+
type: "missing-shell-commands",
|
|
458
|
+
message: `shell task ${task.id} requires shell.preset, shell.verdictGate, and/or shell.commands`,
|
|
459
|
+
});
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
const commands = resolveShellCommands(shell);
|
|
463
|
+
if (commands.length === 0 &&
|
|
464
|
+
!shell.jsonArtifactGate &&
|
|
465
|
+
!shell.backendTestPipeline &&
|
|
466
|
+
!shell.frontendPrewriteGate &&
|
|
467
|
+
!shell.frontendBrowserToolPreflight &&
|
|
468
|
+
!shell.frontendVerificationBundle &&
|
|
469
|
+
!shell.frontendReviewContext &&
|
|
470
|
+
!shell.frontendTestCaseChecklist &&
|
|
471
|
+
!shell.frontendTestEvidenceValidation &&
|
|
472
|
+
!shell.frontendTestL5Report &&
|
|
473
|
+
!shell.frontendTestHtmlReport &&
|
|
474
|
+
!shell.frontendTestCaseManifest &&
|
|
475
|
+
!shell.frontendTestResultFinalize &&
|
|
476
|
+
!shell.frontendTestReports) {
|
|
477
|
+
issues.push({
|
|
478
|
+
type: "missing-shell-commands",
|
|
479
|
+
message: `shell task ${task.id} requires a supported shell operation or non-empty shell.commands`,
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
if (commands.some((command) => command.trim().length === 0)) {
|
|
483
|
+
issues.push({
|
|
484
|
+
type: "missing-shell-commands",
|
|
485
|
+
message: `shell task ${task.id} requires non-empty shell command strings`,
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
const envAllowlist = shell.envAllowlist ?? [];
|
|
489
|
+
const runsRepoGovernance = commands.some(shellCommandRunsCheckRepo);
|
|
490
|
+
const hasActiveDagEnv = envAllowlist.includes("HARNESS_ALLOW_ACTIVE_DAG_RUNS") ||
|
|
491
|
+
commands.some(shellCommandSetsActiveDagEnv);
|
|
492
|
+
if (runsRepoGovernance && !hasActiveDagEnv) {
|
|
493
|
+
issues.push({
|
|
494
|
+
type: "shell-dag-active-check-repo-without-env",
|
|
495
|
+
message: `shell task ${task.id} runs check-repo.sh but does not set HARNESS_ALLOW_ACTIVE_DAG_RUNS=1; this can fail inside an active DAG`,
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
for (const envName of envAllowlist) {
|
|
499
|
+
if (!ENV_VAR_NAME_PATTERN.test(envName)) {
|
|
500
|
+
issues.push({
|
|
501
|
+
type: "invalid-shell-env",
|
|
502
|
+
message: `shell task ${task.id} envAllowlist entry "${envName}" is not a valid env var name`,
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
const timeoutMs = shell.timeoutMs;
|
|
507
|
+
if (timeoutMs !== undefined && !Number.isInteger(timeoutMs)) {
|
|
508
|
+
issues.push({
|
|
509
|
+
type: "invalid-shell-timeout",
|
|
510
|
+
message: `shell task ${task.id} timeoutMs must be an integer`,
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
const cwd = shell.cwd;
|
|
514
|
+
if (cwd &&
|
|
515
|
+
(cwd.startsWith("/") || normalizePath(cwd).split("/").includes(".."))) {
|
|
516
|
+
issues.push({
|
|
517
|
+
type: "shell-cwd-out-of-scope",
|
|
518
|
+
message: `shell task ${task.id} cwd must be relative to the DAG cwd and stay within it`,
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
validateVerdictGateConfig(task, spec, issues);
|
|
522
|
+
validateRequirementCoverageGateConfig(task, spec, issues);
|
|
523
|
+
if (shell.jsonArtifactGate) {
|
|
524
|
+
const sourceNodeIds = [
|
|
525
|
+
shell.jsonArtifactGate.fromNodeId,
|
|
526
|
+
...(shell.jsonArtifactGate.fallbackFromNodeIds ?? []),
|
|
527
|
+
];
|
|
528
|
+
for (const sourceNodeId of new Set(sourceNodeIds)) {
|
|
529
|
+
if (!task.depends_on.includes(sourceNodeId)) {
|
|
530
|
+
issues.push({
|
|
531
|
+
type: "missing-dependency",
|
|
532
|
+
message: `shell task ${task.id} jsonArtifactGate source ${sourceNodeId} must be a direct dependency`,
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
if (shell.frontendPrewriteGate) {
|
|
538
|
+
const sourceNodeIds = [
|
|
539
|
+
shell.frontendPrewriteGate.planFromNodeId,
|
|
540
|
+
...shell.frontendPrewriteGate.planFallbackFromNodeIds,
|
|
541
|
+
shell.frontendPrewriteGate.reviewFromNodeId,
|
|
542
|
+
...shell.frontendPrewriteGate.reviewFallbackFromNodeIds,
|
|
543
|
+
];
|
|
544
|
+
for (const sourceNodeId of new Set(sourceNodeIds)) {
|
|
545
|
+
if (!task.depends_on.includes(sourceNodeId)) {
|
|
546
|
+
issues.push({
|
|
547
|
+
type: "missing-dependency",
|
|
548
|
+
message: `shell task ${task.id} frontendPrewriteGate source ${sourceNodeId} must be a direct dependency`,
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
validateRepairArtifactGateConfig(task, spec, issues);
|
|
554
|
+
validateShellVerdictGateGovernance(task, commands, issues);
|
|
555
|
+
}
|
|
556
|
+
function hasReadOnlyPlannerAncestor(spec, writer) {
|
|
557
|
+
const taskById = new Map(spec.tasks.map((task) => [task.id, task]));
|
|
558
|
+
const pending = [...writer.depends_on];
|
|
559
|
+
const visited = new Set();
|
|
560
|
+
while (pending.length > 0) {
|
|
561
|
+
const id = pending.shift();
|
|
562
|
+
if (visited.has(id))
|
|
563
|
+
continue;
|
|
564
|
+
visited.add(id);
|
|
565
|
+
const task = taskById.get(id);
|
|
566
|
+
if (!task)
|
|
567
|
+
continue;
|
|
568
|
+
if (task.executor === "pi" && task.role === "planner" && resolveWritePolicy(task, spec) === "read-only")
|
|
569
|
+
return true;
|
|
570
|
+
pending.push(...task.depends_on);
|
|
571
|
+
}
|
|
572
|
+
return false;
|
|
573
|
+
}
|
|
574
|
+
function validateWriterSourceBinding(spec, issues) {
|
|
575
|
+
if (spec.version < 3 || spec.sourceBinding)
|
|
576
|
+
return;
|
|
577
|
+
for (const task of spec.tasks) {
|
|
578
|
+
if (resolveWritePolicy(task, spec) !== "exclusive" || hasReadOnlyPlannerAncestor(spec, task))
|
|
579
|
+
continue;
|
|
580
|
+
issues.push({
|
|
581
|
+
type: "orphan-writer-source-binding",
|
|
582
|
+
message: `task ${task.id} is an exclusive writer without source binding or a read-only planner ancestor; recovery/partial writer DAGs must bind authoritative task sources`,
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
function validateStaticTaskConfig(task, issues) {
|
|
587
|
+
if (task.executor !== "static") {
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
const staticConfig = task.static;
|
|
591
|
+
if (!staticConfig?.resultMarkdown?.trim()) {
|
|
592
|
+
issues.push({
|
|
593
|
+
type: "missing-static-config",
|
|
594
|
+
message: `static task ${task.id} requires static.resultMarkdown`,
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
function validateRetryPolicyTaskConfig(task, issues) {
|
|
599
|
+
if (task.retryPolicy === undefined)
|
|
600
|
+
return;
|
|
601
|
+
const isReadOnlyCandidate = isSafeReadOnlyPiRetryCandidate(task);
|
|
602
|
+
const isWriterEmptyDiffCandidate = isWriterEmptyDiffRetryCandidate(task);
|
|
603
|
+
const isWriterTransportCandidate = isWriterTransportRetryCandidate(task);
|
|
604
|
+
const isBackendCompletenessCandidate = isBackendTestCompletenessRetryCandidate(task);
|
|
605
|
+
if (!isReadOnlyCandidate &&
|
|
606
|
+
!isWriterEmptyDiffCandidate &&
|
|
607
|
+
!isWriterTransportCandidate &&
|
|
608
|
+
!isBackendCompletenessCandidate) {
|
|
609
|
+
issues.push({
|
|
610
|
+
type: "invalid-retry-policy",
|
|
611
|
+
message: `task ${task.id} declares retryPolicy but is neither a safe read-only non-dynamic Pi node, an exclusive bounded Pi implementer with writerOutcomePolicy.requireChangedFiles=true, nor a standard exclusive implementer transport-retry candidate`,
|
|
612
|
+
});
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
if (isBackendCompletenessCandidate) {
|
|
616
|
+
const categories = new Set(task.retryPolicy.retryCategories);
|
|
617
|
+
const allowed = new Set([
|
|
618
|
+
WRITER_EMPTY_DIFF_RETRY_CATEGORY,
|
|
619
|
+
INCOMPLETE_WRITE_SET_RETRY_CATEGORY,
|
|
620
|
+
]);
|
|
621
|
+
const unsupported = task.retryPolicy.retryCategories.filter((category) => !allowed.has(category));
|
|
622
|
+
if (task.retryPolicy.maxAttempts < 2 ||
|
|
623
|
+
task.retryPolicy.maxAttempts > 3 ||
|
|
624
|
+
unsupported.length > 0 ||
|
|
625
|
+
!categories.has(WRITER_EMPTY_DIFF_RETRY_CATEGORY)) {
|
|
626
|
+
issues.push({
|
|
627
|
+
type: "invalid-retry-policy",
|
|
628
|
+
message: `task ${task.id} backend-test writer retryPolicy must use 2..3 total attempts and only ${WRITER_EMPTY_DIFF_RETRY_CATEGORY} and/or ${INCOMPLETE_WRITE_SET_RETRY_CATEGORY}`,
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
if (isWriterEmptyDiffCandidate &&
|
|
634
|
+
(task.retryPolicy.maxAttempts !== 2 ||
|
|
635
|
+
task.retryPolicy.retryCategories.length !== 1 ||
|
|
636
|
+
task.retryPolicy.retryCategories[0] !==
|
|
637
|
+
WRITER_EMPTY_DIFF_RETRY_CATEGORY)) {
|
|
638
|
+
issues.push({
|
|
639
|
+
type: "invalid-retry-policy",
|
|
640
|
+
message: `task ${task.id} writer retryPolicy must use exactly two total attempts and only ${WRITER_EMPTY_DIFF_RETRY_CATEGORY}`,
|
|
641
|
+
});
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
if (isWriterTransportCandidate) {
|
|
645
|
+
const categories = new Set(task.retryPolicy.retryCategories);
|
|
646
|
+
if (task.retryPolicy.maxAttempts !== 2 ||
|
|
647
|
+
categories.size !== 1 ||
|
|
648
|
+
!categories.has(WRITER_CLEAN_TIMEOUT_RETRY_CATEGORY)) {
|
|
649
|
+
issues.push({
|
|
650
|
+
type: "invalid-retry-policy",
|
|
651
|
+
message: `task ${task.id} writer transport retryPolicy must use exactly two total attempts and only ${WRITER_CLEAN_TIMEOUT_RETRY_CATEGORY}`,
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
function validateOutputProtocolTaskConfig(task, issues) {
|
|
657
|
+
if (task.outputProtocol === undefined)
|
|
658
|
+
return;
|
|
659
|
+
if (!isSafeReadOnlyPiRetryCandidate(task)) {
|
|
660
|
+
issues.push({
|
|
661
|
+
type: "invalid-output-protocol",
|
|
662
|
+
message: `task ${task.id} declares outputProtocol but is not a safe read-only non-dynamic Pi node; output protocol retry is only allowed for read-only/none Pi planner/scout/reviewer/verifier/closeout nodes`,
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
function validateWriterOutcomePolicyTaskConfig(task, issues) {
|
|
667
|
+
if (task.writerOutcomePolicy === undefined)
|
|
668
|
+
return;
|
|
669
|
+
const isBoundedPiWriter = task.executor === "pi" &&
|
|
670
|
+
task.toolProfile === "write" &&
|
|
671
|
+
task.role === "implementer" &&
|
|
672
|
+
task.writePolicy === "exclusive" &&
|
|
673
|
+
(task.writeSet?.length ?? 0) > 0;
|
|
674
|
+
if (!isBoundedPiWriter) {
|
|
675
|
+
issues.push({
|
|
676
|
+
type: "invalid-writer-outcome-policy",
|
|
677
|
+
message: `task ${task.id} declares writerOutcomePolicy but is not a bounded exclusive Pi implementer writer`,
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
function isFrontendEvidenceWriteSet(writeSet) {
|
|
682
|
+
const entries = writeSet ?? [];
|
|
683
|
+
if (entries.length === 0)
|
|
684
|
+
return false;
|
|
685
|
+
return entries.every((entry) => {
|
|
686
|
+
const normalized = entry.trim().replace(/\\/g, "/").replace(/^\.\//, "");
|
|
687
|
+
return (normalized === "testcase/frontend/evidence/**" ||
|
|
688
|
+
normalized.startsWith("testcase/frontend/evidence/"));
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
function isFrontendBrowserExecutorTask(task) {
|
|
692
|
+
const skills = task.skills ?? [];
|
|
693
|
+
return (task.executor === "pi" &&
|
|
694
|
+
task.toolProfile === "write" &&
|
|
695
|
+
skills.includes("playwright-cli") &&
|
|
696
|
+
isFrontendEvidenceWriteSet(task.writeSet));
|
|
697
|
+
}
|
|
698
|
+
function taskMentionsPlaywrightCliContract(task) {
|
|
699
|
+
const prompt = `${task.subtask_prompt}\n${task.outputContract ?? ""}`;
|
|
700
|
+
return /playwright[_-]?cli/i.test(prompt);
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* Command capability is orthogonal to file write. Fail closed when:
|
|
704
|
+
* - frontend browser executors lack playwright-cli capability
|
|
705
|
+
* - capability is granted without skill/prompt contract or outside evidence writeSet
|
|
706
|
+
* - non-browser nodes receive command capability
|
|
707
|
+
*/
|
|
708
|
+
function validateCommandPolicyTaskConfig(task, issues) {
|
|
709
|
+
const policy = resolveDagCommandPolicy(task.commandPolicy);
|
|
710
|
+
const allowsPlaywright = dagCommandPolicyAllows(task.commandPolicy, "playwright-cli");
|
|
711
|
+
const isBrowserExecutor = isFrontendBrowserExecutorTask(task);
|
|
712
|
+
if (isBrowserExecutor && !allowsPlaywright) {
|
|
713
|
+
issues.push({
|
|
714
|
+
type: "invalid-command-policy",
|
|
715
|
+
message: `frontend-test browser executor requires playwright-cli command capability (task ${task.id})`,
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
if (policy.mode === "deny") {
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
if (task.executor !== "pi") {
|
|
722
|
+
issues.push({
|
|
723
|
+
type: "invalid-command-policy",
|
|
724
|
+
message: `task ${task.id} commandPolicy requires executor=pi`,
|
|
725
|
+
});
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
if (allowsPlaywright) {
|
|
729
|
+
const skills = task.skills ?? [];
|
|
730
|
+
if (!skills.includes("playwright-cli")) {
|
|
731
|
+
issues.push({
|
|
732
|
+
type: "invalid-command-policy",
|
|
733
|
+
message: `task ${task.id} playwright-cli command capability requires skills to include playwright-cli`,
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
if (!taskMentionsPlaywrightCliContract(task)) {
|
|
737
|
+
issues.push({
|
|
738
|
+
type: "invalid-command-policy",
|
|
739
|
+
message: `task ${task.id} playwright-cli command capability requires prompt/outputContract to reference playwright_cli`,
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
if (!isFrontendEvidenceWriteSet(task.writeSet)) {
|
|
743
|
+
issues.push({
|
|
744
|
+
type: "invalid-command-policy",
|
|
745
|
+
message: `task ${task.id} playwright-cli command capability requires frontend evidence writeSet under testcase/frontend/evidence/`,
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
if (task.toolProfile !== "write") {
|
|
749
|
+
issues.push({
|
|
750
|
+
type: "invalid-command-policy",
|
|
751
|
+
message: `task ${task.id} playwright-cli command capability requires toolProfile=write for evidence mutation`,
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
function validateDynamicChildCommandPolicy(task, issues) {
|
|
757
|
+
const expansion = task.dynamicExpansion;
|
|
758
|
+
if (!expansion)
|
|
759
|
+
return;
|
|
760
|
+
const child = expansion.childTask;
|
|
761
|
+
const synthetic = {
|
|
762
|
+
id: `${task.id}-child-template`,
|
|
763
|
+
depends_on: [],
|
|
764
|
+
complexity: child.complexity,
|
|
765
|
+
subtask_prompt: child.subtaskPromptTemplate,
|
|
766
|
+
executor: child.executor,
|
|
767
|
+
role: child.role,
|
|
768
|
+
skills: child.skills,
|
|
769
|
+
toolProfile: child.toolProfile,
|
|
770
|
+
commandPolicy: child.commandPolicy,
|
|
771
|
+
writePolicy: child.writePolicy,
|
|
772
|
+
allowedPaths: child.allowedPaths,
|
|
773
|
+
forbiddenPaths: child.forbiddenPaths,
|
|
774
|
+
writeSet: child.writeSet,
|
|
775
|
+
outputContract: child.outputContract,
|
|
776
|
+
};
|
|
777
|
+
validateCommandPolicyTaskConfig(synthetic, issues);
|
|
778
|
+
}
|
|
779
|
+
function validateDecisionGateTaskConfig(task, issues) {
|
|
780
|
+
if (!task.decisionGate?.enabled) {
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
if (task.executor !== "pi") {
|
|
784
|
+
issues.push({
|
|
785
|
+
type: "invalid-decision-gate-executor",
|
|
786
|
+
message: `task ${task.id} decisionGate requires executor=pi`,
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* AC1: failure-aware dependencies are an explicit, narrow opt-in. Only
|
|
792
|
+
* read-only Pi nodes acting as recovery/diagnosis/supervision/closeout
|
|
793
|
+
* (reviewer, verifier, supervisor, closeout roles) may tolerate an upstream
|
|
794
|
+
* ERROR. Writers, shell verifiers, hard/decision gates, dynamic nodes, and any
|
|
795
|
+
* node with write capability must remain fail-closed.
|
|
796
|
+
*/
|
|
797
|
+
const FAILURE_AWARE_SAFE_ROLES = new Set([
|
|
798
|
+
"reviewer",
|
|
799
|
+
"verifier",
|
|
800
|
+
"supervisor",
|
|
801
|
+
"closeout",
|
|
802
|
+
]);
|
|
803
|
+
function validateFailureAwareDependsOn(task, spec, issues) {
|
|
804
|
+
const tolerated = task.failureAwareDependsOn;
|
|
805
|
+
if (!tolerated || tolerated.length === 0)
|
|
806
|
+
return;
|
|
807
|
+
const isReadOnlyPiRecoveryNode = task.executor === "pi" &&
|
|
808
|
+
FAILURE_AWARE_SAFE_ROLES.has(task.role ?? "") &&
|
|
809
|
+
task.toolProfile !== "write" &&
|
|
810
|
+
(task.writePolicy === undefined ||
|
|
811
|
+
task.writePolicy === "read-only" ||
|
|
812
|
+
task.writePolicy === "none") &&
|
|
813
|
+
(task.writeSet ?? []).length === 0 &&
|
|
814
|
+
!task.decisionGate?.enabled &&
|
|
815
|
+
!task.dynamicExpansion &&
|
|
816
|
+
!task.dynamicReduction &&
|
|
817
|
+
!task.dynamicCondition &&
|
|
818
|
+
!task.dynamicLoopUntil;
|
|
819
|
+
if (!isReadOnlyPiRecoveryNode) {
|
|
820
|
+
issues.push({
|
|
821
|
+
type: "invalid-failure-aware-dependency",
|
|
822
|
+
message: `task ${task.id} declares failureAwareDependsOn but failure-aware dependencies are allowed only for read-only recovery/diagnosis/supervision/closeout-equivalent Pi nodes (reviewer, verifier, supervisor, closeout); writer and shell verification nodes may not tolerate upstream ERROR or failure-derived SKIPPED`,
|
|
823
|
+
});
|
|
824
|
+
return;
|
|
825
|
+
}
|
|
826
|
+
const dependsOn = new Set(task.depends_on);
|
|
827
|
+
const knownIds = new Set(spec.tasks.map((entry) => entry.id));
|
|
828
|
+
for (const upstreamId of tolerated) {
|
|
829
|
+
if (!knownIds.has(upstreamId)) {
|
|
830
|
+
issues.push({
|
|
831
|
+
type: "invalid-failure-aware-dependency",
|
|
832
|
+
message: `task ${task.id} failureAwareDependsOn references unknown task id ${upstreamId}`,
|
|
833
|
+
});
|
|
834
|
+
continue;
|
|
835
|
+
}
|
|
836
|
+
if (!dependsOn.has(upstreamId)) {
|
|
837
|
+
issues.push({
|
|
838
|
+
type: "invalid-failure-aware-dependency",
|
|
839
|
+
message: `task ${task.id} failure-aware dependency ${upstreamId} must be listed in depends_on`,
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
export function collectExecutorModelWarnings(spec, expectedMatrices = DEFAULT_DAG_EXECUTOR_MODELS) {
|
|
845
|
+
const warnings = [];
|
|
846
|
+
const executors = Object.keys(DEFAULT_DAG_EXECUTOR_MODELS);
|
|
847
|
+
for (const executor of executors) {
|
|
848
|
+
const actualByComplexity = spec.executorModels?.[executor];
|
|
849
|
+
if (!actualByComplexity) {
|
|
850
|
+
continue;
|
|
851
|
+
}
|
|
852
|
+
const expectedByComplexity = expectedMatrices[executor] ?? DEFAULT_DAG_EXECUTOR_MODELS[executor];
|
|
853
|
+
for (const [complexityKey, actual] of Object.entries(actualByComplexity)) {
|
|
854
|
+
if (actual === undefined) {
|
|
855
|
+
continue;
|
|
856
|
+
}
|
|
857
|
+
const expected = expectedByComplexity[complexityKey];
|
|
858
|
+
if (actual !== expected) {
|
|
859
|
+
warnings.push({
|
|
860
|
+
executor,
|
|
861
|
+
complexity: complexityKey,
|
|
862
|
+
expected,
|
|
863
|
+
actual,
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
return warnings;
|
|
869
|
+
}
|
|
870
|
+
export function collectForbiddenExecutorIssues(spec, forbiddenExecutors) {
|
|
871
|
+
if (forbiddenExecutors.length === 0)
|
|
872
|
+
return [];
|
|
873
|
+
const forbidden = new Set(forbiddenExecutors);
|
|
874
|
+
const rawTasks = spec.tasks ?? [];
|
|
875
|
+
return spec.tasks
|
|
876
|
+
.filter((task) => forbidden.has(task.executor))
|
|
877
|
+
.map((task, index) => ({
|
|
878
|
+
executor: task.executor,
|
|
879
|
+
taskId: task.id,
|
|
880
|
+
implicitDefault: rawTasks[index]?.executor === undefined,
|
|
881
|
+
}));
|
|
882
|
+
}
|
|
883
|
+
/** Revalidate a rendered dynamic child before it enters state or executes. */
|
|
884
|
+
export function assertValidMaterializedDagTask(task) {
|
|
885
|
+
const issues = [];
|
|
886
|
+
// A minimal v2 carrier makes write-policy validation strict while avoiding
|
|
887
|
+
// unrelated parent graph/rank checks. Dynamic templates are validated at
|
|
888
|
+
// init; this guards values introduced by {{item}} rendering.
|
|
889
|
+
const spec = { version: 2, tasks: [task] };
|
|
890
|
+
validateTaskWritePolicy(task, spec, issues);
|
|
891
|
+
validateShellTaskConfig(task, spec, issues);
|
|
892
|
+
validateStaticTaskConfig(task, issues);
|
|
893
|
+
validateDecisionGateTaskConfig(task, issues);
|
|
894
|
+
validateRetryPolicyTaskConfig(task, issues);
|
|
895
|
+
validateOutputProtocolTaskConfig(task, issues);
|
|
896
|
+
validateWriterOutcomePolicyTaskConfig(task, issues);
|
|
897
|
+
validateCommandPolicyTaskConfig(task, issues);
|
|
898
|
+
if (issues.length > 0) {
|
|
899
|
+
throw new Error(`invalid materialized dynamic child ${task.id}: ${issues.map((issue) => issue.message).join("; ")}`);
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
export function validateDagSpec(spec) {
|
|
903
|
+
const issues = [];
|
|
904
|
+
if (spec.tasks.length === 0) {
|
|
905
|
+
issues.push({
|
|
906
|
+
type: "empty-tasks",
|
|
907
|
+
message: "DAG must contain at least one task",
|
|
908
|
+
});
|
|
909
|
+
return issues;
|
|
910
|
+
}
|
|
911
|
+
const ids = new Set();
|
|
912
|
+
for (const task of spec.tasks) {
|
|
913
|
+
if (ids.has(task.id)) {
|
|
914
|
+
issues.push({
|
|
915
|
+
type: "duplicate-id",
|
|
916
|
+
message: `duplicate task id: ${task.id}`,
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
ids.add(task.id);
|
|
920
|
+
}
|
|
921
|
+
for (const task of spec.tasks) {
|
|
922
|
+
for (const dep of task.depends_on) {
|
|
923
|
+
if (dep === task.id) {
|
|
924
|
+
issues.push({
|
|
925
|
+
type: "self-dependency",
|
|
926
|
+
message: `task ${task.id} depends on itself`,
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
if (!ids.has(dep)) {
|
|
930
|
+
issues.push({
|
|
931
|
+
type: "missing-dependency",
|
|
932
|
+
message: `task ${task.id} depends on unknown id: ${dep}`,
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
const { hasCycle, cycleNodes, ranks } = topoSortToRanks(spec);
|
|
938
|
+
if (hasCycle) {
|
|
939
|
+
issues.push({
|
|
940
|
+
type: "cycle",
|
|
941
|
+
message: `cycle detected involving: ${cycleNodes.join(", ")}`,
|
|
942
|
+
});
|
|
943
|
+
return issues;
|
|
944
|
+
}
|
|
945
|
+
for (const task of spec.tasks) {
|
|
946
|
+
validateTaskWritePolicy(task, spec, issues);
|
|
947
|
+
validateShellTaskConfig(task, spec, issues);
|
|
948
|
+
validateStaticTaskConfig(task, issues);
|
|
949
|
+
validateDecisionGateTaskConfig(task, issues);
|
|
950
|
+
validateRetryPolicyTaskConfig(task, issues);
|
|
951
|
+
validateOutputProtocolTaskConfig(task, issues);
|
|
952
|
+
validateWriterOutcomePolicyTaskConfig(task, issues);
|
|
953
|
+
validateCommandPolicyTaskConfig(task, issues);
|
|
954
|
+
validateDynamicChildCommandPolicy(task, issues);
|
|
955
|
+
validateProjectGovernanceTaskConfig(task, spec, issues);
|
|
956
|
+
validateFailureAwareDependsOn(task, spec, issues);
|
|
957
|
+
}
|
|
958
|
+
validateSameRankWriteSetConflicts(spec, ranks, issues);
|
|
959
|
+
validateSameRankAgentAttributionRisks(spec, ranks, issues);
|
|
960
|
+
validateWriterSourceBinding(spec, issues);
|
|
961
|
+
for (const advisory of spec.advisories ?? []) {
|
|
962
|
+
issues.push({ type: "advisory", message: advisory });
|
|
963
|
+
}
|
|
964
|
+
return issues;
|
|
965
|
+
}
|
|
966
|
+
function validateProjectGovernanceTaskConfig(task, spec, issues) {
|
|
967
|
+
if (task.governanceStandardReview) {
|
|
968
|
+
if (task.executor !== "pi" ||
|
|
969
|
+
task.toolProfile === "write" ||
|
|
970
|
+
!["read-only", "none"].includes((task.writePolicy ?? "read-only"))) {
|
|
971
|
+
issues.push({
|
|
972
|
+
type: "invalid-project-governance-config",
|
|
973
|
+
message: `task ${task.id} governanceStandardReview requires a read-only Pi node`,
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
if (!task.shell?.projectGovernanceGate)
|
|
978
|
+
return;
|
|
979
|
+
const verdictGate = task.shell.verdictGate;
|
|
980
|
+
const source = verdictGate
|
|
981
|
+
? spec.tasks.find((candidate) => candidate.id === verdictGate.fromNodeId)
|
|
982
|
+
: undefined;
|
|
983
|
+
if (task.executor !== "shell" ||
|
|
984
|
+
!verdictGate ||
|
|
985
|
+
!task.depends_on.includes(verdictGate.fromNodeId) ||
|
|
986
|
+
!source?.governanceStandardReview) {
|
|
987
|
+
issues.push({
|
|
988
|
+
type: "invalid-project-governance-config",
|
|
989
|
+
message: `task ${task.id} projectGovernanceGate requires verdictGate over a directly-dependent governanceStandardReview node`,
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
export function assertValidDagSpec(spec, options = {}) {
|
|
994
|
+
const issues = collectBlockingIssues(options.issues ?? validateDagSpec(spec), options);
|
|
995
|
+
if (issues.length > 0) {
|
|
996
|
+
throw new Error(`invalid DAG: ${issues.map((issue) => issue.message).join("; ")}`);
|
|
997
|
+
}
|
|
998
|
+
}
|