@tea-agent/loop-agent 0.41.1-beta.0 → 0.42.0-next.1

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 (273) hide show
  1. package/CHANGELOG.md +61 -207
  2. package/dist/adapters/context-transfer/optional-pi-handoff.js +31 -0
  3. package/dist/adapters/context-transfer/pi-session.js +61 -0
  4. package/dist/application/dag/generate-task-dag.js +19 -75
  5. package/dist/application/task-lifecycle/advance.js +5 -24
  6. package/dist/application/task-lifecycle/observe.js +17 -171
  7. package/dist/application/task-lifecycle/plan-transitions.js +7 -42
  8. package/dist/application/task-lifecycle/recommendations.js +2 -13
  9. package/dist/build-stamp.json +3 -3
  10. package/dist/cli/command-definitions.js +12 -7
  11. package/dist/cli/program.js +23 -6
  12. package/dist/commands/client-recovery.js +0 -3
  13. package/dist/commands/dag-artifact.js +284 -0
  14. package/dist/commands/dag-context.js +184 -0
  15. package/dist/commands/dag-rerun.js +206 -1
  16. package/dist/commands/init.js +1 -27
  17. package/dist/commands/task-advance.js +0 -19
  18. package/dist/executors/dag-pi-executor.js +266 -3792
  19. package/dist/executors/pi-executor.js +4 -15
  20. package/dist/executors/pi-sdk-executor.js +3 -0
  21. package/dist/executors/shell-executor.js +217 -945
  22. package/dist/executors/shell-write-guard.js +0 -7
  23. package/dist/{worker → infrastructure}/console/app-data.js +4 -0
  24. package/dist/infrastructure/console/artifact-revision-store.js +430 -0
  25. package/dist/infrastructure/console/context-export-store.js +160 -0
  26. package/dist/infrastructure/console/dir-lock.js +132 -0
  27. package/dist/infrastructure/console/operation-store.js +197 -0
  28. package/dist/infrastructure/harness/artifact-store.js +10 -1
  29. package/dist/infrastructure/harness/atomic-write.js +12 -2
  30. package/dist/shared/context-transfer/artifact-revision.js +172 -0
  31. package/dist/shared/context-transfer.js +418 -0
  32. package/dist/shared/dag-failure-category.js +0 -12
  33. package/dist/shared/openspec-spec.js +4 -70
  34. package/dist/shared/operator/capabilities.js +14 -7
  35. package/dist/shared/operator/safe-run-summary.js +1 -0
  36. package/dist/shared/path-safety.js +93 -0
  37. package/dist/shared/preview.js +28 -4
  38. package/dist/task/config-types.js +9 -35
  39. package/dist/task/contract/adopt.js +0 -4
  40. package/dist/task/contract/import-revision.js +0 -4
  41. package/dist/task/contract/project.js +0 -3
  42. package/dist/task/contract/schema.js +1 -2
  43. package/dist/task/frontend-project-capability.js +20 -203
  44. package/dist/task/runtime.js +2 -5
  45. package/dist/task/source-prepare/build-draft.js +3 -3
  46. package/dist/task/source-prepare/fragment-inventory.js +9 -15
  47. package/dist/task/source-prepare/prepare.js +1 -89
  48. package/dist/task/source-prepare/semantic-intake.js +2 -6
  49. package/dist/task/source-references.js +1 -22
  50. package/dist/task/task-demand-routing.js +3 -0
  51. package/dist/worker/console/chat/chat-event-store.js +2 -2
  52. package/dist/worker/console/chat/pi-runtime.js +3 -2
  53. package/dist/worker/console/chat/resource-preferences-store.js +1 -1
  54. package/dist/worker/console/chat/routes.js +13 -4
  55. package/dist/worker/console/chat/semantic-activity.js +12 -11
  56. package/dist/worker/console/chat/session-stats.js +96 -0
  57. package/dist/worker/console/chat/session-store.js +1 -1
  58. package/dist/worker/console/chat/turn-process.js +28 -4
  59. package/dist/worker/console/chat/user-questions.js +1 -1
  60. package/dist/worker/console/console-update-runtime.js +1 -1
  61. package/dist/worker/console/context-transfer-diagnostics.js +198 -0
  62. package/dist/worker/console/dag-confirmation.js +1 -1
  63. package/dist/worker/console/dag-execution-receipt.js +1 -1
  64. package/dist/worker/console/doctor.js +1 -1
  65. package/dist/worker/console/draft-store.js +1 -1
  66. package/dist/worker/console/human-gate-token.js +1 -1
  67. package/dist/worker/console/index.js +3 -6
  68. package/dist/worker/console/interview/assessment.js +1 -1
  69. package/dist/worker/console/interview/session.js +1 -1
  70. package/dist/worker/console/operation-runner.js +45 -4
  71. package/dist/worker/console/operation-sse.js +1 -1
  72. package/dist/worker/console/operation-wait.js +1 -1
  73. package/dist/worker/console/operator-actions.js +107 -168
  74. package/dist/worker/console/operator-surface-health.js +1 -1
  75. package/dist/worker/console/operator-user-error.js +169 -0
  76. package/dist/worker/console/pi-plugins.js +60 -1
  77. package/dist/worker/console/routes.js +637 -8
  78. package/dist/worker/console/security.js +35 -0
  79. package/dist/worker/console/server.js +6 -6
  80. package/dist/worker/console/static/assets/{abnfDiagram-N423BO3Z-Bho4we4c.js → abnfDiagram-N423BO3Z-DZZ8m3PO.js} +1 -1
  81. package/dist/worker/console/static/assets/{arc-TBDkTeK0.js → arc-D6PvaVd-.js} +1 -1
  82. package/dist/worker/console/static/assets/{architectureDiagram-T3A2C74G-BF_fZrn2.js → architectureDiagram-T3A2C74G-B_OTOiI8.js} +1 -1
  83. package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-CCnPgUe2.js → blockDiagram-VBNYF7ZC-Bv6rqHBg.js} +1 -1
  84. package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-BCYZJLAT.js → c4Diagram-5PPSVZJV-B8eHr0oz.js} +1 -1
  85. package/dist/worker/console/static/assets/channel-BU5gOilw.js +1 -0
  86. package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-D8K6adhU.js → chunk-2GRJ4B5K-DYwR0im2.js} +1 -1
  87. package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-DkT1Q78b.js → chunk-2Q5K7J3B-D2WPGqXt.js} +1 -1
  88. package/dist/worker/console/static/assets/{chunk-5RXB4S5H-DuhvpIr7.js → chunk-5RXB4S5H-CQISJ_I7.js} +1 -1
  89. package/dist/worker/console/static/assets/{chunk-5VM5RSS4-BnK6dC49.js → chunk-5VM5RSS4-C0o2Du1e.js} +1 -1
  90. package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-DPz__z7r.js → chunk-6Q2QTUOP-4f8kr-U7.js} +1 -1
  91. package/dist/worker/console/static/assets/{chunk-GF5L2VYU-0kkppM2j.js → chunk-GF5L2VYU-D_OWvXzX.js} +1 -1
  92. package/dist/worker/console/static/assets/{chunk-JWPE2WC7-BB41iK5t.js → chunk-JWPE2WC7-CasdPz5X.js} +1 -1
  93. package/dist/worker/console/static/assets/{chunk-KBJHAD2P-CiVrxKHU.js → chunk-KBJHAD2P-Cj8lRrla.js} +1 -1
  94. package/dist/worker/console/static/assets/{chunk-RYQCIY6F-C2h9Xje1.js → chunk-RYQCIY6F-CUvD1FSd.js} +1 -1
  95. package/dist/worker/console/static/assets/{chunk-XXDRQBXY-3iOSHdbM.js → chunk-XXDRQBXY-CqLw_eqB.js} +1 -1
  96. package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-DIzKJGHr.js +1 -0
  97. package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-DIzKJGHr.js +1 -0
  98. package/dist/worker/console/static/assets/{cose-bilkent-JH36ORCC-BN3A7tkk.js → cose-bilkent-JH36ORCC-ku-WqJPx.js} +1 -1
  99. package/dist/worker/console/static/assets/{cynefin-VYW2F7L2-CTuBy0Or.js → cynefin-VYW2F7L2-Bq_PYDhl.js} +1 -1
  100. package/dist/worker/console/static/assets/{cynefinDiagram-MW4NZA55-wb6tUlMN.js → cynefinDiagram-MW4NZA55-BiGZV641.js} +1 -1
  101. package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-GP1Ivx8B.js → dagre-VZM6K2ZE-C4JRlglF.js} +1 -1
  102. package/dist/worker/console/static/assets/{diagram-7IWD3JNH-ejrcK6L0.js → diagram-7IWD3JNH-B0dNeWYG.js} +1 -1
  103. package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-YFkCCvUU.js → diagram-B4RE2ZJO-Cj35YvYM.js} +1 -1
  104. package/dist/worker/console/static/assets/{diagram-LBJQPF4R-B4rrvIaL.js → diagram-LBJQPF4R-uzQoJ2-8.js} +1 -1
  105. package/dist/worker/console/static/assets/{diagram-Q27KOJAE-C-YIZcUf.js → diagram-Q27KOJAE-D1a-Buoz.js} +1 -1
  106. package/dist/worker/console/static/assets/{diagram-UB23O5K3-BPF5wcL1.js → diagram-UB23O5K3-XjRrLRSs.js} +1 -1
  107. package/dist/worker/console/static/assets/{ebnfDiagram-BXEA7PRR-CU5SzXjO.js → ebnfDiagram-BXEA7PRR-Da_O24cW.js} +1 -1
  108. package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-CpL414DE.js → erDiagram-JOGREHBK-BLJ8jrYU.js} +1 -1
  109. package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-MrhLzNau.js → flowDiagram-UKHOOZJN-B9GrLjM0.js} +1 -1
  110. package/dist/worker/console/static/assets/{ganttDiagram-PKOTCBZU-Bg4qFuUo.js → ganttDiagram-PKOTCBZU-CeJ0TqiK.js} +1 -1
  111. package/dist/worker/console/static/assets/{gitGraphDiagram-DS77QQ5N-ColxSXLR.js → gitGraphDiagram-DS77QQ5N-Bm2eNNFX.js} +1 -1
  112. package/dist/worker/console/static/assets/index-H9rFJiGL.css +1 -0
  113. package/dist/worker/console/static/assets/index-xwu9GxEc.js +451 -0
  114. package/dist/worker/console/static/assets/{infoDiagram-6WML65LV-Czvtm6gc.js → infoDiagram-6WML65LV-DB26i3d8.js} +1 -1
  115. package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-B7Xp8HyJ.js → ishikawaDiagram-WSZJBQD7-BOGRyeZT.js} +1 -1
  116. package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-DWYZcvph.js → journeyDiagram-NVQOT4AX-CZRoBO_6.js} +1 -1
  117. package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-KTLZRUjx.js → kanban-definition-27J2QSJJ-qlWhJyoB.js} +1 -1
  118. package/dist/worker/console/static/assets/{linear-_Exn7bfl.js → linear-CfUiDDB3.js} +1 -1
  119. package/dist/worker/console/static/assets/{mermaid.core-Cxg8kX8V.js → mermaid.core-BQe6fpqj.js} +5 -5
  120. package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-oKrlo2Bt.js → mindmap-definition-FAOFIHXS-zFzWHw64.js} +1 -1
  121. package/dist/worker/console/static/assets/{pegDiagram-VL7TDLO6-XAeteiNd.js → pegDiagram-VL7TDLO6-DFGUqjZO.js} +1 -1
  122. package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-BTf1K-lp.js → pieDiagram-7S7Q4E2Y-BB5i0l8Z.js} +1 -1
  123. package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-C0IlY0Jf.js → quadrantDiagram-CIZ2JOQS-obbVZ_X5.js} +1 -1
  124. package/dist/worker/console/static/assets/{railroadDiagram-AXF67PYL-BVbKtZhW.js → railroadDiagram-AXF67PYL-BwdaNzc1.js} +1 -1
  125. package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP-C5e4JFcr.js → requirementDiagram-LRYGKXZP-CkTJaugh.js} +1 -1
  126. package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-Cz30hc29.js → sankeyDiagram-W5VNT64P-BwJ-hIgq.js} +1 -1
  127. package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-DS33n6d0.js → sequenceDiagram-SI44F4Z6-BzSgmm7w.js} +1 -1
  128. package/dist/worker/console/static/assets/{sizeCapture-X5ZJPWSS-46w7v-9T.js → sizeCapture-X5ZJPWSS-Bn3oj5Q1.js} +1 -1
  129. package/dist/worker/console/static/assets/{stateDiagram-OKZ733FA-pbcD5SsZ.js → stateDiagram-OKZ733FA-dxhGtL8K.js} +1 -1
  130. package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-Cld2qK9v.js +1 -0
  131. package/dist/worker/console/static/assets/{swimlanes-SLNWSIFB-DuivYBSj.js → swimlanes-SLNWSIFB-BLpEInya.js} +2 -2
  132. package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-TIHpiT7w.js +8 -0
  133. package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-Cb9VZVIl.js → timeline-definition-Z64GVDOM-ChJGYcXy.js} +1 -1
  134. package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-D2-mfOgR.js → vennDiagram-T6HMQDX7-DK-qjRer.js} +1 -1
  135. package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-DeS2aC76.js → wardleyDiagram-T6FBY63Y-3qeaWAg-.js} +1 -1
  136. package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-WGsrFjxH.js → xychartDiagram-ELKLHX3M-CootlyP9.js} +1 -1
  137. package/dist/worker/console/static/index.html +7 -2
  138. package/dist/worker/console/static-src/app/useOperatorActions.js +3 -2
  139. package/dist/worker/console/static-src/app/useRunProgress.js +9 -2
  140. package/dist/worker/console/static-src/operator-chat/dag-progress-link.js +22 -0
  141. package/dist/worker/console/static-src/operator-chat/useChatSessions.js +2 -0
  142. package/dist/worker/console/static-src/operator-chat/useChatThread.js +6 -0
  143. package/dist/worker/console/static-src/operator-chat/useRuntimeControls.js +28 -3
  144. package/dist/worker/console/static-src/pages/tasks/run-panel-progress.js +106 -0
  145. package/dist/worker/console/static-src/shell/console-update-reload.js +25 -0
  146. package/dist/worker/console/workspace-context.js +28 -112
  147. package/dist/worker/console/workspace-registry.js +2 -2
  148. package/dist/worker/continuation/worker-continuation.js +278 -0
  149. package/dist/worker/observability/read-model.js +4 -0
  150. package/dist/worker/observe/health.js +1 -1
  151. package/dist/worker/observe/node-transparency.js +572 -0
  152. package/dist/worker/observe/routes.js +51 -1
  153. package/dist/worker/observe/static/api.js +69 -5
  154. package/dist/worker/observe/static/dag-context-reason-labels.d.ts +9 -0
  155. package/dist/worker/observe/static/dag-context-reason-labels.js +120 -0
  156. package/dist/worker/observe/static/dag-node-purpose.js +0 -5
  157. package/dist/worker/observe/static/state.js +3 -1
  158. package/dist/worker/observe/static/styles.css +1037 -126
  159. package/dist/worker/observe/static/views/dag-inspector.js +1217 -65
  160. package/dist/worker/observe/static/views/session-timeline.js +121 -25
  161. package/dist/worker/outcomes/adapters.js +19 -0
  162. package/dist/worker/outcomes/types.js +1 -0
  163. package/dist/worker/pool/attempt-lease.js +97 -66
  164. package/dist/worker/pool/begin-attempt-with-lease.js +1 -0
  165. package/dist/worker/pool/reconcile.js +46 -1
  166. package/dist/worker/pool/run-store.js +2 -0
  167. package/dist/worker/pool/state-projection.js +2 -0
  168. package/dist/worker/task-spec/workflow-routing.js +8 -3
  169. package/dist/workflows/dag/artifact-bindings.js +149 -0
  170. package/dist/workflows/dag/artifact-revision-schema-registry.js +31 -0
  171. package/dist/workflows/dag/backend-test-result-contract.js +1 -1
  172. package/dist/workflows/dag/budget-enforcement.js +10 -0
  173. package/dist/workflows/dag/context-receipt.js +305 -0
  174. package/dist/workflows/dag/context-transfer/context-bundle.js +423 -0
  175. package/dist/workflows/dag/context-transfer/operator-actions.js +61 -0
  176. package/dist/workflows/dag/context-transfer/renderers.js +93 -0
  177. package/dist/workflows/dag/contract-validator-registrations.js +2 -1
  178. package/dist/workflows/dag/frontend-implementation-contract.js +162 -932
  179. package/dist/workflows/dag/frontend-plan-render.js +1 -2
  180. package/dist/workflows/dag/frontend-prewrite-gate.js +349 -255
  181. package/dist/workflows/dag/frontend-recovery-plan.js +10 -17
  182. package/dist/workflows/dag/frontend-recovery-run.js +20 -33
  183. package/dist/workflows/dag/frontend-repair.js +432 -1
  184. package/dist/workflows/dag/frontend-review-context.js +15 -261
  185. package/dist/workflows/dag/frontend-verification-trace.js +24 -249
  186. package/dist/workflows/dag/frontend-worktree-diff.js +17 -250
  187. package/dist/workflows/dag/frontend-writer-rollback.js +32 -0
  188. package/dist/workflows/dag/init-hybrid.js +640 -685
  189. package/dist/workflows/dag/interrupt-request.js +0 -7
  190. package/dist/workflows/dag/node-execution.js +116 -759
  191. package/dist/workflows/dag/path-safety.js +1 -0
  192. package/dist/workflows/dag/prompt.js +30 -38
  193. package/dist/workflows/dag/report.js +1 -37
  194. package/dist/workflows/dag/rerun-feedback.js +1 -256
  195. package/dist/workflows/dag/rerun-plan.js +557 -11
  196. package/dist/workflows/dag/rerun-run.js +601 -38
  197. package/dist/workflows/dag/rerun-task.js +0 -29
  198. package/dist/workflows/dag/retry-policy.js +104 -214
  199. package/dist/workflows/dag/runner.js +142 -430
  200. package/dist/workflows/dag/scheduler.js +16 -114
  201. package/dist/workflows/dag/skill-snapshot.js +17 -0
  202. package/dist/workflows/dag/types.js +195 -246
  203. package/dist/workflows/dag/validate.js +12 -28
  204. package/docs/architecture/runtime-boundaries.md +6 -6
  205. package/docs/architecture/worker-and-feature.md +1 -1
  206. package/docs/init-surface.manifest.json +12 -30
  207. package/docs/skills/vetted-skill-registry.md +2 -4
  208. package/docs/templates/README.md +0 -2
  209. package/docs/templates/agent-dag-report.schema.json +2 -8
  210. package/docs/templates/agent-dag.schema.json +33 -1
  211. package/docs/templates/frontend-implementation-contract.schema.json +1 -4
  212. package/docs/templates/product-line/task.yaml +1 -1
  213. package/harness.json +3 -3
  214. package/package.json +3 -1
  215. package/skills/frontend-bounded-implement/SKILL.md +14 -15
  216. package/skills/frontend-design-review/SKILL.md +41 -22
  217. package/skills/frontend-implementation/SKILL.md +52 -0
  218. package/skills/frontend-implementation/references/code-standards.md +33 -0
  219. package/skills/frontend-implementation/references/design-spec.md +56 -0
  220. package/skills/frontend-implementation/references/node-contracts.md +31 -0
  221. package/skills/frontend-review/SKILL.md +15 -20
  222. package/skills/frontend-review/references/review-findings.md +7 -6
  223. package/skills/frontend-verification/SKILL.md +1 -1
  224. package/skills/loop-agent/references/command-reference.md +6 -1
  225. package/skills/loop-agent/references/hybrid-dag.md +2 -2
  226. package/dist/commands/dag-follow-up.js +0 -138
  227. package/dist/executors/pi-read-budget-policy.js +0 -239
  228. package/dist/worker/console/frontend-human-decision-adapter.js +0 -19
  229. package/dist/worker/console/frontend-split-operation-adapter.js +0 -20
  230. package/dist/worker/console/operation-store.js +0 -389
  231. package/dist/worker/console/static/assets/channel-bnXW0U3C.js +0 -1
  232. package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-rZpq_twR.js +0 -1
  233. package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-rZpq_twR.js +0 -1
  234. package/dist/worker/console/static/assets/index-D3CC4eUz.css +0 -1
  235. package/dist/worker/console/static/assets/index-DLt4ZFvD.js +0 -437
  236. package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-zBMYiUyi.js +0 -1
  237. package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-d_rms-5i.js +0 -8
  238. package/dist/worker/console/static-src/active-run-badge.js +0 -17
  239. package/dist/worker/materialize/frontend-split-task-materializer.js +0 -72
  240. package/dist/workflows/dag/dag-retry-schema.js +0 -138
  241. package/dist/workflows/dag/frontend-closeout.js +0 -221
  242. package/dist/workflows/dag/frontend-design-policy.js +0 -400
  243. package/dist/workflows/dag/frontend-human-decision.js +0 -182
  244. package/dist/workflows/dag/frontend-provider-capability-matrix.js +0 -159
  245. package/dist/workflows/dag/frontend-read-budgets.js +0 -12
  246. package/dist/workflows/dag/frontend-recovery-capsule.js +0 -455
  247. package/dist/workflows/dag/frontend-recovery-controller.js +0 -202
  248. package/dist/workflows/dag/frontend-recovery-lineage.js +0 -178
  249. package/dist/workflows/dag/frontend-review-findings.js +0 -270
  250. package/dist/workflows/dag/frontend-shadow-dual-write.js +0 -914
  251. package/dist/workflows/dag/frontend-shape-capsule-store.js +0 -191
  252. package/dist/workflows/dag/frontend-shape-facts.js +0 -409
  253. package/dist/workflows/dag/frontend-shape.js +0 -427
  254. package/dist/workflows/dag/frontend-source-fidelity-ledger.js +0 -108
  255. package/dist/workflows/dag/frontend-split-application-service.js +0 -203
  256. package/dist/workflows/dag/frontend-split-orchestrator.js +0 -899
  257. package/dist/workflows/dag/frontend-typed-event-store.js +0 -452
  258. package/dist/workflows/dag/frontend-typed-event-transaction.js +0 -180
  259. package/dist/workflows/dag/frontend-writer-admission.js +0 -285
  260. package/dist/workflows/dag/frontend-writer-status.js +0 -256
  261. package/dist/workflows/dag/recovery-lease.js +0 -80
  262. package/docs/templates/frontend-implementation-dag.json +0 -89
  263. package/docs/templates/spec-registry.schema.json +0 -45
  264. package/skills/frontend-bounded-implement/references/code-standards.md +0 -19
  265. package/skills/frontend-contract/SKILL.md +0 -23
  266. package/skills/frontend-contract/references/contract-protocol.md +0 -34
  267. package/skills/frontend-plan/SKILL.md +0 -26
  268. package/skills/frontend-plan/references/decision-contract.md +0 -37
  269. package/skills/frontend-plan/references/design-decisions.md +0 -17
  270. package/skills/frontend-scout/SKILL.md +0 -25
  271. package/skills/frontend-scout/references/design-evidence.md +0 -16
  272. package/skills/frontend-scout/references/scout-evidence.md +0 -23
  273. /package/dist/{worker → infrastructure}/console/repo-fingerprint.js +0 -0
@@ -160,18 +160,18 @@ Runner / Loop ──(迁移中)──> 逐步改为仅经 Store / Appli
160
160
 
161
161
  | From | May import | Must not import |
162
162
  | ------ | ------------ | ----------------- |
163
- | `src/commands/**` | application, workflows, infrastructure, task, records, executors, shared | — |
164
- | `src/workflows/**` | executors, task, records, shared, application(目标) | `src/commands/**` |
163
+ | `src/commands/**` | application, workflows, infrastructure, task, records, executors, shared | `src/worker/**` |
164
+ | `src/workflows/**` | executors, task, records, shared, infrastructure, application(目标) | `src/commands/**` |
165
165
  | `src/executors/**` | shared, 外部 SDK | `src/commands/**`, `src/cli/**` |
166
- | `src/worker/**` | worker-local modules, task contracts, shared, Node APIs | `src/commands/**`, `src/cli/**`, `src/application/**` |
167
- | `src/cli/**` | commands, adapters, shared, application(目标) | — |
166
+ | `src/worker/**` | worker-local modules, task contracts, shared, infrastructure, Node APIs | `src/commands/**`, `src/cli/**`, `src/application/**` |
167
+ | `src/cli/**` | commands, adapters, shared, infrastructure, application(目标) | — |
168
168
  | `.agents/skills/**` | (Markdown 引用,非 TS import) | 运行时 TS 模块 |
169
169
 
170
170
  ## 已知过渡耦合
171
171
 
172
- 当前没有允许的 `src/workflows/**` / `src/executors/**` forbidden import,也没有允许的 `src/worker/**` → `src/{cli,commands,application}/**` TypeScript import。
172
+ 当前没有允许的 `src/workflows/**` / `src/executors/**` forbidden import,也没有允许的 `src/worker/**` → `src/{cli,commands,application}/**` 或 `src/commands/**` → `src/worker/**` TypeScript import。Console app-data 存储(operations、context exports、artifact revisions、app-data path helpers)位于 `src/infrastructure/console/**`,由 Console(worker 层)与 CLI 命令共同向下依赖;Console 专属的 route/action 编排仍留在 `src/worker/console/**`。
173
173
 
174
- `scripts/check-architecture-boundaries.sh` 的 transitional allowlist 保持为空。任何新增的 `workflows/executors/worker` forbidden import 必须导致检查 **exit 1**;如果未来确有临时例外,必须先写入 active exec plan,说明移除时间和验证门禁。
174
+ `scripts/check-architecture-boundaries.sh` 的 transitional allowlist 保持为空。任何新增的 `workflows/executors/worker/commands` forbidden import 必须导致检查 **exit 1**;如果未来确有临时例外,必须先写入 active exec plan,说明移除时间和验证门禁。
175
175
 
176
176
  ## Governance 钩子
177
177
 
@@ -61,7 +61,7 @@ controller identity 与 DAG skill snapshot 是两个不同冻结层(前者跨
61
61
 
62
62
  - schema/validate:`src/worker/task-spec/{schema,validate}.ts`。
63
63
  - 校验验收条件、依赖、验证命令;`agent-worker task validate-feature` 等用之。
64
- - **0.16.0+**:可选 `execution.workflow` 映射到 loop-agent `taskKind`(如 agent-dag / frontend-implementation / backend-test / frontend-test);typed Task Outcome 与 artifact-aware Ready 门禁见 completed `2026-07-19-taskspec-workflow-routing.md`。
64
+ - **0.16.0+**:可选 `execution.workflow` 映射到 loop-agent `taskKind`(agent-dag / frontend-implementation / backend-test-analysis / backend-test / frontend-test);`backend-test-analysis` 只读生成严格 analysis artifact,不执行测试;typed Task Outcome 与 artifact-aware Ready 门禁见 completed `2026-07-19-taskspec-workflow-routing.md`。
65
65
  - 文档映射镜像:`docs/architecture/taskspec-to-loop-agent-mapping.md`(runtime 真源仍在 `src/worker/` 与 materialize 路径)。
66
66
 
67
67
  ### Task Pool
@@ -34,7 +34,6 @@
34
34
  "docs/templates/worker-dogfood-setup.md",
35
35
  "docs/templates/worker-dogfood-evidence.md",
36
36
  "docs/templates/harness.schema.json",
37
- "docs/templates/spec-registry.schema.json",
38
37
  "docs/templates/interactive-ui-round2-experiment.md",
39
38
  "docs/templates/product-line/README.md",
40
39
  "docs/templates/product-line/AGENTS.md",
@@ -78,16 +77,11 @@
78
77
  "skills/webapp-testing/SKILL.md",
79
78
  "skills/playwright-cli/SKILL.md",
80
79
  "skills/playwright-cli-case-generator/SKILL.md",
81
- "skills/frontend-contract/SKILL.md",
82
- "skills/frontend-contract/references/contract-protocol.md",
83
- "skills/frontend-scout/SKILL.md",
84
- "skills/frontend-scout/references/scout-evidence.md",
85
- "skills/frontend-scout/references/design-evidence.md",
86
- "skills/frontend-plan/SKILL.md",
87
- "skills/frontend-plan/references/decision-contract.md",
88
- "skills/frontend-plan/references/design-decisions.md",
80
+ "skills/frontend-implementation/SKILL.md",
81
+ "skills/frontend-implementation/references/node-contracts.md",
82
+ "skills/frontend-implementation/references/design-spec.md",
83
+ "skills/frontend-implementation/references/code-standards.md",
89
84
  "skills/frontend-bounded-implement/SKILL.md",
90
- "skills/frontend-bounded-implement/references/code-standards.md",
91
85
  "skills/frontend-design-review/SKILL.md",
92
86
  "skills/frontend-design-review/references/review-checklist.md",
93
87
  "skills/frontend-review/SKILL.md",
@@ -109,7 +103,6 @@
109
103
  "docs/feature-workflow.md",
110
104
  "docs/verification-matrix.md",
111
105
  "docs/loop-agent-harness.md",
112
- "docs/spec-registry.json",
113
106
  "docs/harness-methodology-tdd.md",
114
107
  "docs/harness-methodology-verification.md",
115
108
  "docs/harness-methodology-debugging.md",
@@ -164,16 +157,11 @@
164
157
  ".agents/skills/webapp-testing/SKILL.md",
165
158
  ".agents/skills/playwright-cli/SKILL.md",
166
159
  ".agents/skills/playwright-cli-case-generator/SKILL.md",
167
- ".agents/skills/frontend-contract/SKILL.md",
168
- ".agents/skills/frontend-contract/references/contract-protocol.md",
169
- ".agents/skills/frontend-scout/SKILL.md",
170
- ".agents/skills/frontend-scout/references/scout-evidence.md",
171
- ".agents/skills/frontend-scout/references/design-evidence.md",
172
- ".agents/skills/frontend-plan/SKILL.md",
173
- ".agents/skills/frontend-plan/references/decision-contract.md",
174
- ".agents/skills/frontend-plan/references/design-decisions.md",
160
+ ".agents/skills/frontend-implementation/SKILL.md",
161
+ ".agents/skills/frontend-implementation/references/node-contracts.md",
162
+ ".agents/skills/frontend-implementation/references/design-spec.md",
163
+ ".agents/skills/frontend-implementation/references/code-standards.md",
175
164
  ".agents/skills/frontend-bounded-implement/SKILL.md",
176
- ".agents/skills/frontend-bounded-implement/references/code-standards.md",
177
165
  ".agents/skills/frontend-design-review/SKILL.md",
178
166
  ".agents/skills/frontend-design-review/references/review-checklist.md",
179
167
  ".agents/skills/frontend-review/SKILL.md",
@@ -190,7 +178,6 @@
190
178
  ".pi/settings.json"
191
179
  ],
192
180
  "initSurface": {
193
- "docs/spec-registry.json": "generated",
194
181
  "README.md": "managed-block",
195
182
  "AGENTS.md": "managed-block",
196
183
  ".gitignore": "managed-block",
@@ -255,16 +242,11 @@
255
242
  ".agents/skills/webapp-testing/SKILL.md": "copied",
256
243
  ".agents/skills/playwright-cli/SKILL.md": "copied",
257
244
  ".agents/skills/playwright-cli-case-generator/SKILL.md": "copied",
258
- ".agents/skills/frontend-contract/SKILL.md": "copied",
259
- ".agents/skills/frontend-contract/references/contract-protocol.md": "copied",
260
- ".agents/skills/frontend-scout/SKILL.md": "copied",
261
- ".agents/skills/frontend-scout/references/scout-evidence.md": "copied",
262
- ".agents/skills/frontend-scout/references/design-evidence.md": "copied",
263
- ".agents/skills/frontend-plan/SKILL.md": "copied",
264
- ".agents/skills/frontend-plan/references/decision-contract.md": "copied",
265
- ".agents/skills/frontend-plan/references/design-decisions.md": "copied",
245
+ ".agents/skills/frontend-implementation/SKILL.md": "copied",
246
+ ".agents/skills/frontend-implementation/references/node-contracts.md": "copied",
247
+ ".agents/skills/frontend-implementation/references/design-spec.md": "copied",
248
+ ".agents/skills/frontend-implementation/references/code-standards.md": "copied",
266
249
  ".agents/skills/frontend-bounded-implement/SKILL.md": "copied",
267
- ".agents/skills/frontend-bounded-implement/references/code-standards.md": "copied",
268
250
  ".agents/skills/frontend-design-review/SKILL.md": "copied",
269
251
  ".agents/skills/frontend-design-review/references/review-checklist.md": "copied",
270
252
  ".agents/skills/frontend-review/SKILL.md": "copied",
@@ -16,13 +16,11 @@ The entries below are local wrappers or existing local skills. They are not whol
16
16
  | `code-review-core` | local wrapper inspired by code review practice | `skills/code-review-core/SKILL.md` | reviewer | reviewer | No external tools or network by default. |
17
17
  | `codebase-scout` | local wrapper | `skills/codebase-scout/SKILL.md` | scout | scout | Read-only reconnaissance guidance. |
18
18
  | `init-capability-evolution` | local wrapper | `skills/init-capability-evolution/SKILL.md` | supervisor, maintenance | optional | Used only when changes may affect target-project initialization, package surface, or init projection rules. |
19
- | `frontend-contract` | local frontend hybrid DAG contract skill | `skills/frontend-contract/SKILL.md` | `frontend-contract-pi` only | frontend-implementation DAG only | Required contract-protocol ref stays complete under the default runtime budget; does not inject design or implementation guidance. |
20
- | `frontend-scout` | local frontend hybrid DAG scouting skill | `skills/frontend-scout/SKILL.md` | `frontend-scout-pi` only | frontend-implementation DAG only | Required target-surface and design-evidence refs are bounded and complete; discovery does not leak into Plan. |
21
- | `frontend-plan` | local frontend hybrid DAG planning skill | `skills/frontend-plan/SKILL.md` | `frontend-plan-pi` and legacy Mock assessment only | frontend-implementation DAG only | Required decision/design refs carry stable trace IDs, Mock/data and dependency decisions without the full lifecycle contract. |
19
+ | `frontend-implementation` | local existing (frontend hybrid DAG) | `skills/frontend-implementation/SKILL.md` | frontend plan / contract / scout / mock nodes (spec-level `skillsByRole`) | frontend-implementation DAG only | Required refs node-contracts / design-spec / code-standards; injected by `init-hybrid.ts` spec generation and `src/adapters/loop-agent.ts`; projected via init-surface manifest. Not in `DEFAULT_SKILLS_BY_ROLE`. |
22
20
  | `frontend-review` | local existing (frontend hybrid DAG) | `skills/frontend-review/SKILL.md` | reviewer (frontend review nodes, spec-level) | frontend-implementation / repair DAGs | Consumed by `init-hybrid.ts` / `frontend-repair.ts` / `shell-executor.ts`; required ref review-findings (maxChars 2800). |
23
21
  | `frontend-verification` | local existing (frontend hybrid DAG) | `skills/frontend-verification/SKILL.md` | verifier / closeout (frontend evidence, spec-level) | frontend DAG closeout | Consumed by `shell-executor.ts` / `frontend-repair.ts` / `frontend-review-context.ts`; required ref verification-checklist. |
24
22
  | `frontend-design-review` | local existing (frontend hybrid DAG) | `skills/frontend-design-review/SKILL.md` | design-gate reviewer (before any writer) | frontend-implementation DAG design gate | Injected by `init-hybrid.ts`; runs before the prewrite gate authorizes writers; required ref review-checklist. |
25
- | `frontend-bounded-implement` | local existing (frontend hybrid DAG) | `skills/frontend-bounded-implement/SKILL.md` | implementer (writer nodes, spec-level) | frontend writers after canonical contract gate | Injected by `init-hybrid.ts`; its required bounded code-standards ref applies only inside canonical targets and does not authorize OpenSpec/source rediscovery. |
23
+ | `frontend-bounded-implement` | local existing (frontend hybrid DAG) | `skills/frontend-bounded-implement/SKILL.md` | implementer (writer nodes, spec-level) | frontend writers after canonical contract gate | Injected by `init-hybrid.ts`; writers run only after the canonical contract gate accepts and only inside the frozen writeSet (ADR 0015/0016 discipline). |
26
24
  | `grill-with-docs` | local operator skill adapted from domain grilling + ADR/glossary discipline | `skills/grill-with-docs/SKILL.md` | explicit interactive operator only | never a default DAG role | Resolves decisions via `harness.json.governanceRoot`; required refs `context-format.md` / `adr-format.md`; respects writeSet; not in `DEFAULT_SKILLS_BY_ROLE`. |
27
25
  | `grill-me` | local interview question engine wrapper | `skills/grill-me/SKILL.md` | interview runtime dependency (not a DAG role) | never a default DAG role | Question engine lives in `src/worker/console/interview/grill-me.ts` (Console interview / operator-actions); intentionally NOT projected by init-surface manifest — runs in this repo's Console only. |
28
26
  | `analyze-product-requirements` | local org-internal Product Analysis V4 skill | `skills/analyze-product-requirements/SKILL.md` | source-prepare dependency (not a DAG role) | never a default DAG role | Loaded by `src/task/source-prepare/prepare.ts` during 任务源 preparation; IRON-LAW freeze semantics on `product-analysis.md`; intentionally NOT projected by init-surface manifest. |
@@ -38,7 +38,6 @@
38
38
 
39
39
  - `frontend-task-requirement.md`、`frontend-task-constraints.md`、`frontend-design-contract.md` — 前端任务输入与设计合同。
40
40
  - `frontend-implementation-contract.schema.json` — 前端实现合同 schema(sourceBinding v2 ledger 字段 all-or-none:任一出现则四项齐全,禁止 v1+optional 冒充 v2)。`requirements[].sourceRefs[].items` 使用合法 `$ref: #/$defs/path`(相对路径、无 `..` 逃逸、无反斜杠),模板 JSON 无非法键,运行时加载器可直接编译(AC-003)。
41
- - `frontend-implementation-dag.json` — 自包含的前端实现 DAG 模板:契约 → 侦察 → 计划 → 设计策略/评审 → writer 准入 → 有界写入 → 验证 → 真实 diff 审查 → closeout。它不依赖 runtime builder 或其他模板;执行前必须将所有 `REPLACE/WITH/...` 路径和确定性命令替换为当前项目的具体值。
42
41
  - `frontend-test-dag.json` — frontend-test DAG 模板;其 deterministic checklist 会拒绝 alternative executable instructions,仅允许 allowlisted `playwright-cli` command。Pi generator/reviser 的 runtime writeSet 仅授权下列目标项目生成路径(不是本仓库文档索引目标):
43
42
 
44
43
  ~~~text
@@ -57,7 +56,6 @@
57
56
  - `knowledge-sync-dag.json`、`knowledge-graph-bootstrap-dag.json` — 知识同步与图谱初始化 DAG。
58
57
  - `knowledge-sync-draft.schema.json` — 知识同步草稿 schema。
59
58
  - `harness.schema.json` — `harness.json` 的 IDE JSON Schema。
60
- - `spec-registry.schema.json` — 项目级 `ai_workspace/loop-agent/spec-registry.json` 的机器校验 schema。
61
59
 
62
60
  ## 子目录
63
61
 
@@ -176,8 +176,7 @@
176
176
  "humanEscalationJson",
177
177
  "humanEscalationMd",
178
178
  "humanApproval",
179
- "humanRejection",
180
- "changeManifest"
179
+ "humanRejection"
181
180
  ],
182
181
  "properties": {
183
182
  "resultSummary": { "$ref": "#/$defs/dagArtifactRef" },
@@ -189,12 +188,7 @@
189
188
  "humanEscalationJson": { "$ref": "#/$defs/dagArtifactRef" },
190
189
  "humanEscalationMd": { "$ref": "#/$defs/dagArtifactRef" },
191
190
  "humanApproval": { "$ref": "#/$defs/dagArtifactRef" },
192
- "humanRejection": { "$ref": "#/$defs/dagArtifactRef" },
193
- "changeManifest": { "$ref": "#/$defs/dagArtifactRef" },
194
- "changeManifestChangedFiles": {
195
- "type": "array",
196
- "items": { "type": "string" }
197
- }
191
+ "humanRejection": { "$ref": "#/$defs/dagArtifactRef" }
198
192
  }
199
193
  },
200
194
  "repairArtifact": {
@@ -466,7 +466,7 @@
466
466
  "retryCategories": {
467
467
  "type": "array",
468
468
  "items": {
469
- "enum": ["timeout", "network", "rate-limit", "unavailable", "empty-output", "output-too-large", "protocol-invalid", "invalid-output", "writer-empty-diff", "incomplete-write-set", "writer-clean-timeout", "read-burst", "context-overflow"]
469
+ "enum": ["timeout", "network", "rate-limit", "unavailable", "empty-output", "output-too-large", "protocol-invalid", "invalid-output", "writer-empty-diff", "incomplete-write-set", "writer-clean-timeout"]
470
470
  },
471
471
  "default": ["timeout", "network", "rate-limit", "unavailable", "empty-output"],
472
472
  "description": "Failure categories eligible for retry. quota/auth/write-guard are never eligible. invalid-output is allowed only on explicit structured/protocol policies; writer-empty-diff and incomplete-write-set are reserved for requireChangedFiles generation/completeness writers; writer-clean-timeout is reserved for standard bounded writers after explicit zero-write-tool-call and empty-diff evidence."
@@ -483,6 +483,28 @@
483
483
  "sha256": { "type": "string", "minLength": 1 }
484
484
  }
485
485
  },
486
+ "producedArtifact": {
487
+ "type": "object",
488
+ "additionalProperties": false,
489
+ "required": ["artifactId", "kind", "path", "mediaType", "revisionPolicy"],
490
+ "properties": {
491
+ "artifactId": { "type": "string", "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$" },
492
+ "kind": { "enum": ["structured", "assistant", "stdout"] },
493
+ "path": { "type": "string", "pattern": "^(?!/)(?![A-Za-z]:)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\).+$" },
494
+ "mediaType": { "type": "string", "minLength": 1 },
495
+ "schemaId": { "type": "string", "minLength": 1 },
496
+ "revisionPolicy": { "enum": ["immutable", "replace-file"] }
497
+ }
498
+ },
499
+ "consumedArtifact": {
500
+ "type": "object",
501
+ "additionalProperties": false,
502
+ "required": ["artifactId"],
503
+ "properties": {
504
+ "artifactId": { "type": "string", "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$" },
505
+ "required": { "type": "boolean", "default": true }
506
+ }
507
+ },
486
508
  "task": {
487
509
  "type": "object",
488
510
  "additionalProperties": false,
@@ -570,6 +592,16 @@
570
592
  "type": "string",
571
593
  "minLength": 1
572
594
  },
595
+ "producesArtifacts": {
596
+ "type": "array",
597
+ "items": { "$ref": "#/$defs/producedArtifact" },
598
+ "description": "Frozen producer declarations. Artifact lineage and impact analysis must use these declarations, never prompt/outputContract/path heuristics."
599
+ },
600
+ "consumesArtifacts": {
601
+ "type": "array",
602
+ "items": { "$ref": "#/$defs/consumedArtifact" },
603
+ "description": "Frozen logical artifact inputs consumed by this node."
604
+ },
573
605
  "outputMode": {
574
606
  "enum": ["default", "structured-required"],
575
607
  "description": "Optional output semantics for Pi nodes. structured-required means oversized assistant output must not be accepted as a truncated success; eligible read-only nodes may compact-retry and downstream gates should rely on canonical structured artifacts."
@@ -502,12 +502,9 @@
502
502
  ]
503
503
  },
504
504
  "then": {
505
- "required": [
506
- "specReference"
507
- ],
508
505
  "properties": {
509
506
  "specReference": {
510
- "$ref": "#/$defs/uiComponentSpecReference"
507
+ "type": "null"
511
508
  }
512
509
  }
513
510
  }
@@ -31,7 +31,7 @@ constraints:
31
31
  hard_constraints:
32
32
  - Do not access production secrets
33
33
  # Explicit runtime workflow → taskKind. For fullstack-v1 packets this should be set
34
- # on every TaskSpec. Allowed: agent-dag | frontend-implementation | backend-test | frontend-test
34
+ # on every TaskSpec. Allowed: agent-dag | frontend-implementation | backend-test-analysis | backend-test | frontend-test
35
35
  execution:
36
36
  workflow: agent-dag
37
37
  verify:
package/harness.json CHANGED
@@ -83,8 +83,8 @@
83
83
  "pi": {
84
84
  "description": "Pi 负责规划、评审、诊断;当 DAG toolProfile=write 时也可做有界写入。模型按复杂度三档配置,支持 provider/model 字符串或带 thinking 的对象;斜杠前为 Pi provider,后为 modelId,勿只写裸 modelId。",
85
85
  "LOW": "wizard-local/minimax-m3",
86
- "MED": "wizard-local/gpt-5.5",
87
- "HIGH": "wizard-local/gpt-5.5"
86
+ "MED": "wizard-local/glm-5.3",
87
+ "HIGH": "wizard-local/gpt-5.6-sol"
88
88
  }
89
89
  }
90
- }
90
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tea-agent/loop-agent",
3
- "version": "0.41.1-beta.0",
3
+ "version": "0.42.0-next.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "loop-agent": "bin/loop-agent.js",
@@ -72,7 +72,9 @@
72
72
  "verify:tree": "node scripts/pre-push-verify.mjs --verify-current-tree"
73
73
  },
74
74
  "dependencies": {
75
+ "@deepseek-ai/cordis": "4.0.1",
75
76
  "@deepseek-ai/dsh-host-directory-picker-native": "0.1.1-rc.2",
77
+ "@deepseek-ai/dsh-invariants": "0.1.1-rc.2",
76
78
  "@earendil-works/pi-ai": "0.83.0",
77
79
  "@earendil-works/pi-coding-agent": "0.83.0",
78
80
  "commander": "^12.1.0",
@@ -1,23 +1,17 @@
1
1
  ---
2
2
  name: frontend-bounded-implement
3
3
  description: >-
4
- Use only for frontend implementation writers after the canonical
4
+ Use only for frontend implementation and repair writers after the canonical
5
5
  contract gate has authorized a bounded write set.
6
- references:
7
- - path: references/code-standards.md
8
- required: true
9
- maxChars: 2600
10
6
  ---
11
7
 
12
8
  # Frontend Bounded Implement
13
9
 
14
- Read the bounded code standards before editing. They apply only inside the
15
- canonical targets and do not authorize additional discovery.
16
-
17
10
  ## Authoritative Inputs
18
11
 
19
12
  - For implementation, use the run-owned
20
13
  `contracts/frontend-implementation-contract.json`.
14
+ - For repair, also use `contracts/frontend-repair-assessment.json`.
21
15
  - Treat requirement `expectedOutcome`, interaction `trigger` /
22
16
  `expectedBehavior`, target files, UI states, Mock/API strategy, and verification
23
17
  targets as closed decisions. Do not rediscover or reinterpret them.
@@ -31,7 +25,7 @@ canonical targets and do not authorize additional discovery.
31
25
  - Start the bounded edit after confirming the contract and targets. Optional
32
26
  context is not a reason to postpone implementation.
33
27
  - If behavior is still ambiguous or a required target is outside `writeSet`, stop
34
- without writing and explain the blocker; do not compensate with broader scouting.
28
+ with `IMPLEMENTATION_OUTCOME: blocked`; do not compensate with broader scouting.
35
29
 
36
30
  ## Implementation Discipline
37
31
 
@@ -45,10 +39,15 @@ canonical targets and do not authorize additional discovery.
45
39
  - Run only the focused checks already frozen by the task. Leave full verification
46
40
  to downstream deterministic nodes.
47
41
 
48
- ## Completion Summary
42
+ ## Required Outcome
43
+
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.
49
51
 
50
- Briefly report changed files, implemented requirements/interactions, focused checks
51
- attempted, blockers, and residual risks. This summary is human-readable only: the
52
- runtime derives implementation state from persisted write events, run delta, write
53
- guard, requirement coverage, and focused checks. Do not use a mandatory
54
- `IMPLEMENTATION_OUTCOME:` response-text protocol.
52
+ Then report changed files, requirements/interactions implemented, tests or focused
53
+ checks attempted, and residual risks. Never report `changed` for an empty diff.
@@ -9,26 +9,31 @@ references:
9
9
 
10
10
  # Frontend Design Review
11
11
 
12
- For frontend design review nodes. Read the checklist and the non-blocking contract
13
- capacity diagnostic first. Audit either the canonical contract or, when the
14
- diagnostic recommends indexed reading, its hash-bound field sections. Check the
15
- bound Mock strategy, task bounds, and traceable design evidence supplied by the
16
- upstream context. Do not rediscover task sources, search specification roots, or
17
- replace frozen evidence with nearby-code conventions. Use only exact, bound evidence
18
- paths when additional reading is necessary; never invent connector results.
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.
19
18
 
20
- ## Authoritative Terminal
19
+ ## Verdict Contract
21
20
 
22
- Complete the review with exactly one committed typed tool call:
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.
23
24
 
24
- - `approve_design` when no blocking design defect remains;
25
- - `request_design_changes` when a blocker exists. It must include a typed
26
- `issueCategory`, at least one `evidenceRef`, and non-empty findings.
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.
27
29
 
28
- The typed terminal is the only authoritative outcome. Do not require or emit a
29
- `VERDICT:` line, JSON verdict, revision patch, or a second final-design-review
30
- verdict. A requested design change ends this run; the recovery controller creates
31
- any bounded follow-up run from the appropriate phase.
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.
32
37
 
33
38
  ## Blocking Conditions
34
39
 
@@ -46,15 +51,29 @@ Knowledge-base absence is advisory if relevant rules from either openspec
46
51
  specification directory were read and applied. Block skipped fallback, unresolved
47
52
  conflict, or unresolved UI decisions.
48
53
 
49
- ## Method And Human-readable Output
54
+ ## Method And Output
50
55
 
51
56
  Map criteria to steps/files/states/checks, audit paths/evidence, classify Blocking
52
57
  or Advisory, and never edit files.
53
58
 
54
59
  ### Spec Evidence Rules
55
60
 
56
- Read only the canonical contract (or its indexed, hash-bound sections) and any exact
57
- evidence paths bound in its upstream context. Successful paired reads are the only proof that a specification was read;
58
- summaries do not substitute for them. A concise human-readable summary may list
59
- checked items and findings, but it is never a control protocol. Each requested
60
- change names its criterion/section, gap, and required plan change.
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.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: frontend-implementation
3
+ description: >-
4
+ Use for frontend contract, scout, mock strategy, and plan DAG nodes.
5
+ references:
6
+ - path: references/node-contracts.md
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
11
+ - path: references/design-spec.md
12
+ required: true
13
+ maxChars: 3000
14
+ - path: references/code-standards.md
15
+ required: true
16
+ maxChars: 3000
17
+ ---
18
+
19
+ # Frontend Implementation
20
+
21
+ Read all required references before running any listed frontend node.
22
+
23
+ ## Source And Evidence Rules
24
+
25
+ Use task sources/references, constraints, then `task.json`. Follow `design-spec.md`:
26
+ query the knowledge base when available and always inspect `openspec/schemas/`,
27
+ `openspec/project-specs/`, and `ai_workspace/`; then use repo evidence. Cite tight paths/symbols, and never invent APIs,
28
+ rules, commands, or retrievals. Scout/planners locate and explicitly read applicable
29
+ specs; only successful paired reads count. Lockfile-only, fixture-only, or unread
30
+ search hits do not prove a reusable Mock service.
31
+
32
+ This broad discovery rule applies only to contract, scout, and plan phases.
33
+ Implementation and repair use the separate `frontend-bounded-implement` skill.
34
+
35
+ ## Implementation Discipline
36
+
37
+ - Reuse confirmed specs, components, tokens, helpers, APIs, mocks, schemas, and tests.
38
+ - Keep real requests enabled by default; never comment them out for a mock.
39
+ - Prefer native Mock support; otherwise use existing browser interception for e2e or
40
+ a reversible request adapter/DI seam for local preview.
41
+ - Trace fixtures to API/schema evidence. Activation is explicit, dev/test-only,
42
+ production-off; Mock evidence never proves real API integration.
43
+ - Add dependencies only when approved. Cover applicable success/loading/empty/error/
44
+ permission/boundary states and justify N/A.
45
+ - Keep state testable. Stay in `writeSet`, preserve behavior, and update tests.
46
+ - Never relax lint/type/test/build config or write unauthorized generated output.
47
+
48
+ ## Output And Failure Rules
49
+
50
+ - Follow `node-contracts.md`; read-only nodes never edit. Missing input blocks work
51
+ when proceeding would guess behavior, bounds, or verification.
52
+ - Preserve tokens, commands, paths, IDs, and language. Completion needs fresh shell evidence.
@@ -0,0 +1,33 @@
1
+ # Frontend Code Standards
2
+
3
+ Discover rules from task constraints, `design-spec.md` source order, config, code,
4
+ tests, manifests, and generated types. Regardless of knowledge-base results,
5
+ applicable `openspec/schemas/`, `openspec/project-specs/`, and `ai_workspace/` rules are normative.
6
+ Preferences are not rules, and docs do not override installed APIs without an
7
+ explicit compatibility decision.
8
+
9
+ ## Discover And Cite
10
+
11
+ - Find routing and server/client boundaries; state, forms, data/cache, and errors;
12
+ API/mock/UI/schema/test locations and naming; supported tests; dependency rules.
13
+
14
+ Cite representative files/config for each convention. Describe conflicts instead of
15
+ silently selecting one.
16
+
17
+ ## Plan And Implement
18
+
19
+ - Map criteria to code and checks. Define placement, state ownership, request
20
+ lifecycle, validation/failures, API compatibility, mocks, and fixtures.
21
+ - Trace fixtures to API evidence; label gaps. Prefer native mocks, then browser
22
+ interception for existing e2e, then a reversible request adapter/DI preview seam.
23
+ - Real API stays default; mock activation is explicit, local/test-only,
24
+ non-production, and removable.
25
+ - Reuse helpers/public APIs and preserve out-of-contract behavior. Keep rendering,
26
+ transitions, validation, and side effects testable; cover lifecycle races/bounds
27
+ when relevant. Update supported tests; stay in `writeSet`.
28
+
29
+ ## Prohibited
30
+
31
+ - Do not relax checks, add unapproved dependencies, comment real requests, hardcode
32
+ fixtures in production UI, import test mocks into production, store fixture
33
+ secrets, equate mock evidence with real integration, or report unrun checks as verified.
@@ -0,0 +1,56 @@
1
+ # Frontend Design And Component Specification
2
+
3
+ ## Required Source Sequence
4
+
5
+ Knowledge base, OpenSpec, and `ai_workspace/` are parallel specification sources:
6
+
7
+ 1. Attempt the configured component/design knowledge-base query first when a
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.
12
+ 3. Treat relevant matches from both sources as the current project's
13
+ specification for this run.
14
+ 4. Only then use component source, tokens, stories, tests, and pages as
15
+ non-normative repository fallback.
16
+
17
+ Never skip local OpenSpec or `ai_workspace/` for neighboring-code conventions,
18
+ even when a knowledge-base query returned results. Report source conflicts instead
19
+ of combining them. Explicit task requirements remain the contract.
20
+
21
+ Connector format is TODO; attempt only an available connector, otherwise record
22
+ `not-configured` and run the openspec fallback (never invent a connection).
23
+
24
+ ## openspec Fallback Procedure
25
+
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.
30
+ - Read matches in context; a filename-only hit is not a rule.
31
+ - Record search terms, inspected/matched paths, headings or tight line ranges,
32
+ applied rules, and conflicts.
33
+ - If both directories or relevant rules are absent, record that before using
34
+ repository fallback.
35
+
36
+ ## Retrieval Evidence
37
+
38
+ Record source as `knowledge-base`, `openspec fallback`, `repository fallback`, or
39
+ `unavailable`. Knowledge-base evidence includes query, source ID/version/time, rules,
40
+ and conflicts. `openspec fallback` includes terms, paths/headings/lines, rules, and conflicts.
41
+
42
+ ## Rules To Retrieve Or Discover
43
+
44
+ - Components, variants, props, composition, accessibility, deprecations, placement, forms, overlays, navigation, and state patterns.
45
+ - Tokens, typography, color, layout, breakpoints, motion, focus/keyboard/contrast, exceptions, design debt, and forbidden patterns.
46
+
47
+ ## Gate Expectations
48
+
49
+ - Reuse confirmed primitives unless a new pattern is authorized.
50
+ - Define applicable states and responsive behavior before implementation.
51
+ - Cite knowledge-base or openspec spec evidence for component/token choices;
52
+ label weaker repo fallback.
53
+ - 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.