@tea-agent/loop-agent 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/CHANGELOG.md +48 -9
  2. package/README.md +23 -4
  3. package/dist/workflows/dag/init-hybrid.js +27 -11
  4. package/docs/README.md +1 -0
  5. package/docs/init-surface.manifest.json +4 -7
  6. package/docs/templates/branch-merge-report.md +0 -1
  7. package/harness.json +1 -1
  8. package/package.json +6 -16
  9. package/skills/browser-tools/SKILL.md +2 -2
  10. package/skills/frontend-design-review/references/review-checklist.md +27 -45
  11. package/skills/frontend-implementation/references/node-contracts.md +4 -4
  12. package/skills/frontend-review/SKILL.md +3 -1
  13. package/skills/frontend-review/references/review-findings.md +2 -1
  14. package/skills/frontend-verification/SKILL.md +3 -1
  15. package/skills/frontend-verification/references/verification-checklist.md +13 -22
  16. package/skills/loop-agent/references/hybrid-dag.md +1 -1
  17. package/docs/agent-dag-recovery-playbook.md +0 -195
  18. package/docs/agent-dag-runner.md +0 -67
  19. package/docs/cursor-prompt-sidecar.md +0 -36
  20. package/docs/decisions/README.md +0 -18
  21. package/docs/design/README.md +0 -167
  22. package/docs/development-principles.md +0 -73
  23. package/docs/exec-plans/README.md +0 -6
  24. package/docs/exec-plans/active/README.md +0 -13
  25. package/docs/exec-plans/completed/README.md +0 -108
  26. package/docs/feature-workflow.md +0 -414
  27. package/docs/loop-agent-harness.md +0 -142
  28. package/docs/production-readiness.md +0 -96
  29. package/docs/progress/README.md +0 -81
  30. package/docs/reports/README.md +0 -163
  31. package/docs/verification-matrix.md +0 -70
  32. package/scripts/check-product-line-docs.sh +0 -29
  33. package/scripts/check-task-pool-root.sh +0 -32
  34. package/scripts/kb-graph-incremental-prepare.sh +0 -5
  35. package/scripts/kb-graph-materialize.sh +0 -4
  36. package/scripts/kb-graph-promote.sh +0 -4
  37. package/scripts/kb-query.sh +0 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # 更新日志
2
2
 
3
+ ## [0.15.0] - 2026-07-18
4
+
5
+ ### 重点更新
6
+
7
+ - 新增 Pull Request 的只读 AI 自动审查,自动检查代码缺陷与测试缺口并更新评论
8
+ - 引入内部测试版本夜间自动发布工作流,主干达标后自动更新版本并发布
9
+ - 收紧 npm 发布包范围,仅保留 init 与 runtime 必需的文档和脚本
10
+ - 修复预发布版本被误发布至 latest 的风险,发布门禁改为按版本号状态严格限制
11
+
12
+ ### 新增
13
+
14
+ - 新增 Pull Request 的只读 AI 自动审查:在创建、重新打开、转为 ready 或更新提交时检查 bug、测试缺口、runtime boundary 等,并更新单条 PR 评论
15
+ - 新增内部测试版本夜间自动发布:达到提交门槛并通过发布检查后,自动更新版本、生成中文说明并发布 GitHub Release 与 npm
16
+ - 新增面向内部研发人员的轻量 GitHub 协作指南和简短 Pull Request 模板,统一采用短分支与 Squash Merge 的最小协作闭环
17
+ - 新增 `.editorconfig` 与 `.gitattributes`,统一常见文本文件的 UTF-8、LF、缩进和文件末尾换行约定
18
+
19
+ ### 改进
20
+
21
+ - 收紧 npm 发布包中的 `docs/` 范围:只保留 init/runtime 所需的治理文档、architecture、skills 与 templates
22
+ - 收紧 npm 发布包中的 `scripts/`:只保留知识库实际调用的脚本,不再打包源仓治理检查与 `.sh` 包装
23
+ - 前端实现 DAG 的 `frontendMock.policy=auto` 不再因为目标项目缺少 Mock 能力而阻塞,无确认能力时自动跳过并保留真实请求默认路径
24
+ - 文档基线全面校准至 0.14.0,修复了多处的文档索引遗漏与旧路径引用
25
+
26
+ ### 修复
27
+
28
+ - 修复私有仓库 AI PR 审查因通过网页 `*.diff` 地址拉取差异导致 404 的问题,改为经 GitHub API 获取 diff
29
+ - 修复预发布版本误发布到 `latest` 的问题:发布门禁改为按版本号的 prerelease 状态限制 dist-tag,beta prerelease 仅允许 `beta` tag
30
+ - 修复网站更新日志(Changelog)的版本插入位置错误:新版本段落不再错误地插入到读者摘要之前,保持页面结构正常
31
+ - 修复网站更新日志中残留的 `[Unreleased]` 块未随版本发布移除的问题
32
+
3
33
  ## [0.14.0] - 2026-07-18
4
34
 
5
35
  ### 重点更新
@@ -29,8 +59,17 @@
29
59
 
30
60
  ## [Unreleased]
31
61
 
62
+ - 新增 Pull Request 的只读 AI 自动审查:在创建、重新打开、转为 ready 或更新提交时检查 bug、测试缺口、runtime boundary、command registry、初始化投影与文档收敛,并更新单条 PR 评论;Fork PR 无模型密钥时安全跳过。
63
+ - 修复私有仓库 AI PR 审查因通过网页 `*.diff` 地址拉取差异导致 404 的问题,改为经 GitHub API 获取 diff。
64
+ - 新增 `.editorconfig` 与 `.gitattributes`,统一常见文本文件的 UTF-8、LF、缩进和文件末尾换行约定,减少不同 IDE 与操作系统产生的无意义差异;本轮不引入 Git hooks 或格式化依赖。
65
+ - 新增面向内部研发人员的轻量 GitHub 协作指南和简短 Pull Request 模板,统一采用短分支、CI 与 Squash Merge 的最小协作闭环,不改变现有 Agent DAG 和发布流程。
66
+ - 收紧 npm 发布包中的 `docs/` 范围:只保留 init/runtime 所需的治理文档、architecture、skills 与 templates;源仓库专属说明与 progress/report/exec-plan 等目录契约不再打进包内。
67
+ - 收紧 npm 发布包中的 `scripts/`:只保留 `loop-agent knowledge` 实际调用的知识库脚本;源仓治理检查与 `.sh` 薄包装不再打进包内。
32
68
  - 新增内部测试版本夜间自动发布:达到提交门槛并通过发布检查后,自动更新版本、生成中文说明并发布 GitHub Release 与 npm;手动运行默认只做 dry-run。
33
69
  - 发布说明支持 OpenAI-compatible 模型,模型不可用时自动使用保守摘要。
70
+ - 修复 PR #34 发布风险:合并到 main 后包版本被错误提升为 `0.14.1-beta.0`,现已恢复为 `0.14.0`;发布门禁由仅按 frontend 分支判断改为按版本号的 prerelease 状态限制 dist-tag(beta prerelease 只允许 `beta` tag,使用 `latest`/空/默认 tag 时 fail-closed;非 beta prerelease 如 alpha/rc 全局拒绝),避免在 main 上执行默认 `npm publish` 时把 prerelease 误发布到 `latest`。
71
+ - `frontend` 分支继续保留本地 npm beta 发布门禁,并在合入 main 0.14.0 后把测试版本线调整为 `0.14.1-beta.0`,避免误推正式版本或 `latest`。
72
+ - 前端实现 DAG 的 `frontendMock.policy=auto` 不再因为目标项目缺少 Mock 能力而阻塞;无确认 Mock 能力时跳过 Mock、保留真实请求默认路径,并在未真实联调时记录 `Frontend status: locally-validated` 与 `Real integration: pending`。
34
73
 
35
74
  ## [0.13.0] - 2026-07-18
36
75
 
@@ -47,21 +86,21 @@
47
86
 
48
87
  ## [0.12.0] - 2026-07-16
49
88
 
50
- - **只读 Pi 节点安全重试**:opt-in `retryPolicy`(network / rate-limit / unavailable / timeout);writer / shell 等声明策略会校验失败。见 [Agent DAG](./guides/agent-dag.md)。
89
+ - **只读 Pi 节点安全重试**:opt-in `retryPolicy`(network / rate-limit / unavailable / timeout);writer / shell 等声明策略会校验失败。见 [Agent DAG](./website/docs/guides/agent-dag.md)。
51
90
  - **`taskKind: backend-test`**:需求分析 → 功能用例 → pytest → 复盘。
52
91
  - **知识同步与业务图谱 MVP**:`taskKind: knowledge-sync`(须 `featureId`)/ `knowledge-graph-bootstrap`;`loop-agent knowledge query|graph-init|graph-materialize|graph-promote|graph-incremental-prepare`(`knowledge curate` 仍只负责 repair guidance 提案)。
53
92
  - **init surface 全量跟踪**:`check-update` / `update --apply-safe` 覆盖包内全部 `docs/templates/**` 与 `skills/**` 到目标目录的投影。
54
- - 详见根 `CHANGELOG.md [0.12.0]`;站上 [当前规划](./overview/roadmap.md) 与 [功能导览](./overview/feature-map.md)。
93
+ - 详见根 `CHANGELOG.md [0.12.0]`;站上 [当前规划](./website/docs/overview/roadmap.md) 与 [功能导览](./website/docs/overview/feature-map.md)。
55
94
 
56
95
  ## [0.11.0] - 2026-07-15
57
96
 
58
- - **Observe 本地运营面 R1–R5**:资源池 / Task 下钻、Batch·Run 三层事实、Feature 决策详情与对象关系条、有界事件历史、ES modules 前端模块化;`observe serve` keep-alive / SSE keepalive,可选非 loopback 绑定(默认仍 `127.0.0.1`)。见 [Observe](./guides/observe-ui.md)。
97
+ - **Observe 本地运营面 R1–R5**:资源池 / Task 下钻、Batch·Run 三层事实、Feature 决策详情与对象关系条、有界事件历史、ES modules 前端模块化;`observe serve` keep-alive / SSE keepalive,可选非 loopback 绑定(默认仍 `127.0.0.1`)。见 [Observe](./website/docs/guides/observe-ui.md)。
59
98
  - **版本化自举**:controller identity / package fingerprint / expected gate、run-owned skill snapshot、deterministic `self-host:canary`、`skills/agent-worker` 及目标镜像;dogfood Feature `F-2026-004`。
60
99
  - **DagSpec v3 + repair 契约**:新 DAG 携带 `runtimeContract`;supervised `repairNodeId`;run-owned controller identity pin。
61
- - **`plan create` / `plan complete` / `plan check`**:exec-plan 生命周期与 DAG 前置索引校验。见 [CLI 参考](./reference/cli.md)。
62
- - **CLI 自更新提醒**:交互式成功命令后检查 npm 新版本;`LOOP_AGENT_DISABLE_UPDATE_CHECK=1` 可关。见 [安装](./quick-start/installation.md)。
100
+ - **`plan create` / `plan complete` / `plan check`**:exec-plan 生命周期与 DAG 前置索引校验。见 [CLI 参考](./website/docs/reference/cli.md)。
101
+ - **CLI 自更新提醒**:交互式成功命令后检查 npm 新版本;`LOOP_AGENT_DISABLE_UPDATE_CHECK=1` 可关。见 [安装](./website/docs/quick-start/installation.md)。
63
102
  - **init 布局收敛**:目标项目默认 `ai_workspace/loop-agent/` + `.agents/skills/`;`init update --apply-safe` 可安全迁移旧根 `docs/` / `skills/`。
64
- - **文档站 IA**:intro 概念地图与 30 分钟路径;[功能导览](./overview/feature-map.md)、[架构导读](./overview/architecture.md)、[当前规划](./overview/roadmap.md);Markdown 断链构建失败;`skills/loop-agent/references/docs-converge.md` 固化文档收敛检查表。
103
+ - **文档站 IA**:intro 概念地图与 30 分钟路径;[功能导览](./website/docs/overview/feature-map.md)、[架构导读](./website/docs/overview/architecture.md)、[当前规划](./website/docs/overview/roadmap.md);Markdown 断链构建失败;`skills/loop-agent/references/docs-converge.md` 固化文档收敛检查表。
65
104
  - 可选 repo-local SDD skill 嵌入;前端 DAG skill 契约与验证命令安全解析。
66
105
 
67
106
  ## [0.10.0] - 2026-07-12
@@ -73,17 +112,17 @@
73
112
 
74
113
  ## [0.9.0] - 2026-07-12
75
114
 
76
- - Observe 看板重设计为暖白运行控制台:统一信息层级、依赖图 + 节点表、右侧节点检查器、安全 Markdown;本机资源 guardrail。见 [Observe](./guides/observe-ui.md)。
115
+ - Observe 看板重设计为暖白运行控制台:统一信息层级、依赖图 + 节点表、右侧节点检查器、安全 Markdown;本机资源 guardrail。见 [Observe](./website/docs/guides/observe-ui.md)。
77
116
 
78
117
  ## [0.8.0] 及更早
79
118
 
80
- - 0.8.0:[CLI 参考](./reference/cli.md) 补充 `task validate-feature`、`task retry`、`scripts/worker-nightly.sh` + GitHub Actions、`capabilities: [interactive-ui]`,Task Pool 唯一根 `.harness/task-pool/`。
119
+ - 0.8.0:[CLI 参考](./website/docs/reference/cli.md) 补充 `task validate-feature`、`task retry`、`scripts/worker-nightly.sh` + GitHub Actions、`capabilities: [interactive-ui]`,Task Pool 唯一根 `.harness/task-pool/`。
81
120
  - 0.7.5:Observe 新增 DAG 依赖图可视化。
82
121
  - 0.7.0:interactive-ui writer-only HIGH 路由与 UI 交付契约。
83
122
  - 更早条目见根目录 `CHANGELOG.md`。
84
123
 
85
124
  ## 文档站点同步说明
86
125
 
87
- - 站上 guide / reference 与根 `docs/` 双树边界见 [架构导读 · 双树边界](./overview/architecture.md#双树边界)。
126
+ - 站上 guide / reference 与根 `docs/` 双树边界见 [架构导读 · 双树边界](./website/docs/overview/architecture.md#双树边界)。
88
127
  - 活能力短摘要:[`docs/reports/current-capability-summary.md`](https://github.com/tea-agent/loop-agent/blob/main/docs/reports/current-capability-summary.md)。
89
128
  - 冻结基线长文:[`docs/reports/2026-07-02-repository-analysis.md`](https://github.com/tea-agent/loop-agent/blob/main/docs/reports/2026-07-02-repository-analysis.md)(2026-07-16 再采样对齐 0.12.0 + 主干 Unreleased;勿当第二 CHANGELOG)。
package/README.md CHANGED
@@ -45,7 +45,7 @@ loop-agent inspect
45
45
 
46
46
  ## 自动发布
47
47
 
48
- 仓库通过 GitHub Actions 定时检查 `main`,达到提交门槛并通过发布检查后,自动更新版本、生成 Release 说明并发布 GitHub Release 与 npm。手动触发默认只执行 dry-run,不产生远端发布副作用;具体配置、版本规则和恢复步骤见 [`docs/exec-plans/active/2026-07-18-nightly-auto-release.md`](docs/exec-plans/active/2026-07-18-nightly-auto-release.md)。
48
+ 仓库通过 GitHub Actions 定时检查 `main`,达到提交门槛并通过发布检查后,自动更新版本、生成 Release 说明并发布 GitHub Release 与 npm。手动触发默认只执行 dry-run,不产生远端发布副作用;具体配置、版本规则和恢复步骤见 [`docs/exec-plans/completed/2026-07-18-nightly-auto-release.md`](docs/exec-plans/completed/2026-07-18-nightly-auto-release.md)。
49
49
 
50
50
  ## 初始化目标项目
51
51
 
@@ -105,7 +105,7 @@ loop-agent dag validate --dag <temp-dir>/<task-id>-dag.json --strict-models --st
105
105
  loop-agent run-dag --dag <temp-dir>/<task-id>-dag.json --cwd .
106
106
  ```
107
107
 
108
- `dag run-task` 会先尊重显式声明的专用 `taskKind`。对于默认 `standard` 任务,它会根据任务标题、`source/需求.md` 和结构化 `allowedPaths` 做保守、确定性的需求分类;只有高置信的前端实现需求才会自动进入前端专用节点链。只读 `frontend-mock-assess-pi` 在计划前读取 Mock/API/schema 证据,并通过确定性 contract gate 选择原生 Mock、浏览器拦截、请求适配层、`not-needed` 或明确阻塞;它只能使用 DAG 生成时已固化的验证入口。可选 `task.json.frontendMock` 可设置 `auto|required|disabled`、既有服务目录和专项验证命令;不安全或不完整的显式 required 合同不会生成 writer。真实请求始终是默认路径,唯一写节点仍是 `frontend-implement-pi`。自动分类不会覆盖显式 profile、`workflowPolicy` 或 supervised quality gate。后端、混合或证据不足的需求继续使用通用模板,也不会自动进入 `backend-test`。Mock 验证只证明前端状态与交互;未实际请求后端时,收尾保留 `Frontend status: mock-validated`、`Real integration: pending`,并给出 `<task-id>-real-api-integration-verify`。该复验任务不会自动创建或执行,需要在后端就绪后显式运行。
108
+ `dag run-task` 会先尊重显式声明的专用 `taskKind`。对于默认 `standard` 任务,它会根据任务标题、`source/需求.md` 和结构化 `allowedPaths` 做保守、确定性的需求分类;只有高置信的前端实现需求才会自动进入前端专用节点链。只读 `frontend-mock-assess-pi` 在计划前读取 Mock/API/schema 证据,并通过确定性 contract gate 选择原生 Mock、浏览器拦截、请求适配层、`not-needed` 或明确阻塞;它只能使用 DAG 生成时已固化的验证入口。可选 `task.json.frontendMock` 可设置 `auto|required|disabled`、既有服务目录和专项验证命令;默认 `auto` 下没有已确认 Mock 能力时会跳过 Mock 继续前端实现,并保留真实联调缺口,不会因为缺 Mock 本身阻塞。不安全或不完整的显式 required 合同仍不会生成 writer。真实请求始终是默认路径,唯一写节点仍是 `frontend-implement-pi`。自动分类不会覆盖显式 profile、`workflowPolicy` 或 supervised quality gate。后端、混合或证据不足的需求继续使用通用模板,也不会自动进入 `backend-test`。Mock 验证只证明前端状态与交互;未实际请求后端时,收尾保留 `Real integration: pending`,并给出 `<task-id>-real-api-integration-verify`。该复验任务不会自动创建或执行,需要在后端就绪后显式运行。
109
109
 
110
110
  测试结论写回与业务知识图谱(结构化 Git,非 RAG):
111
111
 
@@ -281,6 +281,7 @@ npm run self-host:canary -- --deterministic --tarball <candidate.tgz> --output <
281
281
  | 路径 | 用途 |
282
282
  |---|---|
283
283
  | `AGENTS.md` | 本仓库的 agent 开工协议、会话协议和长期工作规则 |
284
+ | `docs/github-collaboration.md` | 内部贡献者的轻量 GitHub 协作指南:短分支、PR、CI 与 Squash Merge |
284
285
  | `harness.json` | loop-agent 在本仓库的模型、executor、治理根目录和脚本配置 |
285
286
  | `docs/README.md` | 治理文档索引 |
286
287
  | `docs/verification-matrix.md` | 不同变更类型对应的验证命令 |
@@ -293,6 +294,8 @@ npm run self-host:canary -- --deterministic --tarball <candidate.tgz> --output <
293
294
 
294
295
  ## 本仓库开发
295
296
 
297
+ 内部贡献代码时,先阅读 [`docs/github-collaboration.md`](docs/github-collaboration.md)。当前采用轻量协作方式:一个小工作块使用一个短分支,通过简短 Pull Request、CI 和同事确认后,默认 Squash Merge 到 `main`。
298
+
296
299
  本地源码开发:
297
300
 
298
301
  ```bash
@@ -318,9 +321,9 @@ Windows 上运行 `scripts/*.sh` 时使用 Git Bash 或已配置的兼容 Bash
318
321
 
319
322
  ## 发布包内容
320
323
 
321
- 发布包包含静态运行和指导资料:`bin/`、`dist/`、`skills/`(包括 `loop-agent` 与可选的 `agent-worker` operator skill)、`docs/*.md`、`docs/architecture/runtime-boundaries.md`、`docs/skills/`、`docs/templates/`、`docs/init-surface.manifest.json`、`examples/`、`harness.json`、`AGENTS.md`、`README.md` 和 `CHANGELOG.md`。
324
+ 发布包包含静态运行和指导资料:`bin/`、`dist/`、`skills/`(包括 `loop-agent` 与可选的 `agent-worker` operator skill)、必要的治理文档(`docs/README.md`、三份 methodology、显式列出的 `docs/architecture/*.md`)、`docs/skills/`、`docs/templates/`、`docs/init-surface.manifest.json`、知识库运行脚本(`scripts/kb-*.mjs` 与 `kb-bootstrap-init-skeleton.sh`)、`examples/`、`harness.json`、`AGENTS.md`、`README.md` 和 `CHANGELOG.md`。
322
325
 
323
- `docs/progress/`、`docs/reports/`、`docs/exec-plans/`、`docs/decisions/` 等目录下的任务正文是目标仓库实时生成或历史事实;npm 包只携带这些目录的 README,不携带本仓库已有历史记录。
326
+ `docs/progress/`、`docs/reports/`、`docs/exec-plans/`、`docs/decisions/`、`docs/design/` 的任务正文与目录 README 不随包发布;`loop-agent init` 会在目标项目生成空目录契约,具体 plan/progress/report/decision 由后续真实任务写入。源仓库专属说明(如 agent-dag playbook、sidecar 说明)也不再打进 npm 包。
324
327
 
325
328
  DAG skill 指令优先从用户配置目录和目标项目 `.agents/skills/` 解析;目标项目未提供本地 skill 时,CLI 会回退到 npm 包内置的 `skills/`。因此普通项目不需要复制 loop-agent 仓库历史文档或根 `skills/` 目录才可获得默认 DAG 能力。
326
329
 
@@ -336,4 +339,20 @@ node bin/loop-agent.js --help
336
339
  npm pack --dry-run
337
340
  ```
338
341
 
342
+ `npm publish` 时会通过 `prepublishOnly` 依次执行:
343
+
344
+ 1. `node scripts/check-npm-publish-policy.mjs` — 发布策略门禁
345
+ 2. `npm run typecheck`
346
+ 3. `npm test`
347
+ 4. `npm run build`
348
+
349
+ ### frontend 分支发布限制
350
+
351
+ 在 `frontend` 分支执行 `npm publish` 时,必须同时满足:
352
+
353
+ - `package.json` 版本为合法的 SemVer **beta** 预发布版本(例如 `0.13.0-beta.1`)
354
+ - 必须显式指定 `--tag beta`(即 `npm publish --tag beta`)
355
+
356
+ 任一条件不满足时,`prepublishOnly` 会在上传 npm registry 前失败并给出中文错误提示。其他分支不受此限制。
357
+
339
358
  发布入口 `bin/loop-agent.js` 只加载 `dist/cli.js`;`npm run dev -- <args>` 只用于源码开发和定位问题。
@@ -555,7 +555,7 @@ export function hasApiDependency(sources) {
555
555
  * |---|---|---|---|
556
556
  * | 无 | 任意 | auto | not-required |
557
557
  * | 有 | present | auto | required |
558
- * | 有 | present/absent/ambiguous | auto | required (strategy chooses a safe mechanism) |
558
+ * | 有 | absent/ambiguous | auto | not-required (skip Mock, preserve integration gap) |
559
559
  * | 任意 | present | required | required |
560
560
  * | 任意 | absent/ambiguous | required | blocked |
561
561
  * | 任意 | 任意 | disabled | not-required (if spec allows) else blocked |
@@ -587,12 +587,12 @@ export function resolveFrontendMockMode(capability, taskConfig, hasApiDep) {
587
587
  if (!hasApiDep) {
588
588
  return "not-required";
589
589
  }
590
- // In auto mode, capability discovery is evidence for the strategy node, not
591
- // a final mechanism decision. Projects without a native Mock service may use
592
- // an existing browser interception harness or a reversible request adapter.
593
- // The deterministic strategy gate blocks before the writer when none can be
594
- // verified by the DAG's frozen static/behavior entrypoints.
595
- return "required";
590
+ // In auto mode, frontend Mock is optional. Only require Mock-backed strategy
591
+ // assessment when a native project Mock capability is actually present.
592
+ // Projects without confirmed Mock support continue through the normal
593
+ // frontend writer and must preserve the real integration gap instead of
594
+ // inventing a temporary Mock framework or blocking solely for missing Mock.
595
+ return capability.status === "present" ? "required" : "not-required";
596
596
  }
597
597
  function mapTaskComplexity(complexity) {
598
598
  if (complexity === "small")
@@ -1322,6 +1322,12 @@ export function buildStandardHybridDagFromTask(sources) {
1322
1322
  return spec;
1323
1323
  }
1324
1324
  function buildFrontendMockAssessNode(sources, sourceContext, mockContextBlock, fixedVerificationContext, readOnlyPaths, forbiddenPaths) {
1325
+ const configuredPolicy = sources.taskConfig.frontendMock?.policy ?? "auto";
1326
+ const mockMode = sources.frontendMockMode ?? "not-required";
1327
+ const capabilityStatus = sources.frontendMockCapability?.status;
1328
+ const autoMaySkipMissingMock = configuredPolicy === "auto" &&
1329
+ mockMode === "not-required" &&
1330
+ (capabilityStatus === "absent" || capabilityStatus === "ambiguous");
1325
1331
  return {
1326
1332
  id: "frontend-mock-assess-pi",
1327
1333
  depends_on: ["frontend-contract-pi", "frontend-scout-pi"],
@@ -1337,7 +1343,9 @@ function buildFrontendMockAssessNode(sources, sourceContext, mockContextBlock, f
1337
1343
  "Perform read-only Mock assessment and select one safe frontend data strategy.",
1338
1344
  "The first non-empty line must be exactly one of: MOCK_STRATEGY: native, MOCK_STRATEGY: browser-intercept, MOCK_STRATEGY: request-adapter, MOCK_STRATEGY: not-needed, or MOCK_STRATEGY: blocked.",
1339
1345
  "Prefer an existing native Mock facility. Use browser-intercept only with an existing browser/e2e harness. When no Mock exists but the API layer is writable, use request-adapter by adding a minimal reversible adapter/DI seam within the approved writeSet; the real adapter must remain the production default.",
1340
- "Select not-needed only with positive evidence that no remote API is involved, a stable real backend will be exercised, or existing fixtures already cover the contract without changes. not-needed still requires the fixed behavior entrypoint to exercise applicable real or no-remote behavior verification. When configured policy is required, not-needed is forbidden.",
1346
+ autoMaySkipMissingMock
1347
+ ? "Auto mode may skip Mock when no project Mock capability is confirmed. Select not-needed with positive evidence from contract/scout that no project Mock capability is confirmed, continue without adding Mock files or dependencies, run the fixed verification entrypoints, and record any unproved real API behavior in Real Integration Gap. Do not block solely because no project Mock capability, browser interception harness, or request adapter exists."
1348
+ : "Select not-needed only with positive evidence that no remote API is involved, a stable real backend will be exercised, or existing fixtures already cover the contract without changes. not-needed still requires the fixed behavior entrypoint to exercise applicable real or no-remote behavior verification. When configured policy is required, not-needed is forbidden.",
1341
1349
  "Configured policy disabled requests no Mock but cannot override project specifications; if an actually-read project rule requires Mock, select blocked.",
1342
1350
  "",
1343
1351
  "## Required Output Sections:",
@@ -1356,6 +1364,9 @@ function buildFrontendMockAssessNode(sources, sourceContext, mockContextBlock, f
1356
1364
  "- Read project Mock/API/schema specifications before making any judgment.",
1357
1365
  "- Do not infer Mock service from lockfile-only or transitive dependency evidence.",
1358
1366
  "- Output MOCK_STRATEGY: blocked if capability evidence conflicts, contract fields are missing/conflicting, paths or dependencies are unauthorized, specs were not actually read, sources conflict, production-default-off cannot be proven, the API layer is not writable for a new adapter, or the frozen entrypoints cannot verify the selected strategy.",
1367
+ ...(autoMaySkipMissingMock
1368
+ ? ["- In auto mode with no confirmed project Mock capability, do not block solely because Mock is unavailable or Mock-specific verification is absent; choose not-needed and make the Real Integration Gap explicit unless project specs require Mock or another safety rule is violated."]
1369
+ : []),
1359
1370
  "- Never comment out or replace the real request with inline data, hard-code Mock enablement, import test mocks from a production entrypoint, invent API fields, or place secrets/real user data in fixtures.",
1360
1371
  "- Mock-backed behavior evidence proves the documented frontend contract only; it never proves real API integration.",
1361
1372
  "",
@@ -1564,7 +1575,11 @@ function resolveFrontendMockContextBlock(sources) {
1564
1575
  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.");
1565
1576
  }
1566
1577
  if (mode === "not-required") {
1567
- parts.push("Generation-time evidence does not require Mock. The assessment must still use contract/scout evidence: select not-needed only positively, or select a safe Mock strategy if an API dependency is confirmed.");
1578
+ 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.");
1579
+ if ((sources.taskConfig.frontendMock?.policy ?? "auto") === "auto" &&
1580
+ (capability.status === "absent" || capability.status === "ambiguous")) {
1581
+ parts.push("Auto mode may skip Mock when no project Mock capability is confirmed. Do not block solely for missing Mock; keep the real request path as default and record any unproved backend behavior as Real Integration Gap.");
1582
+ }
1568
1583
  }
1569
1584
  if (mode === "blocked") {
1570
1585
  parts.push("Mock contract is blocked. The DAG must stop before any write node executes.");
@@ -1900,7 +1915,7 @@ function buildFrontendHybridDagFromTask(sources) {
1900
1915
  subtask_prompt: [
1901
1916
  "Audit the frontend plan before implementation.",
1902
1917
  "First non-empty line must be exactly VERDICT: pass or VERDICT: request-revision.",
1903
- "Request revision when the Mock strategy is MOCK_STRATEGY: 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 the selected strategy. Mock strategies require Mock-backed evidence; not-needed requires applicable real or no-remote behavior evidence.",
1918
+ "Request revision when the Mock strategy is MOCK_STRATEGY: 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 the selected strategy. 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 the plan must preserve the real request path and record the Real Integration Gap.",
1904
1919
  "Also request revision 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.",
1905
1920
  "Read-only: do not modify repository files.",
1906
1921
  fixedVerificationContext,
@@ -2330,7 +2345,7 @@ function buildFrontendHybridDagFromTask(sources) {
2330
2345
  "Read the validated frontend-implementation-contract, frontend-verification-trace evidence, static/behavior shell facts, and actual diff. Trace proves command/file/symbol binding only—not semantic correctness.",
2331
2346
  "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).",
2332
2347
  "Use the direct contract, original plan, revision/no-op result, and final design review to reconstruct the approved plan and design verdict; do not infer them from the implementation summary.",
2333
- "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 or no-remote behavior evidence. Verify that the real request remains the default when Mock activation is absent.",
2348
+ "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.",
2334
2349
  "Inspect the production/default-real-path static evidence directly and require Mock activation to be off for that check.",
2335
2350
  "Distinguish Mock-backed evidence from real API integration evidence and preserve the Real Integration Gap when the backend was not exercised.",
2336
2351
  "Review implementation quality, behavior/state coverage, verification evidence, and maintainability. Read-only: do not modify files.",
@@ -2391,6 +2406,7 @@ function buildFrontendHybridDagFromTask(sources) {
2391
2406
  "Return a frontend closeout summary covering Mock decision/strategy/files/verification/production boundary, changes, verification evidence, review result, known risks, and follow-up.",
2392
2407
  "Include a coverage matrix for each requirement id, applicable UI state, and verification target/check with status passed|failed|not-run|blocked|unavailable. Always state Browser accessibility verification: not-run and Visual regression: not-run. Use frontend-verification-trace facts; do not invent Browser evidence from component tests.",
2393
2408
  `When only Mock-backed evidence passed, state exactly Frontend status: mock-validated and Real integration: pending, summarize the Real Integration Gap, and name ${taskConfig.taskId}-real-api-integration-verify as the explicit follow-up task to create/run after backend readiness. This follow-up is not auto-created or auto-executed. Never describe Mock evidence as real API integration.`,
2409
+ `When Mock was skipped in auto mode and no real API evidence passed, state exactly Frontend status: locally-validated and Real integration: pending, summarize the Real Integration Gap, and name ${taskConfig.taskId}-real-api-integration-verify as the explicit follow-up task when backend readiness matters.`,
2394
2410
  "Read-only: do not modify code, docs, artifacts, or .harness/dag-runs/.",
2395
2411
  sourceContext,
2396
2412
  mockContextBlock,
package/docs/README.md CHANGED
@@ -12,6 +12,7 @@
12
12
 
13
13
  - `design/archive/2026-07-14-loop-agent-self-update-notifier.md` — loop-agent CLI 自更新提醒设计(已实现;历史设计说明)
14
14
  - `development-principles.md` — 仓库开发原则
15
+ - `github-collaboration.md` — 内部研发人员的轻量 GitHub 协作指南:短分支、简短 PR、CI 与 Squash Merge
15
16
  - `architecture/runtime-boundaries.md` — runtime 层边界与依赖方向
16
17
  - `architecture/README.md` — 架构文档目录索引与阅读路径
17
18
  - `architecture/system-overview.md` — loop-agent / agent-worker / 治理层 / 外部系统全景
@@ -8,6 +8,9 @@
8
8
  "harness.json",
9
9
  "bin/loop-agent.js",
10
10
  "docs/README.md",
11
+ "docs/harness-methodology-tdd.md",
12
+ "docs/harness-methodology-verification.md",
13
+ "docs/harness-methodology-debugging.md",
11
14
  "docs/init-surface.manifest.json",
12
15
  "docs/architecture/runtime-boundaries.md",
13
16
  "docs/architecture/README.md",
@@ -38,16 +41,10 @@
38
41
  "docs/templates/product-line/task.yaml",
39
42
  "docs/templates/product-line/closeout.yaml",
40
43
  "docs/templates/product-line/links.md",
41
- "scripts/check-product-line-docs.sh",
42
- "scripts/check-task-pool-root.sh",
43
44
  "scripts/kb-bootstrap-init-skeleton.sh",
44
- "scripts/kb-query.sh",
45
45
  "scripts/kb-query.mjs",
46
- "scripts/kb-graph-materialize.sh",
47
46
  "scripts/kb-graph-materialize.mjs",
48
- "scripts/kb-graph-promote.sh",
49
47
  "scripts/kb-graph-promote.mjs",
50
- "scripts/kb-graph-incremental-prepare.sh",
51
48
  "scripts/kb-graph-incremental-prepare.mjs",
52
49
  "docs/templates/agent-dag.schema.json",
53
50
  "examples/example-dag.json",
@@ -181,7 +178,7 @@
181
178
  "docs/templates/product-line/closeout.yaml": "copied",
182
179
  "docs/templates/product-line/links.md": "copied",
183
180
  "scripts/check-skill-entry.sh": "generated",
184
- "scripts/check-product-line-docs.sh": "copied",
181
+ "scripts/check-product-line-docs.sh": "generated",
185
182
  "scripts/check-repo.sh": "generated",
186
183
  "scripts/ci-governance.sh": "generated",
187
184
  "scripts/ci-tests.sh": "generated",
@@ -90,4 +90,3 @@ Add focused tests and real init/update/browser/CLI smokes required by the merged
90
90
  - Conflict files: `<paths>`.
91
91
  - First tests to run if a feature appears missing: `<commands>`.
92
92
  - Safe rollback strategy: prefer `git revert -m 1 <merge-commit>` after review; do not use destructive reset on shared work.
93
-
package/harness.json CHANGED
@@ -59,7 +59,7 @@
59
59
  "pi": {
60
60
  "description": "Pi planning, review, diagnosis, and bounded writing when DAG toolProfile=write",
61
61
  "LOW": "gpt-5.3-codex-spark",
62
- "MED": "grok-4.5",
62
+ "MED": "glm-5.2",
63
63
  "HIGH": "gpt-5.6-sol"
64
64
  }
65
65
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tea-agent/loop-agent",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "loop-agent": "bin/loop-agent.js",
@@ -10,7 +10,10 @@
10
10
  "AGENTS.md",
11
11
  "bin/",
12
12
  "dist/",
13
- "docs/*.md",
13
+ "docs/README.md",
14
+ "docs/harness-methodology-tdd.md",
15
+ "docs/harness-methodology-verification.md",
16
+ "docs/harness-methodology-debugging.md",
14
17
  "docs/architecture/runtime-boundaries.md",
15
18
  "docs/architecture/README.md",
16
19
  "docs/architecture/system-overview.md",
@@ -18,29 +21,16 @@
18
21
  "docs/architecture/worker-and-feature.md",
19
22
  "docs/architecture/facts-and-state.md",
20
23
  "docs/architecture/evolution.md",
21
- "docs/decisions/README.md",
22
- "docs/design/README.md",
23
- "docs/exec-plans/README.md",
24
- "docs/exec-plans/active/README.md",
25
- "docs/exec-plans/completed/README.md",
26
24
  "docs/init-surface.manifest.json",
27
- "docs/progress/README.md",
28
- "docs/reports/README.md",
29
25
  "docs/skills/",
30
26
  "docs/templates/",
31
27
  "examples/",
32
28
  "harness.json",
33
29
  "skills/",
34
- "scripts/check-product-line-docs.sh",
35
- "scripts/check-task-pool-root.sh",
36
30
  "scripts/kb-bootstrap-init-skeleton.sh",
37
- "scripts/kb-query.sh",
38
31
  "scripts/kb-query.mjs",
39
- "scripts/kb-graph-materialize.sh",
40
32
  "scripts/kb-graph-materialize.mjs",
41
- "scripts/kb-graph-promote.sh",
42
33
  "scripts/kb-graph-promote.mjs",
43
- "scripts/kb-graph-incremental-prepare.sh",
44
34
  "scripts/kb-graph-incremental-prepare.mjs",
45
35
  "README.md",
46
36
  "CHANGELOG.md"
@@ -55,7 +45,7 @@
55
45
  "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
56
46
  "build": "npm run clean && tsc -p tsconfig.build.json && node -e \"const fs=require('node:fs');const p='dist/worker/observe/static';fs.mkdirSync(p,{recursive:true});fs.cpSync('src/worker/observe/static',p,{recursive:true});\"",
57
47
  "prepack": "npm run build",
58
- "prepublishOnly": "npm run typecheck && npm test && npm run build",
48
+ "prepublishOnly": "node scripts/check-npm-publish-policy.mjs && npm run typecheck && npm test && npm run build",
59
49
  "lint": "tsc --noEmit",
60
50
  "typecheck": "tsc --noEmit",
61
51
  "test": "node scripts/run-tests.mjs",
@@ -117,10 +117,10 @@ Wrap everything in an IIFE to run multi-statement code:
117
117
  // Multiple operations
118
118
  const data = document.querySelector('#target').textContent;
119
119
  const buttons = document.querySelectorAll('button');
120
-
120
+
121
121
  // Interactions
122
122
  buttons[0].click();
123
-
123
+
124
124
  // Return results
125
125
  return JSON.stringify({ data, buttonCount: buttons.length });
126
126
  })()
@@ -1,58 +1,40 @@
1
1
  # Frontend Design Review Checklist
2
2
 
3
- ## Requirement And State Coverage
3
+ ## Coverage
4
4
 
5
- - Target route/page/component and non-goals are clear.
6
- - Every acceptance criterion maps to steps, files, UI behavior, and verification.
7
- - Assumptions and unresolved ambiguity are explicit.
8
- - Applicable success, error, loading, empty, disabled, permission, retry, stale-response, and boundary states are handled or marked N/A.
5
+ - Route/component, non-goals, assumptions, and unresolved ambiguity are explicit.
6
+ - Each acceptance criterion maps to steps, files, UI behavior, states, and verification.
7
+ - Success/error/loading/empty/disabled/permission/retry/stale/boundary states are handled or N/A.
9
8
 
10
- ## Project And Knowledge Fit
9
+ ## Project Fit
11
10
 
12
- - Existing components, hooks, API helpers, mocks, schemas, router patterns, templates, tokens, and theme rules were considered.
13
- - Component/design choices cite knowledge-base or `openSpec/`; failed/empty knowledge-base queries recurse through `<repoRoot>/openSpec/**` first.
14
- - Evidence records source status, query terms, paths/headings, and conflicts.
15
- - Dependencies are authorized; paths fit allowed/write scope and avoid forbidden/generated files.
16
- - A required Mock-backed strategy reuses native support when proven, otherwise an
17
- existing browser-intercept/request-adapter seam; it maps endpoint/states to fixtures,
18
- stays in writer scope, and is off in production. `not-needed` adds none.
11
+ - Reuse components, hooks, API helpers, mocks, schemas, router patterns, tokens, and theme rules.
12
+ - Cite knowledge-base or `openSpec/`; failed/empty knowledge queries must search `<repoRoot>/openSpec/**`.
13
+ - Record source status, query terms, paths/headings, conflicts, authorized deps, and allowed paths.
19
14
 
20
- ## Interaction And Quality
15
+ ## Interaction / Quality
21
16
 
22
- - Actions, feedback, validation timing, navigation, persistence, and recovery are unambiguous.
23
- - Responsive and overflow behavior covers target environments.
24
- - Keyboard, focus, semantics, contrast, reduced motion, data lifecycle, cancellation, and error recovery are addressed when applicable.
17
+ - Actions, feedback, validation timing, navigation, persistence, recovery, responsive/overflow, focus/keyboard/semantics/contrast/reduced motion, cancellation, and data lifecycle are covered when applicable.
25
18
 
26
19
  ## Verification
27
20
 
28
- - Static and behavior commands are exact, discoverable, and deterministic.
29
- - Tests prove changed state logic and flows at repository-supported levels.
30
- - Browser/visual checks are required only by task intent or existing gates.
31
- - Every missing verification path is a blocker or disclosed risk.
32
- - Verification entrypoints are frozen; any Mock-specific command is generated only
33
- from trusted sources, and behavior separately proves page consumption.
34
-
35
- ## Mock Strategy Safety
36
-
37
- - The strategy protocol is valid and not `MOCK_STRATEGY: blocked`.
38
- - For Mock strategies, API fields and fixture states trace to contract evidence; gaps are explicit.
39
- - Selection follows repository capability: native mock first, browser interception
40
- for existing e2e, request adapter/injection for local preview.
41
- - The real request remains enabled by default; activation is explicit, reversible,
42
- local/test-only, and excluded from production behavior.
43
- - Verification uses only shell entrypoints fixed when the DAG was generated; the
44
- plan does not invent commands that shell nodes cannot execute.
45
- - Mock strategies include a production/default-real-path build with Mock off and
46
- Mock-backed behavior evidence. `not-needed` instead needs applicable real or
47
- no-remote behavior evidence.
48
- - Mock-backed checks prove frontend states only. Real integration remains pending
49
- until the actual backend path has fresh evidence.
21
+ - Static/behavior commands are exact, frozen, discoverable, and deterministic.
22
+ - Tests prove changed state and flows at supported levels; browser/visual only when task/gate requires.
23
+ - Missing required verification is a blocker; optional gaps are disclosed risks.
24
+
25
+ ## Mock Safety
26
+
27
+ - Strategy line is valid and not `MOCK_STRATEGY: blocked`.
28
+ - Mock API fields/states trace to contract evidence; gaps are explicit.
29
+ - Prefer native mock; browser intercept only for existing e2e; request adapter only for reversible local preview.
30
+ - Real request stays default; activation is explicit, reversible, local/test-only, and production-off.
31
+ - Plans use only DAG-frozen shell entrypoints.
32
+ - Mock strategies need default-real-path build with Mock off plus Mock-backed behavior evidence.
33
+ - `not-needed` needs real/no-remote evidence, or default-auto skipped-Mock rationale with Real Integration Gap preserved when no project Mock capability exists.
34
+ - Mock-backed checks prove frontend states only; real integration remains pending until actual backend evidence exists.
50
35
 
51
36
  ## Verdict Matrix
52
37
 
53
- - Coverage gap, unsafe scope, unauthorized dependency, unresolved required interaction, or missing required verification: request revision.
54
- - Missing knowledge-base evidence and skipped `openSpec/` fallback: request revision.
55
- - No relevant knowledge-base or `openSpec/` rule for a required decision: request revision.
56
- - Unsafe/missing mock strategy or mock evidence presented as real integration: request revision.
57
- - Knowledge-base unavailable but relevant `openSpec/` rules were applied: advisory connection gap, not a specification gap.
58
- - Optional cleanup that cannot affect acceptance: advisory.
38
+ - Request revision for coverage gaps, unsafe scope, unauthorized deps, unresolved required interaction, missing required verification, skipped `openSpec/` fallback, unsafe/missing Mock strategy, or Mock evidence presented as real integration.
39
+ - Knowledge-base unavailable but relevant `openSpec/` rules applied is advisory only.
40
+ - Optional cleanup that cannot affect acceptance is advisory.
@@ -6,11 +6,11 @@ Pre-write nodes are read-only. Preserve IDs, labels, commands, language, require
6
6
 
7
7
  - **`frontend-contract-pi`**: `Scope`, `Non-goals`, `Acceptance Criteria`, `UI States`, `Target Runtime Environment`, `Risks`, `Verification Expectations`. No guessed requirements.
8
8
  - **`frontend-scout-pi`**: routes, components, tokens, data/API/Mock, scripts, tests, assets. Fact vs inference vs gap. Knowledge base first; else search+read `<repoRoot>/openSpec/**` before repo fallback. Output stack, routes, components, styling, conventions, state/data, test entry points, reuse, risks.
9
- - **`frontend-mock-assess-pi` + gate**: first non-empty line
10
- `MOCK_STRATEGY: native|browser-intercept|request-adapter|not-needed|blocked`
11
- Prefer native Mock; browser intercept only with existing e2e; request-adapter only for reversible local preview. `not-needed` needs positive no-remote/stable-backend evidence; invalid when `frontendMock.policy=required`. `blocked` for missing/conflicting contracts, unsafe paths/deps, unread specs, production-default-on, unverifiable entrypoints. Output Mock Decision, API/spec/service evidence, backend readiness, selection evidence, endpoint/fixture matrix, activation, targets, production safety, verification plan, real-integration gap, blocking issues. Never invent fields, store secrets, comment real requests, import test mocks into production, or treat Mock as real integration. Gate uses `first-non-empty` only; never authorizes writes. Unsafe required contracts → no writer.
9
+ - **`frontend-mock-assess-pi` + gate**: first non-empty line
10
+ `MOCK_STRATEGY: native|browser-intercept|request-adapter|not-needed|blocked`
11
+ Prefer native Mock; browser intercept only with existing e2e; request-adapter only for reversible local preview. Default `auto` may select `not-needed` when contract/scout evidence confirms no project Mock capability, without adding Mock files/deps, while keeping real requests default and recording the Real Integration Gap. Other `not-needed` cases need positive no-remote/stable-backend evidence; invalid when `frontendMock.policy=required`. `blocked` for missing/conflicting contracts, unsafe paths/deps, unread specs, production-default-on, unverifiable entrypoints. Output Mock Decision, API/spec/service evidence, backend readiness, selection evidence, endpoint/fixture matrix, activation, targets, production safety, verification plan, real-integration gap, blocking issues. Never invent fields, store secrets, comment real requests, import test mocks into production, or treat Mock as real integration. Gate uses `first-non-empty` only; never authorizes writes. Unsafe required contracts → no writer.
12
12
  - **`frontend-plan-pi` + design loop**: AC → steps, in-bound files, UI states, reuse, deps, activation/rollback, frozen verify entrypoints, real-integration gap. First gate: `VERDICT: pass|request-revision`. Pass may emit `PASS_NO_REVISION_NEEDED`; else full corrected plan without invented evidence. Final review rechecks plan/findings/revision/assessment/Mock safety. Only final `VERDICT: pass` authorizes writes; failure → replan/rerun (not dev-fix).
13
- - **`frontend-implement-pi`**: sole exclusive writer. Stay in `writeSet`; real requests default-on; Mock reversible, dev/test-only, production-off. Atomic handler/intercept/adapter with consumer+tests. Stop on forbidden paths or guesses. Output changed files, behavior, UI states, styling notes, verification attempted, residual risks. Optional mock-verify when frozen; static+behavior always; behavior must prove page consumption.
13
+ - **`frontend-implement-pi`**: sole exclusive writer. Stay in `writeSet`; real requests default-on; Mock reversible, dev/test-only, production-off. Atomic handler/intercept/adapter with consumer+tests. Stop on forbidden paths or guesses. Output changed files, behavior, UI states, styling notes, verification attempted, residual risks. Optional mock-verify when frozen; static+behavior always; behavior must prove page consumption. Skipped-Mock `not-needed` keeps real integration pending unless the real backend path has fresh evidence.
14
14
 
15
15
  ## Contract / trace / stages (M1–M2)
16
16
 
@@ -30,7 +30,9 @@ required check, forbidden write, or unmet acceptance criterion forces revision.
30
30
  - Inspect static, behavior, and available Mock-specific artifacts directly. For Mock
31
31
  strategies, compare the endpoint matrix, handler/fixture/adapter and consumer diff;
32
32
  require the real request as default, contract-aligned fixtures, production isolation,
33
- and no false real-integration claim. `not-needed` needs applicable real/no-remote evidence.
33
+ and no false real-integration claim. `not-needed` needs applicable real/no-remote
34
+ evidence, or an explicit default-auto skipped-Mock rationale with the Real
35
+ Integration Gap preserved when no project Mock capability is confirmed.
34
36
  - Component/design claims require traceable knowledge-base evidence or, after connection/query failure or no match, relevant `<repoRoot>/openSpec/**` evidence. The connector format is TODO; never claim a query or fallback search without evidence. Execute explicit `grep`/`find` to locate spec files and `read` to load them before referencing their rules. Only successful `read` tool calls are observable as "已读取规范文件" in the spec-evidence inspector.
35
37
  - Treat shell exit status as authoritative. Do not edit files.
36
38
 
@@ -43,5 +43,6 @@ Avoid vague advice. When no source location exists, cite the command or artifact
43
43
  - Changed files are authorized.
44
44
  - Criteria and applicable states have implementation and evidence.
45
45
  - Required Mock-backed behavior passed; any generated Mock-specific verification also
46
- passed; Mock is not enabled by default in production.
46
+ passed; Mock is not enabled by default in production. For default-auto skipped
47
+ Mock, the real request remains default and the Real Integration Gap is preserved.
47
48
  - Optional unavailable knowledge-base, browser, visual, or manual checks remain explicit risks.
@@ -45,7 +45,9 @@ Return Markdown headings:
45
45
  - `Follow-up`: concrete work or `None`.
46
46
 
47
47
  When the backend remains unavailable but required mock-backed checks pass, state
48
- `Frontend status: mock-validated` and `Real integration: pending`. Use a completed
48
+ `Frontend status: mock-validated` and `Real integration: pending`. When default
49
+ `auto` skipped Mock and no real API evidence passed, state
50
+ `Frontend status: locally-validated` and `Real integration: pending`. Use a completed
49
51
  `<task-id>-real-api-integration-verify` task before changing the latter to complete;
50
52
  the follow-up is explicit, not auto-created or auto-executed.
51
53