@tea-agent/loop-agent 0.10.0-alpha.0 → 0.11.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 (48) hide show
  1. package/AGENTS.md +2 -2
  2. package/CHANGELOG.md +39 -47
  3. package/README.md +33 -6
  4. package/dist/application/dag/args.js +2 -3
  5. package/dist/application/dag/generate-task-dag.js +5 -14
  6. package/dist/cli/command-definitions.js +44 -5
  7. package/dist/cli/program.js +37 -3
  8. package/dist/cli/update/notifier.js +117 -0
  9. package/dist/cli/update/npm-client.js +151 -0
  10. package/dist/cli/update/policy.js +58 -0
  11. package/dist/cli/update/state.js +68 -0
  12. package/dist/cli.js +33 -0
  13. package/dist/commands/init.js +432 -58
  14. package/dist/commands/plan.js +50 -0
  15. package/dist/governance/exec-plans.js +545 -0
  16. package/dist/governance/manifest-types.js +0 -5
  17. package/dist/task/config-types.js +0 -1
  18. package/dist/worker/observe/static/app.js +326 -45
  19. package/dist/worker/observe/static/styles.css +1 -0
  20. package/dist/workflows/dag/governance-profile.js +0 -10
  21. package/dist/workflows/dag/init-hybrid.js +5 -201
  22. package/dist/workflows/dag/sdd-embedded.js +128 -0
  23. package/dist/workflows/dag/skill-instructions.js +5 -4
  24. package/docs/README.md +1 -0
  25. package/docs/agent-dag-runner.md +2 -2
  26. package/docs/architecture/runtime-boundaries.md +3 -0
  27. package/docs/design/README.md +1 -0
  28. package/docs/development-principles.md +1 -1
  29. package/docs/exec-plans/active/README.md +2 -2
  30. package/docs/exec-plans/completed/README.md +6 -0
  31. package/docs/feature-workflow.md +27 -21
  32. package/docs/harness-methodology-debugging.md +1 -1
  33. package/docs/harness-methodology-tdd.md +3 -3
  34. package/docs/init-surface.manifest.json +23 -50
  35. package/docs/loop-agent-harness.md +8 -3
  36. package/docs/progress/README.md +6 -0
  37. package/docs/reports/README.md +10 -0
  38. package/docs/templates/project-start-checklist.md +2 -2
  39. package/harness.json +1 -3
  40. package/package.json +3 -3
  41. package/skills/frontend-implementation/SKILL.md +3 -0
  42. package/skills/loop-agent/references/command-reference.md +6 -0
  43. package/skills/loop-agent/references/docs-converge.md +5 -5
  44. package/skills/loop-agent/references/task-workflow.md +1 -1
  45. package/docs/templates/backend-test-dag.generate-pytest.prompt.md +0 -131
  46. package/docs/templates/backend-test-dag.json +0 -213
  47. package/docs/templates/backend-test-dag.retrospect.prompt.md +0 -128
  48. package/docs/templates/backend-test-dag.review-cases.prompt.md +0 -85
@@ -19,6 +19,7 @@
19
19
  "docs/skills/README.md",
20
20
  "docs/skills/vetted-skill-registry.md",
21
21
  "docs/templates/init-evolution-review.md",
22
+ "docs/templates/exec-plan.md",
22
23
  "docs/templates/production-readiness-checklist.md",
23
24
  "docs/templates/frontend-task-requirement.md",
24
25
  "docs/templates/frontend-task-constraints.md",
@@ -104,30 +105,6 @@
104
105
  ".harness/prompts/analyze.md",
105
106
  ".harness/tasks",
106
107
  ".harness/dag-runs/active",
107
- "skills/agent-worker/SKILL.md",
108
- "skills/agent-worker/references/agent-worker-operator.md",
109
- "skills/loop-agent/SKILL.md",
110
- "skills/loop-agent/references/command-reference.md",
111
- "skills/loop-agent/references/docs-converge.md",
112
- "skills/ai-engineering-context/SKILL.md",
113
- "skills/verification-before-completion/SKILL.md",
114
- "skills/systematic-debugging/SKILL.md",
115
- "skills/requesting-code-review/SKILL.md",
116
- "skills/codebase-scout/SKILL.md",
117
- "skills/test-driven-development/SKILL.md",
118
- "skills/code-review-core/SKILL.md",
119
- "skills/init-capability-evolution/SKILL.md",
120
- "skills/webapp-testing/SKILL.md",
121
- "skills/frontend-implementation/SKILL.md",
122
- "skills/frontend-implementation/references/node-contracts.md",
123
- "skills/frontend-implementation/references/design-spec.md",
124
- "skills/frontend-implementation/references/code-standards.md",
125
- "skills/frontend-design-review/SKILL.md",
126
- "skills/frontend-design-review/references/review-checklist.md",
127
- "skills/frontend-review/SKILL.md",
128
- "skills/frontend-review/references/review-findings.md",
129
- "skills/frontend-verification/SKILL.md",
130
- "skills/frontend-verification/references/verification-checklist.md",
131
108
  ".agents/skills/agent-worker/SKILL.md",
132
109
  ".agents/skills/agent-worker/references/agent-worker-operator.md",
133
110
  ".agents/skills/loop-agent/SKILL.md",
@@ -141,7 +118,17 @@
141
118
  ".agents/skills/test-driven-development/SKILL.md",
142
119
  ".agents/skills/code-review-core/SKILL.md",
143
120
  ".agents/skills/init-capability-evolution/SKILL.md",
144
- ".agents/skills/webapp-testing/SKILL.md"
121
+ ".agents/skills/webapp-testing/SKILL.md",
122
+ ".agents/skills/frontend-implementation/SKILL.md",
123
+ ".agents/skills/frontend-implementation/references/node-contracts.md",
124
+ ".agents/skills/frontend-implementation/references/design-spec.md",
125
+ ".agents/skills/frontend-implementation/references/code-standards.md",
126
+ ".agents/skills/frontend-design-review/SKILL.md",
127
+ ".agents/skills/frontend-design-review/references/review-checklist.md",
128
+ ".agents/skills/frontend-review/SKILL.md",
129
+ ".agents/skills/frontend-review/references/review-findings.md",
130
+ ".agents/skills/frontend-verification/SKILL.md",
131
+ ".agents/skills/frontend-verification/references/verification-checklist.md"
145
132
  ],
146
133
  "initSurface": {
147
134
  "README.md": "managed-block",
@@ -182,30 +169,6 @@
182
169
  ".harness/tasks": "directory",
183
170
  ".harness/dag-runs/active": "directory",
184
171
  ".harness/init-surface.json": "state",
185
- "skills/agent-worker/SKILL.md": "copied",
186
- "skills/agent-worker/references/agent-worker-operator.md": "copied",
187
- "skills/loop-agent/SKILL.md": "copied",
188
- "skills/loop-agent/references/command-reference.md": "copied",
189
- "skills/loop-agent/references/docs-converge.md": "copied",
190
- "skills/ai-engineering-context/SKILL.md": "copied",
191
- "skills/verification-before-completion/SKILL.md": "copied",
192
- "skills/systematic-debugging/SKILL.md": "copied",
193
- "skills/requesting-code-review/SKILL.md": "copied",
194
- "skills/codebase-scout/SKILL.md": "copied",
195
- "skills/test-driven-development/SKILL.md": "copied",
196
- "skills/code-review-core/SKILL.md": "copied",
197
- "skills/init-capability-evolution/SKILL.md": "copied",
198
- "skills/webapp-testing/SKILL.md": "copied",
199
- "skills/frontend-implementation/SKILL.md": "copied",
200
- "skills/frontend-implementation/references/node-contracts.md": "copied",
201
- "skills/frontend-implementation/references/design-spec.md": "copied",
202
- "skills/frontend-implementation/references/code-standards.md": "copied",
203
- "skills/frontend-design-review/SKILL.md": "copied",
204
- "skills/frontend-design-review/references/review-checklist.md": "copied",
205
- "skills/frontend-review/SKILL.md": "copied",
206
- "skills/frontend-review/references/review-findings.md": "copied",
207
- "skills/frontend-verification/SKILL.md": "copied",
208
- "skills/frontend-verification/references/verification-checklist.md": "copied",
209
172
  ".agents/skills/agent-worker/SKILL.md": "copied",
210
173
  ".agents/skills/agent-worker/references/agent-worker-operator.md": "copied",
211
174
  ".agents/skills/loop-agent/SKILL.md": "copied",
@@ -219,7 +182,17 @@
219
182
  ".agents/skills/test-driven-development/SKILL.md": "copied",
220
183
  ".agents/skills/code-review-core/SKILL.md": "copied",
221
184
  ".agents/skills/init-capability-evolution/SKILL.md": "copied",
222
- ".agents/skills/webapp-testing/SKILL.md": "copied"
185
+ ".agents/skills/webapp-testing/SKILL.md": "copied",
186
+ ".agents/skills/frontend-implementation/SKILL.md": "copied",
187
+ ".agents/skills/frontend-implementation/references/node-contracts.md": "copied",
188
+ ".agents/skills/frontend-implementation/references/design-spec.md": "copied",
189
+ ".agents/skills/frontend-implementation/references/code-standards.md": "copied",
190
+ ".agents/skills/frontend-design-review/SKILL.md": "copied",
191
+ ".agents/skills/frontend-design-review/references/review-checklist.md": "copied",
192
+ ".agents/skills/frontend-review/SKILL.md": "copied",
193
+ ".agents/skills/frontend-review/references/review-findings.md": "copied",
194
+ ".agents/skills/frontend-verification/SKILL.md": "copied",
195
+ ".agents/skills/frontend-verification/references/verification-checklist.md": "copied"
223
196
  },
224
197
  "packageExcluded": [
225
198
  "docs/progress/20*.md",
@@ -16,16 +16,18 @@ loop-agent 提供结构化 agent 工作的本地 harness。
16
16
 
17
17
  - `skills/loop-agent/` — loop-agent 仓库自有的 skill 指令与参考资料
18
18
  - `skills/agent-worker/` — Feature Packet、TaskSpec、Task Pool、controller pinning、自举 candidate canary 与 Worker recovery 的可选 outer-loop operator skill;不是 DAG node skill
19
- - `skills/<skill-name>/` — DAG 模板引用的 skill 本地副本,含 supervised implementation 角色
19
+ - `.agents/skills/<skill-name>/` — 目标项目 repo-local skill 副本;`skills/<skill-name>/` 仍是 loop-agent 源仓库和 npm 包内置回退路径
20
20
  - 历史 `skill/` 不再是必需仓库路径;runtime 查找仅为 `loop-agent` 保留兼容 fallback
21
21
 
22
+ 目标项目若在 `.agents/skills/` 中提供 `SDD-requirement-analysis`、`SDD-design-analysis`、`SDD-implementation-test-review`,hybrid DAG 生成器会按节点追加对应 skill。该增强只复用 repo-local 知识与方法:loop-agent 仍拥有流程与状态控制权,embedded-mode 约束禁止 SDD 状态推进、确认门禁和归档;初始化/扫描类 SDD skill 不会自动执行。未命中时不会改变默认 DAG。命中的节点 skill 继续由同一 resolved instruction 和 run-owned snapshot 机制冻结,没有第二套 loader 或旁路。
23
+
22
24
  ## Package 资产
23
25
 
24
26
  npm 包包含运行与说明 harness 所需的静态能力资产:`bin/`、`dist/`、`skills/`(包括 `loop-agent` 与 `agent-worker`)、顶层 `docs/*.md`、`docs/templates/`、`examples/`、`harness.json`、`AGENTS.md`、`README.md`、`CHANGELOG.md`。
25
27
 
26
28
  生成或历史的 task facts 不是 package 资产。`docs/progress/`、`docs/reports/`、`docs/exec-plans/`、`docs/decisions/` 下现有文件属于目标仓库历史;包只携带这些目录的 README。
27
29
 
28
- 从 npm 安装 `loop-agent` 并在其他项目使用时,DAG skill 指令按配置、用户或目标本地 skill 目录解析(若存在),再回退到包内 `skills/`。目标项目可添加本地 skills,但不必复制 loop-agent 源码历史或 `skills/` 目录即可使用默认 DAG 工作流。
30
+ 从 npm 安装 `loop-agent` 并在其他项目使用时,DAG skill 指令按配置、用户或目标项目 `.agents/skills/` 解析(若存在),再回退到包内 `skills/`。目标项目可添加本地 skills,但不必复制 loop-agent 源码历史或根 `skills/` 目录即可使用默认 DAG 工作流。
29
31
 
30
32
  `scripts/self-host-canary.mjs` 是源码仓库维护脚本,不进入 npm package `files`;安装后的 package 不把它作为用户命令 surface。
31
33
 
@@ -64,12 +66,15 @@ DAG agent 节点的输出语言由 `harness.json.workflowPolicy.dag.outputLangua
64
66
 
65
67
  - `new-task`、`status`、`inspect`、`doctor`
66
68
  - `dag run-task`、`dag validate`、`run-dag`、`dag report`、`dag resume`、`dag reconcile-run`
69
+ - `plan list`、`plan create`、`plan complete`、`plan check`、`docs audit`、`docs archive`
67
70
  - `delegate`、`harvest`、`promote-run`、`closeout`
68
71
  - `loop init`、`loop run`、`loop status`、`loop closeout`
69
72
  - `pi-prompt`、`cursor-prompt`
70
- - `docs audit`、`handoff check`、`spine audit`、`knowledge curate`
73
+ - `handoff check`、`spine audit`、`knowledge curate`
71
74
  - `agent-worker feature review|run|verify-final|delivery|closeout|approve-followup`、`agent-worker task validate|explain-profile|retry|draft-followup`、`agent-worker batch run-ready`、`agent-worker report morning|metrics`、`agent-worker observe serve|snapshot`
72
75
 
76
+ `dag run-task` 在生成 DAG 草稿前会运行与 `plan check` 同源的 exec-plan 索引校验;active plan 与 `docs/exec-plans/active/README.md` 索引不一致时立即失败,避免运行昂贵节点后才在末端 shell verify 发现。`plan create` 优先复用目标项目模板并回退到发布包内置 `docs/templates/exec-plan.md`,`plan create`/`plan complete` 的多文件写入均有回滚保护;`new-task` 不自动绑定 exec-plan。
77
+
73
78
  ## Feature Review
74
79
 
75
80
  `agent-worker feature review --feature-dir <feature-dir> --repo <target-repo>` 是只读的 Feature 级决策入口。它复用 Feature Packet validation、task graph 和 `.harness/task-pool/` 事实,派生 `Draft`、`Ready`、`Running`、`NeedsAction`、`AwaitingQA`、`Deliverable`、`Closed`,同时展示 required AC 覆盖、阻塞、证据和唯一主行动。
@@ -6,18 +6,24 @@
6
6
 
7
7
  ## 近期要点(导读)
8
8
 
9
+ - [`2026-07-14-init-canonical-layout-handoff.md`](2026-07-14-init-canonical-layout-handoff.md) — 目标项目初始化布局迁移到 `ai_workspace/loop-agent/` 与 `.agents/skills/` 的跨会话交接
10
+ - [`2026-07-14-self-update-notifier-implementation.md`](2026-07-14-self-update-notifier-implementation.md) — loop-agent CLI 自更新提醒实现、TDD 验证和 bounded DAG fallback 交接
9
11
  - [`2026-07-14-docs-living-docs-calibration.md`](2026-07-14-docs-living-docs-calibration.md) — 活文档校准(Dynamic Workflow / 六个月 / ADR)
10
12
  - [`2026-07-14-docs-governance-hygiene.md`](2026-07-14-docs-governance-hygiene.md) — 文档治理与双树/索引收敛
11
13
  - [`2026-07-14-website-docs-ia-and-converge.md`](2026-07-14-website-docs-ia-and-converge.md) — Website 文档 IA 交接
14
+ - [`2026-07-13-sdd-embedded-skills.md`](2026-07-13-sdd-embedded-skills.md) — 目标项目 repo-local SDD skills 的可选 DAG 节点嵌入、验证与基线风险交接
12
15
  - [`2026-07-13-dev-controller-001-implementation.md`](2026-07-13-dev-controller-001-implementation.md) — controller identity 实施
13
16
  - [`2026-07-13-dev-snapshot-001-implementation.md`](2026-07-13-dev-snapshot-001-implementation.md) — skill snapshot 实施
14
17
  - [`2026-07-13-dev-canary-001-implementation.md`](2026-07-13-dev-canary-001-implementation.md) — candidate canary 实施
15
18
 
16
19
  ## 全量列表(新→旧)
17
20
 
21
+ - [`2026-07-14-init-canonical-layout-handoff.md`](2026-07-14-init-canonical-layout-handoff.md)
22
+ - [`2026-07-14-self-update-notifier-implementation.md`](2026-07-14-self-update-notifier-implementation.md)
18
23
  - [`2026-07-14-website-docs-ia-and-converge.md`](2026-07-14-website-docs-ia-and-converge.md)
19
24
  - [`2026-07-14-docs-living-docs-calibration.md`](2026-07-14-docs-living-docs-calibration.md)
20
25
  - [`2026-07-14-docs-governance-hygiene.md`](2026-07-14-docs-governance-hygiene.md)
26
+ - [`2026-07-13-sdd-embedded-skills.md`](2026-07-13-sdd-embedded-skills.md)
21
27
  - [`2026-07-13-dev-snapshot-001-implementation.md`](2026-07-13-dev-snapshot-001-implementation.md)
22
28
  - [`2026-07-13-dev-controller-001-implementation.md`](2026-07-13-dev-controller-001-implementation.md)
23
29
  - [`2026-07-13-dev-canary-001-implementation.md`](2026-07-13-dev-canary-001-implementation.md)
@@ -13,25 +13,35 @@
13
13
  ## 近期要点(导读,非权威全集)
14
14
 
15
15
  - [`current-capability-summary.md`](current-capability-summary.md) — **活**能力摘要(新进展写这里 / CHANGELOG / 新 report)
16
+ - [`2026-07-15-init-canonical-layout-init-evolution-review.md`](2026-07-15-init-canonical-layout-init-evolution-review.md) — init canonical layout、旧布局安全迁移和废弃 harness 字段清理审查
17
+ - [`2026-07-14-self-update-notifier-implementation.md`](2026-07-14-self-update-notifier-implementation.md) — loop-agent CLI 自更新提醒实现、DAG 边界、TDD 与 init surface 非影响证据
16
18
  - [`2026-07-14-docs-living-docs-calibration.md`](2026-07-14-docs-living-docs-calibration.md) — 活文档校准(Dynamic Workflow / 六个月 / analysis 冻结 / ADR)
17
19
  - [`2026-07-14-docs-governance-hygiene.md`](2026-07-14-docs-governance-hygiene.md) — 文档治理扫描与索引/双树收敛
18
20
  - [`2026-07-14-website-docs-ia-and-converge.md`](2026-07-14-website-docs-ia-and-converge.md) — Website IA 与 docs-converge 收口
21
+ - [`2026-07-13-sdd-embedded-skills.md`](2026-07-13-sdd-embedded-skills.md) — repo-local SDD skill 嵌入增强的 DAG、TDD、独立审查、验证和基线风险证据
19
22
  - [`2026-07-13-versioned-self-hosting-bootstrap.md`](2026-07-13-versioned-self-hosting-bootstrap.md) — 版本化自举证据
20
23
  - [`2026-07-12-m2-completion-audit.md`](2026-07-12-m2-completion-audit.md) — 第二月完成审计
21
24
  - [`2026-07-02-repository-analysis.md`](2026-07-02-repository-analysis.md) — **已冻结**仓库能力基线快照(勿再当 CHANGELOG)
22
25
 
23
26
  ## 全量列表(新→旧)
24
27
 
28
+ - [`2026-07-15-init-canonical-layout-init-evolution-review.md`](2026-07-15-init-canonical-layout-init-evolution-review.md)
25
29
  - [`dogfood-preflight-static-20260709090443.md`](dogfood-preflight-static-20260709090443.md)
26
30
  - [`current-capability-summary.md`](current-capability-summary.md)
27
31
  - [`2026-07-14-website-docs-ia-init-evolution-review.md`](2026-07-14-website-docs-ia-init-evolution-review.md)
28
32
  - [`2026-07-14-website-docs-ia-and-converge.md`](2026-07-14-website-docs-ia-and-converge.md)
33
+ - [`2026-07-14-self-update-notifier-implementation.md`](2026-07-14-self-update-notifier-implementation.md)
29
34
  - [`2026-07-14-docs-living-docs-calibration.md`](2026-07-14-docs-living-docs-calibration.md)
30
35
  - [`2026-07-14-docs-governance-hygiene.md`](2026-07-14-docs-governance-hygiene.md)
31
36
  - [`2026-07-13-versioned-self-hosting-init-evolution-review.md`](2026-07-13-versioned-self-hosting-init-evolution-review.md)
32
37
  - [`2026-07-13-versioned-self-hosting-bootstrap.md`](2026-07-13-versioned-self-hosting-bootstrap.md)
38
+ - [`2026-07-13-test-environment-stability.md`](2026-07-13-test-environment-stability.md)
39
+ - [`2026-07-13-sdd-embedded-skills-init-evolution-review.md`](2026-07-13-sdd-embedded-skills-init-evolution-review.md)
40
+ - [`2026-07-13-sdd-embedded-skills.md`](2026-07-13-sdd-embedded-skills.md)
33
41
  - [`2026-07-13-frontend-verification-command-safety-init-evolution-review.md`](2026-07-13-frontend-verification-command-safety-init-evolution-review.md)
34
42
  - [`2026-07-13-frontend-skill-contracts-init-evolution-review.md`](2026-07-13-frontend-skill-contracts-init-evolution-review.md)
43
+ - [`2026-07-13-exec-plan-lifecycle-init-evolution-review.md`](2026-07-13-exec-plan-lifecycle-init-evolution-review.md)
44
+ - [`2026-07-13-exec-plan-lifecycle.md`](2026-07-13-exec-plan-lifecycle.md)
35
45
  - [`2026-07-12-production-readiness-hardening.md`](2026-07-12-production-readiness-hardening.md)
36
46
  - [`2026-07-12-pi-only-agent-runtime-init-evolution-review.md`](2026-07-12-pi-only-agent-runtime-init-evolution-review.md)
37
47
  - [`2026-07-12-observe-warm-console-redesign.md`](2026-07-12-observe-warm-console-redesign.md)
@@ -1,9 +1,9 @@
1
1
  # 项目开工检查清单
2
2
 
3
3
  - [ ] 确认 `pwd`
4
- - [ ] 阅读 `README.md`、`harness.json`、`docs/README.md`
4
+ - [ ] 阅读 `README.md`、`harness.json`,以及 `harness.json.governanceRoot` 指向的 `README.md`
5
5
  - [ ] 检查 `git status --short --branch`
6
6
  - [ ] 确定单一工作块
7
- - [ ] `docs/verification-matrix.md` 选择验证命令
7
+ - [ ] 从治理根目录下的 `verification-matrix.md` 选择验证命令
8
8
  - [ ] 保留无关用户变更
9
9
  - [ ] 非平凡工作时记录 handoff 证据
package/harness.json CHANGED
@@ -12,8 +12,7 @@
12
12
  "minimal": "standard-dag",
13
13
  "standard": "standard-dag",
14
14
  "reviewed": "review-gated-dag",
15
- "supervised": "supervised-implementation",
16
- "backend-test": "backend-test-dag"
15
+ "supervised": "supervised-implementation"
17
16
  }
18
17
  },
19
18
  "humanGatePolicy": {
@@ -59,7 +58,6 @@
59
58
  "executors": {
60
59
  "pi": {
61
60
  "description": "Pi planning, review, diagnosis, and bounded writing when DAG toolProfile=write",
62
- "defaultModel": "gpt-5.3-codex-spark",
63
61
  "LOW": "gpt-5.3-codex-spark",
64
62
  "MED": "grok-4.5",
65
63
  "HIGH": "gpt-5.6-sol"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tea-agent/loop-agent",
3
- "version": "0.10.0-alpha.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "loop-agent": "bin/loop-agent.js",
@@ -40,7 +40,7 @@
40
40
  "smoke:stale-serial": "node --import tsx/esm scripts/smoke-stale-plan-serial.ts",
41
41
  "self-host:canary": "node scripts/self-host-canary.mjs"
42
42
  },
43
- "dependencies": { "commander": "^12.1.0", "yaml": "^2.9.0", "zod": "^3.25.76" },
43
+ "dependencies": { "commander": "^12.1.0", "semver": "^7.8.5", "yaml": "^2.9.0", "zod": "^3.25.76" },
44
44
  "optionalDependencies": { "@cursor/sdk": "^1.0.7", "@earendil-works/pi-ai": "*", "@earendil-works/pi-coding-agent": "*" },
45
- "devDependencies": { "@types/node": "^24.6.0", "tsx": "^4.20.6", "typescript": "^5.9.3", "vitest": "^3.2.4" }
45
+ "devDependencies": { "@types/node": "^24.6.0", "@types/semver": "^7.7.1", "tsx": "^4.20.6", "typescript": "^5.9.3", "vitest": "^3.2.4" }
46
46
  }
@@ -5,10 +5,13 @@ description: >-
5
5
  references:
6
6
  - path: references/node-contracts.md
7
7
  required: true
8
+ maxChars: 3000
8
9
  - path: references/design-spec.md
9
10
  required: true
11
+ maxChars: 3000
10
12
  - path: references/code-standards.md
11
13
  required: true
14
+ maxChars: 3000
12
15
  ---
13
16
 
14
17
  # Frontend Implementation
@@ -303,6 +303,9 @@ loop-agent status <task-id>
303
303
  loop-agent docs audit
304
304
  loop-agent docs archive docs/exec-plans/active/<plan>.md
305
305
  loop-agent plan list
306
+ loop-agent plan create <plan-id> "<title>"
307
+ loop-agent plan complete <plan-id> --summary "<summary>"
308
+ loop-agent plan check
306
309
  loop-agent handoff check [task-id]
307
310
  loop-agent handoff coverage <task-id> [--json|--markdown]
308
311
  ```
@@ -310,6 +313,9 @@ loop-agent handoff coverage <task-id> [--json|--markdown]
310
313
  - `docs audit`:扫描文档腐化风险,如 active/completed 漂移、失效链接、host-gap closeout
311
314
  - `docs archive`:将 active plan 迁入 completed,并自动重写常见 markdown 引用
312
315
  - `plan list`:列出当前 active plans 及其解析状态
316
+ - `plan create`:优先从目标项目模板创建 active exec-plan,不存在时回退发布包内置模板;同步 `active/README.md`,拒绝重复 id、不安全文件名,失败时回滚
317
+ - `plan complete`:将 active exec-plan 标记完成、迁入 completed、追加 `--summary` 并同步 active/completed 索引;失败时回滚所有已触碰文件
318
+ - `plan check`:确定性校验 exec-plan 目录与索引之间的 missing、stale、duplicate、status mismatch;发现问题时输出 JSON 并以非零状态失败
313
319
  - `handoff check`:检查任务 source / artifacts / auto-commit scope 是否满足交付闭环
314
320
  - `handoff coverage`:从 `source/需求.md` 抽取 checklist / numbered / `REQ-*` 项并输出 coverage audit;未覆盖项 exit 1;`explicitly_out_of_scope` 不计为缺口
315
321
 
@@ -1,9 +1,9 @@
1
- # Docs Converge(文档收敛)
1
+ # Docs Converge(文档收敛)
2
2
 
3
- 本 reference 把会话协议中的 **Converge Docs** 落成可执行检查表。
3
+ 本 reference 把会话协议中的 **Converge Docs** 落成可执行检查表。
4
4
  定位是**收敛 / 同步**,不是「每次重新 invent 文档大纲」。
5
5
 
6
- 权威规划:`docs/exec-plans/completed/2026-07-14-website-docs-ia-and-converge.md`。
6
+ 权威规划:`docs/exec-plans/completed/2026-07-14-website-docs-ia-and-converge.md`。
7
7
  站与治理双树边界:`website/README.md`。
8
8
 
9
9
  ## 何时触发
@@ -61,8 +61,8 @@
61
61
  跨树链接规则:
62
62
 
63
63
  - 站内页面用 Docusaurus 相对文档链接。
64
- - 链到根目录 `docs/`、`AGENTS.md`、`CHANGELOG.md` 等时,使用
65
- `https://github.com/tea-agent/loop-agent/blob/main/<repo-path>`,
64
+ - 链到根目录 `docs/`、`AGENTS.md`、`CHANGELOG.md` 等时,使用
65
+ `https://github.com/tea-agent/loop-agent/blob/main/<repo-path>`,
66
66
  正文同时写出 repo-relative path;禁止伪造站内 `/docs/architecture/...` 作为根目录文档路由。
67
67
 
68
68
  ## 执行步骤(最小闭环)
@@ -77,7 +77,7 @@ loop-agent --repo-root /path/to/target-repo <command>
77
77
 
78
78
  ## Verification
79
79
 
80
- 完成声明必须来自新鲜验证证据。按目标 repo 的 `docs/verification-matrix.md` 选择最小证明命令;loop-agent 自身常用:
80
+ 完成声明必须来自新鲜验证证据。按目标 repo 的 `harness.json.governanceRoot` 下 `verification-matrix.md` 选择最小证明命令;loop-agent 自身常用:
81
81
 
82
82
  ```bash
83
83
  npm run typecheck
@@ -1,131 +0,0 @@
1
- # Backend Test DAG Generate Pytest Prompt Template
2
-
3
- ## Purpose
4
-
5
- Use this prompt for a **pytest code generation** node: `executor: "pi"`, `role: "implementer"`, `toolProfile: "write"`, `writePolicy: "exclusive"`. The implementer converts reviewed backend functional test cases into pytest automation code with 1:1 traceability.
6
-
7
- Do **not** create a new executor type. This is a standard `executor: pi` writer node.
8
-
9
- ## Recommended DAG Node Shape
10
-
11
- ```json
12
- {
13
- "id": "generate-backend-pytest-pi",
14
- "depends_on": ["review-backend-cases-pi"],
15
- "complexity": "HIGH",
16
- "executor": "pi",
17
- "role": "implementer",
18
- "toolProfile": "write",
19
- "writePolicy": "exclusive",
20
- "writeSet": ["testcase/**"],
21
- "allowedPaths": ["testcase/**"],
22
- "forbiddenPaths": [".harness/**", "artifacts/**"],
23
- "outputContract": "Pytest test files under tests/backend/ with 1:1 mapping to functional test case IDs. Summary lists generated files, test function count, and any skipped cases with reasons.",
24
- "subtask_prompt_markdown": "./backend-test-dag.generate-pytest.prompt.md"
25
- }
26
- ```
27
-
28
- ## Prompt Body
29
-
30
- You are the Backend Test DAG **pytest code generator**.
31
-
32
- Your job is to convert reviewed backend functional test cases into pytest automation code. You are an implementer — write test files under `tests/backend/` only. Stay within `writeSet`. Do not write root `artifacts/**`.
33
-
34
- ### Mandatory First Line
35
-
36
- The **first non-empty line** of your response must be a summary line:
37
-
38
- ```
39
- Generated N pytest functions across M files under tests/backend/.
40
- ```
41
-
42
- ### Inputs
43
-
44
- 1. **Reviewed test cases** — files under `testcase/md/` (approved by `review-backend-cases-pi` with `VERDICT: pass`).
45
- 2. **Source references** — `source/references/` for API specs, data models, database schemas.
46
- 3. **Target project conventions** — inspect `conftest.py`, `pytest.ini` / `pyproject.toml` pytest config, fixture patterns, existing test structure.
47
-
48
- ### Conversion Rules
49
-
50
- #### File Naming
51
-
52
- - Every test file must start with `test_` prefix (e.g. `test_order.py`, `test_user_api.py`)
53
- - pytest collects tests from files matching `test_*.py` or `*_test.py` — use `test_` prefix exclusively
54
- - Never create test files without the `test_` prefix
55
-
56
- #### Write Boundary
57
-
58
- - Only **create new** test script files under `testcase/`
59
- - Do NOT modify existing files: `conftest.py`, `pytest.ini`, `pyproject.toml`, `setup.cfg`, `__init__.py`, or any other framework/config file
60
- - If the project needs new fixtures, create them in new files (e.g. `testcase/conftest.py` if it does not exist), never edit existing ones
61
- - Read existing framework files to understand conventions, but treat them as immutable
62
-
63
- #### Naming Conflict Resolution
64
-
65
- - If a file with the target name already exists under `testcase/`, add a numeric suffix: `test_order.py` → `test_order_01.py` → `test_order_02.py`
66
- - Never overwrite or append to existing files — each test script must be a standalone file
67
- - Check for existing files before writing; if `test_<module>.py` exists, use `test_<module>_01.py`
68
-
69
- #### 1:1 Traceability
70
-
71
- Every functional test case ID (`BE-<MODULE>-<NNN>`) must map to exactly one pytest function:
72
-
73
- ```python
74
- # test-cases/backend/BE-ORDER-001 → tests/backend/test_order.py
75
- def test_BE_ORDER_001_create_order_with_valid_data():
76
- """BE-ORDER-001: Create order with valid request body."""
77
- ...
78
- ```
79
-
80
- - Function name: `test_<CASE_ID_with_underscores>` (e.g. `test_BE_ORDER_001_...`)
81
- - Docstring first line: `<CASE_ID>: <Case Title>`
82
-
83
- #### File Organization
84
-
85
- - All test files go under `testcase/` directory in the host project root
86
- - Group test files by MODULE segment: `BE-ORDER-*` → `testcase/test_order.py`, `BE-USER-*` → `testcase/test_user.py`
87
- - Follow existing project conventions for import style, fixture scope
88
-
89
- #### Fixture Strategy
90
-
91
- - Reuse existing project fixtures from `conftest.py` when available
92
- - Create new fixtures only when test data setup is complex or shared across cases
93
- - Prefer `@pytest.fixture(scope="function")` for test isolation
94
- - Use `@pytest.mark.parametrize` for boundary condition cases with multiple inputs
95
-
96
- #### Test Integrity
97
-
98
- - Tests verify implementation correctness — if a test fails, the implementation likely has a bug, not the test
99
- - Do NOT weaken assertions, remove test cases, or modify test logic to make tests pass
100
- - Do NOT add workarounds, skips, or try/except blocks to hide failures without explicit justification
101
- - Report all failures honestly in the output; the downstream `execute-backend-pytest-shell` node captures exit codes and stdout/stderr as-is
102
-
103
- #### Assertions
104
-
105
- - Use `assert` statements, not `unittest` assertions
106
- - Assert specific values, not just "no exception"
107
- - For API tests: assert status code, response body keys, and specific field values
108
- - For database tests: assert record state after operation
109
-
110
- #### Markers
111
-
112
- - `@pytest.mark.positive` — happy path cases
113
- - `@pytest.mark.negative` — error/exception cases
114
- - `@pytest.mark.boundary` — edge cases
115
- - `@pytest.mark.<MODULE>` — module-specific marker (e.g. `@pytest.mark.order`)
116
-
117
- #### Skip Policy
118
-
119
- If a test case cannot be automated (requires external service not mockable, requires manual verification), add it with `@pytest.mark.skip(reason="...")` and document the reason. Do not omit the function — traceability requires it exists.
120
-
121
- ### Output Shape (after summary line)
122
-
123
- After the mandatory summary line, provide:
124
-
125
- 1. **Generated Files** — list of files written under `tests/backend/`.
126
- 2. **Function Mapping Table** — `| Test Case ID | Pytest Function | File | Marker |`.
127
- 3. **Skipped Cases** — if any, list with reason.
128
- 4. **Conventions Observed** — note project fixtures/config discovered and followed.
129
- 5. **Residual Risks** — cases that may need manual verification or environment setup.
130
-
131
- Do not include chain-of-thought. Do not write root `artifacts/**`.