@tea-agent/loop-agent 0.43.0-next.10 → 0.43.0-next.11

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 (91) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/build-stamp.json +3 -3
  3. package/dist/executors/dag-pi-executor.js +27 -6
  4. package/dist/executors/shell-executor.js +3 -2
  5. package/dist/worker/console/chat/browser-policy.js +6 -36
  6. package/dist/worker/console/chat/browser-routes.js +3 -11
  7. package/dist/worker/console/chat/pi-runtime/custom-tools/goal-tools.js +2 -1
  8. package/dist/worker/console/chat/pi-runtime.js +4 -7
  9. package/dist/worker/console/chat/routes.js +1 -5
  10. package/dist/worker/console/chat/session-mode-view.js +5 -4
  11. package/dist/worker/console/chat/session-mode.js +11 -10
  12. package/dist/worker/console/static/assets/{abnfDiagram-N423BO3Z-D_fNbWc_.js → abnfDiagram-N423BO3Z-CTSK0xbU.js} +1 -1
  13. package/dist/worker/console/static/assets/{arc-_HuqLW6m.js → arc-_2MfctFP.js} +1 -1
  14. package/dist/worker/console/static/assets/{architectureDiagram-T3A2C74G-Djy2qY1m.js → architectureDiagram-T3A2C74G-DsDe2wTg.js} +1 -1
  15. package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-bB-1TSyY.js → blockDiagram-VBNYF7ZC-Dtz_779U.js} +1 -1
  16. package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-C5Hmghrz.js → c4Diagram-5PPSVZJV-LaULi-gw.js} +1 -1
  17. package/dist/worker/console/static/assets/channel-CqS4yBWT.js +1 -0
  18. package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-Duyl39oy.js → chunk-2GRJ4B5K-DuHBqqX8.js} +1 -1
  19. package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-x6mdnSyf.js → chunk-2Q5K7J3B-BZgZs1dn.js} +1 -1
  20. package/dist/worker/console/static/assets/{chunk-5RXB4S5H-WlBuFj7W.js → chunk-5RXB4S5H-tzwmlIO_.js} +1 -1
  21. package/dist/worker/console/static/assets/{chunk-5VM5RSS4-CTF429HX.js → chunk-5VM5RSS4-CeYrLkSn.js} +1 -1
  22. package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-Dwd6r-SF.js → chunk-6Q2QTUOP-C92cgilm.js} +1 -1
  23. package/dist/worker/console/static/assets/{chunk-GF5L2VYU-C-Br82D1.js → chunk-GF5L2VYU-XOXpGC0F.js} +1 -1
  24. package/dist/worker/console/static/assets/{chunk-JWPE2WC7-CuGp0DeE.js → chunk-JWPE2WC7-CGHbJyCH.js} +1 -1
  25. package/dist/worker/console/static/assets/{chunk-KBJHAD2P-CJhFX6Lh.js → chunk-KBJHAD2P-Bs2-LTzf.js} +1 -1
  26. package/dist/worker/console/static/assets/{chunk-RYQCIY6F-DpGOa_jT.js → chunk-RYQCIY6F-rN7up7E4.js} +1 -1
  27. package/dist/worker/console/static/assets/{chunk-XXDRQBXY-DXJaTynd.js → chunk-XXDRQBXY-B_fWjKpR.js} +1 -1
  28. package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-DVOxNOq0.js +1 -0
  29. package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-DVOxNOq0.js +1 -0
  30. package/dist/worker/console/static/assets/{cose-bilkent-JH36ORCC-CRBZWjE4.js → cose-bilkent-JH36ORCC-DE3SdJvB.js} +1 -1
  31. package/dist/worker/console/static/assets/{cynefin-VYW2F7L2-BdXcxtlb.js → cynefin-VYW2F7L2-B-4yuRAX.js} +1 -1
  32. package/dist/worker/console/static/assets/{cynefinDiagram-MW4NZA55-07UKsOts.js → cynefinDiagram-MW4NZA55-TiCPFuO8.js} +1 -1
  33. package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-D38p9__S.js → dagre-VZM6K2ZE-7crzLMzA.js} +1 -1
  34. package/dist/worker/console/static/assets/{diagram-7IWD3JNH-nSiBNNjH.js → diagram-7IWD3JNH-Cvr-x6Fd.js} +1 -1
  35. package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-BFOTot5D.js → diagram-B4RE2ZJO-BzcRHUjH.js} +1 -1
  36. package/dist/worker/console/static/assets/{diagram-LBJQPF4R-DypKaZ6k.js → diagram-LBJQPF4R-BjkAXilh.js} +1 -1
  37. package/dist/worker/console/static/assets/{diagram-Q27KOJAE-B6yoOQeW.js → diagram-Q27KOJAE-BkzyATK7.js} +1 -1
  38. package/dist/worker/console/static/assets/{diagram-UB23O5K3-BHYS6viX.js → diagram-UB23O5K3-rZuTarYP.js} +1 -1
  39. package/dist/worker/console/static/assets/{ebnfDiagram-BXEA7PRR-D2VD5Snj.js → ebnfDiagram-BXEA7PRR-CAYENaN1.js} +1 -1
  40. package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-E98mWxN1.js → erDiagram-JOGREHBK-DCEam0Uq.js} +1 -1
  41. package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-CT1zxhqP.js → flowDiagram-UKHOOZJN-e_dH4wVO.js} +1 -1
  42. package/dist/worker/console/static/assets/{ganttDiagram-PKOTCBZU-6GcngNcy.js → ganttDiagram-PKOTCBZU-CvZa2zOK.js} +1 -1
  43. package/dist/worker/console/static/assets/{gitGraphDiagram-DS77QQ5N-DCL6NvKe.js → gitGraphDiagram-DS77QQ5N-CbT5TuKp.js} +1 -1
  44. package/dist/worker/console/static/assets/{index-24jp3aBh.js → index-CUPeoE8W.js} +42 -42
  45. package/dist/worker/console/static/assets/{index-CY6y6I8M.css → index-SAANIK8g.css} +1 -1
  46. package/dist/worker/console/static/assets/{infoDiagram-6WML65LV-C0627e-9.js → infoDiagram-6WML65LV-BWzHQa_Z.js} +1 -1
  47. package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-C_u3P6Ik.js → ishikawaDiagram-WSZJBQD7-BTjlovtU.js} +1 -1
  48. package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-DPDPv9HL.js → journeyDiagram-NVQOT4AX-DkvQoCc1.js} +1 -1
  49. package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-D3OHdWiO.js → kanban-definition-27J2QSJJ-CHSzGi3W.js} +1 -1
  50. package/dist/worker/console/static/assets/{linear-DI88zD7n.js → linear-DZMkTCWH.js} +1 -1
  51. package/dist/worker/console/static/assets/{mermaid.core-p2l8IrWY.js → mermaid.core-BIMhty7A.js} +5 -5
  52. package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-B1bAX-oS.js → mindmap-definition-FAOFIHXS-Dx-tyMl3.js} +1 -1
  53. package/dist/worker/console/static/assets/{pegDiagram-VL7TDLO6-DwOnWxdD.js → pegDiagram-VL7TDLO6-C6G34rbY.js} +1 -1
  54. package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-xRkTXnJC.js → pieDiagram-7S7Q4E2Y-CHK9XOfm.js} +1 -1
  55. package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-_9UC5Zio.js → quadrantDiagram-CIZ2JOQS-CDARkI0w.js} +1 -1
  56. package/dist/worker/console/static/assets/{railroadDiagram-AXF67PYL-CgEUirWJ.js → railroadDiagram-AXF67PYL-DiuUe0ZQ.js} +1 -1
  57. package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP-Czbpwiyz.js → requirementDiagram-LRYGKXZP-RE61UR56.js} +1 -1
  58. package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-_j7_KiqY.js → sankeyDiagram-W5VNT64P-KDNLHMEG.js} +1 -1
  59. package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-BNJa6Hyi.js → sequenceDiagram-SI44F4Z6-CeVgXnD9.js} +1 -1
  60. package/dist/worker/console/static/assets/{sizeCapture-X5ZJPWSS-DedpKtOc.js → sizeCapture-X5ZJPWSS-CXwGyjjG.js} +1 -1
  61. package/dist/worker/console/static/assets/{stateDiagram-OKZ733FA-BBvthr7c.js → stateDiagram-OKZ733FA-BjTfozab.js} +1 -1
  62. package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-BXoYsyr2.js +1 -0
  63. package/dist/worker/console/static/assets/{swimlanes-SLNWSIFB-Ds7umgEM.js → swimlanes-SLNWSIFB-BaXOB8GT.js} +2 -2
  64. package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-DfKliS4e.js +8 -0
  65. package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-CKa-p1nF.js → timeline-definition-Z64GVDOM-C3r2hqUU.js} +1 -1
  66. package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-LoUNR56o.js → vennDiagram-T6HMQDX7-MWKgl1S9.js} +1 -1
  67. package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-Bqbl6ym7.js → wardleyDiagram-T6FBY63Y-C9iFcZPk.js} +1 -1
  68. package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-B8dUg4lf.js → xychartDiagram-ELKLHX3M-DqnM24Jp.js} +1 -1
  69. package/dist/worker/console/static/index.html +2 -2
  70. package/dist/workflows/dag/frontend-closeout.js +1 -1
  71. package/dist/workflows/dag/frontend-prewrite-gate.js +3 -3
  72. package/dist/workflows/dag/frontend-review-context.js +2 -1
  73. package/dist/workflows/dag/frontend-review-scopes.js +2 -2
  74. package/dist/workflows/dag/frontend-verification-trace.js +1 -1
  75. package/dist/workflows/dag/init-hybrid.js +51 -159
  76. package/docs/templates/frontend-implementation-dag.json +9 -8
  77. package/package.json +1 -1
  78. package/skills/frontend-bounded-implement/SKILL.md +3 -3
  79. package/skills/frontend-bounded-implement/references/code-standards.md +3 -3
  80. package/skills/frontend-contract/references/contract-protocol.md +3 -1
  81. package/skills/frontend-design-review/SKILL.md +12 -7
  82. package/skills/frontend-design-review/references/review-checklist.md +7 -7
  83. package/skills/frontend-plan/SKILL.md +12 -0
  84. package/skills/frontend-plan/references/decision-contract.md +25 -19
  85. package/skills/frontend-review/SKILL.md +12 -18
  86. package/skills/frontend-review/references/review-findings.md +24 -43
  87. package/dist/worker/console/static/assets/channel-C0A6UEIa.js +0 -1
  88. package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-DzguNppy.js +0 -1
  89. package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-DzguNppy.js +0 -1
  90. package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-BABVQnfM.js +0 -1
  91. package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-D0qsLaxR.js +0 -8
@@ -699,7 +699,6 @@ export function frontendSourceMentionsMock(sources) {
699
699
  */
700
700
  export function resolveFrontendMockMode(capability, taskConfig, hasApiDep) {
701
701
  const policy = taskConfig.frontendMock?.policy ?? "auto";
702
- const hasDeterministicMockVerification = capability.verifyCommands.length > 0;
703
702
  if (capability.safetyViolation ||
704
703
  !frontendMockServiceRootAllowed(taskConfig)) {
705
704
  return "blocked";
@@ -715,7 +714,7 @@ export function resolveFrontendMockMode(capability, taskConfig, hasApiDep) {
715
714
  }
716
715
  // required policy
717
716
  if (policy === "required") {
718
- if (capability.status === "present" && hasDeterministicMockVerification) {
717
+ if (capability.status === "present") {
719
718
  return "required";
720
719
  }
721
720
  return "blocked";
@@ -724,13 +723,8 @@ export function resolveFrontendMockMode(capability, taskConfig, hasApiDep) {
724
723
  if (!hasApiDep) {
725
724
  return "not-required";
726
725
  }
727
- // In auto mode, frontend Mock is optional. Only enter Mock-backed "required"
728
- // mode when the project has a confirmed native Mock capability AND
729
- // deterministic Mock verification commands. Without executable verification
730
- // commands a non-not-needed strategy could never be verified, so auto falls
731
- // back to not-required; the prewrite gate then forces not-needed and the
732
- // plan records the Real Integration Gap instead of inventing commands.
733
- return capability.status === "present" && hasDeterministicMockVerification
726
+ // Confirmed Mock capability permits implementation; tests are deferred.
727
+ return capability.status === "present"
734
728
  ? "required"
735
729
  : "not-required";
736
730
  }
@@ -2544,7 +2538,7 @@ function resolveFrontendMockContextBlock(sources) {
2544
2538
  parts.push(`Evidence Paths: ${capability.evidencePaths.join(", ")}`);
2545
2539
  }
2546
2540
  if (capability.verifyCommands.length > 0) {
2547
- parts.push(`Frozen Mock Verify Commands: ${capability.verifyCommands
2541
+ parts.push(`Deferred frontend-test Mock Commands: ${capability.verifyCommands
2548
2542
  .map((command) => command.label)
2549
2543
  .join(", ")}`);
2550
2544
  }
@@ -2555,13 +2549,13 @@ function resolveFrontendMockContextBlock(sources) {
2555
2549
  parts.push(`Reasons: ${capability.reasons.join("; ")}`);
2556
2550
  }
2557
2551
  if (mode === "required") {
2558
- parts.push("Mock-backed frontend verification is required. Prefer the detected native service; otherwise the assessment may select an existing browser interception harness or reversible request adapter. Any handler, fixture, adapter, and UI changes stay in the single frontend-implement-pi writeSet.");
2552
+ parts.push("Implement the selected Mock strategy within authorized paths and keep production-default-off isolation. Mock behavior verification is deferred to frontend-test; it is not an implementation gate.");
2559
2553
  }
2560
2554
  if (mode === "not-required") {
2561
2555
  parts.push("Generation-time evidence does not require Mock. The assessment must still use contract/scout evidence: select not-needed when Mock is intentionally skipped, or select a safe Mock strategy if project evidence supports one.");
2562
2556
  if (frontendMockStrategyMustBeNotNeeded(sources)) {
2563
- parts.push('Auto mode has no confirmed project Mock capability or no deterministic Mock verification command. The structured contract must set mockApi.strategy to "not-needed". Keep the real request path as the default, record any unproved backend behavior as Real Integration Gap, and do not add Mock files or dependencies within this run.');
2564
- parts.push('HARD CONSTRAINT (frozen at generation time): this DAG allows only mockApi.strategy "not-needed"; the prewrite gate rejects any other strategy. If project governance (openspec / ai_workspace / decision records, e.g. a DEC rule requiring native) demands Mock-backed verification, that is a generation-time contract gap, not a plan-revision defect: declare frontendMock.verifyCommands (or policy: "required") in task.json and regenerate the DAG.');
2557
+ parts.push('Auto mode has no confirmed project Mock capability. The structured contract must set mockApi.strategy to "not-needed". Keep the real request path as the default, record any unproved backend behavior as Real Integration Gap, and do not add Mock files or dependencies within this run.');
2558
+ parts.push('HARD CONSTRAINT (frozen at generation time): this DAG allows only mockApi.strategy "not-needed"; the prewrite gate rejects any other strategy. If project governance (openspec / ai_workspace / decision records, e.g. a DEC rule requiring native) demands Mock-backed verification, that is a generation-time contract gap, not a plan-revision defect: confirm the project Mock capability and policy: "required" in task.json and regenerate the DAG.');
2565
2559
  }
2566
2560
  }
2567
2561
  if (mode === "blocked") {
@@ -2573,12 +2567,10 @@ function frontendMockStrategyMustBeNotNeeded(sources) {
2573
2567
  const policy = sources.taskConfig.frontendMock?.policy ?? "auto";
2574
2568
  const capability = sources.frontendMockCapability;
2575
2569
  const capabilityStatus = capability?.status;
2576
- const hasDeterministicMockVerification = (capability?.verifyCommands.length ?? 0) > 0;
2577
2570
  return (policy === "auto" &&
2578
2571
  (sources.frontendMockMode ?? "not-required") === "not-required" &&
2579
2572
  (capabilityStatus === "absent" ||
2580
- capabilityStatus === "ambiguous" ||
2581
- !hasDeterministicMockVerification));
2573
+ capabilityStatus === "ambiguous"));
2582
2574
  }
2583
2575
  /**
2584
2576
  * 候选规范懒加载:prompt 只内联与任务相关的候选,不全部塞给模型。
@@ -3073,12 +3065,8 @@ async function buildFrontendHybridDagFromTask(sources) {
3073
3065
  includeReferenceDocuments: false,
3074
3066
  }),
3075
3067
  };
3076
- const hasMockVerifyCommands = (taskConfig.frontendMock?.verifyCommands.length ?? 0) > 0 ||
3077
- mockCapability.verifyCommands.length > 0;
3078
3068
  const requirementIds = frontendSourceBinding.requirementIds;
3079
- const strategy = resolveDagVerifyStrategy(taskConfig);
3080
3069
  const readOnlyPaths = taskConfig.allowedPaths.length > 0 ? taskConfig.allowedPaths : ["**"];
3081
- const behaviorPaths = deriveFrontendBehaviorPaths(taskConfig);
3082
3070
  const globalConstraints = [
3083
3071
  ...taskConfig.hardConstraints,
3084
3072
  ...(sources.constraintMarkdown
@@ -3092,7 +3080,7 @@ async function buildFrontendHybridDagFromTask(sources) {
3092
3080
  "Frontend planning must consume the read-only Mock assessment strategy produced after scouting; MOCK_STRATEGY: blocked must not pass the deterministic Mock contract gate.",
3093
3081
  "Mock implementations must preserve the real request path as the default, require explicit test/dev activation, and never rely on commenting out the real request.",
3094
3082
  "Mock-backed behavior evidence proves only the documented frontend contract, never real API integration.",
3095
- "frontend-implementation DAGs must complete deterministic static verification before final review. Behavior verification is also required when the task declares a behavior entrypoint or the implementation contract contains a behavior-mode verification target; static-only contracts must map every target to the declared static entrypoint.",
3083
+ "frontend-implementation completes requirement-to-code coverage and npm run build only. Behavior correctness and all testing are deferred to frontend-test; build success is never behavior-test success.",
3096
3084
  "Frontend closeout renders only from committed facts; a weak status (failed / not-run / baseline-debt / mock-backed / pending) can never be rewritten into a stronger one (passed / real-integrated).",
3097
3085
  `Frontend risk classification: ${frontendRisk.selectedRisk} — ${frontendRisk.reason}`,
3098
3086
  frontendRisk.forceFullGates
@@ -3104,111 +3092,34 @@ async function buildFrontendHybridDagFromTask(sources) {
3104
3092
  const blockedReason = mockCapability.safetyViolation
3105
3093
  ? `Mock contract blocked: ${mockCapability.safetyViolation}`
3106
3094
  : (taskConfig.frontendMock?.policy ?? "auto") === "required"
3107
- ? "Mock strategy is required, but no authorized Mock verification command was found."
3095
+ ? "Mock strategy is required, but no authorized Mock capability was found."
3108
3096
  : "Mock contract is blocked by deterministic generation-time Mock safety constraints.";
3109
3097
  return buildBlockedFrontendMockDag(frontendSources, readOnlyPaths, forbiddenPaths, globalConstraints, blockedReason);
3110
3098
  }
3111
- const fallbackVerifyCommands = await discoverFrontendFallbackVerifyCommands(sources.repoRoot);
3112
- // The verification bundle schema requires at least one static command. When
3113
- // a real project exposes no usable verification command at all, run an
3114
- // explicit no-op marker instead of a command that is guaranteed to fail:
3115
- // the trace then records not-run honestly and the advisory asks the task
3116
- // to declare verification commands and regenerate.
3117
- const staticFallbackCommands = fallbackVerifyCommands.staticCommands.length > 0
3118
- ? fallbackVerifyCommands.staticCommands
3119
- : [FRONTEND_NO_STATIC_VERIFICATION_MARKER];
3120
- const behaviorFallbackCommands = fallbackVerifyCommands.behaviorCommands;
3121
- const parsedFrontendVerifyCommands = extractFrontendVerifyCommandsFromMarkdown({
3122
- repoRoot: sources.repoRoot,
3123
- requirementMarkdown: sources.requirementMarkdown,
3124
- constraintMarkdown: sources.constraintMarkdown,
3125
- });
3126
- const explicitFrontendVerifyCommands = buildExplicitFrontendVerifyCommands(taskConfig, sources.repoRoot);
3127
- const explicitCommandKeys = new Set([
3128
- ...explicitFrontendVerifyCommands.staticCommands,
3129
- ...explicitFrontendVerifyCommands.behaviorCommands,
3130
- ].map(verifyCommandKey));
3131
- const adapterVerifyCommands = (sources.verifyCommands?.final ?? []).filter((command) => !explicitCommandKeys.has(verifyCommandKey(command)));
3132
- const hasDeclaredFrontendVerification = explicitFrontendVerifyCommands.staticCommands.length > 0 ||
3133
- explicitFrontendVerifyCommands.behaviorCommands.length > 0 ||
3134
- parsedFrontendVerifyCommands.staticCommands.length > 0 ||
3135
- parsedFrontendVerifyCommands.behaviorCommands.length > 0;
3136
- const staticVerifyCommands = chooseFrontendVerifyCommands({
3137
- explicitCommands: explicitFrontendVerifyCommands.staticCommands,
3138
- parsedCommands: parsedFrontendVerifyCommands.staticCommands,
3139
- adapterCommands: adapterVerifyCommands,
3140
- });
3141
- const partitionedStaticVerifyCommands = partitionFrontendStaticVerifyCommands({
3142
- repoRoot: sources.repoRoot,
3143
- commands: staticVerifyCommands.commands,
3144
- commandSource: staticVerifyCommands.commandSource,
3145
- });
3146
- const behaviorVerifyCommands = chooseFrontendVerifyCommands({
3147
- explicitCommands: explicitFrontendVerifyCommands.behaviorCommands,
3148
- parsedCommands: parsedFrontendVerifyCommands.behaviorCommands,
3149
- adapterCommands: adapterVerifyCommands,
3150
- // A declared task verifier owns this task's verification boundary. A
3151
- // static-only task must not inherit unrelated root-level test commands.
3152
- allowAdapter: !hasDeclaredFrontendVerification,
3153
- });
3099
+ // Implementation verifies buildability only. Tests (including task-declared
3100
+ // and Mock commands) belong to the independent frontend-test workflow.
3101
+ // Keep a real failing command when build is unavailable; never use a no-op.
3102
+ const buildCommands = [{
3103
+ label: "build",
3104
+ args: ["bash", "-lc", "npm run build"],
3105
+ cwd: sources.repoRoot ?? process.cwd(),
3106
+ }];
3154
3107
  const staticShellCommands = buildVerifyShellCommands({
3155
- repoRoot: sources.repoRoot,
3156
- commands: partitionedStaticVerifyCommands.static.commands,
3157
- fallbackCommands: staticFallbackCommands,
3158
- });
3159
- const lintShellCommands = buildVerifyShellCommands({
3160
- repoRoot: sources.repoRoot,
3161
- commands: partitionedStaticVerifyCommands.lint.commands,
3162
- fallbackCommands: [],
3108
+ repoRoot: sources.repoRoot ?? process.cwd(), commands: buildCommands, fallbackCommands: [],
3163
3109
  });
3164
- const behaviorShellCommands = buildVerifyShellCommands({
3165
- repoRoot: sources.repoRoot,
3166
- commands: behaviorVerifyCommands.commands,
3167
- fallbackCommands: hasDeclaredFrontendVerification
3168
- ? []
3169
- : behaviorFallbackCommands,
3170
- });
3171
- const effectiveBehaviorFallbackCommands = hasDeclaredFrontendVerification
3172
- ? []
3173
- : behaviorFallbackCommands;
3174
3110
  const staticVerifyEvidence = buildVerifyEvidence({
3175
- phase: "intermediate",
3176
- quota: strategy.intermediateQuota ?? "full",
3177
- commandSource: partitionedStaticVerifyCommands.static.commandSource,
3178
- commands: partitionedStaticVerifyCommands.static.commands,
3179
- fallbackCommands: staticFallbackCommands,
3180
- commandTexts: staticShellCommands,
3181
- commandTimeoutMs: DEFAULT_VERIFY_TIMEOUT_MS,
3182
- preflight: sources.verificationPreflight,
3111
+ phase: "final", quota: "full", commandSource: "inline",
3112
+ commands: buildCommands, fallbackCommands: [], commandTexts: staticShellCommands,
3113
+ finalFullRequired: true, commandTimeoutMs: DEFAULT_VERIFY_TIMEOUT_MS,
3183
3114
  });
3184
- const lintVerifyEvidence = lintShellCommands.length > 0
3185
- ? buildVerifyEvidence({
3186
- phase: "intermediate",
3187
- quota: strategy.intermediateQuota ?? "full",
3188
- commandSource: partitionedStaticVerifyCommands.lint.commandSource,
3189
- commands: partitionedStaticVerifyCommands.lint.commands,
3190
- fallbackCommands: [],
3191
- commandTexts: lintShellCommands,
3192
- commandTimeoutMs: DEFAULT_VERIFY_TIMEOUT_MS,
3193
- preflight: sources.verificationPreflight,
3194
- })
3195
- : undefined;
3115
+ const behaviorShellCommands = [];
3116
+ const lintShellCommands = [];
3117
+ const mockShellCommands = [];
3196
3118
  const behaviorVerifyEvidence = buildVerifyEvidence({
3197
- phase: "final",
3198
- quota: "full",
3199
- commandSource: behaviorVerifyCommands.commandSource,
3200
- commands: behaviorVerifyCommands.commands,
3201
- fallbackCommands: effectiveBehaviorFallbackCommands,
3202
- commandTexts: behaviorShellCommands,
3203
- finalFullRequired: true,
3119
+ phase: "final", quota: "full", commandSource: "inline",
3120
+ commands: [], fallbackCommands: [], commandTexts: [],
3204
3121
  commandTimeoutMs: DEFAULT_VERIFY_TIMEOUT_MS,
3205
- preflight: sources.verificationPreflight,
3206
3122
  });
3207
- const mockVerifyTemplate = mockMode === "required" && hasMockVerifyCommands
3208
- ? buildFrontendMockVerifyNode(frontendSources, implementId, readOnlyPaths, forbiddenPaths)
3209
- : undefined;
3210
- const mockShellCommands = mockVerifyTemplate?.shell?.commands ?? [];
3211
- const mockVerifyEvidence = mockVerifyTemplate?.shell?.verifyEvidence;
3212
3123
  // Contract v2: the frozen command directory is the only command reference
3213
3124
  // the plan may use. Modes are assigned here once from the generation-time
3214
3125
  // lane split; downstream materialization resolves the same directory from
@@ -3216,28 +3127,23 @@ async function buildFrontendHybridDagFromTask(sources) {
3216
3127
  const frontendVerifyDirectory = buildFrontendVerifyCommandDirectory({
3217
3128
  staticLabels: staticVerifyEvidence.commandLabels,
3218
3129
  behaviorLabels: behaviorVerifyEvidence.commandLabels,
3219
- mockLabels: mockVerifyEvidence?.commandLabels ?? [],
3130
+ mockLabels: [],
3220
3131
  staticCommandTexts: staticVerifyEvidence.commandTexts,
3221
3132
  behaviorCommandTexts: behaviorVerifyEvidence.commandTexts,
3222
- mockCommandTexts: mockVerifyEvidence?.commandTexts ?? [],
3133
+ mockCommandTexts: [],
3223
3134
  });
3224
3135
  const fixedVerificationContext = [
3225
3136
  "## Fixed frontend verification entrypoints",
3226
- "These shell entrypoints are fixed at DAG generation and are the only commands the static and behavior shell nodes execute. A strategy or plan may add tests behind an existing entrypoint inside writeSet, but must not invent or replace commands or assume subtask_prompt executes a command.",
3137
+ "Implementation verification is npm run build only. Map requirements to implementation files and the shared static build target. Test design, test execution, behavior correctness, edge cases, regression, accessibility and Mock-backed testing are deferred to the independent frontend-test workflow; missing test plans or test evidence never block this implementation workflow.",
3227
3138
  "Reference frozen commands ONLY by commandId (record_plan_verification_target entry.commandId). The runtime resolves mode and label; never invent a mode or type.",
3228
3139
  ...frontendVerifyDirectory.map((entry) => ` - ${entry.commandId} [${entry.mode}]: ${JSON.stringify(entry.label)}`),
3229
3140
  `- Static command source: ${staticVerifyEvidence.commandSource}`,
3230
3141
  `- Behavior command source: ${behaviorVerifyEvidence.commandSource}`,
3231
3142
  ].join("\n");
3232
3143
  const advisories = [];
3233
- if (!hasDeclaredFrontendVerification &&
3234
- fallbackVerifyCommands.staticCommands.length === 0 &&
3235
- fallbackVerifyCommands.behaviorCommands.length === 0) {
3236
- advisories.push("未发现可用的前端验证命令:目标项目没有可读取的 package.json scripts,也未探测到本地 TypeScript,verify 节点将没有静态/行为命令可执行。请在 task.json --verify 或执行约束.md 的验证约束中显式声明命令(例如 node --check src/app.js),然后重新生成 DAG。");
3237
- }
3238
3144
  if (frontendSourceMentionsMock(frontendSources) &&
3239
3145
  frontendMockStrategyMustBeNotNeeded(frontendSources)) {
3240
- advisories.push("auto 模式已将 Mock 策略收窄为 not-needed:任务源提到接口/API/Mock 需求,但仓库无确认 Mock 能力或无确定性 Mock 验证命令。若项目规范要求 Mock,请声明 frontendMock.verifyCommands policy:required 后重新生成 DAG。");
3146
+ advisories.push("auto 模式已将 Mock 策略收窄为 not-needed:任务源提到接口/API/Mock 需求,但仓库无确认 Mock 能力。若项目规范要求 Mock,请确认项目 Mock 能力与 policy:required 后重新生成 DAG。");
3241
3147
  }
3242
3148
  const openspecGate = await resolveFrontendOpenspecGateConfig(sources);
3243
3149
  const requiresOpenspecClassification = openspecGate.openspecPolicy === "cited" &&
@@ -3349,7 +3255,7 @@ async function buildFrontendHybridDagFromTask(sources) {
3349
3255
  "Consume the complete injected input scope and produce a concise frontend implementation contract as typed requirement facts from complete injected scopes.",
3350
3256
  "Confirm each requirement by the SAME id as the ledger canonical requirement it covers (sourceBinding.requirementIds, e.g. AC-001) — do NOT invent new REQ/BR prefixed ids for canonical requirements: the compiled contract must match the ledger canonical requirement ids exactly or schema validation rejects it (unknown requirement id). record_requirement takes the canonical id and optional execution:{groupId,kind,summary}; the runtime commits the authoritative text and sourceFragmentIds from the frozen ledger. Never pass text/statement/sourceFragmentIds yourself — model rewrites and JSON-stringified fragment arrays are rejected.",
3351
3257
  "Requirement semantics, source spans, dispositions, and fragment bindings are ledger/runtime-owned. If a canonical requirement is genuinely blocked, say so in the Markdown contract narrative and finalize with the matching disposition instead of trying to encode it in the requirement fact.",
3352
- "Register evidence expectations for each requirement across static, behavior, Mock, and real integration as required | optional | not-applicable; required must follow from user requirements, task risk, or project governance, never from model convenience. For UI-visible or interactive requirements, register a non-blocking frontend-test handoff intent.",
3258
+ "Register source evidence expectations without treating them as this implementation run's test gates. Always register a non-blocking frontend-test handoff intent for behavior, regression, Mock, and integration testing. This run checks requirement implementation coverage and npm run build only; test methods and results belong to the separate testing workflow.",
3353
3259
  'Use record_evidence_expectation with {requirementId,evidence:{static,behavior,mock,"real-integration"}}; every lane is required | optional | not-applicable. Requirement text and provenance remain runtime-owned.',
3354
3260
  'Before finalize_contract ready, call record_required_deliverables once with the complete {items:[{path,requirementId,sourceFragmentId}]} inventory, or {items:[]} when no file delivery is mandatory. Interpret the original source, including lists and tables: allowedPaths/only-allowed-to-modify is permission, not an obligation; do not promote prohibited files, examples or references into deliverables. Paths must occur exactly in a frozen source fragment bound to that canonical requirement. Correct the whole inventory before finalizing if needed.',
3355
3261
  "Authoritative UI states: when the task source declares a UI-state table (state id / trigger / observable outcome), extract it VERBATIM through record_ui_state, one call per state, using the source's own state ids. The planner must bind these ids later — do not rename, merge, or invent states.",
@@ -3409,10 +3315,10 @@ async function buildFrontendHybridDagFromTask(sources) {
3409
3315
  },
3410
3316
  outputContract: "Typed decision patch only: map frozen requirements to implementation/verification targets and select the needed component, state, data/Mock, styling, and dependency decisions. Use only the record_* tools needed to express those decisions, then call finalize_plan; correct rejected facts until one successful terminal. Contract owns requirement semantics; Scout owns repository discovery; deterministic runtime owns schema, protected fields, path containment, and command validation. No Markdown narrative or file writes.",
3411
3317
  subtask_prompt: [
3412
- "Plan only the delta between the frozen frontend-contract-pi facts and frontend-scout-pi target surface. Do not reinterpret the task, repeat requirements, search the repository, or choose implementation order.",
3318
+ "List the implementation plan from frozen Contract requirements and Scout paths: what to change, where, and the needed component/state/data decisions. Submit those concrete actions in finalize_plan implementationSteps: [{requirementIds, action}]; cover every frozen requirement, sharing steps across related IDs when appropriate. Do not design tests, prescribe DOM harnesses, or require test evidence.",
3413
3319
  "Record only: requirement-to-file/verification coverage; component/styling choices; applicable UI state and interaction behavior; data/Mock strategy; and a dependency policy or genuine evidence gap. Reuse Scout paths. If scope is missing, record a blocking gap instead of inventing a path.",
3414
3320
  "Use the typed tool schemas as the field contract. Runtime owns schemaVersion, sourceBinding, riskLevel, targets.files, mockApi.productionDefaultOff, aliases, command allowlisting, path containment, and final validation; do not restate those rules or emit a full JSON contract.",
3415
- `Cover each frozen requirement ID exactly once: ${requirementIds.join(", ") || "(none)"}. Bind every verification target to a frozen commandId from the directory above plus a Scout-confirmed file. Behavior commands prove observable behavior: one target may cover multiple related requirementIds when one test behavior proves them together; do not mechanically create one target per requirement. A behavior target id is the stable machine trace token and its file must be a test file. Static commands are project-wide checks traced by file and command only.`,
3321
+ `Cover each frozen requirement ID exactly once: ${requirementIds.join(", ") || "(none)"}. Bind every verification target to a frozen commandId from the directory above plus a Scout-confirmed file. Use the shared static build target for implementation files; do not create behavior test targets or test plans. Static commands are project-wide checks traced by file and command only.`,
3416
3322
  "UX vocabulary protocol: record_state_registry FIRST with the full global vocabulary — one stable kebab-case behavior-domain name per UI state/interaction (e.g. planner-task-edit, focus-queue-move), never one name per AC number and never a rename of an already-recorded concept. Details consume complete execution-group scopes and reuse the same global names across scopes. Constraints/exclusions must not manufacture UI. Then record_state_flow entries whose names all come from that registry; uiState names must use the contract's declared authoritative ids (declaredUiStates in the plan input) when present. Retry attempts see committedUx in this input — reuse those exact names. Components: one choice may cover many state/interaction ids via covers; reuse-existing requires evidencePath naming an existing repo file (greenfield must be decision=new).",
3417
3323
  ...(requiresOpenspecClassification ? ["When a component choice uses an OpenSpec selection, cite that selection; otherwise do not classify unrelated candidates."] : []),
3418
3324
  "Call finalize_plan; correct rejected facts until one successful terminal after the necessary typed facts. Return no Markdown narrative.",
@@ -3457,7 +3363,7 @@ async function buildFrontendHybridDagFromTask(sources) {
3457
3363
  "request-adapter",
3458
3364
  "not-needed",
3459
3365
  ],
3460
- mockCommandLabels: mockVerifyEvidence?.commandLabels ?? [],
3366
+ mockCommandLabels: [],
3461
3367
  artifactName: "frontend-implementation-contract.json",
3462
3368
  outputDir: "contracts",
3463
3369
  requireSourceFreshness: true,
@@ -3501,15 +3407,15 @@ async function buildFrontendHybridDagFromTask(sources) {
3501
3407
  skills: FRONTEND_DESIGN_REVIEW_SKILLS,
3502
3408
  outputContract: "Authoritative typed design terminal via approve_design / request_design_changes tools. No JSON verdict; the committed typed design fact is the only authority. No file writes.",
3503
3409
  subtask_prompt: [
3504
- "Submit findings individually with record_design_finding and stable IDs; terminal tools aggregate saved findings. Correct rejected calls, stop after a successful terminal. Check execution groups against every member source outcome, including permission, threshold and failure-path differences; shared verification is valid only when it proves each independent AC.",
3410
+ "Submit findings individually with record_design_finding and stable IDs; terminal tools aggregate saved findings. Correct rejected calls, stop after a successful terminal. Check execution groups against every member source outcome, including permission, threshold and failure-path differences; each independent AC needs corresponding planned implementation; shared build evidence checks buildability only.",
3505
3411
  "Audit the frontend plan before implementation. frontend-plan-pi is emitted to you as canonical full-contract JSON after the runtime applied and validated the planner's editable patch against its protected skeleton; there is no separate plan prose.",
3506
3412
  "Your authoritative terminal verdict is exactly one committed typed tool call: approve_design or request_design_changes. Call exactly one of them; after calling one, do not call the other.",
3507
3413
  "request_design_changes must carry a typed issueCategory, at least one evidenceRef, and non-empty findings.",
3508
3414
  "Your verdict is consumed as deterministic data input by frontend-writer-admission-shell. approve_design permits admission; request_design_changes blocks writer admission until a recovery plan incorporates every Critical/Important finding.",
3509
- "Request design changes when the Mock strategy is blocked, missing, unsupported by repository evidence, inconsistent with the API contract, outside authorized paths/dependencies, unable to prove production-default-off behavior with the fixed production/default-real-path static check, or missing deterministic behavior verification for a declared behavior target or selected Mock strategy. Mock strategies require Mock-backed evidence; a static-only contract is allowed only when every verification target is static and maps to a declared static entrypoint; not-needed requires applicable real/no-remote behavior evidence unless auto mode explicitly skipped Mock because no project Mock capability exists, in which case the plan must preserve the real request path and record the Real Integration Gap.",
3510
- "Also request design changes for missing applicable UI states, unsupported dependency additions, design-system drift without reason, weak interaction coverage, broad scope, inline fake data, schema drift, or missing deterministic verification commands.",
3415
+ "Request design changes only for missing requirement implementation coverage or unauthorized scope/dependencies. Preserve declared production-default-off Mock boundaries. Missing test methods, test cases, DOM/state-transition verification, Mock-backed evidence or behavior correctness evidence are not design blockers; defer them to frontend-test.",
3416
+ "Check whether every required feature/state has an implementation plan and whether paths and dependencies are authorized. Do not turn behavior correctness or regression concerns into implementation blockers; record them for frontend-test.",
3511
3417
  "Component selection conformance is a hard blocking condition: request_design_changes when the frontend spec (component/theme/rule.components bucket) already defines a component for a purpose but the plan selects another or self-invents one without a declared deviation; when uiComponentChoices is missing/empty for UI-visible work while the frozen component/theme bucket is non-empty; when a decision=specified specReference.path is missing a ledger OpenSpec reference or successful read event; or when a decision=new component lacks a traceable task-source/PRD specReference. A PRD reference for decision=new is not an OpenSpec citation and must not be rejected merely for lacking an OpenSpec read event. For uiComponentChoices, purpose is the stable coverage key and must match interaction.name or uiState.name; responsibility is expressed by the matched expectedBehavior plus rationale, and you must not reject it merely for matching an interaction or component identifier.",
3512
- "You must NOT make authoritative assertions about the execution result of frozen verification commands: command results are deterministically established by frontend-verify-shell. Record a verification-feasibility concern only as a non-blocking finding (severity must not be Critical, and it must never be the sole fatal basis for request_design_changes). Only semantic design defects (component selection, state flow, interaction contract, or conflicts with the specification) may be Critical; a pure command-will-fail prediction must not be classified as contract-requirement-gap.",
3418
+ "The only executable verification in this workflow is npm run build. A missing test plan, missing behavior evidence, or prediction that tests will fail is non-blocking and belongs to frontend-test. Only requirement omissions, scope violations and a failed build block implementation completion.",
3513
3419
  "Read-only: do not modify repository files.",
3514
3420
  "LARGE-FILE AUDIT (avoid full reads): style/theme audit files can be large (e.g. styles.css is often hundreds of KB). Prefer grep to locate the exact rules/variables you must verify (e.g. grep the oc- class, is-* modifier, or --oc- theme variables with their line numbers), then read only the narrow line range when surrounding context is needed. Do not read a large style/test file in full — a single full read can exhaust the read budget and fail the attempt.",
3515
3421
  "Canonical contract reading: frontend-design-policy-shell prints absolute paths for Contract, Contract index, and the non-blocking Capacity diagnostic. Read the capacity diagnostic first. When it recommends full-contract, read the exact Contract path. When it recommends indexed-sections, read the Contract index and its hash-bound section files instead of opening the full contract. Never resolve a bare contracts/... path against the repository root or hunt for substitutes. Implementation target files inside the writeSet are created later by the implement node: do not read them and do not treat their absence as a design defect.",
@@ -3535,11 +3441,7 @@ async function buildFrontendHybridDagFromTask(sources) {
3535
3441
  frontendWriterAdmission: {
3536
3442
  schemaVersion: 1,
3537
3443
  designReviewFromNodeId: "frontend-design-review-pi",
3538
- frozenCommandLabels: [
3539
- ...staticVerifyEvidence.commandLabels,
3540
- ...behaviorVerifyEvidence.commandLabels,
3541
- ...(mockVerifyEvidence?.commandLabels ?? []),
3542
- ],
3444
+ frozenCommandLabels: staticVerifyEvidence.commandLabels,
3543
3445
  allowedMockStrategies: taskConfig.frontendMock?.policy === "disabled" ||
3544
3446
  frontendMockStrategyMustBeNotNeeded(frontendSources)
3545
3447
  ? ["not-needed"]
@@ -3555,12 +3457,6 @@ async function buildFrontendHybridDagFromTask(sources) {
3555
3457
  "request-adapter",
3556
3458
  "not-needed",
3557
3459
  ],
3558
- ...(lintShellCommands.length > 0 && lintVerifyEvidence
3559
- ? {
3560
- lintCommands: lintShellCommands,
3561
- lintEvidence: lintVerifyEvidence,
3562
- }
3563
- : {}),
3564
3460
  },
3565
3461
  cwd: ".",
3566
3462
  timeoutMs: 60000,
@@ -3576,18 +3472,16 @@ async function buildFrontendHybridDagFromTask(sources) {
3576
3472
  forbiddenPaths,
3577
3473
  writerOutcomePolicyType: "frontend-facts-v1",
3578
3474
  }),
3579
- outputContract: "The implementation status is derived by the executor from mechanical facts (write-tool events, run delta, write guard, requirement coverage, focused-check), not from any IMPLEMENTATION_OUTCOME first line. Deliver a Markdown summary with Contract Ref (path/schema/hash), Changed Files, Requirements Implemented, UI States, Tests Changed, Verification Attempts, Deviations, and Residual Risks. Follow fixed stages: contract confirm tests → component/state → API/Mock → focused checks → diff cleanup.",
3475
+ outputContract: "The executor derives implementation status from write events, diff, write guard and build checks. Report changed files, requirement-to-code coverage, build result and pending frontend-test handoff; do not claim tested behavior correctness.",
3580
3476
  subtask_prompt: [
3581
3477
  "Implement against the validated run-owned Frontend Implementation Contract materialized by frontend-design-policy-shell (path/schema/hash) and authorized by frontend-writer-admission-shell. Do not rebuild the contract from Markdown alone.",
3582
3478
  "WRITER TOOL PROTOCOL (hard): the response text is not delivery. Never paste source code, test code, or full file contents into chat. After reading the canonical contract, make the first implementation change with the structured write/edit tool (one file per call); continue writing through those tools until the writeSet is complete. If a write/edit tool is unavailable, stop and report the blocked capability instead of drafting code in the response.",
3583
3479
  "The canonical contract already contains the approved requirement, target-file, UI-state, verification, design, and Mock/API decisions. Do not re-open task sources, OpenSpec, AI workspace, plan/revision, or design-review prose, and do not repeat broad repository research. Inspect only contract target files and directly related local code needed to implement them.",
3584
- "Execute in fixed stages and report each in the delivery summary: (1) Contract confirm, (2) Tests sync, (3) Component/UI state implementation, (4) API/Mock wiring per contract.mockApi, (5) Focused checks behind frozen entrypoints only, (6) Diff cleanup.",
3585
- "Map every requirement id, expectedOutcome, interaction trigger/expectedBehavior, and applicable UI state from the contract to concrete files. Do not invent shell verification commands; only frozen static/behavior entrypoints will run.",
3586
- "For every behavior verification target, treat target.id as a stable trace token and include that exact token in a real describe/it/test literal title (for example, it('[VT-DASHBOARD-SHELL] renders the dashboard', ...)). One test title may carry multiple target ids when it proves multiple grouped behaviors; comments and ordinary strings do not count as trace evidence.",
3587
- "Before reporting Tests Changed as done, self-audit with the executor's rule: collect ONLY the string literals passed directly to describe(/it(/test( calls in each test file and confirm every behavior target id for that file appears inside one of those literals. A token in a comment, a variable, or a non-title string does not satisfy the trace check; if any id is missing from the literal titles, edit the title strings before finishing.",
3480
+ "Implement the planned requirements and report where each is realized. Do not add a test-first stage or require tests for completion. The independent frontend-test workflow owns tests; the only frozen command here is npm run build.",
3481
+ "Map every requirement id, expectedOutcome, interaction and applicable UI state to concrete implementation files. The shared static build target is a buildability check, not proof of behavior correctness.",
3588
3482
  "Begin implementation after the contract and its target files are confirmed. Do not spend the turn collecting optional context. If the canonical contract lacks behavior needed to edit safely, stop and state the blocking reason in the summary instead of reopening broad discovery.",
3589
3483
  "Your implementation status is derived by the executor from mechanical facts (persisted write-tool events, run delta, write guard, requirement coverage, focused-check failures), never from any IMPLEMENTATION_OUTCOME first line. Do not emit an IMPLEMENTATION_OUTCOME first line.",
3590
- "The node runs a bounded micro-loop: after each write attempt the executor re-runs frozen focused checks and records a per-round diff checkpoint; the write guard stays active every round. Only repair local issues attributable to the current diff (syntax/type/import/format/unit-assert/obvious omission). Never change requirements, design, writeSet, or verification strictness inside the loop.",
3484
+ "The node uses bounded build checks and diff checkpoints. Repair local syntax/type/import/build errors within the writeSet; do not expand into behavior testing, regression testing or test repair.",
3591
3485
  "Implement only the approved Mock strategy carried by the validated contract. Preserve the real request path as the default, require explicit test/dev activation, and never comment out or replace the real request with inline data.",
3592
3486
  "frontend-design-policy-shell materialized and validated the canonical contract; frontend-writer-admission-shell authorized the writeSet. Stay within writeSet and preserve unrelated files.",
3593
3487
  "For native, browser-intercept, or request-adapter, implement contract-aligned fixtures/states and a dev/test-only activation boundary in this same writer. For not-needed, do not add Mock files or a framework and state the positive reason.",
@@ -3595,7 +3489,7 @@ async function buildFrontendHybridDagFromTask(sources) {
3595
3489
  "Edit existing files with the structured edit/write tools. NEVER rewrite Markdown (or any file with quoting/backticks/indentation-sensitive content) via bash sed/awk/echo redirection: escaping mistakes silently corrupt the file and self-repair loops burn the run.",
3596
3490
  ...(implementPaths.docIndexCompanions.length > 0
3597
3491
  ? [
3598
- `Doc index sync is MANDATORY: ${implementPaths.docIndexCompanions.join(", ")} are catalog index files for this writeSet. When you add, rename, or remove any indexed file, you MUST also update ${implementPaths.docIndexCompanions.join(" and ")} in the same run (append or fix the matching index entry following the existing line style). Verification runs check-doc-index and fails the run when a new file is missing from the index.`,
3492
+ `Doc index sync is MANDATORY: ${implementPaths.docIndexCompanions.join(", ")} are catalog index files for this writeSet. When you add, rename, or remove any indexed file, you MUST also update ${implementPaths.docIndexCompanions.join(" and ")} in the same run (append or fix the matching index entry following the existing line style). Keep these index updates within the authorized writeSet.`,
3599
3493
  ]
3600
3494
  : []),
3601
3495
  writerDeliveryContract(taskConfig),
@@ -3612,7 +3506,7 @@ async function buildFrontendHybridDagFromTask(sources) {
3612
3506
  writePolicy: "read-only",
3613
3507
  allowedPaths: readOnlyPaths,
3614
3508
  forbiddenPaths,
3615
- outputContract: "Run frozen Mock/static/behavior commands and materialize the verification trace. Any failure is terminal: no same-run repair branch, failure ownership facts are materialized for recovery.",
3509
+ outputContract: "Run npm run build and preserve its exit status. No test, lint or separate typecheck commands; any build failure remains terminal and eligible for existing bounded recovery.",
3616
3510
  subtask_prompt: "Execute the frontend verification bundle. Preserve per-command evidence; a failure fails this node (terminal) and routes to recovery.",
3617
3511
  shell: {
3618
3512
  commands: [],
@@ -3622,8 +3516,6 @@ async function buildFrontendHybridDagFromTask(sources) {
3622
3516
  lintCommands: lintShellCommands,
3623
3517
  staticCommands: staticShellCommands,
3624
3518
  behaviorCommands: behaviorShellCommands,
3625
- mockEvidence: mockVerifyEvidence,
3626
- lintEvidence: lintVerifyEvidence,
3627
3519
  staticEvidence: staticVerifyEvidence,
3628
3520
  behaviorEvidence: behaviorVerifyEvidence,
3629
3521
  lintBaselineNodeId: lintShellCommands.length > 0
@@ -3667,20 +3559,20 @@ async function buildFrontendHybridDagFromTask(sources) {
3667
3559
  skills: FRONTEND_REVIEW_SKILLS,
3668
3560
  outputContract: 'Authoritative typed review terminal via approve_review / request_review_changes tools. No JSON verdict is required in the response text; the typed terminal fact is the only authority. No file writes.',
3669
3561
  subtask_prompt: [
3670
- "Submit findings individually with record_review_finding and stable IDs; terminal tools aggregate saved findings. Correct rejected calls, stop after a successful terminal. Check execution groups against every member source outcome, including permission, threshold and failure-path differences; shared verification is valid only when it proves each independent AC.",
3671
- "Review the frontend implementation and verification evidence.",
3562
+ "Submit findings individually with record_review_finding and stable IDs; terminal tools aggregate saved findings. Correct rejected calls, stop after a successful terminal. Check execution groups against every member source outcome, including permission, threshold and failure-path differences; each independent AC needs corresponding planned implementation; shared build evidence checks buildability only.",
3563
+ "Check requirement-to-code coverage, authorized files/dependencies and the npm run build result. Behavior correctness, edge cases, regressions and test design/execution belong to frontend-test; their missing evidence is not a blocker here.",
3672
3564
  "Your authoritative terminal verdict is exactly one committed typed tool call: approve_review or request_review_changes. Call it once and do not call the other afterwards.",
3673
3565
  "approve_review means the implementation passes; it must not carry Critical or Important findings. request_review_changes must carry a typed issueCategory, at least one evidenceRef, and non-empty findings.",
3674
3566
  "Do NOT emit an equivalent JSON verdict in the response text: the committed typed terminal fact is the only authority and no branch or gate reads response-text JSON verdicts.",
3675
3567
  "Read contracts/frontend-review-context.json from frontend-review-context-shell. It binds a hash-verified canonical contract reference, a field-to-section index, frontend lint assessment when configured, the effective verification trace, and the run-owned actual diff. Read contractRef.capacityDiagnosticPath first: use contractRef.path only when full-contract is recommended; otherwise read only the hash-bound contractRef.sections needed for the changed surface and verification claims. Then read diff.reviewSummaryPath. The full artifacts/diff_patch.patch is retained only as audit evidence: do NOT read it in full. For semantic review, read only the named per-file diff fragment in the summary/index (in part order when needed) and then the current source file when necessary. Do not claim actual diff is missing when those artifacts exist; do not invent a diff from the implementation summary alone. Trace proves command/file/stable-target-id binding only—not semantic correctness.",
3676
- "Treat lint status exactly as passed | baseline-debt | failed | unavailable. baseline-debt may continue only with intact evidence and zero diagnostics on writer-changed files; report the tolerated debt count and never rewrite it as lint passed. Typecheck, build, and test still require successful final exits.",
3568
+ "This run requires only a successful npm run build exit. Other test/lint/typecheck evidence is not required. Do not claim absent evidence passed; report independent testing as not-run.",
3677
3569
  "Flag .skip/.only, deleted or weakened tests, unauthorized config changes, Mock-only evidence claimed as real integration, and Browser/visual claims (always not-run in this workflow).",
3678
3570
  "The contract referenced and hash-bound by frontend-review-context.json is the effective plan materialized by frontend-design-policy-shell. Do not re-open task sources, OpenSpec, AI workspace, design-review, writer summary, or verification node prose. Inspect only the canonical review context, its indexed contract sections, its bound diff, and diff-referenced files when semantic review requires source code.",
3679
3571
  "For uiComponentChoices, purpose is the stable coverage key and must match interaction.name or uiState.name. Responsibility is expressed by the matched expectedBehavior plus rationale; you must not reject it merely for matching an interaction or component identifier.",
3680
- "Treat a commented-out real request, default-enabled Mock, production entrypoint importing test mocks, API/fixture contract drift, unauthorized Mock dependency/path, or missing behavior evidence for the selected strategy as at least Important. Mock strategies require Mock-backed evidence. not-needed requires applicable real/no-remote behavior evidence unless auto mode explicitly skipped Mock because no project Mock capability exists; in that case verify that the real request remains the default and the Real Integration Gap is preserved.",
3572
+ "Check implementation of source requirements and declared production Mock isolation in the diff. Missing Mock-backed or real API test evidence is a non-blocking frontend-test handoff, not an implementation rejection.",
3681
3573
  "Inspect the frontend-verify-shell evidence in the review context directly, including the production/default-real-path static check, and require Mock activation to be off for that check.",
3682
3574
  "Distinguish Mock-backed evidence from real API integration evidence and preserve the Real Integration Gap when the backend was not exercised.",
3683
- "Review implementation quality, behavior/state coverage, verification evidence, and maintainability. Read-only: do not modify files.",
3575
+ "Review requirement implementation coverage and write authorization. Runtime behavior correctness and quality testing are deferred to frontend-test. Read-only: do not modify files.",
3684
3576
  ].join("\n\n"),
3685
3577
  },
3686
3578
  {
@@ -6,10 +6,11 @@
6
6
  "successCriteria": [
7
7
  "The contract covers every required user-visible behavior, state, and interaction.",
8
8
  "The implementation is admitted only after a concrete, narrow writeSet is reviewed.",
9
- "Static and behavior verification are recorded before final review.",
9
+ "Build verification are recorded before final review.",
10
10
  "The final closeout distinguishes passed, not-run, and residual-risk evidence."
11
11
  ],
12
12
  "globalConstraints": [
13
+ "frontend-implementation plans and reviews requirement implementation coverage; npm run build is the only verification command. Tests and behavior correctness are deferred to frontend-test, non-blocking; preserve existing tests and production Mock isolation.",
13
14
  "This is a self-contained static template: do not generate, import, or merge a DAG from a runtime builder before execution.",
14
15
  "Replace every REPLACE/WITH/... placeholder with concrete repository paths or deterministic commands before execution.",
15
16
  "Do not commit runtime traces under .harness/dag-runs/.",
@@ -38,7 +39,7 @@
38
39
  {
39
40
  "id":"frontend-plan-pi", "depends_on":["frontend-scout-pi"], "complexity":"MED", "executor":"pi", "role":"planner", "writePolicy":"read-only", "allowedPaths":["REPLACE/WITH/FRONTEND/SOURCE/PATH/**","REPLACE/WITH/FRONTEND/TEST/PATH/**"], "forbiddenPaths":[".harness/**","artifacts/**"],
40
41
  "outputContract":"Plan record_* tools for scoped coverage, shared execution groups and UX, one mock endpoint per record, then one successful finalize_plan. Runtime derives canonical JSON and Markdown. No file writes.",
41
- "subtask_prompt":"Turn the contract and reconnaissance into a minimal implementation plan. Every target file and verification step must be concrete. Preserve existing design and accessibility conventions. If any behavior lacks a verifiable target, report it as blocked instead of guessing."
42
+ "subtask_prompt":"List the requirement implementation plan: what to change and in which authorized files. Map requirements to the shared static build target. Do not require test plans or behavior correctness evidence; tests may be added later in frontend-test."
42
43
  },
43
44
  {
44
45
  "id":"frontend-design-policy-shell", "depends_on":["frontend-plan-pi"], "complexity":"LOW", "executor":"shell", "role":"verifier", "writePolicy":"read-only", "allowedPaths":["REPLACE/WITH/FRONTEND/SOURCE/PATH/**","REPLACE/WITH/FRONTEND/TEST/PATH/**"], "forbiddenPaths":[".harness/**","artifacts/**"],
@@ -49,7 +50,7 @@
49
50
  {
50
51
  "id":"frontend-design-review-pi", "depends_on":["frontend-design-policy-shell"], "complexity":"MED", "executor":"pi", "role":"reviewer", "writePolicy":"read-only", "allowedPaths":["REPLACE/WITH/FRONTEND/SOURCE/PATH/**","REPLACE/WITH/FRONTEND/TEST/PATH/**"], "forbiddenPaths":[".harness/**","artifacts/**"],
51
52
  "outputContract":"record_design_finding for individual findings; approve_design or request_design_changes provides the sole committed terminal. Independently review execution-group member differences. No file writes.",
52
- "subtask_prompt":"Review the approved plan against the frontend contract and design-policy result. Reject missing visible states, interaction behavior, accessibility obligations, or unsupported design claims. Do not edit files."
53
+ "subtask_prompt":"Review the approved plan against the frontend contract and design-policy result. Reject missing visible states, interaction behavior, accessibility obligations, or unsupported design claims. Do not edit files. Scope: requirement implementation coverage and authorized paths/dependencies only; do not require test plans, tests or behavior correctness evidence. Preserve existing tests. Only npm run build is required; test work is deferred to frontend-test."
53
54
  },
54
55
  {
55
56
  "id":"frontend-writer-admission-shell", "depends_on":["frontend-design-review-pi"], "complexity":"LOW", "executor":"shell", "role":"verifier", "writePolicy":"read-only", "allowedPaths":["REPLACE/WITH/FRONTEND/TARGET/PATH/**"], "forbiddenPaths":[".harness/**","artifacts/**"],
@@ -60,13 +61,13 @@
60
61
  {
61
62
  "id":"frontend-implement-pi", "depends_on":["frontend-writer-admission-shell"], "complexity":"HIGH", "executor":"pi", "role":"implementer", "toolProfile":"write", "writePolicy":"exclusive", "writeSet":["REPLACE/WITH/FRONTEND/TARGET/PATH/**"], "allowedPaths":["REPLACE/WITH/FRONTEND/TARGET/PATH/**"], "forbiddenPaths":[".harness/**","artifacts/**"],
62
63
  "outputContract":"Implementation summary with changed files, contract coverage, focused checks run, and residual risks.",
63
- "subtask_prompt":"Implement only the admitted frontend changes. Preserve established component, styling, accessibility, and state-management conventions. Cover every approved behavior, state, and interaction, then report changed files and focused verification. Do not broaden writeSet or add undeclared dependencies."
64
+ "subtask_prompt":"Implement only the admitted frontend changes. Preserve established component, styling, accessibility, and state-management conventions. Cover every approved behavior, state, and interaction, then report changed files and focused verification. Do not broaden writeSet or add undeclared dependencies. Scope: requirement implementation coverage and authorized paths/dependencies only; do not require test plans, tests or behavior correctness evidence. Preserve existing tests. Only npm run build is required; test work is deferred to frontend-test."
64
65
  },
65
66
  {
66
67
  "id":"frontend-verify-shell", "depends_on":["frontend-implement-pi"], "complexity":"LOW", "executor":"shell", "role":"verifier", "writePolicy":"read-only", "allowedPaths":["REPLACE/WITH/FRONTEND/TARGET/PATH/**"], "forbiddenPaths":[".harness/**","artifacts/**"],
67
- "outputContract":"Archived static and behavior verification output with command exit codes; no worktree writes.",
68
- "subtask_prompt":"Run the contract-selected deterministic static and behavior verification commands. Record all exit codes. A failed required command is terminal for this DAG run; do not silently substitute a different command.",
69
- "shell":{"preset":"loop-agent-standard-verify","cwd":".","timeoutMs":300000}
68
+ "outputContract":"Archived build verification output with command exit codes; no worktree writes.",
69
+ "subtask_prompt":"Run npm run build and record the actual exit code. Missing or failed builds must fail; never substitute a no-op.",
70
+ "shell":{"commands":["npm run build"],"cwd":".","timeoutMs":300000}
70
71
  },
71
72
  {
72
73
  "id":"frontend-review-context-shell", "depends_on":["frontend-verify-shell"], "complexity":"LOW", "executor":"shell", "role":"verifier", "writePolicy":"read-only", "allowedPaths":["REPLACE/WITH/FRONTEND/TARGET/PATH/**"], "forbiddenPaths":[".harness/**","artifacts/**"],
@@ -77,7 +78,7 @@
77
78
  {
78
79
  "id":"frontend-review-pi", "depends_on":["frontend-review-context-shell"], "complexity":"MED", "executor":"pi", "role":"reviewer", "writePolicy":"read-only", "allowedPaths":["REPLACE/WITH/FRONTEND/TARGET/PATH/**"], "forbiddenPaths":[".harness/**","artifacts/**"],
79
80
  "outputContract":"record_review_finding for individual findings; approve_review or request_review_changes provides the sole committed terminal. No file writes.",
80
- "subtask_prompt":"Review the actual diff and archived verification evidence against the frontend contract. Do not treat missing, weak, mock-only, or not-run evidence as passed. Report explicit residual risks; do not edit files."
81
+ "subtask_prompt":"Review the actual diff and archived verification evidence against the frontend contract. Do not treat missing, weak, mock-only, or not-run evidence as passed. Report explicit residual risks; do not edit files. Scope: requirement implementation coverage and authorized paths/dependencies only; do not require test plans, tests or behavior correctness evidence. Preserve existing tests. Only npm run build is required; test work is deferred to frontend-test."
81
82
  },
82
83
  {
83
84
  "id":"frontend-closeout-shell", "depends_on":["frontend-review-pi"], "complexity":"LOW", "executor":"shell", "role":"closeout", "writePolicy":"read-only", "allowedPaths":["REPLACE/WITH/FRONTEND/TARGET/PATH/**"], "forbiddenPaths":[".harness/**","artifacts/**"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tea-agent/loop-agent",
3
- "version": "0.43.0-next.10",
3
+ "version": "0.43.0-next.11",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "loop-agent": "bin/loop-agent.js",
@@ -35,15 +35,15 @@ canonical targets and do not authorize additional discovery.
35
35
 
36
36
  ## Implementation Discipline
37
37
 
38
- - Work test-first where behavior changes. Preserve unrelated files and stay inside
38
+ - Implement the planned requirements without a test-first stage. Preserve existing tests and unrelated files; stay inside
39
39
  `allowedPaths` and `writeSet`.
40
40
  - Implement every requirement outcome, interaction, and applicable UI state
41
41
  assigned to the writer. Keep the real request path enabled by default and use
42
42
  only the approved Mock/API strategy.
43
43
  - Do not add dependencies unless the contract approves them. Never relax lint,
44
44
  type, test, or build configuration; never add `.skip` or `.only`.
45
- - Run only the focused checks already frozen by the task. Leave full verification
46
- to downstream deterministic nodes.
45
+ - Run only npm run build, frozen by this workflow. Do not add or run unit tests;
46
+ testing can be added later in the independent frontend-test workflow.
47
47
 
48
48
  ## Completion Summary
49
49
 
@@ -4,16 +4,16 @@ Apply the canonical contract and the conventions visible in target files and the
4
4
  direct local dependencies. Do not reopen task sources, OpenSpec, `ai_workspace`, or
5
5
  unrelated repository areas to discover new rules or redesign approved decisions.
6
6
 
7
- - Work test-first when behavior changes and preserve unrelated behavior.
7
+ - Implement requirement coverage and preserve existing tests and unrelated behavior.
8
8
  - Reuse existing public helpers, APIs, components, tokens, schemas, and test
9
9
  patterns that are directly available from the bounded target surface.
10
10
  - Keep rendering, transitions, validation, request lifecycle, errors, and side
11
- effects testable; cover relevant races and boundaries.
11
+ effects clear; defer race and boundary tests to frontend-test.
12
12
  - Keep real API behavior enabled by default. Mock activation must follow the
13
13
  approved strategy, remain explicit and dev/test-only, and never import test mocks
14
14
  into production code.
15
15
  - Trace fixtures to the approved API/schema evidence and never store secrets.
16
16
  - Do not add unapproved dependencies, relax lint/type/test/build configuration,
17
17
  add `.skip`/`.only`, comment out real requests, or write outside `writeSet`.
18
- - Run only frozen focused checks and report their real status. Downstream shell
18
+ - Run only npm run build and report its real status. Downstream shell
19
19
  verification remains authoritative.
@@ -15,7 +15,9 @@
15
15
 
16
16
  - Register static, behavior, Mock, and real-integration evidence expectations as
17
17
  required, optional, or not-applicable. The classification follows the source and
18
- risk; it is not selected for model convenience.
18
+ risk; it is not selected for model convenience. These are source expectations
19
+ for the non-blocking frontend-test handoff, not implementation test gates.
20
+ This implementation workflow executes only npm run build.
19
21
  - Register a non-blocking frontend-test handoff for UI-visible or interactive work.
20
22
  - Preserve exact command labels and referenced paths. Do not invent evidence,
21
23
  connector results, APIs, or verification commands.