@tea-agent/loop-agent 0.39.0-beta.8 → 0.39.0-beta.9

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 (158) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +17 -5
  3. package/README.md +2 -2
  4. package/dist/application/task-lifecycle/advance.js +12 -0
  5. package/dist/build-stamp.json +3 -3
  6. package/dist/cli/update/runtime-activity.js +1 -29
  7. package/dist/commands/dag-rerun.js +1 -1
  8. package/dist/commands/init.js +26 -0
  9. package/dist/executors/dag-pi-executor.js +326 -8
  10. package/dist/executors/pi-read-budget-policy.js +166 -0
  11. package/dist/executors/shell-executor.js +26 -30
  12. package/dist/shared/dag-prompt-override.js +4 -5
  13. package/dist/shared/update/npm-client.js +33 -11
  14. package/dist/task/contract/apply.js +11 -1
  15. package/dist/task/contract/constants.js +2 -0
  16. package/dist/task/contract/hash.js +3 -0
  17. package/dist/task/contract/observe.js +25 -4
  18. package/dist/task/contract/paths.js +2 -1
  19. package/dist/task/contract/project.js +15 -1
  20. package/dist/task/contract/schema.js +2 -0
  21. package/dist/task/contract/transaction.js +12 -0
  22. package/dist/task/frontend-project-capability.js +123 -4
  23. package/dist/task/source-prepare/completeness.js +188 -0
  24. package/dist/task/source-prepare/fragment-inventory.js +477 -0
  25. package/dist/task/source-prepare/index.js +3 -0
  26. package/dist/task/source-prepare/ledger-reconciliation.js +127 -0
  27. package/dist/task/source-prepare/ledger-review.js +214 -0
  28. package/dist/task/source-prepare/ledger.js +545 -0
  29. package/dist/task/source-prepare/prepare.js +262 -1
  30. package/dist/task/source-prepare/semantic-intake.js +25 -5
  31. package/dist/task/source-prepare/source-fidelity-pi.js +384 -0
  32. package/dist/task/source-prepare/types.js +22 -0
  33. package/dist/worker/cli.js +12 -26
  34. package/dist/worker/console/console-handoff.js +82 -0
  35. package/dist/worker/console/console-update-and-init.js +115 -0
  36. package/dist/worker/console/console-update-runtime.js +84 -0
  37. package/dist/worker/console/draft-store.js +49 -0
  38. package/dist/worker/console/operation-store.js +1 -1
  39. package/dist/worker/console/operator-actions.js +129 -4
  40. package/dist/worker/console/operator-surface-health.js +1 -0
  41. package/dist/worker/console/prd-intake-bridge.js +13 -0
  42. package/dist/worker/console/routes.js +3 -0
  43. package/dist/worker/console/server.js +73 -5
  44. package/dist/worker/console/static/assets/{abnfDiagram-N423BO3Z-bPer1waP.js → abnfDiagram-N423BO3Z-D1-Z-BBa.js} +1 -1
  45. package/dist/worker/console/static/assets/{arc-BLdkwucW.js → arc-q8qAYm5m.js} +1 -1
  46. package/dist/worker/console/static/assets/{architectureDiagram-T3A2C74G-Bw4wo4I1.js → architectureDiagram-T3A2C74G-CAu4_lve.js} +1 -1
  47. package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-DUUkc0gr.js → blockDiagram-VBNYF7ZC-D5GhQvHm.js} +1 -1
  48. package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-BC3O0nob.js → c4Diagram-5PPSVZJV-ClQjeLkO.js} +1 -1
  49. package/dist/worker/console/static/assets/channel-ClAuhSUL.js +1 -0
  50. package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-Dd4g2nti.js → chunk-2GRJ4B5K-DLqWlFbo.js} +1 -1
  51. package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-s2EDm7-n.js → chunk-2Q5K7J3B-DkRT_usL.js} +1 -1
  52. package/dist/worker/console/static/assets/{chunk-5RXB4S5H-GqtHM2yQ.js → chunk-5RXB4S5H-Cqp7Chi3.js} +1 -1
  53. package/dist/worker/console/static/assets/{chunk-5VM5RSS4-BzRFrN8j.js → chunk-5VM5RSS4-CedEdFB9.js} +1 -1
  54. package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-Bw9nFjCJ.js → chunk-6Q2QTUOP-BHM8vP5x.js} +1 -1
  55. package/dist/worker/console/static/assets/{chunk-GF5L2VYU-B4n-03Qm.js → chunk-GF5L2VYU-D7EFr377.js} +1 -1
  56. package/dist/worker/console/static/assets/{chunk-JWPE2WC7-Dt75ZdBD.js → chunk-JWPE2WC7-DR38mTWV.js} +1 -1
  57. package/dist/worker/console/static/assets/{chunk-KBJHAD2P-B_afMhHB.js → chunk-KBJHAD2P-BFv2LsR3.js} +1 -1
  58. package/dist/worker/console/static/assets/{chunk-RYQCIY6F-Bd8Rqqg9.js → chunk-RYQCIY6F-BAvpJS5z.js} +1 -1
  59. package/dist/worker/console/static/assets/{chunk-XXDRQBXY-9boOMji4.js → chunk-XXDRQBXY-eKI9TO72.js} +1 -1
  60. package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-cBgeCpVU.js +1 -0
  61. package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-cBgeCpVU.js +1 -0
  62. package/dist/worker/console/static/assets/{cose-bilkent-JH36ORCC-BtCycfCc.js → cose-bilkent-JH36ORCC-BMJXpgo4.js} +1 -1
  63. package/dist/worker/console/static/assets/{cynefin-VYW2F7L2-eTOts9L1.js → cynefin-VYW2F7L2-CKJ2ofZx.js} +1 -1
  64. package/dist/worker/console/static/assets/{cynefinDiagram-MW4NZA55-Cibd2mjg.js → cynefinDiagram-MW4NZA55-CsKnsazm.js} +1 -1
  65. package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-CDjDZtDV.js → dagre-VZM6K2ZE-DVQ46vIw.js} +1 -1
  66. package/dist/worker/console/static/assets/{diagram-7IWD3JNH-Btexn-JJ.js → diagram-7IWD3JNH-D_RuonYS.js} +1 -1
  67. package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-Cyl8sdpM.js → diagram-B4RE2ZJO-D2Mt0nMu.js} +1 -1
  68. package/dist/worker/console/static/assets/{diagram-LBJQPF4R-Ev-83E1t.js → diagram-LBJQPF4R-DjBDuye6.js} +1 -1
  69. package/dist/worker/console/static/assets/{diagram-Q27KOJAE-41LqE0Mc.js → diagram-Q27KOJAE-8VZkqpE_.js} +1 -1
  70. package/dist/worker/console/static/assets/{diagram-UB23O5K3-BC39T5R3.js → diagram-UB23O5K3-D0izYxia.js} +1 -1
  71. package/dist/worker/console/static/assets/{ebnfDiagram-BXEA7PRR-DzcNRuri.js → ebnfDiagram-BXEA7PRR-CncG2I95.js} +1 -1
  72. package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-B5Frvvnz.js → erDiagram-JOGREHBK-DiBUUXR8.js} +1 -1
  73. package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-BapxROIM.js → flowDiagram-UKHOOZJN-Dtc0fArb.js} +1 -1
  74. package/dist/worker/console/static/assets/{ganttDiagram-PKOTCBZU-Cd4d4wQ0.js → ganttDiagram-PKOTCBZU-BPNFP5OZ.js} +1 -1
  75. package/dist/worker/console/static/assets/{gitGraphDiagram-DS77QQ5N-CrL6buFW.js → gitGraphDiagram-DS77QQ5N-CsgpxEEd.js} +1 -1
  76. package/dist/worker/console/static/assets/{index-DBh_x_Ek.js → index-Bai8Z25q.js} +81 -81
  77. package/dist/worker/console/static/assets/index-CH0Tr5hY.css +1 -0
  78. package/dist/worker/console/static/assets/{infoDiagram-6WML65LV-BrSiNxyd.js → infoDiagram-6WML65LV-kHGxkJUS.js} +1 -1
  79. package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-gvlvY-n9.js → ishikawaDiagram-WSZJBQD7-CbLe9wrr.js} +1 -1
  80. package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-D-YaPzRQ.js → journeyDiagram-NVQOT4AX-BOkwxAcP.js} +1 -1
  81. package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-BsmDv9E_.js → kanban-definition-27J2QSJJ-BHYQ2rDu.js} +1 -1
  82. package/dist/worker/console/static/assets/{linear-UWaoDN3h.js → linear-CHT4ujob.js} +1 -1
  83. package/dist/worker/console/static/assets/{mermaid.core-BlvpGVG8.js → mermaid.core-yL8sfqnY.js} +5 -5
  84. package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-CUCIP5CP.js → mindmap-definition-FAOFIHXS-DZx1coV-.js} +1 -1
  85. package/dist/worker/console/static/assets/{pegDiagram-VL7TDLO6-CB1aQUAK.js → pegDiagram-VL7TDLO6-DStWRCI8.js} +1 -1
  86. package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-BwehHxhf.js → pieDiagram-7S7Q4E2Y-DSKZkwzK.js} +1 -1
  87. package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-CFz30APB.js → quadrantDiagram-CIZ2JOQS-CmoEGOuW.js} +1 -1
  88. package/dist/worker/console/static/assets/{railroadDiagram-AXF67PYL-BwNmw1i6.js → railroadDiagram-AXF67PYL-BLqzhKyq.js} +1 -1
  89. package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP-jg-tPXlI.js → requirementDiagram-LRYGKXZP-gbHeUabM.js} +1 -1
  90. package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-BlyReDKl.js → sankeyDiagram-W5VNT64P-CaKkBCKO.js} +1 -1
  91. package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-DBUzW1f3.js → sequenceDiagram-SI44F4Z6-PUbi3Upu.js} +1 -1
  92. package/dist/worker/console/static/assets/{sizeCapture-X5ZJPWSS-BYcI2RAr.js → sizeCapture-X5ZJPWSS-dm7S9Qfe.js} +1 -1
  93. package/dist/worker/console/static/assets/{stateDiagram-OKZ733FA-D7AiyJdo.js → stateDiagram-OKZ733FA-C7WSzv4p.js} +1 -1
  94. package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-sQDv5AP3.js +1 -0
  95. package/dist/worker/console/static/assets/{swimlanes-SLNWSIFB-BHGt7Kkv.js → swimlanes-SLNWSIFB-CBKCiQwd.js} +2 -2
  96. package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-BXwsmcPs.js +8 -0
  97. package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-OPjooWcX.js → timeline-definition-Z64GVDOM-CvnUlylk.js} +1 -1
  98. package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-ggsWDvrO.js → vennDiagram-T6HMQDX7-xM0StY1O.js} +1 -1
  99. package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-DjNe-BjZ.js → wardleyDiagram-T6FBY63Y-CWtJMagy.js} +1 -1
  100. package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-Byp63Hei.js → xychartDiagram-ELKLHX3M-BO_-MeK8.js} +1 -1
  101. package/dist/worker/console/static/index.html +2 -2
  102. package/dist/worker/console/static-src/app/console-types.js +40 -1
  103. package/dist/worker/console/static-src/app/useOperatorActions.js +5 -0
  104. package/dist/worker/console/static-src/app/useTaskWizard.js +73 -1
  105. package/dist/worker/observability/init-runtime-activity.js +26 -0
  106. package/dist/worker/observe/node-input.js +88 -2
  107. package/dist/worker/observe/routes.js +188 -0
  108. package/dist/worker/observe/static/api.js +3 -3
  109. package/dist/worker/observe/static/format.js +37 -0
  110. package/dist/worker/observe/static/index.html +5 -0
  111. package/dist/worker/observe/static/prompt-restart-candidates.d.ts +18 -0
  112. package/dist/worker/observe/static/prompt-restart-candidates.js +36 -0
  113. package/dist/worker/observe/static/state.js +2 -2
  114. package/dist/worker/observe/static/styles.css +331 -35
  115. package/dist/worker/observe/static/views/dag-inspector.js +509 -78
  116. package/dist/worker/observe/static/views/task.js +55 -0
  117. package/dist/workflows/dag/frontend-design-policy.js +19 -9
  118. package/dist/workflows/dag/frontend-implementation-contract.js +109 -49
  119. package/dist/workflows/dag/frontend-plan-render.js +27 -0
  120. package/dist/workflows/dag/frontend-prewrite-gate.js +45 -1
  121. package/dist/workflows/dag/frontend-recovery-controller.js +1 -0
  122. package/dist/workflows/dag/frontend-review-context.js +102 -15
  123. package/dist/workflows/dag/frontend-shadow-dual-write.js +36 -2
  124. package/dist/workflows/dag/frontend-source-fidelity-ledger.js +108 -0
  125. package/dist/workflows/dag/frontend-worktree-diff.js +154 -0
  126. package/dist/workflows/dag/frontend-writer-admission.js +12 -0
  127. package/dist/workflows/dag/init-hybrid.js +293 -65
  128. package/dist/workflows/dag/interrupt-request.js +7 -0
  129. package/dist/workflows/dag/node-execution.js +111 -1
  130. package/dist/workflows/dag/prompt.js +34 -1
  131. package/dist/workflows/dag/recovery-lease.js +80 -0
  132. package/dist/workflows/dag/rerun-run.js +23 -0
  133. package/dist/workflows/dag/rerun-task.js +29 -0
  134. package/dist/workflows/dag/retry-policy.js +26 -3
  135. package/dist/workflows/dag/runner.js +38 -8
  136. package/dist/workflows/dag/types.js +51 -11
  137. package/docs/README.md +1 -0
  138. package/docs/architecture/evolution.md +45 -0
  139. package/docs/init-surface.manifest.json +4 -0
  140. package/docs/templates/README.md +2 -1
  141. package/docs/templates/frontend-implementation-contract.schema.json +684 -24
  142. package/docs/templates/spec-registry.schema.json +45 -0
  143. package/harness.json +3 -3
  144. package/package.json +1 -1
  145. package/skills/frontend-bounded-implement/SKILL.md +8 -14
  146. package/skills/frontend-design-review/SKILL.md +20 -41
  147. package/skills/frontend-implementation/SKILL.md +2 -3
  148. package/skills/frontend-implementation/references/design-spec.md +4 -3
  149. package/skills/frontend-implementation/references/node-contracts.md +4 -3
  150. package/skills/frontend-review/SKILL.md +22 -14
  151. package/skills/frontend-review/references/review-findings.md +6 -7
  152. package/skills/loop-agent/references/hybrid-dag.md +7 -0
  153. package/dist/worker/console/static/assets/channel-AbFtVnFm.js +0 -1
  154. package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-n1yf2Jcv.js +0 -1
  155. package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-n1yf2Jcv.js +0 -1
  156. package/dist/worker/console/static/assets/index-DwOGauxU.css +0 -1
  157. package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-BBSH5c8m.js +0 -1
  158. package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-D2F7-U4H.js +0 -8
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://loop-agent.local/schemas/spec-registry.schema.json",
4
+ "title": "Frontend specification registry",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["version", "roots"],
8
+ "properties": {
9
+ "version": { "const": 1 },
10
+ "roots": {
11
+ "type": "array",
12
+ "maxItems": 32,
13
+ "items": {
14
+ "type": "object",
15
+ "additionalProperties": false,
16
+ "required": ["path"],
17
+ "properties": {
18
+ "path": {
19
+ "type": "string",
20
+ "minLength": 1,
21
+ "pattern": "^(?!/)(?!.*//)(?!.*\\\\)(?!.*(?:^|/)\\.{1,2}(?:/|$)).+$"
22
+ },
23
+ "scope": {
24
+ "type": "array",
25
+ "items": { "type": "string", "minLength": 1 },
26
+ "uniqueItems": true
27
+ },
28
+ "mode": { "enum": ["normative", "advisory"] },
29
+ "description": { "type": "string" }
30
+ }
31
+ }
32
+ },
33
+ "discovery": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "properties": {
37
+ "enabled": { "type": "boolean", "default": true },
38
+ "maxDepth": { "type": "integer", "minimum": 0, "maximum": 8, "default": 3 },
39
+ "maxFiles": { "type": "integer", "minimum": 1, "maximum": 200, "default": 100 },
40
+ "maxBytes": { "type": "integer", "minimum": 1, "maximum": 10485760, "default": 1048576 },
41
+ "timeoutMs": { "type": "integer", "minimum": 1, "maximum": 10000, "default": 2000 }
42
+ }
43
+ }
44
+ }
45
+ }
package/harness.json CHANGED
@@ -82,9 +82,9 @@
82
82
  "executors": {
83
83
  "pi": {
84
84
  "description": "Pi 负责规划、评审、诊断;当 DAG toolProfile=write 时也可做有界写入。模型按复杂度三档配置,支持 provider/model 字符串或带 thinking 的对象;斜杠前为 Pi provider,后为 modelId,勿只写裸 modelId。",
85
- "LOW": "deepseek/deepseek-v4-flash",
86
- "MED": "deepseek/deepseek-v4-flash",
87
- "HIGH": "deepseek/deepseek-v4-flash"
85
+ "LOW": "wizard-local/minimax-m3",
86
+ "MED": "wizard-local/gpt-5.6-sol",
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.39.0-beta.8",
3
+ "version": "0.39.0-beta.9",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "loop-agent": "bin/loop-agent.js",
@@ -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,9 +5,8 @@ description: >-
5
5
  references:
6
6
  - path: references/node-contracts.md
7
7
  required: true
8
- # Current file is ~6.3KB; cap aligned with actual size so the required
9
- # reference injects untruncated.
10
- maxChars: 7000
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
12
  maxChars: 3500
@@ -55,6 +55,7 @@ and conflicts. `openspec fallback` includes terms, paths/headings/lines, rules,
55
55
  - Cite knowledge-base or openspec spec evidence for component/token choices;
56
56
  label weaker repo fallback.
57
57
  - Make deviations and unresolved gaps explicit.
58
- - Contract `uiComponentChoices[]` per UI purpose: `specified` needs
59
- `specReference {path,section,line}`; `new` needs null ref + rationale; never
60
- 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.
@@ -8,7 +8,7 @@ Pre-write nodes are read-only. Preserve IDs, labels, commands, language, require
8
8
  - **`frontend-contract-pi`**(仅 cited 且候选非空):在既有 Markdown contract 的末尾输出一个 `frontend-openspec-selection-v1` JSON block,对 generation-frozen specRoots 候选逐一分类为 `required` / `relevant` / `irrelevant`;显式 `requiredReadPaths` 和任务源文件引用必须为 `required`。只读,不改 task.json,不新增节点。
9
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
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 `specReference{path,section,line}`; `new` needs null ref+rationale.
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
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.
13
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.
14
14
  - `mockApi.strategy !== "not-needed"` fails closed when `mockCommandLabels` empty (`no authorized Mock verification commands`).
@@ -16,14 +16,15 @@ Pre-write nodes are read-only. Preserve IDs, labels, commands, language, require
16
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
17
  - Canonical serialization (UTF-8) >64KB → `retryable-invalid` + `contract-too-large`.
18
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 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.
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
20
 
21
21
  ## Typed terminal protocol
22
22
 
23
23
  - `frontend-plan-pi` commits incremental `record_*` facts plus one `finalize_plan` (plan).
24
24
  - `frontend-design-review-pi` commits `approve_design` | `request_design_changes` (request carries typed issueCategory + evidenceRefs + findings).
25
25
  - `frontend-review-pi` commits `approve_review` | `request_review_changes` (request carries typed issueCategory + evidenceRefs + findings).
26
- - These committed typed tools replace `VERDICT:` first-line parsing; the verdict is consumed only as deterministic data input by downstream admission/closeout.
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.
27
28
 
28
29
  ## Contract / trace / stages (M1–M2)
29
30
 
@@ -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
  ```
@@ -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。
@@ -1 +0,0 @@
1
- import{ag as o,ah as n}from"./mermaid.core-BlvpGVG8.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-B4n-03Qm.js";import{_ as i}from"./mermaid.core-BlvpGVG8.js";import"./chunk-5VM5RSS4-BzRFrN8j.js";import"./chunk-XXDRQBXY-9boOMji4.js";import"./chunk-KBJHAD2P-B_afMhHB.js";import"./chunk-2GRJ4B5K-Dd4g2nti.js";import"./index-DBh_x_Ek.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-B4n-03Qm.js";import{_ as i}from"./mermaid.core-BlvpGVG8.js";import"./chunk-5VM5RSS4-BzRFrN8j.js";import"./chunk-XXDRQBXY-9boOMji4.js";import"./chunk-KBJHAD2P-B_afMhHB.js";import"./chunk-2GRJ4B5K-Dd4g2nti.js";import"./index-DBh_x_Ek.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};