@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.
Files changed (1050) hide show
  1. package/AGENTS.md +114 -0
  2. package/CHANGELOG.md +2283 -0
  3. package/README.md +177 -0
  4. package/bin/agent-worker.js +22 -0
  5. package/bin/loop-agent.js +57 -0
  6. package/dist/adapters/aimax.js +91 -0
  7. package/dist/adapters/context.js +32 -0
  8. package/dist/adapters/index.js +29 -0
  9. package/dist/adapters/loop-agent.js +192 -0
  10. package/dist/adapters/types.js +1 -0
  11. package/dist/application/context-usage/skill-resolution-stats.js +263 -0
  12. package/dist/application/dag/args.js +486 -0
  13. package/dist/application/dag/generate-task-dag.js +408 -0
  14. package/dist/application/dag/report-dag.js +14 -0
  15. package/dist/application/dag/run-dag.js +109 -0
  16. package/dist/application/dag/validate-dag.js +166 -0
  17. package/dist/application/evaluation/alias.js +184 -0
  18. package/dist/application/evaluation/budget.js +192 -0
  19. package/dist/application/evaluation/campaign-hash.js +47 -0
  20. package/dist/application/evaluation/campaign-matrix.js +372 -0
  21. package/dist/application/evaluation/campaign-scorecard.js +135 -0
  22. package/dist/application/evaluation/campaign.js +370 -0
  23. package/dist/application/evaluation/candidate-hash.js +75 -0
  24. package/dist/application/evaluation/candidate.js +69 -0
  25. package/dist/application/evaluation/corpus-hash.js +38 -0
  26. package/dist/application/evaluation/corpus.js +56 -0
  27. package/dist/application/evaluation/experiment.js +294 -0
  28. package/dist/application/evaluation/ignition.js +198 -0
  29. package/dist/application/evaluation/integrity-audit.js +162 -0
  30. package/dist/application/evaluation/outer-loop.js +132 -0
  31. package/dist/application/evaluation/pi-cell-executor.js +39 -0
  32. package/dist/application/evaluation/private-verifier.js +46 -0
  33. package/dist/application/evaluation/promotion-policy.js +151 -0
  34. package/dist/application/evaluation/proposer.js +98 -0
  35. package/dist/application/evaluation/replay.js +289 -0
  36. package/dist/application/evaluation/types.js +652 -0
  37. package/dist/application/loop/run-action.js +19 -0
  38. package/dist/application/task-lifecycle/advance.js +1204 -0
  39. package/dist/application/task-lifecycle/gates.js +130 -0
  40. package/dist/application/task-lifecycle/index.js +7 -0
  41. package/dist/application/task-lifecycle/observe.js +424 -0
  42. package/dist/application/task-lifecycle/plan-transitions.js +251 -0
  43. package/dist/application/task-lifecycle/recommendations.js +180 -0
  44. package/dist/application/task-lifecycle/record.js +73 -0
  45. package/dist/application/task-lifecycle/types.js +1 -0
  46. package/dist/build-stamp.json +6 -0
  47. package/dist/cli/catalog.js +24 -0
  48. package/dist/cli/command-definitions.js +659 -0
  49. package/dist/cli/help.js +56 -0
  50. package/dist/cli/index.js +5 -0
  51. package/dist/cli/program.js +647 -0
  52. package/dist/cli/router.js +13 -0
  53. package/dist/cli/update/init-surface-notifier.js +167 -0
  54. package/dist/cli/update/notifier.js +117 -0
  55. package/dist/cli/update/npm-client.js +151 -0
  56. package/dist/cli/update/policy.js +92 -0
  57. package/dist/cli/update/runtime-activity.js +29 -0
  58. package/dist/cli/update/state.js +68 -0
  59. package/dist/cli-governance/active-residue-check.js +38 -0
  60. package/dist/cli.js +57 -0
  61. package/dist/commands/client-recovery.js +1373 -0
  62. package/dist/commands/closeout.js +13 -0
  63. package/dist/commands/coverage-audit.js +14 -0
  64. package/dist/commands/coverage-report.js +50 -0
  65. package/dist/commands/cursor-prompt.js +182 -0
  66. package/dist/commands/dag-approve.js +142 -0
  67. package/dist/commands/dag-final-verification.js +76 -0
  68. package/dist/commands/dag-init-hybrid.js +57 -0
  69. package/dist/commands/dag-reconcile-run.js +5 -0
  70. package/dist/commands/dag-reconcile-tasks.js +51 -0
  71. package/dist/commands/dag-reject.js +91 -0
  72. package/dist/commands/dag-report.js +76 -0
  73. package/dist/commands/dag-request-interrupt.js +20 -0
  74. package/dist/commands/dag-rerun-task.js +19 -0
  75. package/dist/commands/dag-rerun.js +111 -0
  76. package/dist/commands/dag-resume.js +35 -0
  77. package/dist/commands/dag-run-task.js +12 -0
  78. package/dist/commands/dag-validate.js +20 -0
  79. package/dist/commands/dag-workflow-compile.js +91 -0
  80. package/dist/commands/dag-workflow-plan.js +130 -0
  81. package/dist/commands/dag-workflow-validate.js +66 -0
  82. package/dist/commands/delegate.js +130 -0
  83. package/dist/commands/docs-archive.js +5 -0
  84. package/dist/commands/docs-audit.js +6 -0
  85. package/dist/commands/doctor.js +283 -0
  86. package/dist/commands/eval.js +1398 -0
  87. package/dist/commands/examples.js +90 -0
  88. package/dist/commands/goal.js +92 -0
  89. package/dist/commands/handoff-check.js +5 -0
  90. package/dist/commands/harvest.js +44 -0
  91. package/dist/commands/import-prd.js +81 -0
  92. package/dist/commands/init-upgrade.js +3085 -0
  93. package/dist/commands/init.js +3630 -0
  94. package/dist/commands/inspect.js +11 -0
  95. package/dist/commands/instructions.js +223 -0
  96. package/dist/commands/knowledge.js +162 -0
  97. package/dist/commands/loop-benchmark.js +72 -0
  98. package/dist/commands/loop.js +251 -0
  99. package/dist/commands/new-task.js +5 -0
  100. package/dist/commands/operator.js +44 -0
  101. package/dist/commands/pi-prompt.js +174 -0
  102. package/dist/commands/pi-reuse-benchmark.js +153 -0
  103. package/dist/commands/plan-list.js +5 -0
  104. package/dist/commands/plan.js +50 -0
  105. package/dist/commands/promote-run.js +29 -0
  106. package/dist/commands/reference-index.js +16 -0
  107. package/dist/commands/run-dag-progress.js +123 -0
  108. package/dist/commands/run-dag.js +22 -0
  109. package/dist/commands/spine.js +38 -0
  110. package/dist/commands/stats.js +113 -0
  111. package/dist/commands/status.js +57 -0
  112. package/dist/commands/study-init.js +192 -0
  113. package/dist/commands/task-advance.js +366 -0
  114. package/dist/commands/task-contract.js +269 -0
  115. package/dist/commands/task-source-prepare.js +479 -0
  116. package/dist/commands/task-status.js +133 -0
  117. package/dist/commands/workflow.js +259 -0
  118. package/dist/commands/worktree-create.js +31 -0
  119. package/dist/commands/worktree-list.js +5 -0
  120. package/dist/commands/worktree-remove.js +26 -0
  121. package/dist/executors/config-core.js +5 -0
  122. package/dist/executors/config.js +2 -0
  123. package/dist/executors/dag-pi-executor.js +1277 -0
  124. package/dist/executors/dag-static-executor.js +42 -0
  125. package/dist/executors/dag.js +3 -0
  126. package/dist/executors/index.js +6 -0
  127. package/dist/executors/model-routing.js +71 -0
  128. package/dist/executors/pi-defaults.js +9 -0
  129. package/dist/executors/pi-event-serializer.js +65 -0
  130. package/dist/executors/pi-executor.js +981 -0
  131. package/dist/executors/pi-playwright-cli-tool.js +1006 -0
  132. package/dist/executors/pi-prompt-transport.js +198 -0
  133. package/dist/executors/pi-reuse-benchmark.js +316 -0
  134. package/dist/executors/pi-runtime-reuse.js +29 -0
  135. package/dist/executors/pi-sdk-executor.js +722 -0
  136. package/dist/executors/pi-sdk.js +1 -0
  137. package/dist/executors/pi-writer-tool-policy.js +266 -0
  138. package/dist/executors/pi.js +3 -0
  139. package/dist/executors/playwright-cli-launcher.js +63 -0
  140. package/dist/executors/process-tree.js +33 -0
  141. package/dist/executors/shell-executor.js +3055 -0
  142. package/dist/executors/shell-presets.js +99 -0
  143. package/dist/executors/shell-verification.js +262 -0
  144. package/dist/executors/shell-write-guard.js +543 -0
  145. package/dist/executors/shell.js +3 -0
  146. package/dist/executors/static.js +1 -0
  147. package/dist/governance/checks.js +437 -0
  148. package/dist/governance/document-index-closure.js +164 -0
  149. package/dist/governance/exec-plans.js +549 -0
  150. package/dist/governance/harness.js +9 -0
  151. package/dist/governance/index.js +3 -0
  152. package/dist/governance/manifest-types.js +254 -0
  153. package/dist/governance/manifest.js +2 -0
  154. package/dist/governance/path-guard.js +69 -0
  155. package/dist/governance/path-guards.js +2 -0
  156. package/dist/governance/profiles.js +3 -0
  157. package/dist/governance/requirement-coverage.js +425 -0
  158. package/dist/governance/skill-safety.js +135 -0
  159. package/dist/governance/spine-audit.js +155 -0
  160. package/dist/infrastructure/evaluation/alias-store.js +199 -0
  161. package/dist/infrastructure/evaluation/campaign-store.js +154 -0
  162. package/dist/infrastructure/evaluation/candidate-store.js +439 -0
  163. package/dist/infrastructure/evaluation/corpus-store.js +181 -0
  164. package/dist/infrastructure/evaluation/experiment-store.js +124 -0
  165. package/dist/infrastructure/evaluation/ignition-store.js +82 -0
  166. package/dist/infrastructure/evaluation/private-verifier-store.js +145 -0
  167. package/dist/infrastructure/evaluation/proposer-store.js +78 -0
  168. package/dist/infrastructure/evaluation/store.js +40 -0
  169. package/dist/infrastructure/harness/active-residue-policy.js +73 -0
  170. package/dist/infrastructure/harness/artifact-store.js +72 -0
  171. package/dist/infrastructure/harness/atomic-write.js +50 -0
  172. package/dist/infrastructure/harness/completed-facts-guard.js +40 -0
  173. package/dist/infrastructure/harness/loop-action-store.js +20 -0
  174. package/dist/infrastructure/harness/loop-store.js +41 -0
  175. package/dist/infrastructure/harness/one-shot-run-store.js +94 -0
  176. package/dist/infrastructure/harness/task-store.js +108 -0
  177. package/dist/records/closeout.js +2 -0
  178. package/dist/records/harvest.js +215 -0
  179. package/dist/records/index.js +3 -0
  180. package/dist/records/one-shot-runs.js +386 -0
  181. package/dist/records/promotion.js +200 -0
  182. package/dist/shared/artifacts-core.js +107 -0
  183. package/dist/shared/artifacts.js +2 -0
  184. package/dist/shared/context-files.js +32 -0
  185. package/dist/shared/context.js +2 -0
  186. package/dist/shared/copy-dir.js +17 -0
  187. package/dist/shared/git-progress.js +172 -0
  188. package/dist/shared/index.js +5 -0
  189. package/dist/shared/logger.js +17 -0
  190. package/dist/shared/one-shot-prompt-args.js +98 -0
  191. package/dist/shared/openspec-spec.js +125 -0
  192. package/dist/shared/operator/capabilities.js +2659 -0
  193. package/dist/shared/operator/command-lifecycle.js +94 -0
  194. package/dist/shared/operator/envelope.js +59 -0
  195. package/dist/shared/operator/index.js +5 -0
  196. package/dist/shared/operator/registry.js +38 -0
  197. package/dist/shared/operator/types.js +5 -0
  198. package/dist/shared/output-truncation.js +37 -0
  199. package/dist/shared/package-metadata.js +530 -0
  200. package/dist/shared/path-refs.js +31 -0
  201. package/dist/shared/pi-retry-settings.js +23 -0
  202. package/dist/shared/playwright-cli-command-policy.js +41 -0
  203. package/dist/shared/preview.js +39 -0
  204. package/dist/shared/prompts.js +26 -0
  205. package/dist/shared/reference-context.js +264 -0
  206. package/dist/shared/resilient-git.js +133 -0
  207. package/dist/shared/runtime-activity.js +6 -0
  208. package/dist/shared/timeout-policy.js +24 -0
  209. package/dist/shared/timeout.js +1 -0
  210. package/dist/shared/types.js +5 -0
  211. package/dist/sidecars/cursor-prompt/executor.js +428 -0
  212. package/dist/sidecars/cursor-prompt/index.js +3 -0
  213. package/dist/sidecars/cursor-prompt/stream.js +121 -0
  214. package/dist/task/config-types.js +235 -0
  215. package/dist/task/config.js +2 -0
  216. package/dist/task/contract/adopt.js +166 -0
  217. package/dist/task/contract/apply.js +326 -0
  218. package/dist/task/contract/canonicalize.js +60 -0
  219. package/dist/task/contract/constants.js +30 -0
  220. package/dist/task/contract/diff.js +177 -0
  221. package/dist/task/contract/hash.js +42 -0
  222. package/dist/task/contract/import-revision.js +96 -0
  223. package/dist/task/contract/index.js +17 -0
  224. package/dist/task/contract/journal.js +155 -0
  225. package/dist/task/contract/lock.js +153 -0
  226. package/dist/task/contract/observe.js +296 -0
  227. package/dist/task/contract/paths.js +19 -0
  228. package/dist/task/contract/project.js +185 -0
  229. package/dist/task/contract/recover.js +312 -0
  230. package/dist/task/contract/request-ledger.js +37 -0
  231. package/dist/task/contract/schema.js +153 -0
  232. package/dist/task/contract/transaction.js +160 -0
  233. package/dist/task/contract/types.js +1 -0
  234. package/dist/task/contract/validate-draft.js +106 -0
  235. package/dist/task/dag-source-paths.js +50 -0
  236. package/dist/task/delegate.js +208 -0
  237. package/dist/task/frontend-preflight.js +131 -0
  238. package/dist/task/frontend-project-capability.js +570 -0
  239. package/dist/task/goal-audit.js +51 -0
  240. package/dist/task/goal-policy.js +8 -0
  241. package/dist/task/goal.js +3 -0
  242. package/dist/task/ids.js +1 -0
  243. package/dist/task/index.js +12 -0
  244. package/dist/task/lifecycle.js +1 -0
  245. package/dist/task/operator/capabilities.js +6 -0
  246. package/dist/task/operator/envelope.js +2 -0
  247. package/dist/task/operator/index.js +5 -0
  248. package/dist/task/operator/registry.js +2 -0
  249. package/dist/task/operator/types.js +1 -0
  250. package/dist/task/paths.js +1 -0
  251. package/dist/task/read-model.js +140 -0
  252. package/dist/task/runtime.js +708 -0
  253. package/dist/task/source-prepare/artifact-meta.js +137 -0
  254. package/dist/task/source-prepare/build-draft.js +232 -0
  255. package/dist/task/source-prepare/completeness.js +248 -0
  256. package/dist/task/source-prepare/index.js +10 -0
  257. package/dist/task/source-prepare/parse-intent.js +496 -0
  258. package/dist/task/source-prepare/path-policy.js +197 -0
  259. package/dist/task/source-prepare/placeholder-paths.js +77 -0
  260. package/dist/task/source-prepare/prepare.js +920 -0
  261. package/dist/task/source-prepare/reference-integrity.js +290 -0
  262. package/dist/task/source-prepare/semantic-intake.js +717 -0
  263. package/dist/task/source-prepare/types.js +7 -0
  264. package/dist/task/source-references.js +228 -0
  265. package/dist/task/source-state.js +1 -0
  266. package/dist/task/state.js +41 -0
  267. package/dist/task/subagent-guidance.js +1 -0
  268. package/dist/task/task-demand-routing.js +443 -0
  269. package/dist/task/workflow-state-types.js +92 -0
  270. package/dist/task/worktree-cleanup.js +140 -0
  271. package/dist/task/worktree.js +388 -0
  272. package/dist/verification/maven/cache.js +142 -0
  273. package/dist/verification/maven/index.js +120 -0
  274. package/dist/verification/maven/plan-commands.js +421 -0
  275. package/dist/verification/maven/pom-static.js +136 -0
  276. package/dist/verification/maven/scope-resolve.js +153 -0
  277. package/dist/verification/maven/stale.js +130 -0
  278. package/dist/verification/maven/types.js +23 -0
  279. package/dist/verification/maven/workspace-graph.js +322 -0
  280. package/dist/worker/cli.js +957 -0
  281. package/dist/worker/closeout/apply.js +73 -0
  282. package/dist/worker/closeout/preview.js +30 -0
  283. package/dist/worker/console/app-data.js +316 -0
  284. package/dist/worker/console/chat/artifact-card.js +30 -0
  285. package/dist/worker/console/chat/assistant-content.js +121 -0
  286. package/dist/worker/console/chat/chat-event-store.js +981 -0
  287. package/dist/worker/console/chat/chat-ui-policy.js +25 -0
  288. package/dist/worker/console/chat/compaction-errors.js +64 -0
  289. package/dist/worker/console/chat/composer-draft-store.js +45 -0
  290. package/dist/worker/console/chat/context-panel.js +54 -0
  291. package/dist/worker/console/chat/contract-apply-receipt-store.js +174 -0
  292. package/dist/worker/console/chat/explore-tools.js +299 -0
  293. package/dist/worker/console/chat/human-gate-card.js +45 -0
  294. package/dist/worker/console/chat/interview-adapter.js +149 -0
  295. package/dist/worker/console/chat/mcp-inventory.js +221 -0
  296. package/dist/worker/console/chat/model-resolver.js +215 -0
  297. package/dist/worker/console/chat/operation-card.js +92 -0
  298. package/dist/worker/console/chat/pi-console-config.js +376 -0
  299. package/dist/worker/console/chat/pi-runtime.js +2446 -0
  300. package/dist/worker/console/chat/repo-browser.js +140 -0
  301. package/dist/worker/console/chat/repo-walk.js +125 -0
  302. package/dist/worker/console/chat/resource-loader.js +59 -0
  303. package/dist/worker/console/chat/resource-preferences-store.js +152 -0
  304. package/dist/worker/console/chat/routes.js +3137 -0
  305. package/dist/worker/console/chat/runtime-context.js +102 -0
  306. package/dist/worker/console/chat/runtime-selection.js +96 -0
  307. package/dist/worker/console/chat/semantic-activity.js +489 -0
  308. package/dist/worker/console/chat/session-store.js +484 -0
  309. package/dist/worker/console/chat/shortcuts.js +217 -0
  310. package/dist/worker/console/chat/tool-adapter.js +131 -0
  311. package/dist/worker/console/chat/tool-preview.js +247 -0
  312. package/dist/worker/console/chat/tools.js +212 -0
  313. package/dist/worker/console/chat/turn-execution-registry.js +82 -0
  314. package/dist/worker/console/chat/turn-process.js +346 -0
  315. package/dist/worker/console/chat/usage.js +165 -0
  316. package/dist/worker/console/chat/workspace-landing.js +103 -0
  317. package/dist/worker/console/dag-confirmation.js +347 -0
  318. package/dist/worker/console/dag-execution-receipt.js +393 -0
  319. package/dist/worker/console/doctor.js +230 -0
  320. package/dist/worker/console/draft-store.js +158 -0
  321. package/dist/worker/console/harness-pi-model-matrix.js +137 -0
  322. package/dist/worker/console/human-gate-token.js +130 -0
  323. package/dist/worker/console/index.js +17 -0
  324. package/dist/worker/console/inspect-split.js +82 -0
  325. package/dist/worker/console/interview/assessment.js +67 -0
  326. package/dist/worker/console/interview/grill-me.js +277 -0
  327. package/dist/worker/console/interview/session.js +100 -0
  328. package/dist/worker/console/interview/tools.js +109 -0
  329. package/dist/worker/console/loopback.js +16 -0
  330. package/dist/worker/console/mutation-gate-receipt-store.js +184 -0
  331. package/dist/worker/console/night-aux-ticker.js +146 -0
  332. package/dist/worker/console/observe-health-match.js +179 -0
  333. package/dist/worker/console/observe-link.js +42 -0
  334. package/dist/worker/console/open-browser.js +134 -0
  335. package/dist/worker/console/operation-run-facts.js +190 -0
  336. package/dist/worker/console/operation-runner.js +353 -0
  337. package/dist/worker/console/operation-sse.js +184 -0
  338. package/dist/worker/console/operation-store.js +169 -0
  339. package/dist/worker/console/operation-wait.js +355 -0
  340. package/dist/worker/console/operator-actions.js +3768 -0
  341. package/dist/worker/console/operator-selection.js +105 -0
  342. package/dist/worker/console/operator-surface-health.js +24 -0
  343. package/dist/worker/console/operator-user-error.js +45 -0
  344. package/dist/worker/console/pi-readiness.js +288 -0
  345. package/dist/worker/console/prd-identity.js +102 -0
  346. package/dist/worker/console/prd-intake-bridge.js +441 -0
  347. package/dist/worker/console/prd-reference-discovery.js +124 -0
  348. package/dist/worker/console/recovery-cta.js +320 -0
  349. package/dist/worker/console/recovery-error-copy.js +198 -0
  350. package/dist/worker/console/recovery-selection.js +107 -0
  351. package/dist/worker/console/repo-fingerprint.js +35 -0
  352. package/dist/worker/console/resolve-dag-run-for-task.js +115 -0
  353. package/dist/worker/console/resource-loader.js +95 -0
  354. package/dist/worker/console/routes.js +475 -0
  355. package/dist/worker/console/security.js +170 -0
  356. package/dist/worker/console/server.js +357 -0
  357. package/dist/worker/console/sibling-controller.js +33 -0
  358. package/dist/worker/console/static/assets/abnfDiagram-N423BO3Z-BmOEx0gA.js +1 -0
  359. package/dist/worker/console/static/assets/arc-BGiVVe8b.js +1 -0
  360. package/dist/worker/console/static/assets/architectureDiagram-T3A2C74G-nDdu4rgJ.js +36 -0
  361. package/dist/worker/console/static/assets/blockDiagram-VBNYF7ZC-Bb5u0BWf.js +132 -0
  362. package/dist/worker/console/static/assets/c4Diagram-5PPSVZJV-BlhC0j94.js +10 -0
  363. package/dist/worker/console/static/assets/channel-Tl-FkUqr.js +1 -0
  364. package/dist/worker/console/static/assets/chunk-2GRJ4B5K-Ai8_qQXI.js +1 -0
  365. package/dist/worker/console/static/assets/chunk-2Q5K7J3B-B9gyCjqX.js +1 -0
  366. package/dist/worker/console/static/assets/chunk-5RXB4S5H-Bzbj3zGH.js +231 -0
  367. package/dist/worker/console/static/assets/chunk-5VM5RSS4-BT415PvT.js +15 -0
  368. package/dist/worker/console/static/assets/chunk-6Q2QTUOP-D_A5_5QL.js +88 -0
  369. package/dist/worker/console/static/assets/chunk-GF5L2VYU-srJkaP3f.js +206 -0
  370. package/dist/worker/console/static/assets/chunk-JWPE2WC7-UYGvEP4l.js +1 -0
  371. package/dist/worker/console/static/assets/chunk-KBJHAD2P-B8luBrrz.js +1 -0
  372. package/dist/worker/console/static/assets/chunk-RYQCIY6F-DN7wXZSq.js +1 -0
  373. package/dist/worker/console/static/assets/chunk-XXDRQBXY-DXKyMuKS.js +1 -0
  374. package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-BaehtRk4.js +1 -0
  375. package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-BaehtRk4.js +1 -0
  376. package/dist/worker/console/static/assets/cose-bilkent-JH36ORCC-dqvoynXj.js +1 -0
  377. package/dist/worker/console/static/assets/cynefin-VYW2F7L2--PcyL34A.js +166 -0
  378. package/dist/worker/console/static/assets/cynefinDiagram-MW4NZA55-DvWs_hTY.js +62 -0
  379. package/dist/worker/console/static/assets/cytoscape.esm-yzknjiTM.js +321 -0
  380. package/dist/worker/console/static/assets/dagre-VZM6K2ZE-DxeIxbyO.js +4 -0
  381. package/dist/worker/console/static/assets/defaultLocale-DX6XiGOO.js +1 -0
  382. package/dist/worker/console/static/assets/diagram-7IWD3JNH-DPCG61Of.js +30 -0
  383. package/dist/worker/console/static/assets/diagram-B4RE2ZJO-CmuU50-U.js +3 -0
  384. package/dist/worker/console/static/assets/diagram-LBJQPF4R-B61XLD_v.js +24 -0
  385. package/dist/worker/console/static/assets/diagram-Q27KOJAE-BB7HTRRY.js +24 -0
  386. package/dist/worker/console/static/assets/diagram-UB23O5K3-DvkboAIp.js +41 -0
  387. package/dist/worker/console/static/assets/ebnfDiagram-BXEA7PRR-BdJ_y1fL.js +1 -0
  388. package/dist/worker/console/static/assets/erDiagram-JOGREHBK-9bUBZTRi.js +85 -0
  389. package/dist/worker/console/static/assets/flowDiagram-UKHOOZJN-Dw4L4RBa.js +156 -0
  390. package/dist/worker/console/static/assets/ganttDiagram-PKOTCBZU-Jr82N_QP.js +292 -0
  391. package/dist/worker/console/static/assets/gitGraphDiagram-DS77QQ5N-DAz9wFLr.js +106 -0
  392. package/dist/worker/console/static/assets/graph-DOmOIIwC.js +1 -0
  393. package/dist/worker/console/static/assets/index-B7Y-0g3J.css +1 -0
  394. package/dist/worker/console/static/assets/index-DkCrqaYg.js +325 -0
  395. package/dist/worker/console/static/assets/infoDiagram-6WML65LV-CBB5Np7y.js +2 -0
  396. package/dist/worker/console/static/assets/init-Gi6I4Gst.js +1 -0
  397. package/dist/worker/console/static/assets/ishikawaDiagram-WSZJBQD7-D8IOp94y.js +70 -0
  398. package/dist/worker/console/static/assets/journeyDiagram-NVQOT4AX-Dgd3AHGG.js +139 -0
  399. package/dist/worker/console/static/assets/kanban-definition-27J2QSJJ-BmYOxLE9.js +89 -0
  400. package/dist/worker/console/static/assets/layout-D-LzfAck.js +1 -0
  401. package/dist/worker/console/static/assets/linear-DfYTEF6J.js +1 -0
  402. package/dist/worker/console/static/assets/map-DxJ2ADlA.js +1 -0
  403. package/dist/worker/console/static/assets/mermaid.core-BjuFPRqa.js +308 -0
  404. package/dist/worker/console/static/assets/mindmap-definition-FAOFIHXS-CLyUViGd.js +96 -0
  405. package/dist/worker/console/static/assets/ordinal-Cboi1Yqb.js +1 -0
  406. package/dist/worker/console/static/assets/pegDiagram-VL7TDLO6-BvX2Di4-.js +1 -0
  407. package/dist/worker/console/static/assets/pieDiagram-7S7Q4E2Y-BFj0_OLv.js +39 -0
  408. package/dist/worker/console/static/assets/quadrantDiagram-CIZ2JOQS-BIUrD_hx.js +7 -0
  409. package/dist/worker/console/static/assets/railroadDiagram-AXF67PYL-CHBB48fj.js +1 -0
  410. package/dist/worker/console/static/assets/requirementDiagram-LRYGKXZP-sJrYw2Sf.js +84 -0
  411. package/dist/worker/console/static/assets/sankeyDiagram-W5VNT64P-BzHH6fPR.js +40 -0
  412. package/dist/worker/console/static/assets/sequenceDiagram-SI44F4Z6-7QCnelCt.js +162 -0
  413. package/dist/worker/console/static/assets/sizeCapture-X5ZJPWSS-sDYSxn72.js +1 -0
  414. package/dist/worker/console/static/assets/stateDiagram-OKZ733FA-XpiUdwzm.js +1 -0
  415. package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-eEhq2A8Y.js +1 -0
  416. package/dist/worker/console/static/assets/swimlanes-SLNWSIFB-DvqgNPzD.js +2 -0
  417. package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-la8AC7fo.js +8 -0
  418. package/dist/worker/console/static/assets/timeline-definition-Z64GVDOM-2TyOYNx0.js +120 -0
  419. package/dist/worker/console/static/assets/vennDiagram-T6HMQDX7-B-nM6wM2.js +34 -0
  420. package/dist/worker/console/static/assets/wardleyDiagram-T6FBY63Y-B86wPdbr.js +78 -0
  421. package/dist/worker/console/static/assets/xychartDiagram-ELKLHX3M-Dr1C4AQz.js +7 -0
  422. package/dist/worker/console/static/favicon.svg +37 -0
  423. package/dist/worker/console/static/fonts/katex/KaTeX_AMS-Regular.woff2 +0 -0
  424. package/dist/worker/console/static/fonts/katex/KaTeX_Caligraphic-Bold.woff2 +0 -0
  425. package/dist/worker/console/static/fonts/katex/KaTeX_Caligraphic-Regular.woff2 +0 -0
  426. package/dist/worker/console/static/fonts/katex/KaTeX_Fraktur-Bold.woff2 +0 -0
  427. package/dist/worker/console/static/fonts/katex/KaTeX_Fraktur-Regular.woff2 +0 -0
  428. package/dist/worker/console/static/fonts/katex/KaTeX_Main-Bold.woff2 +0 -0
  429. package/dist/worker/console/static/fonts/katex/KaTeX_Main-BoldItalic.woff2 +0 -0
  430. package/dist/worker/console/static/fonts/katex/KaTeX_Main-Italic.woff2 +0 -0
  431. package/dist/worker/console/static/fonts/katex/KaTeX_Main-Regular.woff2 +0 -0
  432. package/dist/worker/console/static/fonts/katex/KaTeX_Math-BoldItalic.woff2 +0 -0
  433. package/dist/worker/console/static/fonts/katex/KaTeX_Math-Italic.woff2 +0 -0
  434. package/dist/worker/console/static/fonts/katex/KaTeX_SansSerif-Bold.woff2 +0 -0
  435. package/dist/worker/console/static/fonts/katex/KaTeX_SansSerif-Italic.woff2 +0 -0
  436. package/dist/worker/console/static/fonts/katex/KaTeX_SansSerif-Regular.woff2 +0 -0
  437. package/dist/worker/console/static/fonts/katex/KaTeX_Script-Regular.woff2 +0 -0
  438. package/dist/worker/console/static/fonts/katex/KaTeX_Size1-Regular.woff2 +0 -0
  439. package/dist/worker/console/static/fonts/katex/KaTeX_Size2-Regular.woff2 +0 -0
  440. package/dist/worker/console/static/fonts/katex/KaTeX_Size3-Regular.woff2 +0 -0
  441. package/dist/worker/console/static/fonts/katex/KaTeX_Size4-Regular.woff2 +0 -0
  442. package/dist/worker/console/static/fonts/katex/KaTeX_Typewriter-Regular.woff2 +0 -0
  443. package/dist/worker/console/static/index.html +15 -0
  444. package/dist/worker/console/static-src/app/console-types.js +184 -0
  445. package/dist/worker/console/static-src/app/useConsoleShell.js +101 -0
  446. package/dist/worker/console/static-src/app/useOperatorActions.js +324 -0
  447. package/dist/worker/console/static-src/app/usePrdImport.js +172 -0
  448. package/dist/worker/console/static-src/app/useRecoveryActions.js +289 -0
  449. package/dist/worker/console/static-src/app/useRecoveryConsole.js +425 -0
  450. package/dist/worker/console/static-src/app/useTaskWizard.js +296 -0
  451. package/dist/worker/console/static-src/chat-markdown-security.js +38 -0
  452. package/dist/worker/console/static-src/chat-view-types.js +2 -0
  453. package/dist/worker/console/static-src/night/night-types.js +24 -0
  454. package/dist/worker/console/static-src/night/useNightBoard.js +94 -0
  455. package/dist/worker/console/static-src/night/useNightWizard.js +171 -0
  456. package/dist/worker/console/static-src/night-prepare-result.js +118 -0
  457. package/dist/worker/console/static-src/operator-chat/activity-journey.js +125 -0
  458. package/dist/worker/console/static-src/operator-chat/activity-rail-presentation.js +73 -0
  459. package/dist/worker/console/static-src/operator-chat/activity-references.js +20 -0
  460. package/dist/worker/console/static-src/operator-chat/chat-sse-events.js +420 -0
  461. package/dist/worker/console/static-src/operator-chat/format.js +71 -0
  462. package/dist/worker/console/static-src/operator-chat/landing-density.js +23 -0
  463. package/dist/worker/console/static-src/operator-chat/mutation-gate.js +45 -0
  464. package/dist/worker/console/static-src/operator-chat/refs.js +86 -0
  465. package/dist/worker/console/static-src/operator-chat/resource-auto-invocation.js +91 -0
  466. package/dist/worker/console/static-src/operator-chat/resource-diagnostics.js +204 -0
  467. package/dist/worker/console/static-src/operator-chat/runtime-snapshot-store.js +257 -0
  468. package/dist/worker/console/static-src/operator-chat/session-title-watcher.js +128 -0
  469. package/dist/worker/console/static-src/operator-chat/sidebar-split.js +90 -0
  470. package/dist/worker/console/static-src/operator-chat/slash-palette-layout.js +24 -0
  471. package/dist/worker/console/static-src/operator-chat/slash-palette-nav.js +141 -0
  472. package/dist/worker/console/static-src/operator-chat/spatial-overlay.js +38 -0
  473. package/dist/worker/console/static-src/operator-chat/tools-catalog.js +77 -0
  474. package/dist/worker/console/static-src/operator-chat/turn-stream-controller.js +690 -0
  475. package/dist/worker/console/static-src/operator-chat/turn-submission.js +158 -0
  476. package/dist/worker/console/static-src/operator-chat/types.js +1 -0
  477. package/dist/worker/console/static-src/operator-chat/useActivityRailTransition.js +59 -0
  478. package/dist/worker/console/static-src/operator-chat/useChatSessions.js +495 -0
  479. package/dist/worker/console/static-src/operator-chat/useChatStream.js +780 -0
  480. package/dist/worker/console/static-src/operator-chat/useChatThread.js +280 -0
  481. package/dist/worker/console/static-src/operator-chat/useComposer.js +257 -0
  482. package/dist/worker/console/static-src/operator-chat/useInterview.js +108 -0
  483. package/dist/worker/console/static-src/operator-chat/useOverlayFocus.js +84 -0
  484. package/dist/worker/console/static-src/operator-chat/useRepoBrowser.js +148 -0
  485. package/dist/worker/console/static-src/operator-chat/useRuntimeControls.js +358 -0
  486. package/dist/worker/console/static-src/operator-chat/useRuntimeSnapshot.js +196 -0
  487. package/dist/worker/console/static-src/operator-chat/useWorkspaceLayout.js +58 -0
  488. package/dist/worker/console/static-src/operator-chat/workspace-layout-mode.js +35 -0
  489. package/dist/worker/console/static-src/prd-file-import.js +218 -0
  490. package/dist/worker/console/vite.config.js +27 -0
  491. package/dist/worker/console/workflow-kinds.js +46 -0
  492. package/dist/worker/delivery/final-verification.js +302 -0
  493. package/dist/worker/delivery/git-transaction.js +497 -0
  494. package/dist/worker/delivery/package.js +537 -0
  495. package/dist/worker/delivery/verification-bundle.js +544 -0
  496. package/dist/worker/feature/acceptance-policy.js +227 -0
  497. package/dist/worker/feature/advance.js +301 -0
  498. package/dist/worker/feature/decision-loader.js +99 -0
  499. package/dist/worker/feature/discover.js +14 -0
  500. package/dist/worker/feature/doctor.js +223 -0
  501. package/dist/worker/feature/fullstack-validate.js +337 -0
  502. package/dist/worker/feature/next-action.js +140 -0
  503. package/dist/worker/feature/profile-schema.js +47 -0
  504. package/dist/worker/feature/ready-plan-projection.js +82 -0
  505. package/dist/worker/feature/reducer.js +137 -0
  506. package/dist/worker/feature/review.js +678 -0
  507. package/dist/worker/feature/run.js +390 -0
  508. package/dist/worker/feature/scaffold.js +812 -0
  509. package/dist/worker/feature/types.js +1 -0
  510. package/dist/worker/follow-up/approve.js +273 -0
  511. package/dist/worker/follow-up/factory.js +234 -0
  512. package/dist/worker/follow-up/paths.js +25 -0
  513. package/dist/worker/follow-up/policy.js +26 -0
  514. package/dist/worker/follow-up/schema.js +93 -0
  515. package/dist/worker/follow-up/store.js +96 -0
  516. package/dist/worker/loop-agent/command-result.js +1 -0
  517. package/dist/worker/loop-agent/controller-protocol.js +143 -0
  518. package/dist/worker/loop-agent/loop-agent-client.js +489 -0
  519. package/dist/worker/loop-agent/parse-json.js +14 -0
  520. package/dist/worker/materialize/harness-task-lifecycle-probe.js +126 -0
  521. package/dist/worker/materialize/harness-task-lineage.js +220 -0
  522. package/dist/worker/materialize/harness-task-materializer.js +648 -0
  523. package/dist/worker/metrics/projector.js +139 -0
  524. package/dist/worker/observability/dag-execution-trajectory.js +591 -0
  525. package/dist/worker/observability/event-history.js +216 -0
  526. package/dist/worker/observability/event-store.js +83 -0
  527. package/dist/worker/observability/events.js +79 -0
  528. package/dist/worker/observability/interrupt-eligibility.js +264 -0
  529. package/dist/worker/observability/progress-composite.js +34 -0
  530. package/dist/worker/observability/read-model.js +2499 -0
  531. package/dist/worker/observability/snapshot-store.js +43 -0
  532. package/dist/worker/observability/types.js +1 -0
  533. package/dist/worker/observe/dag-node-execution-output.js +180 -0
  534. package/dist/worker/observe/dag-run-artifacts.js +90 -0
  535. package/dist/worker/observe/health.js +58 -0
  536. package/dist/worker/observe/night-jobs.js +104 -0
  537. package/dist/worker/observe/node-input.js +441 -0
  538. package/dist/worker/observe/paths.js +174 -0
  539. package/dist/worker/observe/routes.js +1077 -0
  540. package/dist/worker/observe/server.js +117 -0
  541. package/dist/worker/observe/spec-evidence.js +398 -0
  542. package/dist/worker/observe/static/api.js +117 -0
  543. package/dist/worker/observe/static/app.js +169 -0
  544. package/dist/worker/observe/static/constants.js +182 -0
  545. package/dist/worker/observe/static/copy.js +67 -0
  546. package/dist/worker/observe/static/custom-select.js +567 -0
  547. package/dist/worker/observe/static/dag-edge-routing.js +368 -0
  548. package/dist/worker/observe/static/dag-helpers.js +161 -0
  549. package/dist/worker/observe/static/dag-history-labels.js +95 -0
  550. package/dist/worker/observe/static/dag-layout.d.ts +36 -0
  551. package/dist/worker/observe/static/dag-layout.js +163 -0
  552. package/dist/worker/observe/static/dag-model.js +145 -0
  553. package/dist/worker/observe/static/dom.js +220 -0
  554. package/dist/worker/observe/static/favicon.svg +37 -0
  555. package/dist/worker/observe/static/format-pool.d.ts +71 -0
  556. package/dist/worker/observe/static/format-pool.js +153 -0
  557. package/dist/worker/observe/static/format.js +347 -0
  558. package/dist/worker/observe/static/index.html +409 -0
  559. package/dist/worker/observe/static/kpi.js +78 -0
  560. package/dist/worker/observe/static/markdown-render.js +124 -0
  561. package/dist/worker/observe/static/operator-chrome.css +517 -0
  562. package/dist/worker/observe/static/operator-chrome.d.ts +83 -0
  563. package/dist/worker/observe/static/operator-chrome.js +623 -0
  564. package/dist/worker/observe/static/relations.js +133 -0
  565. package/dist/worker/observe/static/router.js +156 -0
  566. package/dist/worker/observe/static/run-processing.js +148 -0
  567. package/dist/worker/observe/static/shell-chrome.js +65 -0
  568. package/dist/worker/observe/static/state.js +496 -0
  569. package/dist/worker/observe/static/styles.css +3567 -0
  570. package/dist/worker/observe/static/views/batch.js +227 -0
  571. package/dist/worker/observe/static/views/dag-graph.js +508 -0
  572. package/dist/worker/observe/static/views/dag-inspector.js +1722 -0
  573. package/dist/worker/observe/static/views/dag-trajectory.js +313 -0
  574. package/dist/worker/observe/static/views/dag.js +483 -0
  575. package/dist/worker/observe/static/views/dags.js +877 -0
  576. package/dist/worker/observe/static/views/dashboard.js +747 -0
  577. package/dist/worker/observe/static/views/failures.js +143 -0
  578. package/dist/worker/observe/static/views/feature.js +492 -0
  579. package/dist/worker/observe/static/views/night.js +201 -0
  580. package/dist/worker/observe/static/views/pool.js +708 -0
  581. package/dist/worker/observe/static/views/run.js +453 -0
  582. package/dist/worker/observe/static/views/session-timeline.js +771 -0
  583. package/dist/worker/observe/static/views/shell.js +7 -0
  584. package/dist/worker/observe/static/views/task.js +315 -0
  585. package/dist/worker/observe/static/views/timeline.js +163 -0
  586. package/dist/worker/outcomes/adapters.js +153 -0
  587. package/dist/worker/outcomes/declared-artifacts.js +103 -0
  588. package/dist/worker/outcomes/evidence-tokens.js +29 -0
  589. package/dist/worker/outcomes/gate.js +40 -0
  590. package/dist/worker/outcomes/projector.js +227 -0
  591. package/dist/worker/outcomes/registry.js +1 -0
  592. package/dist/worker/outcomes/store.js +131 -0
  593. package/dist/worker/outcomes/types.js +79 -0
  594. package/dist/worker/pool/attempt-identity.js +41 -0
  595. package/dist/worker/pool/attempt-lease.js +184 -0
  596. package/dist/worker/pool/attempt-transition.js +210 -0
  597. package/dist/worker/pool/begin-attempt-with-lease.js +26 -0
  598. package/dist/worker/pool/begin-attempt.js +35 -0
  599. package/dist/worker/pool/doctor.js +165 -0
  600. package/dist/worker/pool/failure-routing.js +182 -0
  601. package/dist/worker/pool/migrate-state.js +303 -0
  602. package/dist/worker/pool/reconcile.js +285 -0
  603. package/dist/worker/pool/recovery-decision.js +163 -0
  604. package/dist/worker/pool/run-owner-store.js +126 -0
  605. package/dist/worker/pool/run-store.js +360 -0
  606. package/dist/worker/pool/runtime-reconcile-inventory.js +127 -0
  607. package/dist/worker/pool/state-projection.js +57 -0
  608. package/dist/worker/pool/types.js +17 -0
  609. package/dist/worker/pool/validation.js +144 -0
  610. package/dist/worker/preflight.js +157 -0
  611. package/dist/worker/profile-mapping.js +76 -0
  612. package/dist/worker/progress-reporter.js +63 -0
  613. package/dist/worker/report/morning-report.js +155 -0
  614. package/dist/worker/repos/repo-resolver.js +23 -0
  615. package/dist/worker/run-task/execute-prepared-task.js +178 -0
  616. package/dist/worker/run-task/run-task.js +912 -0
  617. package/dist/worker/runner/run-ready.js +561 -0
  618. package/dist/worker/runner/single-task-attempt.js +176 -0
  619. package/dist/worker/scheduler/admission.js +547 -0
  620. package/dist/worker/scheduler/auto-followup.js +99 -0
  621. package/dist/worker/scheduler/cli.js +644 -0
  622. package/dist/worker/scheduler/clock-install/darwin-launchd.js +238 -0
  623. package/dist/worker/scheduler/clock-install/linux-systemd-user.js +224 -0
  624. package/dist/worker/scheduler/clock-install/types.js +1 -0
  625. package/dist/worker/scheduler/clock-install/win32-schtasks.js +227 -0
  626. package/dist/worker/scheduler/clock-install.js +284 -0
  627. package/dist/worker/scheduler/clock.js +420 -0
  628. package/dist/worker/scheduler/dispatcher.js +503 -0
  629. package/dist/worker/scheduler/doctor.js +431 -0
  630. package/dist/worker/scheduler/evidence.js +170 -0
  631. package/dist/worker/scheduler/git-base.js +90 -0
  632. package/dist/worker/scheduler/index.js +25 -0
  633. package/dist/worker/scheduler/lease.js +114 -0
  634. package/dist/worker/scheduler/lifecycle.js +348 -0
  635. package/dist/worker/scheduler/lock.js +80 -0
  636. package/dist/worker/scheduler/morning-window.js +191 -0
  637. package/dist/worker/scheduler/night-git-finalizer.js +114 -0
  638. package/dist/worker/scheduler/night-harvest.js +412 -0
  639. package/dist/worker/scheduler/paths.js +92 -0
  640. package/dist/worker/scheduler/prepared-attempt-recovery.js +471 -0
  641. package/dist/worker/scheduler/recovery.js +277 -0
  642. package/dist/worker/scheduler/reservation.js +146 -0
  643. package/dist/worker/scheduler/retry.js +199 -0
  644. package/dist/worker/scheduler/scheduler-loop.js +272 -0
  645. package/dist/worker/scheduler/store.js +275 -0
  646. package/dist/worker/scheduler/traceability.js +54 -0
  647. package/dist/worker/scheduler/trigger.js +258 -0
  648. package/dist/worker/scheduler/types.js +369 -0
  649. package/dist/worker/scheduler/workspace-adapter.js +128 -0
  650. package/dist/worker/task-graph/acceptance-schema.js +40 -0
  651. package/dist/worker/task-graph/ready-planner.js +267 -0
  652. package/dist/worker/task-graph/ready-queue.js +23 -0
  653. package/dist/worker/task-graph/task-graph-schema.js +59 -0
  654. package/dist/worker/task-graph/types.js +1 -0
  655. package/dist/worker/task-graph/validate.js +293 -0
  656. package/dist/worker/task-spec/complexity-mapping.js +8 -0
  657. package/dist/worker/task-spec/schema.js +125 -0
  658. package/dist/worker/task-spec/types.js +1 -0
  659. package/dist/worker/task-spec/validate.js +391 -0
  660. package/dist/worker/task-spec/workflow-routing.js +149 -0
  661. package/dist/workflows/dag/authoring.js +8 -0
  662. package/dist/workflows/dag/authority-surface.js +138 -0
  663. package/dist/workflows/dag/backend-test-analysis-contract.js +507 -0
  664. package/dist/workflows/dag/backend-test-case-coverage-analysis.js +1985 -0
  665. package/dist/workflows/dag/backend-test-case-manifest.js +638 -0
  666. package/dist/workflows/dag/backend-test-classification-contract.js +38 -0
  667. package/dist/workflows/dag/backend-test-contract-envelope.js +205 -0
  668. package/dist/workflows/dag/backend-test-coverage-contract.js +202 -0
  669. package/dist/workflows/dag/backend-test-execution-contract.js +715 -0
  670. package/dist/workflows/dag/backend-test-gap-fill.js +205 -0
  671. package/dist/workflows/dag/backend-test-intake-context.js +178 -0
  672. package/dist/workflows/dag/backend-test-layout.js +133 -0
  673. package/dist/workflows/dag/backend-test-markdown-workflow.js +1984 -0
  674. package/dist/workflows/dag/backend-test-module-stem.js +26 -0
  675. package/dist/workflows/dag/backend-test-pytest-collection.js +859 -0
  676. package/dist/workflows/dag/backend-test-result-contract.js +1030 -0
  677. package/dist/workflows/dag/backend-test-scenario-param.js +1670 -0
  678. package/dist/workflows/dag/backend-test-scenario-partitions.js +249 -0
  679. package/dist/workflows/dag/backend-test-semantic-review-contract.js +36 -0
  680. package/dist/workflows/dag/backend-test-stability-contract.js +57 -0
  681. package/dist/workflows/dag/backend-test-writer-completeness.js +1058 -0
  682. package/dist/workflows/dag/budget-enforcement.js +67 -0
  683. package/dist/workflows/dag/canvas-observer.js +474 -0
  684. package/dist/workflows/dag/context-policy.js +137 -0
  685. package/dist/workflows/dag/contract-output-registry.js +14 -0
  686. package/dist/workflows/dag/contract-validator-registrations.js +10 -0
  687. package/dist/workflows/dag/controller-identity.js +104 -0
  688. package/dist/workflows/dag/convergence/controller.js +596 -0
  689. package/dist/workflows/dag/decision-envelope.js +557 -0
  690. package/dist/workflows/dag/decision-evidence.js +153 -0
  691. package/dist/workflows/dag/decision-gates.js +1 -0
  692. package/dist/workflows/dag/dynamic-runtime/condition.js +48 -0
  693. package/dist/workflows/dag/dynamic-runtime/loop-until.js +161 -0
  694. package/dist/workflows/dag/dynamic-runtime/map.js +435 -0
  695. package/dist/workflows/dag/dynamic-runtime/reduction.js +72 -0
  696. package/dist/workflows/dag/dynamic-runtime/shared.js +203 -0
  697. package/dist/workflows/dag/event-observer.js +132 -0
  698. package/dist/workflows/dag/executor-registry.js +23 -0
  699. package/dist/workflows/dag/facts.js +4 -0
  700. package/dist/workflows/dag/failure-category.js +118 -0
  701. package/dist/workflows/dag/failure-routing.js +105 -0
  702. package/dist/workflows/dag/final-verification.js +180 -0
  703. package/dist/workflows/dag/frontend-implementation-contract.js +1911 -0
  704. package/dist/workflows/dag/frontend-lint-baseline.js +474 -0
  705. package/dist/workflows/dag/frontend-plan-render.js +90 -0
  706. package/dist/workflows/dag/frontend-prewrite-gate.js +1011 -0
  707. package/dist/workflows/dag/frontend-project-capability.js +1 -0
  708. package/dist/workflows/dag/frontend-recovery-plan.js +73 -0
  709. package/dist/workflows/dag/frontend-recovery-root-manifest.js +123 -0
  710. package/dist/workflows/dag/frontend-recovery-run.js +539 -0
  711. package/dist/workflows/dag/frontend-repair.js +541 -0
  712. package/dist/workflows/dag/frontend-review-context.js +116 -0
  713. package/dist/workflows/dag/frontend-risk.js +161 -0
  714. package/dist/workflows/dag/frontend-test-case-checklist.js +343 -0
  715. package/dist/workflows/dag/frontend-test-case-manifest.js +104 -0
  716. package/dist/workflows/dag/frontend-test-case-quality.js +105 -0
  717. package/dist/workflows/dag/frontend-test-html-report.js +174 -0
  718. package/dist/workflows/dag/frontend-test-l5-report.js +177 -0
  719. package/dist/workflows/dag/frontend-test-result-contract.js +487 -0
  720. package/dist/workflows/dag/frontend-verification-trace.js +275 -0
  721. package/dist/workflows/dag/frontend-worktree-diff.js +201 -0
  722. package/dist/workflows/dag/frontend-writer-recovery.js +106 -0
  723. package/dist/workflows/dag/frontend-writer-rollback.js +821 -0
  724. package/dist/workflows/dag/governance-constants.js +5 -0
  725. package/dist/workflows/dag/governance-profile.js +413 -0
  726. package/dist/workflows/dag/index.js +6 -0
  727. package/dist/workflows/dag/init-hybrid.js +7345 -0
  728. package/dist/workflows/dag/interrupt-request.js +559 -0
  729. package/dist/workflows/dag/knowledge-curator.js +165 -0
  730. package/dist/workflows/dag/l5-report-metrics.js +33 -0
  731. package/dist/workflows/dag/lifecycle.js +855 -0
  732. package/dist/workflows/dag/liveness-policy.js +251 -0
  733. package/dist/workflows/dag/node-execution.js +1081 -0
  734. package/dist/workflows/dag/observer-compose.js +52 -0
  735. package/dist/workflows/dag/output-protocol.js +356 -0
  736. package/dist/workflows/dag/project-governance-context.js +514 -0
  737. package/dist/workflows/dag/prompt-source.js +88 -0
  738. package/dist/workflows/dag/prompt.js +348 -0
  739. package/dist/workflows/dag/reconcile-run.js +145 -0
  740. package/dist/workflows/dag/reconcile-tasks.js +404 -0
  741. package/dist/workflows/dag/recovery-recommendation.js +329 -0
  742. package/dist/workflows/dag/repair-artifact.js +363 -0
  743. package/dist/workflows/dag/report.js +1229 -0
  744. package/dist/workflows/dag/rerun-plan.js +614 -0
  745. package/dist/workflows/dag/rerun-run.js +556 -0
  746. package/dist/workflows/dag/rerun-task.js +370 -0
  747. package/dist/workflows/dag/retry-policy.js +263 -0
  748. package/dist/workflows/dag/run-store.js +41 -0
  749. package/dist/workflows/dag/runner.js +1069 -0
  750. package/dist/workflows/dag/runtime-contract.js +87 -0
  751. package/dist/workflows/dag/runtime.js +5 -0
  752. package/dist/workflows/dag/scheduler.js +497 -0
  753. package/dist/workflows/dag/sdd-embedded.js +128 -0
  754. package/dist/workflows/dag/skill-instructions.js +478 -0
  755. package/dist/workflows/dag/skill-snapshot.js +553 -0
  756. package/dist/workflows/dag/skills.js +41 -0
  757. package/dist/workflows/dag/spec.js +3 -0
  758. package/dist/workflows/dag/task-contract-binding.js +138 -0
  759. package/dist/workflows/dag/task-demand-routing.js +1 -0
  760. package/dist/workflows/dag/topo.js +30 -0
  761. package/dist/workflows/dag/types.js +1145 -0
  762. package/dist/workflows/dag/upstream-artifacts.js +98 -0
  763. package/dist/workflows/dag/validate.js +998 -0
  764. package/dist/workflows/dag/workspace-checkpoint.js +186 -0
  765. package/dist/workflows/dynamic/artifacts.js +65 -0
  766. package/dist/workflows/dynamic/compile.js +371 -0
  767. package/dist/workflows/dynamic/compileTypes.js +1 -0
  768. package/dist/workflows/dynamic/errors.js +5 -0
  769. package/dist/workflows/dynamic/index.js +7 -0
  770. package/dist/workflows/dynamic/profiles.js +156 -0
  771. package/dist/workflows/dynamic/spec.js +115 -0
  772. package/dist/workflows/dynamic/validate.js +275 -0
  773. package/dist/workflows/loop/actions/dag-action.js +129 -0
  774. package/dist/workflows/loop/actions/pi-review.js +267 -0
  775. package/dist/workflows/loop/actions/shared.js +157 -0
  776. package/dist/workflows/loop/actions/shell-verify.js +82 -0
  777. package/dist/workflows/loop/actions/types.js +1 -0
  778. package/dist/workflows/loop/actions/workflow-action.js +255 -0
  779. package/dist/workflows/loop/actions.js +160 -0
  780. package/dist/workflows/loop/benchmark.js +510 -0
  781. package/dist/workflows/loop/closeout.js +135 -0
  782. package/dist/workflows/loop/context.js +47 -0
  783. package/dist/workflows/loop/events.js +26 -0
  784. package/dist/workflows/loop/hash.js +32 -0
  785. package/dist/workflows/loop/index.js +8 -0
  786. package/dist/workflows/loop/paths.js +17 -0
  787. package/dist/workflows/loop/policy/auto-policy.js +112 -0
  788. package/dist/workflows/loop/policy/path-patterns.js +13 -0
  789. package/dist/workflows/loop/rounds.js +81 -0
  790. package/dist/workflows/loop/signals.js +52 -0
  791. package/dist/workflows/loop/state.js +116 -0
  792. package/dist/workflows/loop/templates.js +54 -0
  793. package/dist/workflows/loop/types.js +28 -0
  794. package/docs/README.md +82 -0
  795. package/docs/architecture/README.md +35 -0
  796. package/docs/architecture/dag-execution.md +165 -0
  797. package/docs/architecture/evolution.md +108 -0
  798. package/docs/architecture/facts-and-state.md +74 -0
  799. package/docs/architecture/runtime-boundaries.md +226 -0
  800. package/docs/architecture/system-overview.md +100 -0
  801. package/docs/architecture/worker-and-feature.md +122 -0
  802. package/docs/governance/README.md +18 -0
  803. package/docs/governance/harness-methodology-debugging.md +177 -0
  804. package/docs/governance/harness-methodology-tdd.md +130 -0
  805. package/docs/governance/harness-methodology-verification.md +27 -0
  806. package/docs/init-surface.manifest.json +358 -0
  807. package/docs/operations/README.md +15 -0
  808. package/docs/operations/local-development-environment.md +77 -0
  809. package/docs/skills/README.md +7 -0
  810. package/docs/skills/vetted-skill-registry.md +49 -0
  811. package/docs/templates/README.md +67 -0
  812. package/docs/templates/adr.md +60 -0
  813. package/docs/templates/agent-dag-authority-surface-audit.prompt.md +94 -0
  814. package/docs/templates/agent-dag-decision-envelope.schema.json +213 -0
  815. package/docs/templates/agent-dag-decision-gate-dogfood-report.md +117 -0
  816. package/docs/templates/agent-dag-decision-gate.prompt.md +246 -0
  817. package/docs/templates/agent-dag-process-supervisor.prompt.md +98 -0
  818. package/docs/templates/agent-dag-report.schema.json +473 -0
  819. package/docs/templates/agent-dag-review-verdict.prompt.md +68 -0
  820. package/docs/templates/agent-dag.base.json +190 -0
  821. package/docs/templates/agent-dag.final-verification.json +185 -0
  822. package/docs/templates/agent-dag.schema.json +590 -0
  823. package/docs/templates/agent-dag.supervised-implementation.json +640 -0
  824. package/docs/templates/agent-worker-production-readiness-checklist.md +47 -0
  825. package/docs/templates/backend-test-analysis.schema.json +37 -0
  826. package/docs/templates/backend-test-case-manifest.schema.json +223 -0
  827. package/docs/templates/backend-test-dag.classify.prompt.md +75 -0
  828. package/docs/templates/backend-test-dag.generate-pytest.prompt.md +41 -0
  829. package/docs/templates/backend-test-dag.json +671 -0
  830. package/docs/templates/backend-test-dag.retrospect.prompt.md +165 -0
  831. package/docs/templates/backend-test-dag.review-cases.prompt.md +36 -0
  832. package/docs/templates/backend-test-execution.schema.json +138 -0
  833. package/docs/templates/backend-test-result.schema.json +99 -0
  834. package/docs/templates/branch-merge-report.md +115 -0
  835. package/docs/templates/evaluation/agents-map-slim-v1.candidate.json +9 -0
  836. package/docs/templates/evaluation/agents-map-slim-v1.md +87 -0
  837. package/docs/templates/evaluation/agents-map-verbose-v0.candidate.json +9 -0
  838. package/docs/templates/evaluation/agents-map-verbose-v0.md +153 -0
  839. package/docs/templates/evaluation/campaign-budget-v1.json +12 -0
  840. package/docs/templates/evaluation/campaign-dogfood-v0.json +24 -0
  841. package/docs/templates/evaluation/campaign-evidence-v1.json +44 -0
  842. package/docs/templates/evaluation/context-policy-baseline-v1.json +17 -0
  843. package/docs/templates/evaluation/context-policy-role-specialized-v1.json +28 -0
  844. package/docs/templates/evaluation/corpus-dogfood-v0.manifest.json +118 -0
  845. package/docs/templates/evaluation/matrix-dag-dry-run-v1.json +21 -0
  846. package/docs/templates/evaluation/matrix-fixture-v1.json +10 -0
  847. package/docs/templates/evaluation/private-verifier-dogfood-v0.json +16 -0
  848. package/docs/templates/exec-plan.md +66 -0
  849. package/docs/templates/feature-spec.md +53 -0
  850. package/docs/templates/frontend-design-contract.md +68 -0
  851. package/docs/templates/frontend-eval/fixtures/failures/01-type-build-error.md +17 -0
  852. package/docs/templates/frontend-eval/fixtures/failures/02-unit-component-test-fail.md +16 -0
  853. package/docs/templates/frontend-eval/fixtures/failures/03-fixture-schema-drift.md +16 -0
  854. package/docs/templates/frontend-eval/fixtures/failures/04-missing-loading-empty-error-state.md +16 -0
  855. package/docs/templates/frontend-eval/fixtures/failures/05-forbidden-write-writeset-expansion.md +16 -0
  856. package/docs/templates/frontend-eval/fixtures/failures/06-unapproved-dependency-add.md +16 -0
  857. package/docs/templates/frontend-eval/fixtures/failures/07-mock-production-on.md +21 -0
  858. package/docs/templates/frontend-eval/fixtures/functional/01-simple-component-style.md +29 -0
  859. package/docs/templates/frontend-eval/fixtures/functional/02-form-validation.md +28 -0
  860. package/docs/templates/frontend-eval/fixtures/functional/03-list-detail-page.md +28 -0
  861. package/docs/templates/frontend-eval/fixtures/functional/04-api-mock.md +29 -0
  862. package/docs/templates/frontend-eval/fixtures/functional/05-permission-auth-gated-ui.md +27 -0
  863. package/docs/templates/frontend-eval/fixtures/functional/06-ssr-server-client-boundary.md +28 -0
  864. package/docs/templates/frontend-eval/fixtures/functional/07-shared-public-component-api.md +28 -0
  865. package/docs/templates/frontend-eval/fixtures/functional/08-pure-local-no-remote.md +27 -0
  866. package/docs/templates/frontend-eval/metrics.md +138 -0
  867. package/docs/templates/frontend-eval/smoke-targets.md +53 -0
  868. package/docs/templates/frontend-implementation-contract.schema.json +35 -0
  869. package/docs/templates/frontend-task-constraints.md +62 -0
  870. package/docs/templates/frontend-task-requirement.md +104 -0
  871. package/docs/templates/frontend-test-case-checklist.md +44 -0
  872. package/docs/templates/frontend-test-case.example.md +143 -0
  873. package/docs/templates/frontend-test-dag.generate-cases.prompt.md +63 -0
  874. package/docs/templates/frontend-test-dag.json +409 -0
  875. package/docs/templates/frontend-test-dag.retrieve-context.prompt.md +21 -0
  876. package/docs/templates/frontend-test-dag.retrospect.prompt.md +5 -0
  877. package/docs/templates/frontend-test-dag.review-cases.prompt.md +5 -0
  878. package/docs/templates/frontend-test-dag.review-execution.prompt.md +3 -0
  879. package/docs/templates/frontend-test-standard-scenarios.v1.json +159 -0
  880. package/docs/templates/harness.schema.json +351 -0
  881. package/docs/templates/hybrid-dag.json +188 -0
  882. package/docs/templates/init-evolution-review.md +35 -0
  883. package/docs/templates/init-managed-agents.md +157 -0
  884. package/docs/templates/interactive-ui-round2-experiment.md +66 -0
  885. package/docs/templates/knowledge-graph-bootstrap-dag.json +118 -0
  886. package/docs/templates/knowledge-sync-dag.json +178 -0
  887. package/docs/templates/knowledge-sync-draft.schema.json +71 -0
  888. package/docs/templates/product-line/AGENTS.md +9 -0
  889. package/docs/templates/product-line/README.md +42 -0
  890. package/docs/templates/product-line/acceptance.yaml +23 -0
  891. package/docs/templates/product-line/closeout.yaml +9 -0
  892. package/docs/templates/product-line/design.md +13 -0
  893. package/docs/templates/product-line/feature-scaffold-batch.example.yaml +31 -0
  894. package/docs/templates/product-line/feature.yaml +11 -0
  895. package/docs/templates/product-line/links.md +10 -0
  896. package/docs/templates/product-line/requirement.md +17 -0
  897. package/docs/templates/product-line/scaffold-samples/README.md +36 -0
  898. package/docs/templates/product-line/scaffold-samples/backend-only/acceptance.yaml +16 -0
  899. package/docs/templates/product-line/scaffold-samples/backend-only/design.md +14 -0
  900. package/docs/templates/product-line/scaffold-samples/backend-only/feature.yaml +14 -0
  901. package/docs/templates/product-line/scaffold-samples/backend-only/requirement.md +6 -0
  902. package/docs/templates/product-line/scaffold-samples/backend-only/tasks/BE-IMPL-001.yaml +83 -0
  903. package/docs/templates/product-line/scaffold-samples/backend-only/tasks/task-graph.yaml +14 -0
  904. package/docs/templates/product-line/scaffold-samples/fe-with-api/acceptance.yaml +18 -0
  905. package/docs/templates/product-line/scaffold-samples/fe-with-api/design.md +18 -0
  906. package/docs/templates/product-line/scaffold-samples/fe-with-api/feature.yaml +14 -0
  907. package/docs/templates/product-line/scaffold-samples/fe-with-api/requirement.md +6 -0
  908. package/docs/templates/product-line/scaffold-samples/fe-with-api/tasks/BE-IMPL-001.yaml +84 -0
  909. package/docs/templates/product-line/scaffold-samples/fe-with-api/tasks/CONTRACT-001.yaml +84 -0
  910. package/docs/templates/product-line/scaffold-samples/fe-with-api/tasks/FE-IMPL-001.yaml +86 -0
  911. package/docs/templates/product-line/scaffold-samples/fe-with-api/tasks/task-graph.yaml +40 -0
  912. package/docs/templates/product-line/scaffold-samples/frontend-only/acceptance.yaml +16 -0
  913. package/docs/templates/product-line/scaffold-samples/frontend-only/design.md +14 -0
  914. package/docs/templates/product-line/scaffold-samples/frontend-only/feature.yaml +14 -0
  915. package/docs/templates/product-line/scaffold-samples/frontend-only/requirement.md +6 -0
  916. package/docs/templates/product-line/scaffold-samples/frontend-only/tasks/FE-IMPL-001.yaml +85 -0
  917. package/docs/templates/product-line/scaffold-samples/frontend-only/tasks/task-graph.yaml +14 -0
  918. package/docs/templates/product-line/task-graph.yaml +23 -0
  919. package/docs/templates/product-line/task.yaml +68 -0
  920. package/docs/templates/product-line/test-plan.md +7 -0
  921. package/docs/templates/production-readiness-checklist.md +57 -0
  922. package/docs/templates/progress-log.md +27 -0
  923. package/docs/templates/project-start-checklist.md +9 -0
  924. package/docs/templates/qa-report.md +48 -0
  925. package/docs/templates/sprint-contract.md +29 -0
  926. package/docs/templates/worker-dogfood-evidence.md +80 -0
  927. package/docs/templates/worker-dogfood-setup.md +68 -0
  928. package/examples/decision-gate-agent-dag.json +177 -0
  929. package/examples/example-dag.json +46 -0
  930. package/examples/hybrid-loop-agent-dag.json +189 -0
  931. package/examples/l5-report-coms-process-definition.html +322 -0
  932. package/examples/l5-report-demo.html +79 -0
  933. package/harness.json +90 -0
  934. package/package.json +98 -0
  935. package/scripts/kb-bootstrap-init-skeleton.sh +241 -0
  936. package/scripts/kb-graph-incremental-prepare.mjs +386 -0
  937. package/scripts/kb-graph-materialize.mjs +105 -0
  938. package/scripts/kb-graph-promote.mjs +164 -0
  939. package/scripts/kb-query.mjs +554 -0
  940. package/skills/agent-worker/SKILL.md +48 -0
  941. package/skills/agent-worker/references/agent-worker-operator.md +159 -0
  942. package/skills/ai-engineering-context/SKILL.md +48 -0
  943. package/skills/analyze-product-dependencies/SKILL.md +108 -0
  944. package/skills/analyze-product-dependencies/references/api-documentation-schema.md +35 -0
  945. package/skills/analyze-product-dependencies/references/dependency-analysis-schema.md +38 -0
  946. package/skills/analyze-product-dependencies/references/example.md +76 -0
  947. package/skills/analyze-product-dependencies/references/forward-test-cases.md +110 -0
  948. package/skills/analyze-product-dependencies/references/input-contract.md +34 -0
  949. package/skills/analyze-product-dependencies/references/kb-integration.md +64 -0
  950. package/skills/analyze-product-dependencies/references/scouting-rules.md +76 -0
  951. package/skills/analyze-product-dependencies/scripts/test-validators.mjs +460 -0
  952. package/skills/analyze-product-dependencies/scripts/validate-api-documentation.mjs +194 -0
  953. package/skills/analyze-product-dependencies/scripts/validate-dependency-analysis.mjs +200 -0
  954. package/skills/analyze-product-dependencies/scripts/validate-product-requirement-input.mjs +90 -0
  955. package/skills/analyze-product-dependencies/scripts/validation-helpers.mjs +138 -0
  956. package/skills/analyze-product-requirements/SKILL.md +145 -0
  957. package/skills/analyze-product-requirements/references/acceptance-criteria.md +87 -0
  958. package/skills/analyze-product-requirements/references/clarification-and-knowledge.md +70 -0
  959. package/skills/analyze-product-requirements/references/example.md +104 -0
  960. package/skills/analyze-product-requirements/references/forward-test-cases.md +144 -0
  961. package/skills/analyze-product-requirements/references/kb-integration.md +56 -0
  962. package/skills/analyze-product-requirements/references/product-analysis-schema.md +41 -0
  963. package/skills/analyze-product-requirements/references/product-requirement-schema.md +42 -0
  964. package/skills/analyze-product-requirements/references/requirement-clarification-schema.md +66 -0
  965. package/skills/analyze-product-requirements/scripts/compute-source-identity.mjs +35 -0
  966. package/skills/analyze-product-requirements/scripts/test-validators.mjs +501 -0
  967. package/skills/analyze-product-requirements/scripts/validate-product-analysis.mjs +100 -0
  968. package/skills/analyze-product-requirements/scripts/validate-product-requirement.mjs +109 -0
  969. package/skills/analyze-product-requirements/scripts/validate-requirement-clarification.mjs +109 -0
  970. package/skills/analyze-product-requirements/scripts/validation-helpers.mjs +175 -0
  971. package/skills/browser-tools/SKILL.md +196 -0
  972. package/skills/browser-tools/browser-content.js +103 -0
  973. package/skills/browser-tools/browser-cookies.js +35 -0
  974. package/skills/browser-tools/browser-eval.js +53 -0
  975. package/skills/browser-tools/browser-hn-scraper.js +108 -0
  976. package/skills/browser-tools/browser-nav.js +44 -0
  977. package/skills/browser-tools/browser-pick.js +162 -0
  978. package/skills/browser-tools/browser-screenshot.js +34 -0
  979. package/skills/browser-tools/browser-start.js +86 -0
  980. package/skills/browser-tools/package-lock.json +2556 -0
  981. package/skills/browser-tools/package.json +19 -0
  982. package/skills/code-review-core/SKILL.md +20 -0
  983. package/skills/codebase-scout/SKILL.md +19 -0
  984. package/skills/frontend-bounded-implement/SKILL.md +53 -0
  985. package/skills/frontend-design-review/SKILL.md +79 -0
  986. package/skills/frontend-design-review/references/review-checklist.md +43 -0
  987. package/skills/frontend-implementation/SKILL.md +52 -0
  988. package/skills/frontend-implementation/references/code-standards.md +33 -0
  989. package/skills/frontend-implementation/references/design-spec.md +56 -0
  990. package/skills/frontend-implementation/references/node-contracts.md +31 -0
  991. package/skills/frontend-review/SKILL.md +55 -0
  992. package/skills/frontend-review/references/review-findings.md +50 -0
  993. package/skills/frontend-verification/SKILL.md +61 -0
  994. package/skills/frontend-verification/references/verification-checklist.md +48 -0
  995. package/skills/grill-me/SKILL.md +10 -0
  996. package/skills/grill-with-docs/SKILL.md +80 -0
  997. package/skills/grill-with-docs/adr-format.md +58 -0
  998. package/skills/grill-with-docs/context-format.md +52 -0
  999. package/skills/init-capability-evolution/SKILL.md +70 -0
  1000. package/skills/local-jacoco-coverage/SKILL.md +281 -0
  1001. package/skills/local-jacoco-coverage/references/requirement-to-source-mapping.md +85 -0
  1002. package/skills/local-jacoco-coverage/references/runtime-alignment.md +106 -0
  1003. package/skills/local-jacoco-coverage/scripts/run-coverage-analysis.sh +148 -0
  1004. package/skills/local-jacoco-coverage/scripts/start-jacoco-agent.sh +110 -0
  1005. package/skills/loop-agent/SKILL.md +68 -0
  1006. package/skills/loop-agent/references/README.md +67 -0
  1007. package/skills/loop-agent/references/command-reference.md +645 -0
  1008. package/skills/loop-agent/references/docs-converge.md +126 -0
  1009. package/skills/loop-agent/references/harness-policy.md +289 -0
  1010. package/skills/loop-agent/references/hybrid-dag.md +245 -0
  1011. package/skills/loop-agent/references/learned/README.md +21 -0
  1012. package/skills/loop-agent/references/long-running-loop.md +57 -0
  1013. package/skills/loop-agent/references/model-routing.md +45 -0
  1014. package/skills/loop-agent/references/multi-worktree.md +54 -0
  1015. package/skills/loop-agent/references/one-shot-runs.md +84 -0
  1016. package/skills/loop-agent/references/orchestrator-and-interventions.md +175 -0
  1017. package/skills/loop-agent/references/pi-prompt.md +23 -0
  1018. package/skills/loop-agent/references/pi-subagent-assisted-mode.md +84 -0
  1019. package/skills/loop-agent/references/post-implementation-and-patterns.md +54 -0
  1020. package/skills/loop-agent/references/source-and-plan-practice.md +169 -0
  1021. package/skills/loop-agent/references/task-workflow.md +104 -0
  1022. package/skills/loop-agent/references/verification-and-failure-handling.md +148 -0
  1023. package/skills/playwright-cli/SKILL.md +93 -0
  1024. package/skills/playwright-cli/references/element-attributes.md +23 -0
  1025. package/skills/playwright-cli/references/playwright-tests.md +39 -0
  1026. package/skills/playwright-cli/references/request-mocking.md +87 -0
  1027. package/skills/playwright-cli/references/running-code.md +241 -0
  1028. package/skills/playwright-cli/references/session-management.md +225 -0
  1029. package/skills/playwright-cli/references/storage-state.md +275 -0
  1030. package/skills/playwright-cli/references/test-generation.md +433 -0
  1031. package/skills/playwright-cli/references/tracing.md +5 -0
  1032. package/skills/playwright-cli/references/video-recording.md +5 -0
  1033. package/skills/playwright-cli-case-generator/SKILL.md +108 -0
  1034. package/skills/requesting-code-review/SKILL.md +101 -0
  1035. package/skills/requesting-code-review/code-reviewer.md +168 -0
  1036. package/skills/systematic-debugging/CREATION-LOG.md +119 -0
  1037. package/skills/systematic-debugging/SKILL.md +312 -0
  1038. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  1039. package/skills/systematic-debugging/condition-based-waiting.md +115 -0
  1040. package/skills/systematic-debugging/defense-in-depth.md +122 -0
  1041. package/skills/systematic-debugging/find-polluter.sh +63 -0
  1042. package/skills/systematic-debugging/root-cause-tracing.md +169 -0
  1043. package/skills/systematic-debugging/test-academic.md +14 -0
  1044. package/skills/systematic-debugging/test-pressure-1.md +58 -0
  1045. package/skills/systematic-debugging/test-pressure-2.md +68 -0
  1046. package/skills/systematic-debugging/test-pressure-3.md +69 -0
  1047. package/skills/test-driven-development/SKILL.md +27 -0
  1048. package/skills/using-git-worktrees/SKILL.md +215 -0
  1049. package/skills/verification-before-completion/SKILL.md +154 -0
  1050. 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
+ }