@tea-agent/loop-agent 0.39.0-beta.1 → 0.39.0-beta.10

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 (331) hide show
  1. package/AGENTS.md +4 -1
  2. package/CHANGELOG.md +248 -95
  3. package/README.md +9 -5
  4. package/bin/loop-agent.js +7 -3
  5. package/dist/application/task-lifecycle/advance.js +12 -0
  6. package/dist/application/task-lifecycle/recommendations.js +13 -2
  7. package/dist/build-stamp.json +3 -3
  8. package/dist/cli/command-definitions.js +23 -5
  9. package/dist/cli/program.js +21 -2
  10. package/dist/cli/update/notifier.js +2 -2
  11. package/dist/cli/update/runtime-activity.js +1 -29
  12. package/dist/cli.js +2 -1
  13. package/dist/commands/client-recovery.js +3 -0
  14. package/dist/commands/dag-follow-up.js +138 -0
  15. package/dist/commands/dag-rerun.js +55 -1
  16. package/dist/commands/init-model-catalog.js +464 -0
  17. package/dist/commands/init-upgrade.js +265 -97
  18. package/dist/commands/init.js +455 -28
  19. package/dist/commands/inspect-next.js +8 -0
  20. package/dist/commands/task-advance.js +19 -0
  21. package/dist/executors/dag-pi-executor.js +2306 -61
  22. package/dist/executors/pi-executor.js +7 -0
  23. package/dist/executors/pi-extension-resolver.js +233 -0
  24. package/dist/executors/pi-playwright-cli-tool.js +74 -28
  25. package/dist/executors/pi-read-budget-policy.js +239 -0
  26. package/dist/executors/pi-sdk-executor.js +180 -33
  27. package/dist/executors/shell-executor.js +1249 -224
  28. package/dist/executors/shell-write-guard.js +14 -0
  29. package/dist/executors/workspace-write-snapshot.js +68 -0
  30. package/dist/infrastructure/harness/atomic-write.js +23 -0
  31. package/dist/shared/dag-failure-category.js +150 -0
  32. package/dist/shared/dag-prompt-override.js +27 -0
  33. package/dist/shared/openspec-spec.js +70 -4
  34. package/dist/shared/operator/capabilities.js +39 -0
  35. package/dist/shared/playwright-cli-command-policy.js +15 -0
  36. package/dist/shared/update/console-notifier.js +100 -0
  37. package/dist/{cli → shared}/update/npm-client.js +70 -15
  38. package/dist/{cli → shared}/update/state.js +41 -13
  39. package/dist/task/config-types.js +50 -5
  40. package/dist/task/contract/apply.js +11 -1
  41. package/dist/task/contract/constants.js +2 -0
  42. package/dist/task/contract/hash.js +3 -0
  43. package/dist/task/contract/observe.js +25 -4
  44. package/dist/task/contract/paths.js +2 -1
  45. package/dist/task/contract/project.js +18 -1
  46. package/dist/task/contract/schema.js +4 -1
  47. package/dist/task/contract/transaction.js +12 -0
  48. package/dist/task/frontend-project-capability.js +199 -18
  49. package/dist/task/source-prepare/completeness.js +188 -0
  50. package/dist/task/source-prepare/fragment-inventory.js +477 -0
  51. package/dist/task/source-prepare/index.js +3 -0
  52. package/dist/task/source-prepare/ledger-reconciliation.js +127 -0
  53. package/dist/task/source-prepare/ledger-review.js +214 -0
  54. package/dist/task/source-prepare/ledger.js +545 -0
  55. package/dist/task/source-prepare/parse-intent.js +24 -4
  56. package/dist/task/source-prepare/prepare.js +298 -1
  57. package/dist/task/source-prepare/semantic-intake.js +25 -5
  58. package/dist/task/source-prepare/source-fidelity-pi.js +384 -0
  59. package/dist/task/source-prepare/types.js +22 -0
  60. package/dist/task/source-references.js +22 -1
  61. package/dist/worker/cli.js +18 -2
  62. package/dist/worker/console/chat/chat-event-store.js +62 -4
  63. package/dist/worker/console/chat/context-panel.js +7 -0
  64. package/dist/worker/console/chat/deferred-turn.js +12 -0
  65. package/dist/worker/console/chat/operation-card.js +8 -1
  66. package/dist/worker/console/chat/pi-console-config.js +81 -10
  67. package/dist/worker/console/chat/pi-runtime.js +264 -16
  68. package/dist/worker/console/chat/provider-error.js +98 -0
  69. package/dist/worker/console/chat/routes.js +298 -32
  70. package/dist/worker/console/chat/session-stats.js +179 -0
  71. package/dist/worker/console/chat/session-store.js +93 -63
  72. package/dist/worker/console/chat/todos.js +115 -0
  73. package/dist/worker/console/chat/tool-preview.js +42 -0
  74. package/dist/worker/console/chat/turn-process.js +20 -55
  75. package/dist/worker/console/chat/user-questions.js +266 -0
  76. package/dist/worker/console/chat/workspace-landing.js +14 -0
  77. package/dist/worker/console/console-handoff.js +82 -0
  78. package/dist/worker/console/console-update-and-init.js +115 -0
  79. package/dist/worker/console/console-update-runtime.js +84 -0
  80. package/dist/worker/console/dag-execution-receipt.js +33 -0
  81. package/dist/worker/console/draft-store.js +49 -0
  82. package/dist/worker/console/frontend-human-decision-adapter.js +19 -0
  83. package/dist/worker/console/frontend-split-operation-adapter.js +20 -0
  84. package/dist/worker/console/index.js +3 -0
  85. package/dist/worker/console/inspect-split.js +18 -0
  86. package/dist/worker/console/native-directory-picker.js +13 -0
  87. package/dist/worker/console/operation-run-facts.js +19 -3
  88. package/dist/worker/console/operation-store.js +227 -7
  89. package/dist/worker/console/operator-actions.js +388 -0
  90. package/dist/worker/console/operator-surface-health.js +1 -0
  91. package/dist/worker/console/operator-user-error.js +2 -2
  92. package/dist/worker/console/prd-intake-bridge.js +13 -0
  93. package/dist/worker/console/routes.js +355 -3
  94. package/dist/worker/console/security.js +67 -13
  95. package/dist/worker/console/server.js +609 -164
  96. package/dist/worker/console/static/assets/{abnfDiagram-N423BO3Z-C4kVYweA.js → abnfDiagram-N423BO3Z-BAsjg7ew.js} +1 -1
  97. package/dist/worker/console/static/assets/{arc-Bj2M8iO5.js → arc-CyIlrwZw.js} +1 -1
  98. package/dist/worker/console/static/assets/{architectureDiagram-T3A2C74G-CLlXe4-6.js → architectureDiagram-T3A2C74G-Bo4tobhH.js} +1 -1
  99. package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-psEp5xH0.js → blockDiagram-VBNYF7ZC-Dfpow9gu.js} +1 -1
  100. package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-DeKcOCGJ.js → c4Diagram-5PPSVZJV-DPmzG_B4.js} +1 -1
  101. package/dist/worker/console/static/assets/channel-DSrJAn0-.js +1 -0
  102. package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-K0C744p1.js → chunk-2GRJ4B5K-pKQpB1UW.js} +1 -1
  103. package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-xbNw4J9-.js → chunk-2Q5K7J3B-5n9YYquZ.js} +1 -1
  104. package/dist/worker/console/static/assets/{chunk-5RXB4S5H-DjLaSDUO.js → chunk-5RXB4S5H-DP3CtA2a.js} +1 -1
  105. package/dist/worker/console/static/assets/{chunk-5VM5RSS4-CtiPlKel.js → chunk-5VM5RSS4-DYxMJPUy.js} +1 -1
  106. package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-DZtolir7.js → chunk-6Q2QTUOP-CS3D50Io.js} +1 -1
  107. package/dist/worker/console/static/assets/{chunk-GF5L2VYU-CPcdNeew.js → chunk-GF5L2VYU-gSdDfo5_.js} +1 -1
  108. package/dist/worker/console/static/assets/{chunk-JWPE2WC7-NgHc6V37.js → chunk-JWPE2WC7-A48q0ZNt.js} +1 -1
  109. package/dist/worker/console/static/assets/{chunk-KBJHAD2P-DQ_T-hg8.js → chunk-KBJHAD2P-ow8Mm3DY.js} +1 -1
  110. package/dist/worker/console/static/assets/{chunk-RYQCIY6F-DgLsxcVP.js → chunk-RYQCIY6F-CMKfLWYE.js} +1 -1
  111. package/dist/worker/console/static/assets/{chunk-XXDRQBXY-UrVoM9z1.js → chunk-XXDRQBXY-BiTBdQPX.js} +1 -1
  112. package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-DeMmPl0_.js +1 -0
  113. package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-DeMmPl0_.js +1 -0
  114. package/dist/worker/console/static/assets/{cose-bilkent-JH36ORCC-CLkYvTb3.js → cose-bilkent-JH36ORCC-Cm7exRz_.js} +1 -1
  115. package/dist/worker/console/static/assets/{cynefin-VYW2F7L2-BwT_xKrE.js → cynefin-VYW2F7L2-D9O5qGOu.js} +1 -1
  116. package/dist/worker/console/static/assets/{cynefinDiagram-MW4NZA55-Bi9tuzif.js → cynefinDiagram-MW4NZA55-CkvQnako.js} +1 -1
  117. package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-BCIqkWBV.js → dagre-VZM6K2ZE-B1rzp7CB.js} +1 -1
  118. package/dist/worker/console/static/assets/{diagram-7IWD3JNH-Dip6l9_Z.js → diagram-7IWD3JNH-BP07Ipcc.js} +1 -1
  119. package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-B-xkh_wK.js → diagram-B4RE2ZJO-BlPzweQb.js} +1 -1
  120. package/dist/worker/console/static/assets/{diagram-LBJQPF4R-DZO0kTt_.js → diagram-LBJQPF4R-CxPa7n0S.js} +1 -1
  121. package/dist/worker/console/static/assets/{diagram-Q27KOJAE-D6ZplNbZ.js → diagram-Q27KOJAE-CMTZs53A.js} +1 -1
  122. package/dist/worker/console/static/assets/{diagram-UB23O5K3-BPekbhoS.js → diagram-UB23O5K3-CxG_X52r.js} +1 -1
  123. package/dist/worker/console/static/assets/{ebnfDiagram-BXEA7PRR-BtmaJpK5.js → ebnfDiagram-BXEA7PRR-D8axtJM0.js} +1 -1
  124. package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-6DS0Xc44.js → erDiagram-JOGREHBK-DIsGzn7b.js} +1 -1
  125. package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-CihnROSm.js → flowDiagram-UKHOOZJN-CU9zkDG0.js} +1 -1
  126. package/dist/worker/console/static/assets/{ganttDiagram-PKOTCBZU-CZC4zOE2.js → ganttDiagram-PKOTCBZU-DCjTmz5P.js} +1 -1
  127. package/dist/worker/console/static/assets/{gitGraphDiagram-DS77QQ5N-Dq1fhzGN.js → gitGraphDiagram-DS77QQ5N-BksdmFzg.js} +1 -1
  128. package/dist/worker/console/static/assets/index-B-O5ChYq.css +1 -0
  129. package/dist/worker/console/static/assets/index-CfnY8AQx.js +407 -0
  130. package/dist/worker/console/static/assets/{infoDiagram-6WML65LV-DlSl4BGx.js → infoDiagram-6WML65LV-CGzzzJtL.js} +1 -1
  131. package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-snnzFl_U.js → ishikawaDiagram-WSZJBQD7-BdseB80N.js} +1 -1
  132. package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-BDE7qpMx.js → journeyDiagram-NVQOT4AX-DM9gsgha.js} +1 -1
  133. package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-CD2Ci04G.js → kanban-definition-27J2QSJJ-3q-_9R2b.js} +1 -1
  134. package/dist/worker/console/static/assets/{linear-DdnapKIH.js → linear-B8N-Mxsd.js} +1 -1
  135. package/dist/worker/console/static/assets/{mermaid.core-BVjAT9b8.js → mermaid.core-EPIHUUsu.js} +5 -5
  136. package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-D0yJk-zA.js → mindmap-definition-FAOFIHXS-CxwO12aa.js} +1 -1
  137. package/dist/worker/console/static/assets/{pegDiagram-VL7TDLO6-BVo9tFP-.js → pegDiagram-VL7TDLO6-bPqbVX6Y.js} +1 -1
  138. package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-DnOV-mZ_.js → pieDiagram-7S7Q4E2Y-KzqIvzeX.js} +1 -1
  139. package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-CzUJo58i.js → quadrantDiagram-CIZ2JOQS-CyofpWiV.js} +1 -1
  140. package/dist/worker/console/static/assets/{railroadDiagram-AXF67PYL-Bvikrolh.js → railroadDiagram-AXF67PYL-cTWJvLTP.js} +1 -1
  141. package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP-DtaSVCap.js → requirementDiagram-LRYGKXZP-BK--q27B.js} +1 -1
  142. package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-C2c9A0wW.js → sankeyDiagram-W5VNT64P-C0SDOHXK.js} +1 -1
  143. package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-DmXJcU7r.js → sequenceDiagram-SI44F4Z6-Cong6YIo.js} +1 -1
  144. package/dist/worker/console/static/assets/{sizeCapture-X5ZJPWSS-B4GUFW92.js → sizeCapture-X5ZJPWSS-DUVkgZx8.js} +1 -1
  145. package/dist/worker/console/static/assets/{stateDiagram-OKZ733FA-Dsad2MXf.js → stateDiagram-OKZ733FA-C7XgxuZg.js} +1 -1
  146. package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-Dzbnd5oX.js +1 -0
  147. package/dist/worker/console/static/assets/{swimlanes-SLNWSIFB-DGq48Fbi.js → swimlanes-SLNWSIFB-D9Ayvwcy.js} +2 -2
  148. package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-BY0hHk6G.js +8 -0
  149. package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-CSSi6OFf.js → timeline-definition-Z64GVDOM-Byb000cH.js} +1 -1
  150. package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-BqyzPrWv.js → vennDiagram-T6HMQDX7-DMLegPt4.js} +1 -1
  151. package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-DlznVb6S.js → wardleyDiagram-T6FBY63Y-ChMMeOsP.js} +1 -1
  152. package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-CfBcgJ_K.js → xychartDiagram-ELKLHX3M-bEMEPisW.js} +1 -1
  153. package/dist/worker/console/static/index.html +2 -2
  154. package/dist/worker/console/static-src/active-run-badge.js +17 -0
  155. package/dist/worker/console/static-src/app/console-types.js +68 -4
  156. package/dist/worker/console/static-src/app/useConsoleShell.js +30 -12
  157. package/dist/worker/console/static-src/app/useOperatorActions.js +41 -6
  158. package/dist/worker/console/static-src/app/useRecoveryConsole.js +45 -10
  159. package/dist/worker/console/static-src/app/useRunProgress.js +47 -0
  160. package/dist/worker/console/static-src/app/useTaskWizard.js +74 -2
  161. package/dist/worker/console/static-src/night/useNightBoard.js +8 -5
  162. package/dist/worker/console/static-src/operator-chat/cards/failure-category-advice.js +25 -0
  163. package/dist/worker/console/static-src/operator-chat/chat-sse-events.js +140 -8
  164. package/dist/worker/console/static-src/operator-chat/details-dag-actions.js +122 -0
  165. package/dist/worker/console/static-src/operator-chat/input-history.js +76 -0
  166. package/dist/worker/console/static-src/operator-chat/mutation-gate.js +1 -1
  167. package/dist/worker/console/static-src/operator-chat/refs.js +3 -0
  168. package/dist/worker/console/static-src/operator-chat/runtime-selection-labels.js +27 -0
  169. package/dist/worker/console/static-src/operator-chat/turn-submission.js +16 -3
  170. package/dist/worker/console/static-src/operator-chat/useChatSessions.js +168 -72
  171. package/dist/worker/console/static-src/operator-chat/useChatStream.js +102 -21
  172. package/dist/worker/console/static-src/operator-chat/useChatThread.js +184 -4
  173. package/dist/worker/console/static-src/operator-chat/useComposer.js +32 -0
  174. package/dist/worker/console/static-src/operator-chat/useRepoBrowser.js +63 -9
  175. package/dist/worker/console/static-src/operator-chat/useWorkspaceBrowserGate.js +4 -0
  176. package/dist/worker/console/static-src/operator-chat/workspace-layout-mode.js +3 -3
  177. package/dist/worker/console/static-src/pages/tasks/run-id-resolution.js +79 -0
  178. package/dist/worker/console/static-src/pages/tasks/run-ownership-verify.js +23 -0
  179. package/dist/worker/console/static-src/pages/tasks/run-panel-progress.js +110 -0
  180. package/dist/worker/console/static-src/shell/useWorkspaces.js +299 -0
  181. package/dist/worker/console/static-src/shell/workspace-route.js +337 -0
  182. package/dist/worker/console/workspace-context.js +344 -0
  183. package/dist/worker/console/workspace-registry.js +214 -0
  184. package/dist/worker/loop-agent/loop-agent-client.js +7 -3
  185. package/dist/worker/materialize/frontend-split-task-materializer.js +72 -0
  186. package/dist/worker/materialize/harness-task-lineage.js +5 -2
  187. package/dist/worker/observability/init-runtime-activity.js +26 -0
  188. package/dist/worker/observability/read-model.js +22 -0
  189. package/dist/worker/observe/node-input.js +160 -3
  190. package/dist/worker/observe/node-process.js +377 -0
  191. package/dist/worker/observe/routes.js +224 -3
  192. package/dist/worker/observe/server.js +4 -0
  193. package/dist/worker/observe/shell-handler-keys.js +34 -0
  194. package/dist/worker/observe/static/api.js +90 -4
  195. package/dist/worker/observe/static/app.js +18 -70
  196. package/dist/worker/observe/static/constants.js +8 -1
  197. package/dist/worker/observe/static/dag-history-labels.js +4 -0
  198. package/dist/worker/observe/static/dag-node-purpose.d.ts +6 -0
  199. package/dist/worker/observe/static/dag-node-purpose.js +208 -0
  200. package/dist/worker/observe/static/format.js +60 -0
  201. package/dist/worker/observe/static/index.html +6 -1
  202. package/dist/worker/observe/static/inspect-workspace.js +307 -0
  203. package/dist/worker/observe/static/markdown-render.js +20 -1
  204. package/dist/worker/observe/static/operator-chrome.css +145 -20
  205. package/dist/worker/observe/static/operator-chrome.d.ts +20 -3
  206. package/dist/worker/observe/static/operator-chrome.js +330 -96
  207. package/dist/worker/observe/static/prompt-restart-candidates.d.ts +18 -0
  208. package/dist/worker/observe/static/prompt-restart-candidates.js +36 -0
  209. package/dist/worker/observe/static/router.d.ts +46 -0
  210. package/dist/worker/observe/static/router.js +25 -1
  211. package/dist/worker/observe/static/state.d.ts +50 -0
  212. package/dist/worker/observe/static/state.js +184 -1
  213. package/dist/worker/observe/static/styles.css +395 -0
  214. package/dist/worker/observe/static/views/dag-graph.js +4 -2
  215. package/dist/worker/observe/static/views/dag-inspector.js +1067 -9
  216. package/dist/worker/observe/static/views/dag.d.ts +13 -0
  217. package/dist/worker/observe/static/views/dag.js +14 -5
  218. package/dist/worker/observe/static/views/dashboard.js +6 -4
  219. package/dist/worker/observe/static/views/failures.js +5 -2
  220. package/dist/worker/observe/static/views/night.js +2 -2
  221. package/dist/worker/observe/static/views/pool.js +1 -0
  222. package/dist/worker/observe/static/views/run.js +3 -1
  223. package/dist/worker/observe/static/views/session-timeline.js +78 -9
  224. package/dist/worker/observe/static/views/task.js +56 -1
  225. package/dist/workflows/dag/backend-test-case-coverage-analysis.js +49 -3
  226. package/dist/workflows/dag/backend-test-markdown-workflow.js +176 -1
  227. package/dist/workflows/dag/backend-test-pytest-collection.js +98 -14
  228. package/dist/workflows/dag/backend-test-writer-completeness.js +10 -5
  229. package/dist/workflows/dag/contract-output-registry.js +15 -0
  230. package/dist/workflows/dag/contract-validator-registrations.js +1 -2
  231. package/dist/workflows/dag/dynamic-runtime/loop-until.js +1 -1
  232. package/dist/workflows/dag/dynamic-runtime/map.js +1 -1
  233. package/dist/workflows/dag/failure-category.js +7 -116
  234. package/dist/workflows/dag/frontend-closeout.js +221 -0
  235. package/dist/workflows/dag/frontend-design-policy.js +400 -0
  236. package/dist/workflows/dag/frontend-human-decision.js +182 -0
  237. package/dist/workflows/dag/frontend-implementation-contract.js +538 -166
  238. package/dist/workflows/dag/frontend-plan-render.js +24 -0
  239. package/dist/workflows/dag/frontend-prewrite-gate.js +388 -392
  240. package/dist/workflows/dag/frontend-provider-capability-matrix.js +159 -0
  241. package/dist/workflows/dag/frontend-recovery-capsule.js +455 -0
  242. package/dist/workflows/dag/frontend-recovery-controller.js +202 -0
  243. package/dist/workflows/dag/frontend-recovery-lineage.js +178 -0
  244. package/dist/workflows/dag/frontend-recovery-plan.js +17 -10
  245. package/dist/workflows/dag/frontend-recovery-run.js +33 -20
  246. package/dist/workflows/dag/frontend-repair.js +7 -424
  247. package/dist/workflows/dag/frontend-review-context.js +288 -14
  248. package/dist/workflows/dag/frontend-review-findings.js +270 -0
  249. package/dist/workflows/dag/frontend-risk.js +15 -2
  250. package/dist/workflows/dag/frontend-shadow-dual-write.js +814 -0
  251. package/dist/workflows/dag/frontend-shape-capsule-store.js +191 -0
  252. package/dist/workflows/dag/frontend-shape-facts.js +409 -0
  253. package/dist/workflows/dag/frontend-shape.js +427 -0
  254. package/dist/workflows/dag/frontend-source-fidelity-ledger.js +108 -0
  255. package/dist/workflows/dag/frontend-split-application-service.js +203 -0
  256. package/dist/workflows/dag/frontend-split-orchestrator.js +899 -0
  257. package/dist/workflows/dag/frontend-test-case-checklist.js +30 -4
  258. package/dist/workflows/dag/frontend-test-case-manifest.js +11 -4
  259. package/dist/workflows/dag/frontend-test-case-quality.js +11 -16
  260. package/dist/workflows/dag/frontend-test-environment-probe.js +230 -0
  261. package/dist/workflows/dag/frontend-test-html-report.js +3 -1
  262. package/dist/workflows/dag/frontend-test-l5-report.js +3 -1
  263. package/dist/workflows/dag/frontend-test-layout.js +159 -0
  264. package/dist/workflows/dag/frontend-test-markdown.js +61 -0
  265. package/dist/workflows/dag/frontend-test-result-contract.js +188 -42
  266. package/dist/workflows/dag/frontend-test-standard-scenarios.js +70 -0
  267. package/dist/workflows/dag/frontend-typed-event-store.js +452 -0
  268. package/dist/workflows/dag/frontend-typed-event-transaction.js +180 -0
  269. package/dist/workflows/dag/frontend-verification-trace.js +52 -17
  270. package/dist/workflows/dag/frontend-worktree-diff.js +250 -17
  271. package/dist/workflows/dag/frontend-writer-admission.js +272 -0
  272. package/dist/workflows/dag/frontend-writer-status.js +244 -0
  273. package/dist/workflows/dag/init-hybrid.js +984 -613
  274. package/dist/workflows/dag/interrupt-request.js +10 -3
  275. package/dist/workflows/dag/lifecycle.js +3 -3
  276. package/dist/workflows/dag/node-execution.js +468 -58
  277. package/dist/workflows/dag/prompt.js +44 -19
  278. package/dist/workflows/dag/recovery-lease.js +80 -0
  279. package/dist/workflows/dag/report.js +37 -1
  280. package/dist/workflows/dag/rerun-feedback.js +124 -1
  281. package/dist/workflows/dag/rerun-plan.js +144 -5
  282. package/dist/workflows/dag/rerun-run.js +81 -6
  283. package/dist/workflows/dag/rerun-task.js +29 -0
  284. package/dist/workflows/dag/retry-policy.js +318 -8
  285. package/dist/workflows/dag/runner.js +429 -122
  286. package/dist/workflows/dag/scheduler.js +114 -16
  287. package/dist/workflows/dag/structured-output-repair.js +712 -0
  288. package/dist/workflows/dag/types.js +321 -31
  289. package/dist/workflows/dag/upstream-artifacts.js +0 -4
  290. package/dist/workflows/dag/validate.js +92 -32
  291. package/docs/README.md +2 -0
  292. package/docs/architecture/evolution.md +45 -0
  293. package/docs/init-surface.manifest.json +9 -0
  294. package/docs/operations/README.md +1 -1
  295. package/docs/operations/local-development-environment.md +21 -0
  296. package/docs/templates/README.md +2 -1
  297. package/docs/templates/agent-dag-report.schema.json +8 -2
  298. package/docs/templates/agent-dag.schema.json +45 -1
  299. package/docs/templates/frontend-implementation-contract.schema.json +684 -24
  300. package/docs/templates/frontend-test-case-checklist.md +2 -2
  301. package/docs/templates/frontend-test-dag.json +8 -10
  302. package/docs/templates/frontend-test-dag.retrieve-context.prompt.md +1 -1
  303. package/docs/templates/init-managed-agents.md +13 -3
  304. package/docs/templates/spec-registry.schema.json +45 -0
  305. package/harness.json +3 -3
  306. package/package.json +7 -1
  307. package/scripts/next-info.mjs +356 -0
  308. package/scripts/next-publish-gate.mjs +238 -0
  309. package/scripts/release-source-binding.mjs +251 -0
  310. package/skills/codebase-scout/SKILL.md +1 -1
  311. package/skills/fe-test-ui-scout/SKILL.md +65 -0
  312. package/skills/fe-test-ui-scout/references/ledger-schema.md +62 -0
  313. package/skills/fe-test-ui-scout/references/recon-protocol.md +54 -0
  314. package/skills/frontend-bounded-implement/SKILL.md +8 -14
  315. package/skills/frontend-design-review/SKILL.md +20 -41
  316. package/skills/frontend-implementation/SKILL.md +3 -4
  317. package/skills/frontend-implementation/references/design-spec.md +15 -10
  318. package/skills/frontend-implementation/references/node-contracts.md +23 -13
  319. package/skills/frontend-review/SKILL.md +22 -14
  320. package/skills/frontend-review/references/review-findings.md +6 -7
  321. package/skills/loop-agent/references/command-reference.md +12 -4
  322. package/skills/loop-agent/references/hybrid-dag.md +8 -1
  323. package/skills/playwright-cli/SKILL.md +23 -1
  324. package/skills/playwright-cli-case-generator/SKILL.md +29 -8
  325. package/dist/worker/console/static/assets/channel-CPF4N7pf.js +0 -1
  326. package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-C2DwA_Y1.js +0 -1
  327. package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-C2DwA_Y1.js +0 -1
  328. package/dist/worker/console/static/assets/index-DTZOKgAn.js +0 -404
  329. package/dist/worker/console/static/assets/index-Ya5FE7cD.css +0 -1
  330. package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-B8FB_cNk.js +0 -1
  331. package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-CrZYaWfx.js +0 -8
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: frontend-bounded-implement
3
3
  description: >-
4
- Use only for frontend implementation and repair writers after the canonical
4
+ Use only for frontend implementation writers after the canonical
5
5
  contract gate has authorized a bounded write set.
6
6
  ---
7
7
 
@@ -11,7 +11,6 @@ description: >-
11
11
 
12
12
  - For implementation, use the run-owned
13
13
  `contracts/frontend-implementation-contract.json`.
14
- - For repair, also use `contracts/frontend-repair-assessment.json`.
15
14
  - Treat requirement `expectedOutcome`, interaction `trigger` /
16
15
  `expectedBehavior`, target files, UI states, Mock/API strategy, and verification
17
16
  targets as closed decisions. Do not rediscover or reinterpret them.
@@ -25,7 +24,7 @@ description: >-
25
24
  - Start the bounded edit after confirming the contract and targets. Optional
26
25
  context is not a reason to postpone implementation.
27
26
  - If behavior is still ambiguous or a required target is outside `writeSet`, stop
28
- with `IMPLEMENTATION_OUTCOME: blocked`; do not compensate with broader scouting.
27
+ without writing and explain the blocker; do not compensate with broader scouting.
29
28
 
30
29
  ## Implementation Discipline
31
30
 
@@ -39,15 +38,10 @@ description: >-
39
38
  - Run only the focused checks already frozen by the task. Leave full verification
40
39
  to downstream deterministic nodes.
41
40
 
42
- ## Required Outcome
41
+ ## Completion Summary
43
42
 
44
- The first non-empty response line must be exactly one of:
45
-
46
- - `IMPLEMENTATION_OUTCOME: changed` — a non-empty bounded diff was produced.
47
- - `IMPLEMENTATION_OUTCOME: already-satisfied` — the contract was already met and
48
- no file changed.
49
- - `IMPLEMENTATION_OUTCOME: blocked` — implementation cannot proceed without
50
- guessing or exceeding the write boundary.
51
-
52
- Then report changed files, requirements/interactions implemented, tests or focused
53
- checks attempted, and residual risks. Never report `changed` for an empty diff.
43
+ Briefly report changed files, implemented requirements/interactions, focused checks
44
+ attempted, blockers, and residual risks. This summary is human-readable only: the
45
+ runtime derives implementation state from persisted write events, run delta, write
46
+ guard, requirement coverage, and focused checks. Do not use a mandatory
47
+ `IMPLEMENTATION_OUTCOME:` response-text protocol.
@@ -9,31 +9,24 @@ references:
9
9
 
10
10
  # Frontend Design Review
11
11
 
12
- For frontend design review nodes. Read the checklist; audit contract, scout, Mock
13
- strategy, effective plan, task bounds, and traceable design evidence.
14
- Knowledge base, OpenSpec, and `ai_workspace/` are parallel sources. Query the
15
- knowledge-base connector when available; always search/read `openspec/schemas/**`,
16
- `openspec/project-specs/**`, and `ai_workspace/**` before accepting conventions.
17
- Connector format is TODO: never invent results.
12
+ For frontend design review nodes. Read the checklist; audit the canonical contract,
13
+ bound Mock strategy, task bounds, and traceable design evidence supplied by the
14
+ upstream context. Do not rediscover task sources, search specification roots, or
15
+ replace frozen evidence with nearby-code conventions. Use only exact, bound evidence
16
+ paths when additional reading is necessary; never invent connector results.
18
17
 
19
- ## Verdict Contract
18
+ ## Authoritative Terminal
20
19
 
21
- First non-empty line: exactly `VERDICT: pass` or `VERDICT: request-revision`.
22
- Any blocker requires request-revision. An initial pass is the effective verdict;
23
- there is no intermediate first-design shell gate.
20
+ Complete the review with exactly one committed typed tool call:
24
21
 
25
- In standard/full topology, revision and final review run only after initial
26
- `VERDICT: request-revision`. Verify every Required Plan Correction against the
27
- complete revision; reject remaining, incomplete, or new gaps. An initial pass uses
28
- the original plan and skips both conditional nodes.
22
+ - `approve_design` when no blocking design defect remains;
23
+ - `request_design_changes` when a blocker exists. It must include a typed
24
+ `issueCategory`, at least one `evidenceRef`, and non-empty findings.
29
25
 
30
- Small-risk topology instead removes initial review and revision, then runs
31
- `frontend-final-design-review-pi` as the sole review of the original plan. Do not
32
- expect initial findings or a revision there.
33
-
34
- The deterministic gate prefers final-review output and falls back to initial review
35
- only when no current-run final output exists. Existing malformed/non-pass primary
36
- output fails closed.
26
+ The typed terminal is the only authoritative outcome. Do not require or emit a
27
+ `VERDICT:` line, JSON verdict, revision patch, or a second final-design-review
28
+ verdict. A requested design change ends this run; the recovery controller creates
29
+ any bounded follow-up run from the appropriate phase.
37
30
 
38
31
  ## Blocking Conditions
39
32
 
@@ -51,29 +44,15 @@ Knowledge-base absence is advisory if relevant rules from either openspec
51
44
  specification directory were read and applied. Block skipped fallback, unresolved
52
45
  conflict, or unresolved UI decisions.
53
46
 
54
- ## Method And Output
47
+ ## Method And Human-readable Output
55
48
 
56
49
  Map criteria to steps/files/states/checks, audit paths/evidence, classify Blocking
57
50
  or Advisory, and never edit files.
58
51
 
59
52
  ### Spec Evidence Rules
60
53
 
61
- Run `grep`/`find`, then explicit `read` calls for applicable specs/checklist. Only
62
- successful paired reads count as “已读取规范文件”; summaries do not. List each path/
63
- section in `Checked Items`; search/read both openspec specification directories
64
- before accepting conventions.
65
-
66
- ```markdown
67
- VERDICT: pass
68
-
69
- ## Findings
70
- - None blocking.
71
-
72
- ## Required Plan Corrections
73
- - None.
74
-
75
- ## Checked Items
76
- - ...
77
- ```
78
-
79
- Each correction names its criterion/section, gap, and exact plan change.
54
+ Read only the canonical contract and any exact evidence paths bound in its upstream
55
+ context. Successful paired reads are the only proof that a specification was read;
56
+ summaries do not substitute for them. A concise human-readable summary may list
57
+ checked items and findings, but it is never a control protocol. Each requested
58
+ change names its criterion/section, gap, and required plan change.
@@ -5,12 +5,11 @@ description: >-
5
5
  references:
6
6
  - path: references/node-contracts.md
7
7
  required: true
8
- # Compact contract index must stay under skill total budget (~10k with body + other refs).
9
- # Headroom above current ~4k file; do not raise alone without checking totalMaxChars.
10
- maxChars: 6000
8
+ # Keep the required node contract intact under the bounded-skill test budget.
9
+ maxChars: 9000
11
10
  - path: references/design-spec.md
12
11
  required: true
13
- maxChars: 3000
12
+ maxChars: 3500
14
13
  - path: references/code-standards.md
15
14
  required: true
16
15
  maxChars: 3000
@@ -6,9 +6,10 @@ Knowledge base, OpenSpec, and `ai_workspace/` are parallel specification sources
6
6
 
7
7
  1. Attempt the configured component/design knowledge-base query first when a
8
8
  connector is available.
9
- 2. Regardless of knowledge-base success/failure/timeout/no-match, also
10
- recursively search `openspec/schemas/`, `openspec/project-specs/`, and
11
- `ai_workspace/` for index files and relevant content.
9
+ 2. Regardless of knowledge-base success/failure/timeout/no-match, use the
10
+ generation-frozen local-spec capability context and cited candidate set. For
11
+ unresolved task terms, search the three local roots in a bounded way; do not
12
+ recursively read every supported file merely because it exists.
12
13
  3. Treat relevant matches from both sources as the current project's
13
14
  specification for this run.
14
15
  4. Only then use component source, tokens, stories, tests, and pages as
@@ -23,10 +24,13 @@ Connector format is TODO; attempt only an available connector, otherwise record
23
24
 
24
25
  ## openspec Fallback Procedure
25
26
 
26
- - Inspect `<repoRoot>/openspec/schemas/`, `<repoRoot>/openspec/project-specs/`,
27
- and `<repoRoot>/ai_workspace/` when present; enumerate supported files recursively.
28
- - Read indexes first, then search names/content using task, route, component,
29
- interaction, theme, token, and state terms.
27
+ - Start with the generation-frozen classified paths and `frontendOpenspec`
28
+ candidates. Read their indexes or relevant sections first, then use task,
29
+ route, component, interaction, theme, token, and state terms for bounded
30
+ local searches under `<repoRoot>/openspec/schemas/`,
31
+ `<repoRoot>/openspec/project-specs/`, and `<repoRoot>/ai_workspace/`.
32
+ - Do not turn local fallback into a full-directory read. If a searched path is
33
+ relevant, record why it was selected and read it in context.
30
34
  - Read matches in context; a filename-only hit is not a rule.
31
35
  - Record search terms, inspected/matched paths, headings or tight line ranges,
32
36
  applied rules, and conflicts.
@@ -51,6 +55,7 @@ and conflicts. `openspec fallback` includes terms, paths/headings/lines, rules,
51
55
  - Cite knowledge-base or openspec spec evidence for component/token choices;
52
56
  label weaker repo fallback.
53
57
  - Make deviations and unresolved gaps explicit.
54
- - Contract `uiComponentChoices[]` per UI purpose: `specified` needs
55
- `specReference {path,section,line}`; `new` needs null ref + rationale; never
56
- silently replace a spec-defined component.
58
+ - Contract `uiComponentChoices[]` per UI purpose: `specified` needs an OpenSpec
59
+ `specReference {path,section,line}`; a task-source-mandated `new` component
60
+ needs a PRD `specReference {path,section,line}` plus rationale; never silently
61
+ replace a spec-defined component.
@@ -5,27 +5,37 @@ Pre-write nodes are read-only. Preserve IDs, labels, commands, language, require
5
5
  ## Core nodes
6
6
 
7
7
  - **`frontend-contract-pi`**: `Scope`, `Non-goals`, `Acceptance Criteria`, `UI States`, `Target Runtime Environment`, `Risks`, `Verification Expectations`; no guessed requirements.
8
- - **`frontend-scout-pi`**: routes, components, tokens, data/API/Mock, scripts, tests, assets; fact vs inference vs gap. Search+read `openspec/schemas/`, `openspec/project-specs/`, `ai_workspace/` first. Output stack, styling, conventions, state/data, test entry points, reuse, risks.
9
- - **`frontend-plan-pi` + conditional design loop**: AC → observable `expectedOutcome`; interactions → `trigger`+`expectedBehavior`; include steps, in-bound files, UI states, reuse, deps, Mock/API, frozen verify entrypoints and integration gaps. DAG freezes a protected skeleton (`schemaVersion`, `sourceBinding`, `riskLevel`, `targets.files`, `mockApi.productionDefaultOff`). Model returns a **JSON-only** editable RFC 7386 patch (`frontend-implementation-contract-plan-patch-v1`) plus one `openspec-citations` block. Runtime compiles canonical `frontend-implementation-contract-v1` and archives raw/extracted/normalized/validation candidates; unresolved optional symbols are dropped and audited. No plan prose; gate renders plan.md. IDs+paths ≠ behavior semantics. Applicable UI states need behavior/implementation/verification; non-applicable states need reasons. Active Mock needs frozen commands; `auto` without confirmed capability/command → `not-needed`; `required` without command → generation-time blocked. Only `request-revision` runs revision+final review; small-risk gets one review.
10
- - `uiComponentChoices[]` (optional): `{purpose, component, decision, specReference, rationale}`; `specified` needs `specReference{path,section,line}`; `new` needs null ref+rationale.
11
- - **`frontend-prewrite-gate-shell`**: sole write authorization. Resolve effective plan (revised if revision ran, else original) + review; require exact pass; retain every REQ/BR/AC id; enforce Mock policy; validate schema/source binding+writeSet containment; materialize `contracts/frontend-implementation-contract.json` from the **single** fenced contract block (multiple candidates fail closed `invalid-output`). Fallback only when conditional primary absent; malformed primary fails closed. Generation-time blocked Mock yields one blocking shell node, no writer.
8
+ - **`frontend-contract-pi`**(仅 cited 且候选非空):在既有 Markdown contract 的末尾输出一个 `frontend-openspec-selection-v1` JSON block,对 generation-frozen specRoots 候选逐一分类为 `required` / `relevant` / `irrelevant`;显式 `requiredReadPaths` 和任务源文件引用必须为 `required`。只读,不改 task.json,不新增节点。
9
+ - **`frontend-scout-pi`**: routes, components, tokens, data/API/Mock, scripts, tests, assets; fact vs inference vs gap. Start from the generation-frozen OpenSpec capability context and contract selection block; then perform bounded task-term searches only for unresolved relevant rules. Do not recursively read every candidate directory. Output stack, styling, conventions, state/data, test entry points, reuse, risks.
10
+ - **`frontend-plan-pi`**: AC → observable `expectedOutcome`; interactions → `trigger`+`expectedBehavior`; include steps, in-bound files, UI states, reuse, deps, Mock/API, frozen verify entrypoints and integration gaps. DAG freezes a protected skeleton (`schemaVersion`, `sourceBinding`, `riskLevel`, `targets.files`, `mockApi.productionDefaultOff`). The model commits the plan decision ledger incrementally through typed `record_*` tools (target-surface / component-choice / state-flow / data-flow / mock-api / design-deviation / dependency) and closes with exactly one `finalize_plan`; narrative prose stays free-form context and is never the compile authority. `frontend-design-policy-shell` assembles the canonical contract from committed facts (validated, fail-closed — no fenced-JSON text parsing) and materializes `frontend-implementation-contract-v1`; unresolved optional symbols are dropped and audited. `frontend-design-policy-shell` deterministically renders plan.md. IDs+paths ≠ behavior semantics. Applicable UI states need behavior/implementation/verification; non-applicable states need reasons. Active Mock needs frozen commands; `auto` without confirmed capability/command → `not-needed`; `required` without command → generation-time blocked.
11
+ - `uiComponentChoices[]` (optional): `{purpose, component, decision, specReference, rationale}`; `specified` needs an OpenSpec `specReference{path,section,line}`; a task-source-mandated `new` component needs a PRD `specReference{path,section,line}` plus rationale; `reuse-existing` may omit the ref.
12
+ - **`frontend-design-policy-shell`**: read-only deterministic design check (UI coverage, evidence resolvable/fresh, Mock strategy bound to frozen commands, component choice `specReference`, targetPaths boundary, dependency authorization, UI state ownership, requirement coverage); passes by materializing the single authoritative `frontend-implementation-contract-v1`. Blocked ends the run without a model reformat step.
12
13
  - `verificationTarget.commandLabel` must be a **frozen command label** from `verifyEvidence.commandLabels`; others fail closed (`invalid-output`). Empty frozen set (no `run.json`) skips check.
13
14
  - `mockApi.strategy !== "not-needed"` fails closed when `mockCommandLabels` empty (`no authorized Mock verification commands`).
14
- - OpenSpec policy: `task.json.frontendOpenspec.policy` (default `cited`); candidates = `requiredReadPaths` ∪ task-source citations; effective plan must append one fenced `openspec-citations` block (one JSON `{"path","section","line"}` per line). Candidates non-empty but block missing/unparseable → `openspec-citation-block-unparseable`; candidate not cited → `openspec-not-cited`; cited path without read event → `openspec-citation-not-read` (anti-fabrication). Empty candidates skip enforcement. `scan-strict` keeps full-read semantics (`openspec-not-read`); both modes keep `candidate-missing-drift`.
15
- - Component conformance: missing `uiComponentChoices` (frozen bucket non-empty + UI-visible work) → `component-choices-missing`; bad/uncited `specReference.path` → `component-spec-reference-invalid` / `component-spec-not-cited`.
16
- - revisionPatch mode: revision output is an RFC 7386 merge-patch delta applied on the original canonical contract node (`planFallbackFromNodeIds[0]`); protected skeleton paths remain immutable. Legacy DAGs keep full-contract semantics. Size guard: canonical serialization >64KB → `retryable-invalid` + `contract-too-large`.
17
- - **`frontend-implement-pi`**: sole regular exclusive writer; uses `frontend-bounded-implement` (not this skill). Stay in `writeSet`; real requests default-on. Atomic handler/intercept/adapter with tests. Stop on forbidden paths/guesses. First line `IMPLEMENTATION_OUTCOME: changed|already-satisfied|blocked`; runtime checks against attributed diff. Optional mock-verify when frozen; static+behavior always; behavior must prove page consumption. `not-needed` keeps real integration pending unless real backend has fresh evidence.
15
+ - OpenSpec policy: `task.json.frontendOpenspec.policy` (default `cited`); `specRoots` defaults to OpenSpec + ai_workspace and may be fixed during task preparation from an explicitly named normative directory. In cited mode the selector determines the required subset; declared paths/task-source citations cannot be downgraded. Effective plan cites only its required/used specs in one fenced `openspec-citations` block. `scan-strict` keeps full-read semantics (`openspec-not-read`); both modes keep `candidate-missing-drift`.
16
+ - Component conformance: missing `uiComponentChoices` (frozen bucket non-empty + UI-visible work) → `component-choices-missing`; bad/uncited `specReference.path` → `component-spec-reference-invalid` / `component-spec-not-cited`; at least one `decision=specified` choice must bind to the frozen component/theme bucket → `component-spec-choice-unbound`.
17
+ - Canonical serialization (UTF-8) >64KB → `retryable-invalid` + `contract-too-large`.
18
+ - **`frontend-writer-admission-shell`**: sole write authorization for `frontend-implement-pi`. Derives and freezes the concrete writeSet (implementation targets ∪ non-static verification target files), pre-writer baseline, and admission digest (Mock strategy, allowed strategies digest, frozen command digest, `productionDefaultOff`, real-integration expectation); writes `contracts/frontend-writer-admission-result.json` (schemaId `frontend-writer-admission-shell-v1`). The scheduler checks before queueing and before executing the writer: only `admitted` releases it, otherwise SKIPPED + `frontend-prewrite-not-authorized`. Admission blocked (`candidate-contract-invalid` / `prewrite-blocked`) is forced `failed` at aggregation.
19
+ - **`frontend-implement-pi`**: sole regular exclusive writer; uses `frontend-bounded-implement` (not this skill). Stay in `writeSet`; real requests default-on. Atomic handler/intercept/adapter with tests. Stop without writing on forbidden paths or unresolved ambiguity. Runtime derives implementation state from persisted write events, run delta, write guard, requirement coverage, and focused checks; any response summary is non-authoritative. Optional mock-verify when frozen; static+behavior always; behavior must prove page consumption. `not-needed` keeps real integration pending unless real backend has fresh evidence.
20
+
21
+ ## Typed terminal protocol
22
+
23
+ - `frontend-plan-pi` commits incremental `record_*` facts plus one `finalize_plan` (plan).
24
+ - `frontend-design-review-pi` commits `approve_design` | `request_design_changes` (request carries typed issueCategory + evidenceRefs + findings).
25
+ - `frontend-review-pi` commits `approve_review` | `request_review_changes` (request carries typed issueCategory + evidenceRefs + findings).
26
+ - These committed typed tools are the only design/review terminals. They replace
27
+ `VERDICT:` first-line parsing; response text is human-readable context only.
18
28
 
19
29
  ## Contract / trace / stages (M1–M2)
20
30
 
21
- - `frontend-verify-assess-shell` runs Mock/static/behavior groups, binds `verificationTargets` to command labels+evidence, writes `frontend-verification-trace.json`+`frontend-repair-assessment.json`; browser/visual stay `not-run`.
22
- - `frontend-review-context-shell` captures real diff; combines contract, effective trace, repair assessment, diff into `contracts/frontend-review-context.json`.
31
+ - `frontend-verify-shell` runs frozen lint/Mock/static/behavior groups, binds `verificationTargets` to command labels+evidence, writes `frontend-lint-assessment.json` + `frontend-verification-trace.json`; any verification failure is terminal and materializes `frontend-verify-failure-v1` (failureClass / failureOwner / restartPhase) for recovery routing — no same-run repair. Browser/visual stay `not-run`.
32
+ - `frontend-review-context-shell` captures the real diff after the pre-writer baseline; combines contract, lint assessment, effective trace, and diff into `contracts/frontend-review-context.json`.
23
33
  - Implement stages: (1) contract confirm (2) tests sync (3) component/UI (4) API/Mock (5) frozen checks (6) diff cleanup. Summary: Contract Ref, Changed Files, Requirements, UI States, Tests, Verification Attempts, Deviations, Residual Risks.
24
34
 
25
- ## Repair (M3)
35
+ ## Terminal failure & recovery (M3)
26
36
 
27
- Only `eligible=true` runs `frontend-repair-pi` (same writeSet; no re-spec; max 1 attempt) + `frontend-reverify-shell`. No-failure skips both. Non-repairable contract/path/dependency/credential/deploy/spec-unclear failures fail closed.
37
+ Verification, design-review, or final-review failure is terminal — no same-run repair. `frontend-verify-shell` materializes `frontend-verify-failure-v1`; `request_design_changes` / `request_review_changes` block downstream admission/closeout. Recovery routes through the recovery capsule / new-dag; there is no same-run repair branch.
28
38
 
29
39
  ## Risk & capability (M4–M6)
30
40
 
31
- Deterministic risk, no model; high-risk beats small; supervised never small. Standard/high-risk: 15 top-level nodes; small: 13 (omits revision + final review). Capability seed injects adapters; openspec specs and task sources outrank adapter guidance. A11y: static/component tools only when present; Browser a11y always not-run.
41
+ Deterministic risk, no model; high-risk beats small; supervised never small. Topology by shape: Micro 7 (`frontend-contract-import-shell` → `frontend-writer-admission-shell` → `frontend-implement-pi` → `frontend-verify-shell` → `frontend-review-context-shell` → `frontend-review-pi` → `frontend-closeout-shell`), Small 10 (main chain minus the independent `frontend-design-review-pi`), Standard/High 11 (`frontend-contract-pi` → `frontend-scout-pi` → `frontend-plan-pi` → `frontend-design-policy-shell` → `frontend-design-review-pi` → `frontend-writer-admission-shell` → `frontend-implement-pi` → `frontend-verify-shell` → `frontend-review-context-shell` → `frontend-review-pi` → `frontend-closeout-shell`). Capability seed injects adapters; openspec specs and task sources outrank adapter guidance. A11y: static/component tools only when present; Browser a11y always not-run.
@@ -9,17 +9,27 @@ references:
9
9
 
10
10
  # Frontend Review
11
11
 
12
- Use for `frontend-review-pi`; read the findings guide first. Required inputs are
13
- original task/reference material, effective plan/design branch, implementation summary,
14
- and `contracts/frontend-review-context.json`. That canonical context binds the validated
15
- implementation contract, effective verification trace, repair assessment, optional
16
- `frontend-lint-assessment-v1`, and run-owned diff. The diff is authoritative.
12
+ Use for `frontend-review-pi`; read the findings guide first. The required input is
13
+ `contracts/frontend-review-context.json`, its bound diff summary/fragments, and only
14
+ the current source files named by that diff. The canonical context binds the validated
15
+ implementation contract, effective verification trace, optional
16
+ `frontend-lint-assessment-v1`, and run-owned diff. Do not reopen original task sources,
17
+ plans, design-review prose, OpenSpec, or `ai_workspace/`; the bound diff is
18
+ authoritative.
17
19
 
18
- ## Verdict Contract
20
+ ## Authoritative Terminal
19
21
 
20
- The first non-empty line must be exactly `VERDICT: pass` or
21
- `VERDICT: request-revision`. Any Critical/Important finding, failed or missing
22
- required check, forbidden write, or unmet acceptance criterion forces revision.
22
+ Complete the review with exactly one committed typed tool call:
23
+
24
+ - `approve_review` when no Critical/Important finding remains;
25
+ - `request_review_changes` for a defect, missing required evidence, forbidden
26
+ write, or unmet acceptance criterion. It must include a typed `issueCategory`,
27
+ at least one `evidenceRef`, and non-empty findings.
28
+
29
+ The typed terminal is the only authoritative outcome. Do not require or emit a
30
+ `VERDICT:` line or response-text JSON verdict. A request for review changes ends
31
+ this run and is handled by the recovery controller rather than a same-run repair
32
+ branch.
23
33
 
24
34
  ## Review Scope
25
35
 
@@ -38,11 +48,9 @@ required check, forbidden write, or unmet acceptance criterion forces revision.
38
48
  baseline-matched diagnostics on unchanged files, and none on writer-changed files.
39
49
  Report debt, never `lint passed`; `failed`/`unavailable` blocks. Typecheck, build,
40
50
  and test still require successful final exits.
41
- - Component/design claims need both knowledge-base and local openspec evidence. Query
42
- the connector when available and always read task-relevant files under
43
- `<repoRoot>/openspec/schemas/`, `<repoRoot>/openspec/project-specs/`, and `<repoRoot>/ai_workspace/`.
44
- Connector format is TODO; never invent evidence. Only successful `read` calls are
45
- observable as "已读取规范文件".
51
+ - Evaluate component/design claims against the evidence already bound in the canonical
52
+ contract and review context. Do not use a repository-wide search or connector query
53
+ to replace that frozen evidence.
46
54
  - Treat shell exit status as authoritative. Do not edit files.
47
55
 
48
56
  ## Evidence And Output
@@ -14,24 +14,23 @@
14
14
  `baseline-debt` only with a valid `frontend-lint-assessment-v1`; this is not a
15
15
  passed lint result. A changed-file lint diagnostic, new unmatched diagnostic,
16
16
  command drift, missing baseline, timeout, or unparseable output is Important.
17
- - Treat knowledge base, `openspec/schemas/`, `openspec/project-specs/`, and `ai_workspace/` as
18
- parallel sources. Record connector/query/source/time plus openspec search terms and
19
- matched paths/headings; label fallback or unavailable accurately.
17
+ - Treat the design evidence already bound in the canonical review context as the
18
+ source of truth. Do not launch a connector query or repository-wide OpenSpec/
19
+ `ai_workspace` search to replace frozen evidence; label a missing bound evidence
20
+ reference accurately instead.
20
21
 
21
22
  ## Review Sequence
22
23
 
23
24
  1. Establish changed-file inventory and write boundaries.
24
- 2. Compare original requirement with derived contract/constraints.
25
+ 2. Compare the bound contract with the approved constraints and cumulative diff.
25
26
  3. Map each criterion to code, states, tests, and evidence.
26
27
  4. Inspect interactions, state/data/API behavior, failure paths, and regressions.
27
28
  5. Check mock selection, contract-to-fixture mapping, activation/default path,
28
29
  handler/fixture/adapter and consumer diff, verification, production imports, and
29
30
  the real-integration gap.
30
- 6. Check design evidence, responsive/a11y behavior, dependencies, and maintenance.
31
+ 6. Check bound design evidence, responsive/a11y behavior, dependencies, and maintenance.
31
32
  7. Classify findings and derive the verdict mechanically.
32
33
 
33
- Skipping either directory is Important when design compliance affects acceptance.
34
-
35
34
  ```text
36
35
  - [Critical|Important|Minor] path:line — Problem; impact; required correction; evidence.
37
36
  ```
@@ -100,6 +100,8 @@ loop-agent --help
100
100
  ```bash
101
101
  loop-agent inspect # 当前 repo(自动检测)
102
102
  loop-agent --repo-root /path/to/target-repo inspect # 指定 repo
103
+ loop-agent inspect next # 当前 npm next 绑定(version / SHA / unpublished commits)
104
+ loop-agent inspect next --json
103
105
  ```
104
106
 
105
107
  ### 健康检查
@@ -132,13 +134,18 @@ SDK 回归或 SDK 可选依赖不可用时用 `cli-only` 诊断。CLI fallback
132
134
 
133
135
  ```bash
134
136
  loop-agent init instructions --repo-root <target-repo>
137
+ loop-agent init model-catalog --repo-root <target-repo> --json
135
138
  loop-agent init --repo-root <target-repo> --profile full --merge \
136
- --provider deepseek --model deepseek/deepseek-v4-flash
139
+ --low-model deepseek/deepseek-chat \
140
+ --med-model deepseek/deepseek-v4-flash \
141
+ --high-model deepseek/deepseek-v4-pro
137
142
  loop-agent init doctor --repo-root <target-repo>
138
143
  loop-agent init check-update --repo-root <target-repo> --json
139
144
  loop-agent init check-update --repo-root <target-repo> --markdown
140
145
  loop-agent init update --repo-root <target-repo> --bootstrap-surface
141
146
  loop-agent init update --repo-root <target-repo> --apply-safe
147
+ loop-agent init update --repo-root <target-repo> --apply-safe \
148
+ --low-model <current-or-selected> --med-model <current-or-selected> --high-model <current-or-selected>
142
149
  loop-agent init reconcile --repo-root <target-repo> [--json|--markdown] # compatibility low-level diagnostic
143
150
  loop-agent init upgrade --repo-root <target-repo> --json
144
151
  loop-agent init upgrade --repo-root <target-repo> --run-id <run-id> --status --json
@@ -146,13 +153,13 @@ loop-agent init upgrade --repo-root <target-repo> --run-id <run-id> --continue -
146
153
  loop-agent init upgrade --repo-root <target-repo> --run-id <run-id> --report --markdown
147
154
  ```
148
155
 
149
- fresh init 将精确引用写到 `executors.pi.LOW/MED/HIGH`。fresh `loop-agent init` 会将合格且完整的 `provider/model` 引用投影到 `executors.pi.LOW/MED/HIGH`,即 `executors.pi.LOW`、`executors.pi.MED` 和 `executors.pi.HIGH`。三个 tier 齐全时不会写入 `defaultModel`,也不会恢复或建议旧顶层 routing 字段。
156
+ fresh init 将精确引用写到 `executors.pi.LOW/MED/HIGH`。模型先运行只读 `init model-catalog`:Pi SDK runtime 与 OpenCode 非 verbose 列表由代码确定性发现,只向模型暴露 provider/model、能力/成本/窗口元数据、Pi setup、兼容性与 credential-ready 布尔值,不暴露原始配置和凭据。已有档位仍存在于 Pi 时原样保留,只重选失效/缺失档位;代码在 update 时拒绝替换仍有效档位。Pi 无定义时先向用户补齐必要模型元数据并帮助字段级配置 `models.json`;只有认证缺失时保留 harness 并修复认证。三个 tier 齐全时不会写入 `defaultModel`,也不会恢复旧顶层 routing 字段。
150
157
 
151
158
  `init check-update` 是只读升级报告,用于发现目标项目是否落后于当前包内初始化 surface。输出会区分 deterministic actions、model merge tasks、human decisions 和 recommended next。`--markdown` 会渲染可直接交给模型执行的合并指引,包含 `allowedPaths`、`forbiddenPaths`、`mergeRules` 和 `verification`。
152
159
 
153
- `init update --bootstrap-surface` 为旧项目写入 `.harness/init-surface.json` 的 `inferred-baseline`,不伪装成历史 recorded baseline。`init update --apply-safe` 只执行确定性安全动作:补缺失文件、创建目录、刷新 managed block;已有但无法确认与当前包一致的文件会进入 model merge tasks,不会被覆盖。模型 merge 只会自动展开不含 tier 或其他旧字段的唯一、完整且可证明等价的旧 `defaultModel: "provider/model"`;顶层 `model`、`models`、`modelProfiles`、`modelRouting`、`verify`、`sequentialWorkflowRole`、部分/对象 tier、bare model、冲突 provider 或未知语义均 fail closed,并保留原始 `harness.json`。
160
+ `init update --bootstrap-surface` 为旧项目写入 `.harness/init-surface.json` 的 `inferred-baseline`,不伪装成历史 recorded baseline。`init update --apply-safe` 只执行确定性安全动作:补缺失文件、创建目录、刷新 managed block;`harness.json` 永不走整文件 `refresh-owned-file`,即使它仍与旧 recorded hash 一致,也只允许字段级确定性迁移或 bounded merge。带完整三档参数的 update 只替换 catalog 已判定失效的档位,仍有效档位的对象形态与 thinking 配置保持不变。模型 merge 只会自动展开不含 tier 或其他旧字段的唯一、完整且可证明等价的旧 `defaultModel: "provider/model"`;其他歧义均 fail closed 并保留原文件。
154
161
 
155
- `init upgrade` 是写入型升级入口:首次运行冻结 controller identity、检查 npm latest、扫描 surface、自动执行安全动作,并把 run facts 持久化到 `.harness/init-upgrades/<run-id>/`。`--status` 与 `--report` 严格只读;`--continue` 会重新核验 identity、当前 hash 与不变量。版本选择、无法判定冲突、凭据、破坏性删除或 active writer 才进入 human decision。普通语义冲突返回具体单文件 `allowedPaths` merge task,主会话必须合并后继续,不能把 `needs-model-merge` 作为完成。默认管理项目级 OpenCode/Pi recovery 与 `.pi/settings.json` nested merge,保留显式 disabled,Pi trust 后才加载;默认不读写 `~/.pi/agent/settings.json`。旧 `init reconcile` 保留为兼容低层诊断。
162
+ `init upgrade` 是写入型升级入口:首次运行冻结 controller identity 与脱敏模型目录,检查 npm latest,并用一次 surface scan 形成完整计划。固定投影按 recorded bytes 确定性增删改;recorded `harness.json` 按属性树增删字段并保留项目值、同步 schema;项目自适应内容由模型决定。多个语义合并在同一计划中串行排队,每次仍只开放一个文件的 `allowedPaths`;接受后直接激活下一项,不重复版本发现/规划,队列清空后只跑一次最终验证。确定性收敛最多两轮。完成态的 verification/report 均有 controller hash anchor,`--status`、`--report` 和已完成 run 的幂等 `--continue` 只读持久化证据,不重新跑项目校验。默认管理项目级 OpenCode/Pi recovery 与 `.pi/settings.json` nested merge,默认不读写 `~/.pi/agent/settings.json`。旧 `init reconcile` 保留为兼容低层诊断。
156
163
 
157
164
  升级在 managed block 收敛后生成只读 gitignore 迁移评估(`.harness/init-upgrades/<run-id>/gitignore-migration.json`):inventory 已跟踪的 `.harness/**` 与 `.agents/**`,建议 index-only 命令 `git rm -r --cached --ignore-unmatch .harness` / `.agents`(只改 index、保留工作区文件;`scripts/**` 与 `ai_workspace/loop-agent/**` 永不出现)。`.agents` 已跟踪内容会触发 human-decision 暂停等待审查;非 Git 仓库、git 查询失败或存在 staged 条目时 `status: blocked` 且无命令建议。controller 不自动修改 Git index。
158
165
 
@@ -327,6 +334,7 @@ loop-agent dag request-interrupt --run-id <run-id> --request-id <id> --target-op
327
334
  loop-agent dag rerun --run-id <run-id> --from-node <node-id> --plan [--json] # 从节点重跑资格预检(不执行)
328
335
  loop-agent dag rerun --run-id <run-id> --from-node <node-id> --plan-hash <sha256> --request-id <key> --reason "..." [--json] # 安全子图 continuation
329
336
  loop-agent dag rerun-task --run-id <run-id> --reason "..." --request-id <key> [--profile auto] [--task-id <id>] [--json] # standalone 完整任务重跑
337
+ loop-agent dag follow-up <parent-run-id> [--task-id <id>] [--execute] [--profile auto|minimal|standard|reviewed|supervised] # 将 frontend review 的 request_review_changes findings 物化为下游 frontend task;默认只创建并返回 task advance 命令
330
338
  loop-agent dag request-interrupt --run-id <run-id> --request-id <key> --target-operation-id <op-id> --reason-code <code> --reason "..." --expected-runner-pid <pid> --expected-runner-hostname <host> --expected-runner-started-at <ts> --expected-controller-fingerprint <fingerprint> # 协作式中止:经 Human Gate 登记 interrupt.json,runner 等当前节点安全收敛后再停调度,不直接 SIGKILL
331
339
  loop-agent dag reconcile-tasks --glob '<pattern>' # 仅报告的 task/run/artifact/verify drift audit
332
340
  loop-agent dag final-verification <task-id> # 生成 closeout DAG,closeout artifact 后再 final verify
@@ -16,7 +16,7 @@
16
16
 
17
17
  对于默认 `standard` 任务,生成器先读取 `source/需求.md` 中的结构化任务类型,再结合 `allowedPaths` 与 React/Next/Vue 强工程证据做确定性分类。确认是前端项目且任务不是明确后端、前后端混合、排除前端或仅文档/测试范围时,默认选择 `frontend-implementation` DAG,不依赖需求关键词。分类不会把普通后端实现路由到 `backend-test`;显式 profile、`workflowPolicy` 或 supervised quality gate 只记录治理强度,不把已识别的前端业务 workflow 换回通用模板。
18
18
 
19
- 前端专用链保留独立 contract/scout;plan 同时选择 Mock/API 策略并输出结构化 implementation contract。design initial pass 直接使用原计划,只有 request-revision 才运行 revision/final review;small-risk 只执行一次 design review。`frontend-prewrite-gate-shell` 合并生效 verdict、REQ/BR/AC 覆盖、Mock policy 和 contract 物化,是唯一写入授权。实现后 `frontend-verify-assess-shell` 合并 Mock/static/behavior/trace/assessment;只有 `eligible=true` 才运行同 writeSet 的 repair 和 `frontend-reverify-shell`。`frontend-review-context-shell` 绑定真实 diff 与有效验证证据后再 review/closeout。standard/high-risk 为 15 个顶层节点,small-risk 为 13;绿色路径执行 11 个节点、7 次 Pi。生成期 blocked Mock 只生成一个确定性阻塞节点且没有 writer。
19
+ 前端专用链保留独立 contract/scout;plan 通过增量 typed `record_*` 工具提交决策账本并以唯一 `finalize_plan` 收口(无 fenced JSON 文本协议)。写授权由 `frontend-design-policy-shell`(确定性设计检查 + 物化唯一 authoritative `frontend-implementation-contract-v1`)与 `frontend-writer-admission-shell`(唯一写入授权:派生并冻结 writeSet、pre-writer baseline、admission digest,`admitted` 才放行 writer)承接;design review 与 final review 的权威终态是 committed typed tool(`approve_design|request_design_changes`、`approve_review|request_review_changes`)。实现后 `frontend-verify-shell` 合并 lint/Mock/static/behavior/trace;任何验证失败都是 terminal,物化 `frontend-verify-failure-v1` 供 recovery 路由,无同 run repair。`frontend-review-context-shell` 绑定真实 diff 与有效验证证据后再 review/closeout。拓扑按 shape 路由:Micro 7 / Small 10 / Standard-High 11 个顶层节点;Standard/High 完整主链为 `frontend-contract-pi` → `frontend-scout-pi` → `frontend-plan-pi` → `frontend-design-policy-shell` → `frontend-design-review-pi` → `frontend-writer-admission-shell` → `frontend-implement-pi` → `frontend-verify-shell` → `frontend-review-context-shell` → `frontend-review-pi` → `frontend-closeout-shell`,Small 去掉独立 `frontend-design-review-pi`,Micro 为 `frontend-contract-import-shell` → `frontend-writer-admission-shell` → `frontend-implement-pi` → `frontend-verify-shell` → `frontend-review-context-shell` → `frontend-review-pi` → `frontend-closeout-shell`。生成期 blocked Mock 只生成一个确定性阻塞节点且没有 writer。
20
20
 
21
21
  > Backend-test Markdown-first:先由确定性环境 Shell 检查 clean env 中 Python/pytest、常见配置、conftest/fixture、test root、server entry 和 HTML renderer,失败时不消耗模型调用。随后 Pi 生成中文 README 索引与模块用例卡片并独立 Review `testcase/md/**`。第 4 节点只把前置条件、操作步骤、预期结果作为必选章节,并检查 Case ID、业务 AC、步骤/预期和占位措辞;不校验需求来源引用有效性或 Markdown sensitive-shaped 内容。pytest writer 为每次真实接口调用记录脱敏、有界的请求 method/URL/参数摘要和响应 status/body 摘要。第 6 节点只扫描每条 Case 明确映射的 pytest 脚本,同时支持模块级函数和 pytest class 方法,并把缺少请求/响应日志、递归脱敏或有界截断证据记录为 advisory。第 4/6 节点均写 PASS/FAIL findings 而不阻断后续;pytest 仍只运行一次,生成 JUnit,并把 Markdown 名称/场景/脚本映射与同一 JUnit 合成为按测试概览、质量校验、失败概览、用例执行明细和技术证据组织的中文 self-contained HTML 与 Markdown facts。最终 Pi 按固定简洁结构汇总 advisory 状态、执行事实和 L-5 结论。active 流程不要求模型生成 backend-test 业务 JSON。
22
22
 
@@ -52,6 +52,13 @@ loop-agent dag execute --dag <temp-dir>/hybrid-dag.json --init-only --canvas-pat
52
52
  - 顶层:`objective`、`successCriteria`、`globalConstraints`、`defaults`、`skillsByRole`、`executorModels`
53
53
  - 每 node:`role`、`skills`、`writePolicy`、`writeSet`、`piStep`、`shell`、`outputContract`、`executor`(`pi` | `shell` | `static`);Pi 写入节点额外声明 `toolProfile: "write"`;安全只读 Pi 节点可选声明 `retryPolicy`(生成器自动注入默认值)
54
54
 
55
+ **Source binding v2(frontend source fidelity ledger)**:
56
+
57
+ - `dagSourceBindingSchema` 是 `schemaVersion` discriminated union:v1(`schemaVersion: 1`,strict 拒绝 ledger 字段)与 v2(`schemaVersion: 2`,`ledgerPath`/`ledgerSha256`/`inputDigest`/`requirementToFragments` 全部必填)。
58
+ - 仅 `frontend-implementation` 且存在可解析 requirement/acceptance 引用时产出 v2;绑定完全来自 `task advance` 已持久化的 `source/requirement-ledger.json`(intake/apply/prewrite 同一份受管账本),缺失/损坏/漂移 fail closed(`SOURCE_FIDELITY_LEDGER_MISSING`/`SOURCE_FIDELITY_LEDGER_STALE`),不静默降级为 v1。
59
+ - v1 不得携带 optional ledger 字段冒充 v2;prewrite 门禁对 v2 校验 ledger 字节 sha256、inputDigest 新鲜度与 requirement→fragment 覆盖,任一失败以稳定 `source-fidelity-*` 码阻断 writer。
60
+ - ledger `sourceDocuments[].path` 与 DAG 侧 `serializeDagTaskSourcePath`/`resolveDagTaskSourcePath` 单一边界一致(repo-root relative),路径转换不得二次进入 digest 计算。
61
+
55
62
  **Model 生成 DAG 的 template 卫生**:
56
63
 
57
64
  - 执行前将所有 `REPLACE/WITH/...` placeholder 换为具体 repo path。
@@ -25,6 +25,7 @@ close
25
25
  goto
26
26
  snapshot
27
27
  find
28
+ find-unique
28
29
  click
29
30
  dblclick
30
31
  fill
@@ -54,7 +55,7 @@ request
54
55
 
55
56
  ## 推荐执行流程
56
57
 
57
- 使用 `testcase/frontend/rag/context.md` 中已由 environment shell 标记为 `reachable` 的非生产 `baseUrl` 和默认浏览器 session;不得创建 named session。交互前先获取 snapshot,并只使用 snapshot 中可见的 ref 或已知安全 locator。
58
+ 使用 `{testRoot}/rag/context.md`(默认 `testcase/frontend/rag/context.md`)中已由 environment shell 标记为 `reachable` 的非生产 `baseUrl` 和默认浏览器 session;不得创建 named session。交互前先获取 snapshot,并只使用 snapshot 中可见的 ref 或已知安全 locator。截图写入当前 case 的 `{evidenceDir}/<caseId>/`,canonical 文件名仍是 `final.png`。
58
59
 
59
60
  ```text
60
61
  playwright-cli open --browser=chrome http://localhost:5173
@@ -71,6 +72,16 @@ playwright-cli close
71
72
  普通交互和控制台输出均不能单独取得 passed authority。通过的 case 还需要同一 child 的有序
72
73
  controller receipts:successful `open` → successful `find` → successful post-execution cleanup。
73
74
 
75
+ ### 唯一性断言优先用 find-unique
76
+
77
+ 当语义要求「全页恰好一个」时,用 `playwright-cli find-unique "字面"` 代替人工数命中数:它内部
78
+ 执行 find 并在解析命中数 ≠ 1 时以非零退出码失败(零命中/多命中/输出不可解析均 fail),错误
79
+ 信息直接给出 `expected exactly 1 match, got N`。它只接受一个文本字面量、不接受 `--regex` 等
80
+ flag。台账中标注 `==1` 的锚点、以及「唯一命中」类 AC 应优先用它;`>=N` 存在性断言仍用
81
+ `find`(find-unique 会拒绝多命中)。controller 会解析两类命令的命中数写入 receipt,finalize
82
+ 时用 case 文档声明的 `find "字面" >=N / ==N` 对照 receipt 复核,缺失或不满足会把 passed
83
+ 降级为 blocked(assertion-not-receipt-backed),因此声明的断言必须真的执行。
84
+
74
85
  ## 受限证据采集
75
86
 
76
87
  - UI 状态:先 `snapshot`,完成交互后以成功 `find` 证明用户可见结果。
@@ -91,3 +102,14 @@ controller receipts:successful `open` → successful `find` → successful pos
91
102
  当环境、数据、权限、时序、异常路径或响应内容无法用 RAG、已验证 context URL 和 runtime allowlist 证明时,
92
103
  写入 `blocked` evidence,并提供具体 `blockedReason`。不要引入替代执行路径,也不要把隐藏状态或
93
104
  未观察到的网络结果当作通过证据。
105
+
106
+ ### 唯一控件早停(unique-control-unavailable)
107
+
108
+ - 适用:AC 点名的具体控件在到达目标状态后的**首个 post-navigation snapshot** 中缺失,且页面没有
109
+ setup-required 门(如「需先完成 Pi setup」)。
110
+ - 判定:用 case 给出的字面做**单次** `find`;返回 0 命中即为充分证据,直接写
111
+ `status=blocked`、`blockedReason=unique-control-unavailable`,在 execution.md 中引用该次 find 结果。
112
+ - 禁止:换字面重试、反复 snapshot、绕路导航、多轮探索或请求 rerun。这些都产生无放大的 token
113
+ 成本且不改变结论(Wave 3 教训:反复探测不存在控件耗掉约 717k input tokens)。
114
+ - 若 snapshot 显示存在 setup-required 门或状态前置未满足,按其对应 blockedReason 记录
115
+ (环境/状态类),不属于本早停。
@@ -13,12 +13,24 @@ description: 根据 FE-test RAG 知识包生成可由受限 playwright_cli runti
13
13
 
14
14
  ## 输入与边界
15
15
 
16
- - 只读取 `testcase/frontend/rag/context.md`、`coverage-map.md` 与已有 `testcase/frontend/cases/`。
17
- - 只写 `testcase/frontend/cases/**`;不得回读 PRD、读取 `.harness/`,或写
18
- `testcase/frontend/evidence/**`。
16
+ 默认产物根是 `testcase/frontend/`。若任务配置了 `frontendTest.testRoot`,把下列路径中的 `testcase/frontend/` 整段替换为该根(不要只替换 `testcase/`)。
17
+
18
+ - 只读取 `{testRoot}/rag/context.md`、`coverage-map.md` 与已有 `{testRoot}/cases/`。
19
+ - 若存在 `{testRoot}/rag/ui-anchors.md` 锚点台账,必须一并读取并作为 UI 断言的唯一事实源;台账缺失时按 RAG 知识包生成,但不得引用台账外的具体控件字面(缺失信息标 `blocked`)。
20
+ - 只写 `{testRoot}/cases/**`;不得回读 PRD、读取 `.harness/`,或写
21
+ `{testRoot}/evidence/**`。
19
22
  - 所有 API、字段限制、状态流转、数据来源、SLA、URL 与账号要求必须能在 RAG 知识包中追溯。
20
23
  缺失信息标记 `blocked` 或“需人工确认”,不得猜测。
21
24
 
25
+ ### 锚点台账规则(存在 ui-anchors.md 时)
26
+
27
+ - case 中每条拟通过的 `find "<字面>"` 断言必须能在台账对应「页面 × 状态」节找到
28
+ 状态为 `有效` 的行;台账 `不可断言` / `失效` 行的字面**禁止**作为通过断言。
29
+ - AC 点名的控件在台账对应状态节缺失(0 命中或无行)时,该 AC 的 case 生成
30
+ `blocked` 语义说明(或从本批剔除该 AC),`blockedReason` 用
31
+ `unique-control-unavailable`,不得生成探测性步骤反复 find。
32
+ - 台账行备注中的替代断言方案(如拆节点后的短字面二选一)按备注执行。
33
+
22
34
  ## 输出
23
35
 
24
36
  - 写 `index.md`、`manifest.draft.json`(生成阶段;materialize 会写成 `manifest.json`)与独立 case 文件
@@ -28,10 +40,10 @@ description: 根据 FE-test RAG 知识包生成可由受限 playwright_cli runti
28
40
  (例:`FE-LOGIN-001-core`)。禁止把验收标准写成 caseId。
29
41
  - `acIds` = **验收标准 ID 列表**,形态 `AC-FE-*` / `AC-*`
30
42
  (例:`["AC-FE-001"]`)。禁止把用例 ID 放进 acIds。
31
- - `casePath` 必须等于 `testcase/frontend/cases/<caseId>.md`;
32
- `evidenceDir` 必须等于 `testcase/frontend/evidence/<caseId>/`。
43
+ - `casePath` 必须等于 `{casesDir}/<caseId>.md`(默认 `testcase/frontend/cases/<caseId>.md`);
44
+ `evidenceDir` 必须等于 `{evidenceDir}/<caseId>/`(默认 `testcase/frontend/evidence/<caseId>/`)。
33
45
  - `manifest` 使用 `schemaVersion: 1`,每项只含 `caseId`、`casePath`、`dimension`、`acIds`、
34
- `evidenceDir`。所有 ID、路径和 evidenceDir 必须唯一,并位于 `testcase/frontend/` 内。
46
+ `evidenceDir`。所有 ID、路径和 evidenceDir 必须唯一,并位于 `{testRoot}/` 内。
35
47
  - `index.md` 按功能点列出 case、维度、AC、数据依赖、API 映射和预期执行状态。
36
48
 
37
49
  每个 case 必须包含:
@@ -51,10 +63,19 @@ description: 根据 FE-test RAG 知识包生成可由受限 playwright_cli runti
51
63
  占位符仅表示从紧邻其前、最新一次 `snapshot` 输出解析出的真实 `eNN` ref。生成的 case 必须在每次
52
64
  引用元素前写明 fresh snapshot;`eX`/`eY` 不是可传给 structured tool 的 literal ref,新的 snapshot
53
65
  会使旧 ref 失效,不得复用 stale ref。
54
- 5. 明确的 UI/API 预期与数据清理结果;无法满足的环境或数据依赖必须写为 `blocked`。
66
+ 5. **期望命中数不得内联进命令行(硬约束)**:如需声明 find 期望命中数,写在「预期结果」区或
67
+ 列表项的说明文字中(如 “预期唯一命中”);命令行只写纯命令 `playwright-cli find "<字面>"`。
68
+ 禁止 `find "<字面>">=N`、`≥N`、`(≥N)` 等计数后缀内联进命令 token。
69
+ 6. **唯一性断言优先 find-unique**:台账或 AC 标注 `==1`/「唯一命中」的锚点,生成
70
+ `playwright-cli find-unique "<字面>"`(仅一个文本字面量,无 flag;多命中/零命中即命令失败);
71
+ `>=N` 存在性断言仍用 `find`。finalize 会用 case 文档中 `find "字面" >=N / ==N` 声明对照
72
+ controller receipt 的解析命中数复核,声明的断言未真正执行或命中数不满足会把 passed 降级为
73
+ blocked(assertion-not-receipt-backed)——因此「测试点」里声明的每个 find 断言都必须在步骤中
74
+ 真实执行且字面完全一致。
75
+ 7. 明确的 UI/API 预期与数据清理结果;无法满足的环境或数据依赖必须写为 `blocked`。
55
76
 
56
77
  所有文件型输出均由 controller 绑定到执行节点提供的
57
- `testcase/frontend/evidence/<case-id>/` 工作目录。截图一律使用 canonical 语法
78
+ `{evidenceDir}/<case-id>/` 工作目录(默认 `testcase/frontend/evidence/<case-id>/`)。截图一律使用 canonical 语法
58
79
  `playwright-cli screenshot --filename final.png`;如确有从最新 snapshot 解析出的真实元素 ref,写为
59
80
  `playwright-cli screenshot e5 --filename final.png`。`pdf` 必须写为
60
81
  `playwright-cli pdf --filename final.pdf`。`snapshot` 无 filename 时仅返回响应;需要文件时使用
@@ -1 +0,0 @@
1
- import{ag as o,ah as n}from"./mermaid.core-BVjAT9b8.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-GF5L2VYU-CPcdNeew.js";import{_ as i}from"./mermaid.core-BVjAT9b8.js";import"./chunk-5VM5RSS4-CtiPlKel.js";import"./chunk-XXDRQBXY-UrVoM9z1.js";import"./chunk-KBJHAD2P-DQ_T-hg8.js";import"./chunk-2GRJ4B5K-K0C744p1.js";import"./index-DTZOKgAn.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-GF5L2VYU-CPcdNeew.js";import{_ as i}from"./mermaid.core-BVjAT9b8.js";import"./chunk-5VM5RSS4-CtiPlKel.js";import"./chunk-XXDRQBXY-UrVoM9z1.js";import"./chunk-KBJHAD2P-DQ_T-hg8.js";import"./chunk-2GRJ4B5K-K0C744p1.js";import"./index-DTZOKgAn.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};