@tea-agent/loop-agent 0.22.0 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/AGENTS.md +42 -108
  2. package/CHANGELOG.md +68 -0
  3. package/README.md +7 -4
  4. package/dist/application/context-usage/skill-resolution-stats.js +263 -0
  5. package/dist/application/dag/generate-task-dag.js +17 -3
  6. package/dist/cli/command-definitions.js +8 -7
  7. package/dist/cli/program.js +17 -15
  8. package/dist/commands/doctor.js +269 -18
  9. package/dist/commands/init.js +101 -86
  10. package/dist/commands/stats.js +40 -11
  11. package/dist/shared/operator/capabilities.js +11 -1
  12. package/dist/worker/console/app-data.js +4 -0
  13. package/dist/worker/console/chat/instruction-skills.js +217 -0
  14. package/dist/worker/console/chat/model-resolver.js +106 -0
  15. package/dist/worker/console/chat/pi-runtime.js +605 -0
  16. package/dist/worker/console/chat/resource-loader.js +66 -0
  17. package/dist/worker/console/chat/routes.js +357 -0
  18. package/dist/worker/console/chat/session-store.js +238 -0
  19. package/dist/worker/console/chat/tool-adapter.js +238 -0
  20. package/dist/worker/console/chat/tools.js +171 -0
  21. package/dist/worker/console/server.js +55 -0
  22. package/dist/worker/console/static/assets/index-DVl7Jxt5.js +25 -0
  23. package/dist/worker/console/static/assets/index-lVcIr9Ju.css +1 -0
  24. package/dist/worker/console/static/index.html +2 -2
  25. package/dist/worker/feature/profile-schema.js +1 -1
  26. package/dist/workflows/dag/init-hybrid.js +69 -21
  27. package/dist/workflows/dag/node-execution.js +38 -1
  28. package/dist/workflows/dag/output-protocol.js +89 -0
  29. package/dist/workflows/dag/prompt.js +35 -1
  30. package/dist/workflows/dag/recovery-recommendation.js +45 -0
  31. package/dist/workflows/dag/report.js +28 -1
  32. package/dist/workflows/dag/rerun-task.js +1 -1
  33. package/dist/workflows/dag/scheduler.js +9 -0
  34. package/dist/workflows/dag/types.js +12 -0
  35. package/dist/workflows/dag/validate.js +55 -0
  36. package/docs/README.md +73 -156
  37. package/docs/architecture/README.md +3 -2
  38. package/docs/architecture/dag-execution.md +2 -2
  39. package/docs/architecture/evolution.md +14 -12
  40. package/docs/architecture/system-overview.md +1 -1
  41. package/docs/architecture/worker-and-feature.md +3 -3
  42. package/docs/governance/README.md +15 -0
  43. package/docs/{harness-methodology-debugging.md → governance/harness-methodology-debugging.md} +27 -3
  44. package/docs/init-surface.manifest.json +22 -4
  45. package/docs/operations/README.md +12 -0
  46. package/docs/{local-development-environment.md → operations/local-development-environment.md} +1 -1
  47. package/docs/skills/vetted-skill-registry.md +23 -3
  48. package/docs/templates/README.md +55 -0
  49. package/docs/templates/evaluation/agents-map-slim-v1.candidate.json +9 -0
  50. package/docs/templates/evaluation/agents-map-slim-v1.md +87 -0
  51. package/docs/templates/evaluation/agents-map-verbose-v0.candidate.json +9 -0
  52. package/docs/templates/evaluation/agents-map-verbose-v0.md +153 -0
  53. package/docs/templates/hybrid-dag.json +1 -1
  54. package/docs/templates/progress-log.md +9 -2
  55. package/harness.json +5 -5
  56. package/package.json +5 -5
  57. package/scripts/kb-bootstrap-init-skeleton.sh +2 -2
  58. package/skills/agent-worker/SKILL.md +1 -1
  59. package/skills/grill-with-docs/SKILL.md +44 -52
  60. package/skills/grill-with-docs/adr-format.md +37 -26
  61. package/skills/grill-with-docs/context-format.md +18 -26
  62. package/skills/loop-agent/SKILL.md +28 -112
  63. package/skills/loop-agent/references/command-reference.md +9 -3
  64. package/skills/loop-agent/references/harness-policy.md +3 -3
  65. package/skills/loop-agent/references/hybrid-dag.md +1 -1
  66. package/skills/loop-agent/references/orchestrator-and-interventions.md +1 -1
  67. package/skills/loop-agent/references/task-workflow.md +2 -0
  68. package/skills/systematic-debugging/SKILL.md +20 -4
  69. package/skills/test-driven-development/SKILL.md +10 -3
  70. package/dist/worker/console/static/assets/index-CUDke82y.js +0 -18
  71. package/dist/worker/console/static/assets/index-wSEksVSO.css +0 -1
  72. /package/docs/{harness-methodology-tdd.md → governance/harness-methodology-tdd.md} +0 -0
  73. /package/docs/{harness-methodology-verification.md → governance/harness-methodology-verification.md} +0 -0
@@ -64,7 +64,7 @@ workflow runtime(调度 Pi / shell / static 节点)
64
64
  - `agent-worker console serve|doctor` 提供 loopback Operator Console(默认 `127.0.0.1:8790`);Happy Path / Interview 策略面、Task Contract 落地与 recovery CTA 已随 **0.17.0–0.17.2** 发布。
65
65
  - canonical mutation 只经 sibling 已发布 `loop-agent`(`LoopAgentClient`),不 in-process 跑 DAG kernel。
66
66
  - Observe 保持**独立**只读进程(默认 `8787`);Console 通过 versioned Observe `/api/health`(`schemaVersion`、`repoFingerprint`、route capabilities)做深链 fail-closed,**不** mount / proxy。
67
- - openCode 等主会话仍是 Compatibility / Operator Assist,与 Official Console **不等同**。设计锚点:ADR 0005、`docs/design/local-operator-console-from-pi-web.md`;handoff `docs/reports/feature/2026-07-22-console-mvp-handoff.md`。
67
+ - openCode 等主会话仍是 Compatibility / Operator Assist,与 Official Console **不等同**。设计锚点:ADR 0005、`docs/design/active/local-operator-console-from-pi-web.md`;handoff `docs/reports/feature/2026-07-22-console-mvp-handoff.md`。
68
68
 
69
69
  ## 外部边界
70
70
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  本页说明 `agent-worker` 如何通过冻结的已发布 `loop-agent` 子进程执行 DAG(不 in-process import runtime kernel),以及其上的产品线 read model:TaskSpec、Task Pool、Feature 与统一 Operator Console(Operate + Inspect)。边界契约权威是 `runtime-boundaries.md` §Worker adapter。
4
4
 
5
- **维护校准:2026-07-22 / `@tea-agent/loop-agent@0.18.0`** — 统一 Operator Console(Operate + Inspect)已落地;细节以 `CHANGELOG.md` active unify plan 为准。
5
+ **维护校准:2026-07-25 / `@tea-agent/loop-agent@0.23.1`** — 统一 Operator Console(Operate + Inspect)、恢复操作面与自适应 liveness 已落地;细节以 `CHANGELOG.md` 与对应 active/completed plan 为准。
6
6
 
7
7
  ## 核心事实:子进程,非 in-process
8
8
 
@@ -25,7 +25,7 @@
25
25
  - 显式 `worker.timeout_ms` → hard kill(可 capped),观察到 exit 后可报 `timedOut`。
26
26
  - 客户端 `onHeartbeat` 仍是监管心跳,不等于 Pi meaningful progress。
27
27
 
28
- 设计真源:`docs/design/dag-adaptive-liveness-and-supervision.md`。
28
+ 设计真源:`docs/design/active/dag-adaptive-liveness-and-supervision.md`。
29
29
 
30
30
  ## controller identity(冻结的已发布 controller)
31
31
 
@@ -62,7 +62,7 @@ controller identity 与 DAG skill snapshot 是两个不同冻结层(前者跨
62
62
  - schema/validate:`src/worker/task-spec/{schema,validate}.ts`。
63
63
  - 校验验收条件、依赖、验证命令;`agent-worker task validate-feature` 等用之。
64
64
  - **0.16.0+**:可选 `execution.workflow` 映射到 loop-agent `taskKind`(如 agent-dag / frontend-implementation / backend-test / frontend-test);typed Task Outcome 与 artifact-aware Ready 门禁见 completed `2026-07-19-taskspec-workflow-routing.md`。
65
- - 文档映射镜像:`docs/design/taskspec-to-loop-agent-mapping.md`(runtime 真源仍在 `src/worker/` 与 materialize 路径)。
65
+ - 文档映射镜像:`docs/design/active/taskspec-to-loop-agent-mapping.md`(runtime 真源仍在 `src/worker/` 与 materialize 路径)。
66
66
 
67
67
  ### Task Pool
68
68
 
@@ -0,0 +1,15 @@
1
+ # 工程治理
2
+
3
+ 这里放的是“怎么推进一次工作”的长期规则。开始实现前先读工作流,需要选择验证命令时再看验证矩阵;三份方法论文档用于测试、完成声明和故障排查。
4
+
5
+ ## 入口
6
+
7
+ - [`development-principles.md`](development-principles.md):工程原则与完成纪律。
8
+ - [`feature-workflow.md`](feature-workflow.md):会话治理、taskKind、profile 与 Agent DAG 路径。
9
+ - [`verification-matrix.md`](verification-matrix.md):按变更类型选择验证命令。
10
+ - [`harness-methodology-tdd.md`](harness-methodology-tdd.md):测试先行的方法与边界。
11
+ - [`harness-methodology-verification.md`](harness-methodology-verification.md):如何用新鲜命令结果支持完成声明。
12
+ - [`harness-methodology-debugging.md`](harness-methodology-debugging.md):系统化定位故障,不用猜测代替证据。
13
+ - [`document-review-policy.md`](document-review-policy.md):文档 freshness、`reviewTier` 与 `lastReviewed` 更新边界。
14
+
15
+ 架构事实见 [`../architecture/README.md`](../architecture/README.md),运行手册见 [`../runtime/README.md`](../runtime/README.md),日常维护操作见 [`../operations/README.md`](../operations/README.md)。
@@ -10,6 +10,27 @@ NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
10
10
 
11
11
  没有完成 Phase 1(根因调查),就不能提出任何修复方案。修症状 = 失败。
12
12
 
13
+ ## 前置:构建反馈回路(Phase 1 的地基)
14
+
15
+ 在读代码猜原因、列假设或动手修复之前,先建立一条**快速、确定性、Agent 可运行**的 pass/fail 信号。后续复现、假设、插桩和修复都消费这条回路,而不是依赖聊天里的印象。
16
+
17
+ 按优先级选用(能用更靠前的就不要降级):
18
+
19
+ 1. 失败测试(已有或最小新增)
20
+ 2. HTTP / API 脚本(固定输入 → 断言状态码或响应)
21
+ 3. CLI fixture / snapshot
22
+ 4. 浏览器脚本(确定性交互 + 断言)
23
+ 5. Trace / log replay
24
+ 6. 一次性本地 harness(最小复现命令)
25
+ 7. Property / fuzz(非确定性边界)
26
+ 8. `git bisect run`(回归定位)
27
+ 9. 新旧版本 differential
28
+ 10. 结构化 HITL 脚本(仅当自动化回路不可得,且人工步骤可重复)
29
+
30
+ 把回路本身当作产品优化:更快、更锋利、更确定性。间歇性问题先提高复现率,再进入根因调查。
31
+
32
+ **不能建立回路时:停下。** 请求缺失的环境、artifact、凭据或临时插桩许可;不要在没有 pass/fail 信号时继续猜。
33
+
13
34
  ## 何时使用
14
35
 
15
36
  适用于任何技术问题:
@@ -28,7 +49,7 @@ NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
28
49
 
29
50
  ## 四阶段流程
30
51
 
31
- 每个阶段必须完成才能进入下一个。
52
+ 每个阶段必须完成才能进入下一个。反馈回路是 Phase 1 的地基,不是第五阶段。
32
53
 
33
54
  ### Phase 1:根因调查
34
55
 
@@ -113,6 +134,7 @@ NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
113
134
  ## Red Flags:停止并回到 Phase 1
114
135
 
115
136
  如果你发现自己这样想:
137
+ - "没有 pass/fail 回路,先读代码猜原因"
116
138
  - "先快速修一下,后面再调查"
117
139
  - "试试改 X 看看行不行"
118
140
  - "一次改多个东西然后跑测试"
@@ -121,13 +143,14 @@ NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
121
143
  - "不太确定但可能有用"
122
144
  - "再试一个修复"(已经试了 2+ 次)
123
145
 
124
- **以上任何一种 → 停止。回到 Phase 1。**
146
+ **以上任何一种 → 停止。回到反馈回路 / Phase 1。**
125
147
 
126
148
  ## 和 Harness 工作流的对齐
127
149
 
128
150
  | 调试阶段 | Harness 步骤 |
129
151
  |---------|-------------|
130
- | Phase 1:根因调查 | Baseline:先验证当前基线,确认 bug 是可复现的 |
152
+ | 反馈回路 | Baseline / Reproduction evidence:先有可重复的 pass/fail 信号 |
153
+ | Phase 1:根因调查 | Baseline:确认 bug 可复现,并收集证据 |
131
154
  | Phase 2:模式分析 | Orient:读相关代码、文档、测试,找参考 |
132
155
  | Phase 3:假设测试 | Contract:写清修复假设和验证方法 |
133
156
  | Phase 4:实现 | Implement → Verify(TDD:先写失败测试) |
@@ -137,6 +160,7 @@ NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
137
160
 
138
161
  | 阶段 | 关键活动 | 成功标准 |
139
162
  |------|---------|---------|
163
+ | 0. 反馈回路 | 建立快速确定性 pass/fail 信号 | 有可重复命令与退出码 |
140
164
  | 1. 根因 | 读错误、复现、查变更、收集证据 | 理解 WHAT 和 WHY |
141
165
  | 2. 模式 | 找工作中的例子、对比 | 识别差异 |
142
166
  | 3. 假设 | 形成理论、最小测试 | 确认或新假设 |
@@ -8,10 +8,10 @@
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",
14
- "docs/local-development-environment.md",
11
+ "docs/governance/harness-methodology-tdd.md",
12
+ "docs/governance/harness-methodology-verification.md",
13
+ "docs/governance/harness-methodology-debugging.md",
14
+ "docs/operations/local-development-environment.md",
15
15
  "docs/init-surface.manifest.json",
16
16
  "docs/architecture/runtime-boundaries.md",
17
17
  "docs/architecture/README.md",
@@ -22,6 +22,7 @@
22
22
  "docs/architecture/evolution.md",
23
23
  "docs/skills/README.md",
24
24
  "docs/skills/vetted-skill-registry.md",
25
+ "docs/templates/README.md",
25
26
  "docs/templates/init-evolution-review.md",
26
27
  "docs/templates/exec-plan.md",
27
28
  "docs/templates/production-readiness-checklist.md",
@@ -63,6 +64,9 @@
63
64
  "skills/test-driven-development/SKILL.md",
64
65
  "skills/code-review-core/SKILL.md",
65
66
  "skills/init-capability-evolution/SKILL.md",
67
+ "skills/grill-with-docs/SKILL.md",
68
+ "skills/grill-with-docs/context-format.md",
69
+ "skills/grill-with-docs/adr-format.md",
66
70
  "skills/webapp-testing/SKILL.md",
67
71
  "skills/playwright-cli/SKILL.md",
68
72
  "skills/playwright-cli-case-generator/SKILL.md",
@@ -91,6 +95,10 @@
91
95
  "docs/feature-workflow.md",
92
96
  "docs/verification-matrix.md",
93
97
  "docs/loop-agent-harness.md",
98
+ "docs/harness-methodology-tdd.md",
99
+ "docs/harness-methodology-verification.md",
100
+ "docs/harness-methodology-debugging.md",
101
+ "docs/templates/README.md",
94
102
  "docs/templates/init-evolution-review.md",
95
103
  "docs/templates/production-readiness-checklist.md",
96
104
  "docs/templates/frontend-task-requirement.md",
@@ -133,6 +141,9 @@
133
141
  ".agents/skills/test-driven-development/SKILL.md",
134
142
  ".agents/skills/code-review-core/SKILL.md",
135
143
  ".agents/skills/init-capability-evolution/SKILL.md",
144
+ ".agents/skills/grill-with-docs/SKILL.md",
145
+ ".agents/skills/grill-with-docs/context-format.md",
146
+ ".agents/skills/grill-with-docs/adr-format.md",
136
147
  ".agents/skills/webapp-testing/SKILL.md",
137
148
  ".agents/skills/playwright-cli/SKILL.md",
138
149
  ".agents/skills/playwright-cli-case-generator/SKILL.md",
@@ -161,6 +172,10 @@
161
172
  "docs/feature-workflow.md": "generated",
162
173
  "docs/verification-matrix.md": "generated",
163
174
  "docs/loop-agent-harness.md": "generated",
175
+ "docs/harness-methodology-tdd.md": "copied",
176
+ "docs/harness-methodology-verification.md": "copied",
177
+ "docs/harness-methodology-debugging.md": "copied",
178
+ "docs/templates/README.md": "copied",
164
179
  "docs/templates/init-evolution-review.md": "copied",
165
180
  "docs/templates/production-readiness-checklist.md": "copied",
166
181
  "docs/templates/frontend-task-requirement.md": "copied",
@@ -204,6 +219,9 @@
204
219
  ".agents/skills/test-driven-development/SKILL.md": "copied",
205
220
  ".agents/skills/code-review-core/SKILL.md": "copied",
206
221
  ".agents/skills/init-capability-evolution/SKILL.md": "copied",
222
+ ".agents/skills/grill-with-docs/SKILL.md": "copied",
223
+ ".agents/skills/grill-with-docs/context-format.md": "copied",
224
+ ".agents/skills/grill-with-docs/adr-format.md": "copied",
207
225
  ".agents/skills/webapp-testing/SKILL.md": "copied",
208
226
  ".agents/skills/playwright-cli/SKILL.md": "copied",
209
227
  ".agents/skills/playwright-cli-case-generator/SKILL.md": "copied",
@@ -0,0 +1,12 @@
1
+ # 维护与协作
2
+
3
+ 这里收录维护仓库时会直接照着执行的操作手册。
4
+
5
+ ## 入口
6
+
7
+ - [`local-development-environment.md`](local-development-environment.md):本地环境、Windows 差异和常见排障。
8
+ - [`branch-merge-guideline.md`](branch-merge-guideline.md):按风险选择合并模式并留下 source-SHA 证据。
9
+ - [`github-collaboration.md`](github-collaboration.md):仓库内 GitHub 协作约定。
10
+ - [`production-readiness.md`](production-readiness.md):交付前的生产就绪判断。
11
+
12
+ 验证命令仍以 [`../governance/verification-matrix.md`](../governance/verification-matrix.md) 为准。
@@ -1,6 +1,6 @@
1
1
  # 本地开发环境排障
2
2
 
3
- 本文记录仅与特定开发环境有关、但可能反复影响验证结果的问题。它不是通用工程规则;标准验证命令仍以 [`verification-matrix.md`](verification-matrix.md) 为准。
3
+ 本文记录仅与特定开发环境有关、但可能反复影响验证结果的问题。它不是通用工程规则;标准验证命令仍以 [`verification-matrix.md`](../governance/verification-matrix.md) 为准。
4
4
 
5
5
  ## Cursor Cloud
6
6
 
@@ -7,23 +7,43 @@ The entries below are local wrappers or existing local skills. They are not whol
7
7
  | Skill | Source / Inspiration | Local Path | Supported Roles | Default Use | Risk Notes |
8
8
  |---|---|---|---|---|---|
9
9
  | `ai-engineering-context` | local existing | `skills/ai-engineering-context/SKILL.md` | scout, default context | default/scout | Read-only engineering context; not a private platform memory skill. |
10
- | `loop-agent` | local existing | `skills/loop-agent/SKILL.md` | planner, supervisor, closeout | planner/closeout | Long references may be resolved by strict audit with expanded budget; executor behavior unchanged. |
10
+ | `loop-agent` | local existing | `skills/loop-agent/SKILL.md` | planner, supervisor, closeout | planner/closeout | Entry 紧凑在 `perSkillMaxChars=3000` 以内;3 required refs 在默认 baseline-v1 budget 下完整 resolved。`command-reference.md` 降级为按需 reference(路由表仍列出),不默认常驻每个 DAG node。 |
11
11
  | `agent-worker` | local operator skill | `skills/agent-worker/SKILL.md` | outer-loop operator only | never a default DAG role | Routes Feature Packet, TaskSpec, Task Pool, controller pinning, self-hosting canary, and failure recovery. Must not launch recursively from DAG leaves or duplicate executor/kernel behavior. |
12
12
  | `verification-before-completion` | local wrapper inspired by verification discipline | `skills/verification-before-completion/SKILL.md` | implementer, verifier, closeout | implementer/verifier/closeout | Requires shell evidence before completion claims. |
13
- | `systematic-debugging` | local wrapper inspired by systematic debugging discipline | `skills/systematic-debugging/SKILL.md` | implementer, verifier | verifier | Advisory prompt guidance only; does not run tools by itself. |
13
+ | `systematic-debugging` | local wrapper inspired by systematic debugging discipline + feedback-loop-first gate | `skills/systematic-debugging/SKILL.md` | implementer, verifier | verifier | Advisory prompt guidance only; does not run tools by itself. Requires pass/fail loop before root-cause guessing; verifier must not cross writer boundaries. |
14
14
  | `requesting-code-review` | local existing | `skills/requesting-code-review/SKILL.md` | reviewer | reviewer | Review prompt guidance only. |
15
- | `test-driven-development` | local wrapper inspired by TDD practice | `skills/test-driven-development/SKILL.md` | implementer | implementer | Does not force tests in mechanical-only docs changes; implementer still follows task contract. |
15
+ | `test-driven-development` | local wrapper inspired by TDD practice + vertical one-test-one-impl cycle | `skills/test-driven-development/SKILL.md` | implementer | implementer | Does not force tests in mechanical-only docs changes; implementer still follows task contract. Forbids batch-all-RED-then-all-GREEN. |
16
16
  | `code-review-core` | local wrapper inspired by code review practice | `skills/code-review-core/SKILL.md` | reviewer | reviewer | No external tools or network by default. |
17
17
  | `codebase-scout` | local wrapper | `skills/codebase-scout/SKILL.md` | scout | scout | Read-only reconnaissance guidance. |
18
18
  | `init-capability-evolution` | local wrapper | `skills/init-capability-evolution/SKILL.md` | supervisor, maintenance | optional | Used only when changes may affect target-project initialization, package surface, or init projection rules. |
19
+ | `grill-with-docs` | local operator skill adapted from domain grilling + ADR/glossary discipline | `skills/grill-with-docs/SKILL.md` | explicit interactive operator only | never a default DAG role | Resolves decisions via `harness.json.governanceRoot`; required refs `context-format.md` / `adr-format.md`; respects writeSet; not in `DEFAULT_SKILLS_BY_ROLE`. |
19
20
  | `webapp-testing` | local wrapper inspired by frontend/browser testing practice | `skills/webapp-testing/SKILL.md` | verifier, reviewer | optional | Only applies when task explicitly involves browser-rendered behavior; no default Playwright/Semgrep execution. |
20
21
  | `playwright-cli` | repo-local Playwright CLI instructions | `skills/playwright-cli/SKILL.md` | FE-test case executor | FE-test only | Direct browser commands require isolated test environments, per-case evidence paths, and explicit credential/data handling. |
21
22
  | `playwright-cli-case-generator` | adapted from the repo-local playwright CLI case-generator contract | `skills/playwright-cli-case-generator/SKILL.md` | FE-test case generator | FE-test only | Generates Markdown cases and a compact manifest from RAG facts; does not execute browsers, create test code, or invent API/data constraints. |
22
23
 
24
+ ## Verification placement taxonomy
25
+
26
+ Authoring vocabulary for where a check or verification skill should live. Prefer deterministic placement over model soft-chaining. Do **not** add free-text placement comments to every `SKILL.md`, and do **not** extend frontmatter schema until a runtime/checker consumer exists.
27
+
28
+ | placement | 本项目映射 | 何时选用 |
29
+ |---|---|---|
30
+ | **standalone** | 显式 operator skill / 独立只读检查(如 `loop-agent doctor`、`docs audit`、`stats context`) | 跨任务聚合、repo/runtime 健康、不绑定单一 DAG 节点 |
31
+ | **embedded** | DAG 节点自带 shell gate、role skill 或节点内 verify | 节点完成条件可本地判定;失败应阻断该节点 |
32
+ | **chained** | 可 `dag validate` 的 DAG dependencies / ranks;不用模型软调用串联 | 多步顺序或分叉必须可机读、可恢复 |
33
+ | **PR-bound** | CI / GitHub workflow(`scripts/ci.sh`、repo checks) | 合并前门禁;仅在团队流程稳定后启用 |
34
+
35
+ 约束:
36
+
37
+ - Skill 软 chaining **不是**主流程;验证循环优先进入 DAG topology、shell gates、review nodes 与 CI。
38
+ - Registry / authoring guide 使用本表做决策说明即可;placement 不是 runtime 字段。
39
+
23
40
  ## Vetting Rules
24
41
 
25
42
  - Default role mappings may reference only repo-local skills that resolve cleanly under `dag validate --strict-skills`.
26
43
  - `agent-worker` is explicitly outside default role mappings. Its trigger description must cover `agent-worker`, Feature Packet, TaskSpec, Task Pool, self-host/candidate and the `loop-agent` routing boundary; `scripts/check-skill-entry.sh` enforces this public entry contract.
44
+ - `grill-with-docs` is an explicit interactive operator skill only; it must stay outside `DEFAULT_SKILLS_BY_ROLE`.
27
45
  - Optional/security/web skills remain task- or profile-specific until their tool, network, credential, and write behavior is reviewed.
28
46
  - This registry records source inspiration, not license clearance for vendored third-party content. Vendoring requires a separate license/security review.
29
47
  - `SKILL.md` is the entry point. References must be declared in frontmatter and stay within the skill directory.
48
+ - External engineering methodologies may inspire local skill text, but must follow ADR 0006: fuse into existing docs/skills/templates/checks/DAG; do not create parallel governance trees.
49
+ - When choosing where a verification lives, use the placement taxonomy above; do not invent a parallel checklist tree.
@@ -0,0 +1,55 @@
1
+ # 模板库
2
+
3
+ 本目录保存可复用的执行计划、报告、DAG、schema、评测与产品线初始化模板。这里的文件是“可以拿来使用的起点”,不是某次任务的执行证据。
4
+
5
+ `docs/templates/README.md` 随 npm 包发布,并由 full init 复制到目标治理根;旧项目可通过 `init check-update` / `init update --apply-safe` 追踪缺失的模板入口和受管模板。源仓专用的文档治理脚本不会默认复制到目标项目。
6
+
7
+ ## 通用任务、报告与治理
8
+
9
+ - `project-start-checklist.md` — 开工检查。
10
+ - `feature-spec.md`、`sprint-contract.md` — 功能规格与短周期合同。
11
+ - `exec-plan.md`、`progress-log.md`、`qa-report.md` — 执行计划、交接与验证报告。
12
+ - `adr.md` — 架构决策记录。
13
+ - `branch-merge-report.md` — source-SHA 分支合并报告。
14
+ - `init-evolution-review.md` — 初始化能力演化审查。
15
+ - `production-readiness-checklist.md` — Production Readiness 检查。
16
+ - `worker-dogfood-setup.md`、`worker-dogfood-evidence.md` — 已发布控制器下的 Worker dogfood 设置与证据。
17
+ - `interactive-ui-round2-experiment.md` — 交互式 UI 对照实验。
18
+
19
+ ## Agent DAG
20
+
21
+ - `agent-dag.base.json`、`agent-dag.supervised-implementation.json`、`agent-dag.final-verification.json` — 通用 DAG 拓扑。
22
+ - `agent-dag.schema.json`、`agent-dag-report.schema.json`、`agent-dag-decision-envelope.schema.json` — DAG、报告和决策 envelope schema。
23
+ - `hybrid-dag.json` — hybrid DAG 示例。
24
+ - `agent-dag-authority-surface-audit.prompt.md` — 权威面审查提示。
25
+ - `agent-dag-decision-gate.prompt.md`、`agent-dag-decision-gate-dogfood-report.md` — 决策门与 dogfood 报告。
26
+ - `agent-dag-process-supervisor.prompt.md` — 过程监督提示。
27
+ - `agent-dag-review-verdict.prompt.md` — review verdict 提示。
28
+
29
+ ## Backend-test
30
+
31
+ - `backend-test-dag.json` — backend-test DAG 模板。
32
+ - `backend-test-dag.classify.prompt.md`、`backend-test-dag.generate-pytest.prompt.md`、`backend-test-dag.review-cases.prompt.md`、`backend-test-dag.retrospect.prompt.md` — 分类、生成、审查和复盘提示。
33
+ - `backend-test-analysis.schema.json`、`backend-test-execution.schema.json`、`backend-test-result.schema.json`、`backend-test-case-manifest.schema.json` — 分析、执行、结果与用例清单 schema。
34
+
35
+ ## Frontend
36
+
37
+ - `frontend-task-requirement.md`、`frontend-task-constraints.md`、`frontend-design-contract.md` — 前端任务输入与设计合同。
38
+ - `frontend-implementation-contract.schema.json` — 前端实现合同 schema。
39
+ - `frontend-test-dag.json` — frontend-test DAG 模板。
40
+ - `frontend-test-dag.retrieve-context.prompt.md`、`frontend-test-dag.generate-cases.prompt.md`、`frontend-test-dag.review-cases.prompt.md`、`frontend-test-dag.review-execution.prompt.md`、`frontend-test-dag.retrospect.prompt.md` — 上下文、用例、审查、执行审查和复盘提示。
41
+ - `frontend-test-case-checklist.md` — 前端测试用例检查清单。
42
+
43
+ ## 知识同步与配置
44
+
45
+ - `knowledge-sync-dag.json`、`knowledge-graph-bootstrap-dag.json` — 知识同步与图谱初始化 DAG。
46
+ - `knowledge-sync-draft.schema.json` — 知识同步草稿 schema。
47
+ - `harness.schema.json` — `harness.json` 的 IDE JSON Schema。
48
+
49
+ ## 子目录
50
+
51
+ - `product-line/README.md` — Feature、Task、Acceptance、Graph、Closeout 等产品线骨架。
52
+ - `evaluation/` — 通用评测模板与 schema。
53
+ - `frontend-eval/` — 前端评测模板、功能样例和失败 fixture。
54
+
55
+ 新增、删除或重命名模板时,应同步本页、`docs/init-surface.manifest.json` 和相关 init/package 测试;完整性由 `scripts/check-doc-governance.mjs` 枚举校验。
@@ -0,0 +1,9 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "candidateKind": "prompt",
4
+ "variant": "slim-v1",
5
+ "bodyPath": "docs/templates/evaluation/agents-map-slim-v1.md",
6
+ "bodySha256": "0101b0f85d1a78532d9f226f42ca1d3192d3bd421c82310621915b7f00b16968",
7
+ "lineCount": 87,
8
+ "purpose": "Eval Lab context-engineering AGENTS map A/B companion body; JSON contentRef avoids private-verifier token leak"
9
+ }
@@ -0,0 +1,87 @@
1
+ <!-- CODEGRAPH_START -->
2
+ ## CodeGraph
3
+
4
+ 如果仓库根目录存在 `.codegraph/`,在理解或定位代码前优先使用 CodeGraph,再考虑 rg/fd 或手动读文件。
5
+ <!-- CODEGRAPH_END -->
6
+
7
+ # AGENTS.md
8
+
9
+ 本仓库采用“人类掌舵,智能体执行”的工程方式。目标不是一次性写完所有代码,而是在一个可持续演进、可交接、可验证的系统里做小步增量。
10
+
11
+ `AGENTS.md` 是地图,不是百科。顶层只保留开工协议、会话协议与文档导航;长期知识、方法论、决策、计划、报告和模板应进入 `docs/`。
12
+
13
+ ## 默认立场
14
+
15
+ - 仓库是记录系统:决策、契约、计划、测试、报告优先落到仓库,而不是停留在聊天里。
16
+ - 一次只推进一个清晰工作块;主会话按 Orient → Select → Contract → Implement → Verify → Handoff 治理,runtime 真实流程以 `src/workflows/` 为准。
17
+ - 先验证基线,再叠加改动;完成定义必须可验证,不能靠删测试、降标准或模糊描述制造“完成”。
18
+ - Do not consider backward compatibility. Ignore legacy code/libraries.
19
+ - 搜索先于实现;受治理 Agent runtime 只有 Pi(`implement-pi` / `repair-pi`);`cursor-prompt` 仅为显式手工 one-shot sidecar。
20
+ - DAG 标准路径:Contract → Scout → Plan → Implement → Verify → Closeout/Handoff。
21
+ - 机器校验契约真源:`docs/init-surface.manifest.json`、`docs/architecture/runtime-boundaries.md`、`src/cli/command-definitions.ts`、`skills/loop-agent/`、`scripts/check-*.sh`;本文件只指路。
22
+ - 本仓库既是源项目也是 init 默认模板;新增能力必须判断 npm 内置 vs `loop-agent init` 投影。
23
+ - 委托写入前必须结构化 `task.json.allowedPaths` / `forbiddenPaths`,并审查 DAG writer `writeSet`。
24
+ - Shell 搜索优先 `rg`,按名找文件优先 `fd`;脚本用 Git Bash / 兼容 Bash。
25
+ - 用 loop-agent 迭代本仓库时,控制器必须来自已发布 npm 包(记录实际版本);启动后不要中途升级;不要用工作区 `npm link` / `npm run dev` 控制可能改 CLI/runtime/package 的任务。
26
+ - 反复出现的约束固化为文档、脚本、检查、测试或模板;禁止占位实现(除非 contract 标明脚手架)。
27
+ - 非微小实现:`exec-plan` 不能替代 Agent DAG;除非用户要求 one-shot 或计划记录 escape hatch,否则改实现前完成 `new-task`、结构化路径、`dag run-task`、`dag validate` 与 writeSet 审查。
28
+ - 不要自行引入外部 SDD/spec-first 等强制平行治理树;以本文件与 `docs/` 为准(ADR 0006)。
29
+
30
+ ## 开始顺序
31
+
32
+ 改文件前必须先完成:
33
+
34
+ 1. `pwd` → 读 `README.md`、`harness.json`、`docs/README.md`;有 `CONTEXT.md` 则读术语表。
35
+ 2. 实现类工作继续读:`docs/governance/development-principles.md`、`docs/governance/feature-workflow.md`、`docs/governance/verification-matrix.md`。
36
+ 3. 涉及命令/executor/init/skills/发布包/治理检查时继续读:`docs/architecture/runtime-boundaries.md`、`docs/runtime/loop-agent-harness.md`。
37
+ 4. 涉及测试纪律/验证声明/调试时继续读:`docs/harness-methodology-*.md`。
38
+ 5. 查看最近提交、相关 plan/progress/report;`git status --short --branch`;跑最小基线验证。
39
+ 6. 后端/接口/pytest → `taskKind: "backend-test"`(不是 `--profile`);知识回写 `knowledge-sync`;图谱开荒 `knowledge-graph-bootstrap`。`--profile` 仅 `auto|minimal|standard|reviewed|supervised`。
40
+ 7. 看板/observe → `agent-worker console serve --repo . --port 8790`(`/inspect/` 只读);`observe serve` 仅为兼容入口。
41
+ 8. 分支合并 → 先读 `docs/operations/branch-merge-guideline.md`。
42
+
43
+ ## 会话协议
44
+
45
+ 1. Orient → 2. Select(一块)→ 3. Contract → 4. Implement → 5. Verify → 6. Converge Docs → 7. Handoff。
46
+
47
+ 这不是 DAG 节点序列。复杂实现默认 Agent DAG;主 agent 拆任务、写 contract、结构化路径、审查 DAG/writeSet/profile/shell verification。微小任务可用 one-shot escape hatch 并记录边界与验证证据。
48
+
49
+ ## 项目地图
50
+
51
+ - `CONTEXT.md`:术语表
52
+ - `src/`:运行时;`test/`:Vitest;`bin/loop-agent.js`:CLI
53
+ - `skills/`:源仓库/npm 内置 skills;目标项目只生成 `.agents/skills/`
54
+ - `.harness/`:运行态(tasks/dag-runs/runs 等;init 会 gitignore 运行事实,保留 prompts 与占位)
55
+ - `docs/`:治理;`website/`:用户文档站;`scripts/`:检查与 CI
56
+
57
+ ## 工作规则(增量约束)
58
+
59
+ - 保留无关用户改动;优先沿用现有 helper/目录边界。
60
+ - 长期决策写入 `docs/`;面向用户变更更新 `CHANGELOG.md`(结果导向中文)。
61
+ - init/投影变更必须同步目标项目生成物与 package assets;init evolution 按 `docs/init-surface.manifest.json` 分级。
62
+ - CLI/skill entry/runtime boundary/发布包变更同步 catalog、脚本与测试。
63
+ - 没有新鲜验证证据时不声明完成;新债写入 plan/progress/report。
64
+
65
+ ## 验证
66
+
67
+ 权威源:`docs/governance/verification-matrix.md`。常用:
68
+
69
+ ```bash
70
+ npm run typecheck && npm test && npm run build
71
+ node bin/loop-agent.js --help
72
+ bash scripts/check-repo.sh
73
+ bash scripts/ci.sh
74
+ ```
75
+
76
+ 文档站变更:`npm run docs:build`。init / architecture / skill entry / pack 定向验证见 verification-matrix。
77
+
78
+ ## 交接
79
+
80
+ 记录:改了什么、为什么、验证命令与结果、契约/文档/测试影响、剩余风险、后续工作。
81
+
82
+ ## 禁止事项
83
+
84
+ - 未读相关文档就大改;一次混合无关重构/新功能/文档大迁移。
85
+ - 把对话约束当长期知识;缺验证宣称完成;假设系统没有某能力(先搜索)。
86
+ - stub/假数据通路替代交付;把本机绝对路径写入仓库级 AGENTS/README/模板/发布包。
87
+ - 只更新本仓库体验而遗漏目标项目 init 体验。
@@ -0,0 +1,9 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "candidateKind": "prompt",
4
+ "variant": "verbose-v0",
5
+ "bodyPath": "docs/templates/evaluation/agents-map-verbose-v0.md",
6
+ "bodySha256": "50af8ea3c7058071f249f9b45bd8c05fb1b1aa257ec6b2667aa91346c106cf81",
7
+ "lineCount": 153,
8
+ "purpose": "Eval Lab context-engineering AGENTS map A/B companion body; JSON contentRef avoids private-verifier token leak"
9
+ }
@@ -0,0 +1,153 @@
1
+ <!-- CODEGRAPH_START -->
2
+ ## CodeGraph
3
+
4
+ 如果仓库根目录存在 `.codegraph/`,在理解或定位代码前优先使用 CodeGraph,再考虑 rg/fd 或手动读文件。
5
+ <!-- CODEGRAPH_END -->
6
+
7
+ # AGENTS.md
8
+
9
+ 本仓库采用“人类掌舵,智能体执行”的工程方式。目标不是一次性写完所有代码,而是在一个可持续演进、可交接、可验证的系统里做小步增量。
10
+
11
+ `AGENTS.md` 是地图,不是百科。顶层只保留开工协议、会话协议与文档导航;长期知识、方法论、决策、计划、报告和模板应进入 `docs/`。
12
+
13
+ ## 默认立场
14
+
15
+ - 仓库是记录系统:决策、契约、计划、测试、报告优先落到仓库,而不是停留在聊天里。
16
+ - 一次只推进一个清晰工作块;主会话按 Orient → Select → Contract → Implement → Verify → Handoff 治理,runtime 真实流程以 `src/workflows/` 为准。
17
+ - 先验证基线,再叠加改动;如果当前基线已坏,优先定位基线问题。
18
+ - Do not consider backward compatibility. Ignore legacy code/libraries.
19
+ - 完成定义必须可验证;不能靠删测试、降标准或模糊描述制造“完成”。
20
+ - 搜索先于实现;先查现有代码、文档、脚本、测试,避免重复造轮子或误判系统能力。
21
+ - 受治理 Agent runtime 只有 Pi:DAG writer 固定为 `implement-pi` / `repair-pi`;`cursor-prompt` 仅是显式手工 one-shot sidecar,不进入 Loop auto-execute 或 Delegate 自动写入。
22
+ - 在 DAG runtime 中,搜索/侦察是显式节点:标准路径是 Contract → Scout → Plan → Implement → Verify → Closeout/Handoff。
23
+ - init surface、runtime 边界、command registry、skill entry 和架构 import 方向是可机器校验的治理契约;相关细节以 `docs/init-surface.manifest.json`、`docs/architecture/runtime-boundaries.md`、`src/cli/command-definitions.ts`、`skills/loop-agent/` 和 `scripts/check-*.sh` 为准,顶层 `AGENTS.md` 只指路,不重复维护事实源。
24
+ - 本仓库既是 loop-agent 源项目,也是目标项目初始化体验的默认模板;任何新增命令、脚本、文档、skill、模板或发布包内容,都要判断它应由 npm 包内置提供,还是由 `loop-agent init` 投影到目标项目,避免出现“本项目能用、初始化项目缺能力”。
25
+ - 委托模型写入前,必须把写入边界写成结构化 `task.json.allowedPaths` / `task.json.forbiddenPaths`,再审查生成 DAG 的 writer `writeSet`;不要只依赖 `source/执行约束.md` 的自然语言约束。
26
+ - Shell 搜索优先 `rg`,按名找文件优先 `fd`;脚本确为 Bash 脚本时使用 Git Bash 或已配置的兼容 Bash,不要求 Windows 环境适配 POSIX 路径。
27
+ - 用 loop-agent 迭代本仓库时,控制器必须来自已发布的 npm 安装包;首次安装或有意升级可用 `@tea-agent/loop-agent@latest`,但一次自举任务启动后不要中途升级控制器,并记录 `npm list -g @tea-agent/loop-agent --depth=0` 显示的实际版本。不要用当前工作区的 `npm link` 或 `npm run dev` 控制可能改动 CLI、DAG runtime、executor、package metadata 或 build output 的任务。
28
+ - 反复出现的约束要固化为文档、脚本、检查项、测试或模板。
29
+ - 除非用户明确要求,不要自行引入外部 SDD、spec-first、brainstorming 等方法论的强制设计文档、审批门或专用目录;本仓库的工作流程以本文件和 `docs/` 中的治理规则为准。
30
+ - 对非微小的实现或修复,`exec-plan` 只负责记录 Contract、进度和验证证据,不能替代 Agent DAG。除非用户明确要求 one-shot,或在计划中记录了适用的 escape hatch 与理由,否则在改动实现文件前必须完成 `new-task`、结构化 `allowedPaths` / `forbiddenPaths`、`dag run-task` 和 `dag validate`;随后按已校验的 DAG 执行并审查 writer `writeSet`。
31
+ - 禁止占位实现;除非 contract 明确约定为脚手架且标出后续闭环。
32
+
33
+ ## 开始顺序
34
+
35
+ 改文件前必须先完成:
36
+
37
+ 1. 运行 `pwd`。
38
+ 2. 阅读 `README.md`。
39
+ 3. 阅读 `harness.json`。
40
+ 4. 阅读 `docs/README.md`。
41
+ 5. 如果存在 `CONTEXT.md`,阅读项目术语表,避免混用任务源、执行约束、契约、计划等领域概念。
42
+ 6. 如果是实现类工作,继续阅读:
43
+ - `docs/governance/development-principles.md`
44
+ - `docs/governance/feature-workflow.md`
45
+ - `docs/governance/verification-matrix.md`
46
+ 7. 如果任务涉及命令入口、执行流程、executor、初始化投影、skills、脚本矩阵、发布包范围或治理检查,继续阅读:
47
+ - `docs/architecture/runtime-boundaries.md`
48
+ - `docs/runtime/loop-agent-harness.md`
49
+ 8. 如果任务涉及测试纪律、验证声明或调试,继续阅读:
50
+ - `docs/governance/harness-methodology-tdd.md`
51
+ - `docs/governance/harness-methodology-verification.md`
52
+ - `docs/governance/harness-methodology-debugging.md`
53
+ 9. 查看最近提交、相关执行计划、progress/report,确认当前上下文。
54
+ 10. 检查 `git status --short --branch`。
55
+ 11. 运行本次任务相关的最小基线验证。
56
+ 12. 如果用户提到"后端测试"、"接口测试"、"pytest"、"自动化测试",在任务 `task.json` 中设置 `taskKind: "backend-test"` 再 `dag run-task`;不要用 `--profile backend-test`(CLI 不接受该值,专用模板只走 taskKind)。知识回写用 `taskKind: "knowledge-sync"`(须 `featureId`),图谱开荒用 `taskKind: "knowledge-graph-bootstrap"`。`--profile` 仅表示治理强度:`auto|minimal|standard|reviewed|supervised`。
57
+ 13. 如果用户提到"看板"、"observe"、"监控面板"、"启动看板",使用 `agent-worker console serve --repo . --port 8790` 启动统一 Operator Console;`/inspect/` 提供只读检视。`agent-worker observe serve --repo . --port 8787` 仅为兼容入口。
58
+ 14. 如果用户要求“合并 `<source>` 到 `<target>`”或“合并 origin/main 到当前分支”,先阅读 `docs/operations/branch-merge-guideline.md`,按影响自动选择快速、标准或深度模式;始终冻结 source SHA、审查双方功能、运行 merge-tree、生成 source-SHA 合并报告,并在提交前再次 fetch 防止主干前进。
59
+
60
+ ## 会话协议
61
+
62
+ 1. Orient:读入口文档、相关专题、最近变更和现有实现。
63
+ 2. Select:只选一个清晰工作块;避免把重构、新功能、文档迁移混在一轮里。
64
+ 3. Contract:写清本轮交付物、非目标、完成标准、验证方法和失败条件。
65
+ 4. Implement:做最小增量实现,同步维护必要文档、脚本和测试。
66
+ 5. Verify:优先跑快速反馈,再跑必要的真实路径验证。
67
+ 6. Converge Docs:检查 README、AGENTS.md、CHANGELOG.md、docs/README.md、相关治理文档、skills references、website docs、初始化模板和脚本说明是否仍与实际行为一致;只更新与本次变更相关的内容,不做顺手文档迁移。
68
+ 7. Handoff:更新 progress/report/plan 中有长期价值的信息,写清风险、剩余项和下一步。
69
+
70
+ 这套会话协议不是 DAG runtime 的节点序列。复杂实现默认采用 Agent DAG;具体节点拓扑、profile routing、writer 选择和 runner 行为以 `docs/governance/feature-workflow.md` 与 `src/workflows/` 为准。主 agent 负责拆任务、写 contract、把允许/禁止路径写入结构化 task config、审查 DAG/writeSet/profile/shell verification、盯验证与 handoff。微小任务或 DAG runtime 自身修复也应优先使用 DAG,或使用 one-shot `pi-prompt` / `cursor-prompt` escape hatch 并记录边界与验证证据。
71
+
72
+ ## 项目地图
73
+
74
+ - `CONTEXT.md`:项目术语表,定义 loop-agent、任务源、执行约束等领域语言
75
+ - `src/`:loop-agent 运行时代码
76
+ - `test/`:Vitest 测试套件
77
+ - `bin/loop-agent.js`:CLI 可执行入口
78
+ - `skills/`:loop-agent 源仓库和 npm 包内置 skill 指令与参考资料;目标项目初始化后只生成 `.agents/skills/`,不再生成根 `skills/`。初始化还会向目标项目 `.gitignore` 合并 loop-agent managed block,忽略 `.harness/tasks/*`、`.harness/dag-runs/*`、`.harness/runs/*`、`.harness/evaluation/`、`.harness/dogfood-evidence/`、`.harness/init-surface.json`、`.harness/task-pool/*`、`.task-pool/`、`.worktrees/` 等运行态事实,但保留 `.harness/prompts/` 和目录占位可共享,不会整目录忽略 `.harness/`。
79
+ - `.harness/`:任务、DAG、run、cache 和 live state 等运行态目录
80
+ - `docs/`:治理文档、计划、报告和模板
81
+ - `website/`:Docusaurus 用户文档站
82
+ - `scripts/`:验证和维护脚本
83
+
84
+ ## 工作规则
85
+
86
+ - 每次任务只推进一个清晰、有边界的工作块。
87
+ - 保留无关的用户改动,不要回退自己没有做的修改。
88
+ - 优先沿用现有 helper、目录边界和局部模式,再考虑新增抽象。
89
+ - 长期决策写入 `docs/`,不要只留在聊天里。
90
+ - 分支合并遵循 `docs/operations/branch-merge-guideline.md`;快速模式只用于可证明的低风险/no-op 合并,涉及冲突、init/package/runtime/release/public API 时必须升级为标准或深度模式。
91
+ - 后端测试、接口/API 测试、pytest 或明确的后端自动化测试,必须把 `.harness/tasks/<task-id>/task.json` 的 `taskKind` 设置为 `"backend-test"`,不得保留默认 `standard`。`backend-test` 是 `taskKind`,不是 `--profile` 的可选值;`dag run-task` 继续使用 `--profile auto` 选择治理等级。仅说“自动化测试”且前后端不明时,先根据任务源和项目技术栈判断,禁止无条件路由。
92
+ - 本地 Operator Console:`agent-worker console serve --repo . --port 8790`,访问 `http://127.0.0.1:8790/`;其中 `/inspect/` 为只读运行检视。默认绑定本机 `127.0.0.1`;可用 `--host 0.0.0.0` / `--debug`,不要直接暴露到公开网络。
93
+ - 面向使用者的新增、修改、删除或修复,应同步更新根目录 `CHANGELOG.md`;保持版本级摘要即可,不写过细技术细节。
94
+ - 面向用户的中文更新日志、README 和说明文档应使用自然、结果导向的表达:先说明用户能获得什么或问题如何改善,保留必要的命令和产品术语,避免逐字翻译、内部实现细节和无意义的中英混杂。
95
+ - 涉及 `loop-agent init` 或目标项目投影的改动,必须同步考虑目标项目生成物:`AGENTS.md`、`README.md`、`harness.json`、`ai_workspace/loop-agent/`、`scripts/`、`.agents/skills/`、`.harness/prompts`、`.gitignore`(loop-agent runtime managed block)和 npm 包内置 assets;目标项目根 `docs/` 和根 `skills/` 的旧投影需要由 `init update --apply-safe` 安全迁移或退役。
96
+ - 涉及初始化能力演化时,按 `docs/init-surface.manifest.json` 与 `scripts/check-init-evolution-needed.sh` 分级处理:小改 advisory,中等 surface-check,高影响才需要模型审查;不要把所有小改动升级成重流程。
97
+ - 通用脚本、skill 和模板可以复制或投影;项目相关 README、验证命令、发布/维护脚本必须基于模板和目标项目真实文件生成,不假定目标项目是 TypeScript、Node、前端、后端或工具项目。
98
+ - 涉及 CLI command、skill entry、runtime boundary、import 方向或发布包范围时,同步更新对应文档、catalog/definition、治理脚本和测试,避免 README、skill reference、CLI help、npm 包内容互相漂移。
99
+ - 完成相关更新后必须做文档收敛:如果 README、AGENTS.md、CHANGELOG.md、docs、skills、website、初始化生成模板或脚本说明不需要更新,应在交接里写明理由。
100
+ - 不提交占位实现。
101
+ - 没有新鲜验证证据时,不声明工作完成。
102
+ - 发现新 bug、技术债或契约漂移时,写回当前 plan、progress 或 report,而不是只在对话里提一句。
103
+ - 涉及 harness 流程变化时,优先把变化落到 `harness.json`、模板、脚本或治理文档,而不是只改提示词。
104
+
105
+ ## 验证
106
+
107
+ 用 `docs/governance/verification-matrix.md` 选择命令。常用门禁:
108
+
109
+ ```bash
110
+ npm run typecheck
111
+ npm test
112
+ npm run build
113
+ node bin/loop-agent.js --help
114
+ bash scripts/check-repo.sh
115
+ bash scripts/ci.sh
116
+ ```
117
+
118
+ Windows 上运行 `scripts/*.sh` 时使用 Git Bash 或已配置的兼容 Bash。CLI、Node 代码、模板和提示词里的实际文件路径必须兼容 macOS 与 Windows:优先使用平台原生临时目录和 `path`/`os.tmpdir()`;仅在 repo 引用、JSON/Markdown 证据引用和 glob 约定中使用 `/` 作为稳定分隔符。
119
+
120
+ 文档站相关变更还需要按范围运行:
121
+
122
+ ```bash
123
+ npm run docs:build
124
+ ```
125
+
126
+ 按变更类型补充定向验证:
127
+
128
+ - 初始化能力或目标项目投影:运行 `test/init-command.test.ts`,并在临时目标项目执行 `loop-agent init --profile full --merge`、`loop-agent init doctor`、`loop-agent inspect`、`loop-agent docs audit` 和目标项目 `bash scripts/check-repo.sh`。
129
+ - init surface 或初始化能力演化:运行 `bash scripts/check-init-evolution-needed.sh` 和 `bash scripts/check-init-surface.sh`;高影响或发布前按需使用 `--strict` 并参考 `skills/init-capability-evolution/` 与 `docs/templates/init-evolution-review.md`。
130
+ - runtime boundary / command registry / skill entry:运行 `bash scripts/check-architecture-boundaries.sh`、`bash scripts/check-command-registry-drift.sh`、`bash scripts/check-skill-entry.sh`,并确保 `bash scripts/check-repo.sh` 覆盖这些检查。
131
+ - 发布包范围:运行 `npm run build`、`node bin/loop-agent.js --help` 和 `npm pack --dry-run`,确认初始化所需静态资料在 package files 中。
132
+
133
+ ## 交接
134
+
135
+ 较大的工作结束时记录:
136
+
137
+ - 改了什么
138
+ - 为什么这样改
139
+ - 执行过哪些验证命令以及结果
140
+ - 是否影响契约、文档、测试或脚本
141
+ - 剩余风险
142
+ - 后续工作
143
+
144
+ ## 禁止事项
145
+
146
+ - 不要在未读相关文档的前提下直接大改。
147
+ - 不要一次混合重构、新功能和文档大迁移而没有清晰边界。
148
+ - 不要把仅存在于对话里的约束当作长期知识。
149
+ - 不要在缺少验证的情况下宣称完成。
150
+ - 不要假设系统没有某个能力;先搜索再判断。
151
+ - 不要用 stub、假数据通路或注释承诺替代真正交付。
152
+ - 不要把个人机器的绝对路径写入仓库级 `AGENTS.md`、README、模板或发布包资料;个人工具配置应留在用户级配置或本机会话上下文。
153
+ - 不要只更新 loop-agent 本仓库体验而遗漏目标项目初始化体验;新增能力如果不能通过 npm 内置资料或 `loop-agent init` 到达目标项目,必须写清原因和替代入口。
@@ -76,7 +76,7 @@
76
76
  "artifacts/**"
77
77
  ],
78
78
  "outputContract": "Plain Markdown implementation contract summary; no file writes.",
79
- "subtask_prompt": "阅读 ./README.md 与 docs/agent-dag-runner.md,返回 10 行以内的实现契约摘要(只读分析 + 文档建议,不改代码/文档/artifacts)。指出是否适合并行 scout 与窄 writeSet。"
79
+ "subtask_prompt": "阅读 ./README.md 与 docs/runtime/agent-dag-runner.md,返回 10 行以内的实现契约摘要(只读分析 + 文档建议,不改代码/文档/artifacts)。指出是否适合并行 scout 与窄 writeSet。"
80
80
  },
81
81
  {
82
82
  "id": "scout-src",