@tea-agent/loop-agent 0.2.0 → 0.3.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 (77) hide show
  1. package/AGENTS.md +43 -24
  2. package/CHANGELOG.md +72 -44
  3. package/README.md +177 -164
  4. package/bin/loop-agent.js +21 -21
  5. package/dist/application/dag/args.js +6 -0
  6. package/dist/application/dag/generate-task-dag.js +5 -3
  7. package/dist/application/dag/run-dag.js +17 -1
  8. package/dist/application/dag/validate-dag.js +41 -0
  9. package/dist/cli/command-definitions.js +2 -2
  10. package/dist/cli/program.js +24 -4
  11. package/dist/commands/init.js +1036 -461
  12. package/dist/workflows/dag/dynamic-runtime/loop-until.js +2 -1
  13. package/dist/workflows/dag/dynamic-runtime/map.js +1 -0
  14. package/dist/workflows/dag/failure-routing.js +82 -0
  15. package/dist/workflows/dag/init-hybrid.js +3 -3
  16. package/dist/workflows/dag/lifecycle.js +95 -3
  17. package/dist/workflows/dag/report.js +73 -1
  18. package/dist/workflows/dag/skills.js +3 -3
  19. package/dist/workflows/dag/types.js +2 -0
  20. package/dist/workflows/dynamic/compile.js +11 -0
  21. package/dist/workflows/dynamic/spec.js +1 -0
  22. package/docs/README.md +50 -45
  23. package/docs/agent-dag-recovery-playbook.md +32 -6
  24. package/docs/agent-dag-runner.md +19 -17
  25. package/docs/architecture/runtime-boundaries.md +1 -1
  26. package/docs/cursor-executor-usage.md +5 -5
  27. package/docs/decisions/README.md +2 -2
  28. package/docs/design/README.md +24 -24
  29. package/docs/development-principles.md +50 -50
  30. package/docs/dynamic-workflow-dag-engine-roadmap.md +6 -6
  31. package/docs/exec-plans/README.md +4 -4
  32. package/docs/exec-plans/active/README.md +7 -9
  33. package/docs/exec-plans/completed/README.md +10 -8
  34. package/docs/feature-workflow.md +111 -109
  35. package/docs/harness-methodology-verification.md +18 -18
  36. package/docs/init-surface.manifest.json +175 -0
  37. package/docs/loop-agent-harness.md +36 -36
  38. package/docs/production-readiness.md +96 -0
  39. package/docs/progress/README.md +2 -2
  40. package/docs/reports/README.md +4 -2
  41. package/docs/skills/README.md +6 -0
  42. package/docs/skills/vetted-skill-registry.md +26 -0
  43. package/docs/templates/agent-dag-decision-gate-dogfood-report.md +1 -1
  44. package/docs/templates/agent-dag-process-supervisor.prompt.md +2 -2
  45. package/docs/templates/agent-dag-report.schema.json +33 -2
  46. package/docs/templates/agent-dag-review-verdict.prompt.md +1 -1
  47. package/docs/templates/agent-dag.base.json +195 -195
  48. package/docs/templates/agent-dag.final-verification.json +190 -190
  49. package/docs/templates/agent-dag.schema.json +17 -17
  50. package/docs/templates/agent-dag.supervised-implementation.json +500 -500
  51. package/docs/templates/hybrid-dag.json +193 -193
  52. package/docs/templates/init-evolution-review.md +33 -0
  53. package/docs/templates/production-readiness-checklist.md +57 -0
  54. package/docs/templates/progress-log.md +7 -7
  55. package/docs/templates/project-start-checklist.md +8 -8
  56. package/docs/templates/qa-report.md +17 -11
  57. package/docs/templates/sprint-contract.md +19 -19
  58. package/docs/verification-matrix.md +37 -26
  59. package/examples/example-dag.json +51 -51
  60. package/examples/hybrid-loop-agent-dag.json +194 -194
  61. package/harness.json +10 -8
  62. package/package.json +60 -58
  63. package/skills/code-review-core/SKILL.md +20 -0
  64. package/skills/codebase-scout/SKILL.md +19 -0
  65. package/skills/init-capability-evolution/SKILL.md +69 -0
  66. package/skills/loop-agent/SKILL.md +35 -35
  67. package/skills/loop-agent/references/command-reference.md +125 -65
  68. package/skills/loop-agent/references/harness-policy.md +30 -30
  69. package/skills/loop-agent/references/hybrid-dag.md +30 -30
  70. package/skills/loop-agent/references/model-routing.md +1 -1
  71. package/skills/loop-agent/references/orchestrator-and-interventions.md +1 -1
  72. package/skills/loop-agent/references/pi-prompt.md +9 -9
  73. package/skills/loop-agent/references/post-implementation-and-patterns.md +7 -7
  74. package/skills/loop-agent/references/task-workflow.md +19 -19
  75. package/skills/loop-agent/references/verification-and-failure-handling.md +36 -0
  76. package/skills/test-driven-development/SKILL.md +20 -0
  77. package/skills/webapp-testing/SKILL.md +19 -0
package/docs/README.md CHANGED
@@ -1,62 +1,67 @@
1
- # Documentation Index
1
+ # 文档索引
2
2
 
3
- `docs/` is the governance root for loop-agent. It contains workflow rules, methodology, verification rules, execution plans, reports, progress logs, decisions, and reusable templates.
3
+ `docs/` loop-agent 的治理根目录,包含工作流规则、方法论、验证规则、执行计划、报告、进度日志、决策记录和可复用模板。
4
4
 
5
- Top-level `AGENTS.md` is the operating map. Durable knowledge belongs here: decisions, contracts, plans, verification evidence, debugging notes, and reusable process rules should be recorded under `docs/` instead of staying only in chat.
5
+ 顶层 `AGENTS.md` 是操作地图。长期知识应落在此处:决策、契约、计划、验证证据、调试笔记和可复用流程规则应记录在 `docs/` 下,而不是只留在聊天里。
6
6
 
7
- ## Core Documents
7
+ ## 核心文档
8
8
 
9
- - `development-principles.md` — repository development principles
10
- - `architecture/runtime-boundaries.md` — runtime layer boundaries and dependency direction
11
- - `feature-workflow.md` — bounded feature workflow
12
- - `verification-matrix.md` — verification command selection
13
- - `loop-agent-harness.md` — runtime and command surface overview
14
- - `agent-dag-runner.md` — Agent DAG runner guide
15
- - `cursor-executor-usage.md` — Cursor executor usage
16
- - `dynamic-workflow-dag-engine-roadmap.md` — Dynamic Workflow DAG Engine roadmap and fit analysis
9
+ - `development-principles.md` — 仓库开发原则
10
+ - `architecture/runtime-boundaries.md` — runtime 层边界与依赖方向
11
+ - `feature-workflow.md` — 有边界的功能工作流
12
+ - `verification-matrix.md` — 验证命令选择
13
+ - `production-readiness.md` — Production Readiness v0.1 范围、证据与 DAG hardening 标准
14
+ - `loop-agent-harness.md` — runtime command surface 概览
15
+ - `agent-dag-runner.md` — Agent DAG runner 指南
16
+ - `cursor-executor-usage.md` — Cursor executor 用法
17
+ - `dynamic-workflow-dag-engine-roadmap.md` — Dynamic Workflow DAG Engine 路线图与适配分析
18
+ - `init-surface.manifest.json` — npm 包范围、目标项目初始化投影与 `init check-update` surface 分类的机器校验契约
17
19
 
18
- ## Methodology
20
+ ## 方法论
19
21
 
20
- - `harness-methodology-tdd.md` — TDD discipline for behavior changes and bug fixes
21
- - `harness-methodology-verification.md` — verification discipline before completion claims
22
- - `harness-methodology-debugging.md` — systematic debugging workflow before fixes
22
+ - `harness-methodology-tdd.md` — 行为变更与 bug 修复的 TDD 纪律
23
+ - `harness-methodology-verification.md` — 完成声明前的验证纪律
24
+ - `harness-methodology-debugging.md` — 修复前的系统化调试工作流
23
25
 
24
- ## Artifacts
26
+ ## 产物目录
25
27
 
26
- - `design/README.md` — draft design notes and implementation contracts
27
- - `exec-plans/active/README.md` — active execution plans
28
- - `exec-plans/completed/README.md` — completed execution plans
29
- - `progress/README.md` — progress handoff logs
30
- - `reports/README.md` — verification and audit reports
31
- - `decisions/README.md` — architecture decisions
32
- - `templates/`reusable planning, reporting, and DAG templates
28
+ - `design/README.md` — 设计草稿与实现契约
29
+ - `exec-plans/active/README.md` — 进行中的执行计划
30
+ - `exec-plans/completed/README.md` — 已完成的执行计划
31
+ - `progress/README.md` — 进度交接日志
32
+ - `reports/README.md` — 验证与审计报告
33
+ - `decisions/README.md` — 架构决策
34
+ - `skills/README.md`repo-local skill registry and vetting notes
35
+ - `templates/` — 可复用的规划、报告与 DAG 模板
33
36
 
34
- ## Repository Skills
37
+ ## 仓库 Skills
35
38
 
36
- - `../skills/loop-agent/` — loop-agent's own skill instructions and references.
37
- - Each additional skill uses its own subdirectory under repository-root `../skills/`; these local copies are referenced by DAG templates so maintenance does not depend on external agent skill directories.
39
+ - `../skills/loop-agent/` — loop-agent 自身的 skill 指令与参考资料
40
+ - 每个额外 skill 在仓库根 `../skills/` 下使用独立子目录;这些本地副本由 DAG 模板引用,维护不依赖外部 agent skill 目录
38
41
 
39
- ## Templates
42
+ ## 模板
40
43
 
41
- - `templates/project-start-checklist.md` — pre-work checklist
42
- - `templates/feature-spec.md` — bounded feature specification
43
- - `templates/sprint-contract.md` — implementation contract and acceptance criteria
44
- - `templates/exec-plan.md` — execution plan for non-trivial work
45
- - `templates/progress-log.md` — progress and handoff log
46
- - `templates/qa-report.md` — verification and QA evidence
47
- - `templates/adr.md` — architecture decision record
44
+ - `templates/project-start-checklist.md` — 开工前检查清单
45
+ - `templates/feature-spec.md` — 有边界的功能规格
46
+ - `templates/sprint-contract.md` — 实现契约与验收标准
47
+ - `templates/exec-plan.md` — 非平凡工作的执行计划
48
+ - `templates/progress-log.md` — 进度与交接日志
49
+ - `templates/qa-report.md` — 验证与 QA 证据
50
+ - `templates/production-readiness-checklist.md` — 低/中风险单仓库 DAG readiness 检查清单
51
+ - `templates/init-evolution-review.md` — 初始化能力演化审查报告模板
52
+ - `templates/adr.md` — 架构决策记录(ADR)
48
53
 
49
- ## Maintenance
54
+ ## 维护
50
55
 
51
- After docs changes, run:
52
-
53
- ```bash
54
- bash scripts/check-repo.sh
55
- ```
56
-
57
- On Windows, run Bash scripts through Git Bash or a configured compatible Bash. Use platform-native paths for actual file operations; reserve `/` for repo refs, JSON/Markdown evidence refs, and glob conventions.
58
-
59
- For a full local gate, run:
56
+ 文档变更后运行:
57
+
58
+ ```bash
59
+ bash scripts/check-repo.sh
60
+ ```
61
+
62
+ Windows 上通过 Git Bash 或已配置的兼容 Bash 运行脚本。实际文件操作使用平台原生路径;`/` 仅用于 repo 引用、JSON/Markdown 证据引用和 glob 约定。
63
+
64
+ 完整本地门禁:
60
65
 
61
66
  ```bash
62
67
  bash scripts/ci.sh
@@ -1,4 +1,4 @@
1
- # Agent DAG Recovery Playbook
1
+ # Agent DAG Recovery Playbook(恢复手册)
2
2
 
3
3
  > **关联**:[`agent-dag-runner.md`](agent-dag-runner.md)(CLI 与 run 语义)· [`templates/agent-dag-decision-gate.prompt.md`](templates/agent-dag-decision-gate.prompt.md)(Decision Gate 消费 recovery 证据)
4
4
 
@@ -6,6 +6,17 @@
6
6
 
7
7
  Agent DAG **recovery planning 是只读、派生、advisory** 的。`dag report` 与 `buildDagDecisionGateEvidence()` 从 `.harness/dag-runs/` 的 canonical facts 聚合 `normalizedFailureCategory` → `recoveryRecommendation`,供人工或 Decision Gate prompt 消费。
8
8
 
9
+ Production Readiness v0.1 在 normalized DAG category 之上增加 product-line routing。Report 与 doctor 输出应保留 raw DAG fact 并派生,不重写已完成 facts:
10
+
11
+ ```text
12
+ raw_failure_category
13
+ dag_normalized_failure_category
14
+ product_line_failure_category
15
+ recommended_follow_up
16
+ ```
17
+
18
+ Product-line taxonomy 定义见 `design/state-and-failure-taxonomy.md`。
19
+
9
20
  **非目标(本 playbook 不覆盖、runner 不实现):**
10
21
 
11
22
  - 自动 retry / resume 节点执行
@@ -47,7 +58,7 @@ npm run dev -- dag decision inspect --run-id <run-id> [--node-id <node-id>]
47
58
  npm run dev -- dag decision validate --run-id <run-id> [--node-id <node-id>]
48
59
  ```
49
60
 
50
- ### Paused run 操作员路径
61
+ ### Paused run operator 路径
51
62
 
52
63
  1. `dag report --paused-latest --json` 或 `dag doctor` — 定位最新 paused run 与 `primaryRecovery`
53
64
  2. `dag status --run-id <id>` — 读 `approvalFlow`、`escalationArtifactPath`、`pendingNodes`
@@ -79,7 +90,22 @@ Decision Gate prompt 侧:`buildDagDecisionGateEvidence()`(`./src/core/dag-de
79
90
  | `inspect-upstream` | 先查上游失败 | SKIPPED 下游节点 |
80
91
  | `unknown` | 未映射类别(不应出现在正常派生路径) | 内部兜底 |
81
92
 
82
- ## 类别 动作 → 操作员指引
93
+ ## Product-Line Routing v0.1
94
+
95
+ | Product-line category | Default follow-up |
96
+ |---|---|
97
+ | `SpecUnclear` | `spec-clarification` |
98
+ | `ContractMismatch` | `architecture-contract-fix` |
99
+ | `ProductBug` | `dev-fix` |
100
+ | `TestBug` | `qa-fix-test` |
101
+ | `EnvFailure` | `env-fix` 或 retry verify |
102
+ | `FlakyTest` | `flaky-test-analysis` |
103
+ | `RiskyChange` | `human-review` / `architecture-review` |
104
+ | `DependencyFailure` | unblock dependency |
105
+ | `NeedsHuman` | `human-review` |
106
+ | `Unknown` | human triage |
107
+
108
+ ## 类别 → 动作 → operator 指引
83
109
 
84
110
  | Normalized category | Recovery action | Operator guidance | Anti-patterns |
85
111
  |---------------------|-----------------|-------------------|---------------|
@@ -107,9 +133,9 @@ Decision Gate prompt 侧:`buildDagDecisionGateEvidence()`(`./src/core/dag-de
107
133
  1. **Primary Failure** — `primaryFailure`(node 或 run scope)
108
134
  2. **Recovery Action** — `primaryRecovery`(action、summary、reason、flags、commandHint)
109
135
  3. **Blocked Downstream / Skipped Nodes** — `downstreamSkippedNodes`
110
- 4. **Recommended Operator Action** — 面向操作员的步骤摘要
136
+ 4. **Recommended Operator Action** — 面向 operator 的步骤摘要
111
137
 
112
- 保存 handoff 时重定向到平台临时目录或 `docs/reports/`,不要写入 `.harness/dag-runs/`。
138
+ 保存 handoff 时重定向到平台临时目录或 `docs/reports/`,不要写入 `.harness/dag-runs/`。
113
139
 
114
140
  ## Decision Gate 消费约定
115
141
 
@@ -123,7 +149,7 @@ Decision Gate prompt 侧:`buildDagDecisionGateEvidence()`(`./src/core/dag-de
123
149
 
124
150
  `dag doctor` 与 `dag status` 通过 `detectDagRunHealthIssues()` 检测 lifecycle 不一致,**不** mutate run facts。
125
151
 
126
- | Code | 典型场景 | 操作员指引 |
152
+ | Code | 典型场景 | operator 指引 |
127
153
  |------|----------|------------|
128
154
  | `terminal-in-active` | run 已完成但 `active/<run-id>/` 残留 | 对照 `completed/` canonical facts;手动 archive 或删除 stale 目录 |
129
155
  | `paused-in-active` | pause 后目录未迁至 `paused/` | `dag doctor` 诊断;修复 facts 后再 approve/resume |
@@ -1,40 +1,42 @@
1
1
  # Agent DAG Runner
2
2
 
3
- Agent DAG is loop-agent's declarative orchestration runtime. A DAG decomposes work into nodes, runs eligible ranks in order, records artifacts, and uses gates for review and verification.
3
+ Agent DAG loop-agent 的声明式编排 runtimeDAG 将工作拆为节点、按序执行 eligible ranks、记录 artifacts,并用 gate review 与验证。
4
4
 
5
- ## Basic Use
5
+ ## 基本用法
6
6
 
7
7
  ```bash
8
- loop-agent dag run-task <task-id> --profile auto --strict-models --output <temp-dir>/<task-id>-dag.json
9
- loop-agent dag validate --dag <temp-dir>/<task-id>-dag.json --strict-models --strict-governance
10
- loop-agent run-dag --dag <temp-dir>/<task-id>-dag.json --cwd .
11
- ```
12
-
13
- `<temp-dir>` is the platform-native temp directory. On Windows, pass native paths for actual `--output`, `--dag`, and `--cwd` values.
8
+ loop-agent dag run-task <task-id> --profile auto --strict-models --output <temp-dir>/<task-id>-dag.json
9
+ loop-agent dag validate --dag <temp-dir>/<task-id>-dag.json --strict-models --strict-governance
10
+ loop-agent run-dag --dag <temp-dir>/<task-id>-dag.json --cwd .
11
+ ```
12
+
13
+ `<temp-dir>` 为平台原生临时目录。Windows `--output`、`--dag`、`--cwd` 的实际值用原生路径。
14
14
 
15
15
  ## Executors
16
16
 
17
- - `static`: deterministic generated artifacts or notes
18
- - `shell`: verification and file-system checks
19
- - `pi`: planning, review, diagnosis, and bounded writing when a node sets `toolProfile: "write"`
20
- - `cursor`: optional bounded write backend when explicitly enabled
17
+ - `static`:确定性生成的 artifacts notes
18
+ - `shell`:验证与文件系统检查
19
+ - `pi`:规划、review、诊断;节点设 `toolProfile: "write"` 时有界写入
20
+ - `cursor`:显式启用时的可选有界写后端
21
21
 
22
22
  ## Skills
23
23
 
24
- DAG specs may declare `defaults.skills`, `skillsByRole`, and node-level `skills`. The runner resolves local instructions from `skills/<skill-name>/SKILL.md` and records resolution metadata in each node's `skills.json` artifact.
24
+ DAG spec 可声明 `defaults.skills`、`skillsByRole` 与节点级 `skills`。Runner `skills/<skill-name>/SKILL.md` 解析本地指令,并在各节点 `skills.json` artifact 中记录解析元数据。
25
+
26
+ 执行前可用 `dag validate --strict-skills` 做 opt-in skill audit;该门禁会在 missing/error/truncated skill 或 unresolved reference 出现时失败。默认 role skill 应来自 `docs/skills/vetted-skill-registry.md` 中记录的 repo-local wrapper。
25
27
 
26
- The `loop-agent` skill lives at `skills/loop-agent/SKILL.md`. The legacy root `skill/SKILL.md` path is retained only as a compatibility fallback for older worktrees.
28
+ `loop-agent` skill 位于 `skills/loop-agent/SKILL.md`。遗留根路径 `skill/SKILL.md` 仅为旧 worktree 保留兼容 fallback
27
29
 
28
30
  ## Artifacts
29
31
 
30
- DAG artifacts belong under:
32
+ DAG artifacts 位于:
31
33
 
32
34
  ```text
33
35
  .harness/dag-runs/<state>/<run-id>/artifacts/<node-id>/
34
36
  ```
35
37
 
36
- Root `artifacts/` is not a valid default DAG artifact location.
38
+ 根目录 `artifacts/` 不是有效的默认 DAG artifact 位置。
37
39
 
38
40
  ## Shell Gates
39
41
 
40
- - `shell.verdictGate` reads `$HARNESS_DAG_RUN_DIR/<fromNodeId>.json` from the injected current run directory; 不应自行发现 active run paths.
42
+ - `shell.verdictGate` 从注入的当前 run 目录读取 `$HARNESS_DAG_RUN_DIR/<fromNodeId>.json`;不应自行发现 active run paths
@@ -112,7 +112,7 @@ Runner / Loop ──(迁移中)──> 逐步改为仅经 Store / Appli
112
112
 
113
113
  `scripts/check-architecture-boundaries.sh` 的 transitional allowlist 保持为空。任何新增的 `workflows/executors -> commands` import 必须导致检查 **exit 1**;如果未来确有临时例外,必须先写入 active exec plan,说明移除时间和验证门禁。
114
114
 
115
- ## Governance hooks
115
+ ## Governance 钩子
116
116
 
117
117
  以下脚本由 `scripts/check-repo.sh` 调用(Phase 0 起):
118
118
 
@@ -1,8 +1,8 @@
1
- # Cursor Executor Usage
1
+ # Cursor Executor 用法
2
2
 
3
- Cursor is used for bounded write implementation. Every Cursor write task must define scope explicitly.
3
+ Cursor 用于有界写实现。每个 Cursor 写任务必须显式定义 scope
4
4
 
5
- ## Required Prompt Fields
5
+ ## Prompt 必填字段
6
6
 
7
7
  - task id
8
8
  - objective
@@ -10,7 +10,7 @@ Cursor is used for bounded write implementation. Every Cursor write task must de
10
10
  - forbidden paths
11
11
  - constraints
12
12
  - expected verification
13
- - instruction to preserve unrelated changes
13
+ - 保留无关变更的指令
14
14
 
15
15
  ## One-Shot Helper
16
16
 
@@ -22,4 +22,4 @@ loop-agent cursor-prompt \
22
22
  "<bounded task prompt>"
23
23
  ```
24
24
 
25
- After Cursor returns, the main session must inspect the diff and run the relevant verification commands.
25
+ Cursor 返回后,主会话必须检查 diff 并运行相关验证命令。
@@ -1,3 +1,3 @@
1
- # Decisions
1
+ # 决策
2
2
 
3
- Use this directory for architecture decision records.
3
+ 本目录存放架构决策记录(ADR)。
@@ -1,36 +1,36 @@
1
- # Design Notes
1
+ # 设计笔记
2
2
 
3
- `docs/design/` contains planning notes for using `loop-agent` as the repo-local runtime inside a larger product-line agent platform. These documents are design inputs, not proof that the capability already exists in `src/`.
3
+ `docs/design/` 存放将 `loop-agent` 作为更大产品线 agent 平台内仓库本地 runtime 的规划笔记。这些是设计输入,不是 `src/` 已具备该能力的证明。
4
4
 
5
- ## Documents
5
+ ## 文档
6
6
 
7
- | Document | Purpose |
7
+ | 文档 | 用途 |
8
8
  |---|---|
9
- | `产品线共享知识库.md` | Product-line docs repository as the upstream source of truth |
10
- | `研发模式.md` | 10-working-day Feature team workflow |
11
- | `1个月规划.md` | First-month landing plan |
12
- | `1月wbs.md` | First-month WBS and ownership |
13
- | `六个月规划.md` | Six-month roadmap and target architecture |
14
- | `taskspec-to-loop-agent-mapping.md` | Contract for adapting product-line TaskSpec into `loop-agent` tasks |
15
- | `state-and-failure-taxonomy.md` | Canonical status and failure taxonomy across docs, Task Pool, DAG, and Loop |
9
+ | `产品线共享知识库.md` | 产品线文档仓库作为上游事实源 |
10
+ | `研发模式.md` | 10 个工作日 Feature 团队工作流 |
11
+ | `1个月规划.md` | 首月落地计划 |
12
+ | `1月wbs.md` | 首月 WBS 与分工 |
13
+ | `六个月规划.md` | 六个月路线图与目标架构 |
14
+ | `taskspec-to-loop-agent-mapping.md` | 将产品线 TaskSpec 适配为 `loop-agent` task 的契约 |
15
+ | `state-and-failure-taxonomy.md` | 文档、Task Pool、DAG、Loop 共用的 canonical status failure taxonomy |
16
16
 
17
- ## Current Implementation Boundary
17
+ ## 当前实现边界
18
18
 
19
- `loop-agent` currently owns a repo-local harness, Agent DAG generation/validation/execution, shell verification, artifacts, reports, and Loop state. It is not the product-line Task Pool, Orchestrator, docs-sync service, Git/CI platform, or artifact store.
19
+ `loop-agent` 当前拥有:仓库本地 harnessAgent DAG 生成/验证/执行、shell 验证、artifactsreportsLoop state。它不是产品线 Task PoolOrchestratordocs-sync 服务、Git/CI 平台或 artifact store
20
20
 
21
- The design documents use two kinds of profile names:
21
+ 设计文档使用两类 profile 名称:
22
22
 
23
- - Business task profiles: `backend-feature`, `frontend-feature`, `qa-casegen`, `qa-testcode`, `reviewer-gate`.
24
- - `loop-agent dag run-task --profile` governance profiles: `auto`, `minimal`, `standard`, `reviewed`, `supervised`.
23
+ - **Business task profiles**:`backend-feature`、`frontend-feature`、`qa-casegen`、`qa-testcode`、`reviewer-gate`
24
+ - **`loop-agent dag run-task --profile` governance profiles**:`auto`、`minimal`、`standard`、`reviewed`、`supervised`
25
25
 
26
- Do not pass business task profiles directly to `loop-agent dag run-task --profile` unless the CLI is explicitly extended to support them. Use `taskspec-to-loop-agent-mapping.md` to route business profiles to current governance profiles.
26
+ 除非 CLI 显式扩展支持,否则不要把 business task profile 直接传给 `loop-agent dag run-task --profile`。用 `taskspec-to-loop-agent-mapping.md` business profile 路由到当前 governance profile。
27
27
 
28
- ## Maintenance Rules
28
+ ## 维护规则
29
29
 
30
- When these design notes change:
30
+ 设计笔记变更时:
31
31
 
32
- 1. Keep TaskSpec fields, status names, failure categories, and command examples consistent with the contract docs.
33
- 2. Mark future platform components as target architecture unless they exist in `src/` or `scripts/`.
34
- 3. Update `taskspec-to-loop-agent-mapping.md` whenever `src/task/config-types.ts` or DAG profile routing changes.
35
- 4. Update `state-and-failure-taxonomy.md` whenever DAG report categories, Loop failure classes, or Task Pool states change.
36
- 5. Run `bash scripts/check-repo.sh`.
32
+ 1. 保持 TaskSpec 字段、status 名称、failure category 与命令示例与契约文档一致
33
+ 2. 未来平台组件标为目标架构,除非已存在于 `src/` `scripts/`
34
+ 3. `src/task/config-types.ts` DAG profile routing 变更时更新 `taskspec-to-loop-agent-mapping.md`
35
+ 4. DAG report category、Loop failure class Task Pool state 变更时更新 `state-and-failure-taxonomy.md`
36
+ 5. 运行 `bash scripts/check-repo.sh`
@@ -1,71 +1,71 @@
1
- # Development Principles
1
+ # 开发原则
2
2
 
3
- loop-agent is a workflow runtime for agentic coding work. The repository should stay small, explicit, and verifiable.
3
+ loop-agent 是面向 agentic coding 的工作流 runtime。仓库应保持小而显式、可验证。
4
4
 
5
- ## Operating Stance
5
+ ## 操作立场
6
6
 
7
- The project uses a human-led, agent-executed engineering model. Agents may implement, verify, and summarize, but durable intent and completion evidence must live in the repository.
7
+ 项目采用「人类掌舵、智能体执行」的工程模型。Agent 可实现、验证与总结,但持久意图与完成证据必须落在仓库中。
8
8
 
9
- - The repository is the record system. Decisions, contracts, plans, tests, reports, and handoffs belong in tracked files.
10
- - `AGENTS.md` is an operating map, not a knowledge dump. Long-lived methodology and decisions belong under `docs/`.
11
- - Work advances in small, reversible, verifiable increments.
12
- - Baseline verification comes before new work when the current state is uncertain.
13
- - Completion is defined by fresh evidence, not by intent or confidence.
9
+ - 仓库是记录系统。决策、契约、计划、测试、报告与交接属于 tracked files
10
+ - `AGENTS.md` 是操作地图,不是知识 dump。长期方法论与决策属于 `docs/`。
11
+ - 工作以小步、可逆、可验证的增量推进。
12
+ - 状态不确定时,先跑基线验证再开新工。
13
+ - 完成由新鲜证据定义,而非意图或信心。
14
14
 
15
- ## Principles
15
+ ## 原则
16
16
 
17
- 1. One task advances one bounded work block.
18
- 2. Search existing code, docs, scripts, and tests before designing new behavior.
19
- 3. Shell verification is the completion authority.
20
- 4. Runtime state belongs in `.harness/`; durable decisions belong in `docs/`.
21
- 5. Pi writer nodes and optional Cursor write execution must be bounded by explicit allowed and forbidden paths.
22
- 6. Pi review/planning paths are advisory unless followed by deterministic verification.
23
- 7. Repeated constraints should become docs, tests, scripts, checks, or templates.
24
- 8. Do not keep hidden process state only in chat.
25
- 9. Do not add placeholders as completed implementation.
26
- 10. Prefer existing local patterns before adding new abstractions.
17
+ 1. 一次任务只推进一个有边界的工作块。
18
+ 2. 设计新行为前先搜索现有代码、文档、脚本与测试。
19
+ 3. Shell 验证是完成权威。
20
+ 4. Runtime 状态在 `.harness/`;持久决策在 `docs/`。
21
+ 5. Pi writer 节点与可选 Cursor 写执行必须由显式 allowed/forbidden paths 约束。
22
+ 6. Pi review/planning 路径是 advisory,除非后跟确定性验证。
23
+ 7. 反复出现的约束应固化为文档、测试、脚本、检查或模板。
24
+ 8. 不要把隐藏流程状态只留在聊天里。
25
+ 9. 不要把占位实现当作已完成交付。
26
+ 10. 新增抽象前先沿用现有局部模式。
27
27
 
28
- ## Repository Shape
28
+ ## 仓库结构
29
29
 
30
- - Source lives in `src/`.
31
- - Tests live in `test/`.
32
- - Skill instructions live in `skills/`.
33
- - Verification and maintenance scripts live in `scripts/`.
34
- - Governance and handoff artifacts live in `docs/`.
30
+ - 源码:`src/`
31
+ - 测试:`test/`
32
+ - Skill 指令:`skills/`
33
+ - 验证与维护脚本:`scripts/`
34
+ - 治理与交接产物:`docs/`
35
35
 
36
- ## Change Discipline
36
+ ## 变更纪律
37
37
 
38
- For behavior changes, update tests. For workflow or command changes, update docs and examples. For governance changes, update `harness.json` and the relevant check scripts.
38
+ 行为变更要更新测试;工作流或命令变更要更新文档与示例;治理变更要更新 `harness.json` 与相关检查脚本。
39
39
 
40
- When work affects requirements, behavior, cross-command contracts, or harness rules, update the corresponding durable artifact:
40
+ 当工作影响需求、行为、跨命令契约或 harness 规则时,更新对应持久产物:
41
41
 
42
- - design or contract docs for changed expectations
43
- - tests or verification scripts for changed behavior
44
- - progress logs or reports for non-trivial handoff evidence
45
- - ADRs for architecture or public contract decisions
46
- - templates when a repeated process becomes reusable
42
+ - 设计/契约文档 变更后的预期
43
+ - 测试或验证脚本 变更后的行为
44
+ - progress log report 非平凡交接证据
45
+ - ADR 架构或公开契约决策
46
+ - 模板 重复流程可复用时
47
47
 
48
- Do not mix unrelated refactors, new features, and broad documentation migration in one work block unless the contract explicitly says why they must move together.
48
+ 除非 contract 明确说明必须一起移动,否则不要在一个工作块里混合无关重构、新功能与大规模文档迁移。
49
49
 
50
- ## Search And Reuse
50
+ ## 搜索与复用
51
51
 
52
- Before implementing, inspect the existing system:
52
+ 实现前先检视现有系统:
53
53
 
54
- - Use CodeGraph first when the repository is indexed and the task needs code understanding.
55
- - Use `rg` for text search and `fd` for file discovery when available.
56
- - Read nearby tests and helpers before introducing new helpers.
57
- - Prefer structured parsers and existing local APIs over ad hoc string manipulation.
54
+ - 仓库已索引且任务需要理解代码时,优先用 CodeGraph
55
+ - 可用时用 `rg` 做文本搜索、`fd` 找文件。
56
+ - 引入新 helper 前先读邻近测试与 helper。
57
+ - 优先结构化 parser 与现有本地 API,避免 ad hoc 字符串处理。
58
58
 
59
- Assume the system may already contain a partial solution until search proves otherwise.
59
+ 在搜索证明否则之前,假设系统可能已有部分解法。
60
60
 
61
- ## Completion Discipline
61
+ ## 完成纪律
62
62
 
63
- A completion claim must answer:
63
+ 完成声明必须回答:
64
64
 
65
- - what changed
66
- - why this approach was chosen
67
- - which command verified it and what the result was
68
- - whether contracts, docs, tests, or scripts were affected
69
- - what risk or follow-up remains
65
+ - 改了什么
66
+ - 为何选此方案
67
+ - 哪条命令验证、结果如何
68
+ - 是否影响契约、文档、测试或脚本
69
+ - 剩余风险或后续项
70
70
 
71
- If verification fails, report the failing command and observed state instead of softening the completion definition.
71
+ 验证失败时,报告失败命令与观察到的状态,而不是软化完成定义。
@@ -147,11 +147,11 @@ LLM / profile 生成 WorkflowSpec JSON
147
147
 
148
148
  本次复核依据的关键代码与文档:
149
149
 
150
- - `docs/feature-workflow.md`
151
- - 源码仓库历史 completed execution plan: remove-level1-fallback
152
- - `src/workflows/dag/types.ts`
153
- - `src/workflows/dag/validate.ts`
154
- - `src/workflows/dag/runner.ts`
150
+ - `docs/feature-workflow.md`
151
+ - 源码仓库历史 completed execution plan: remove-level1-fallback
152
+ - `src/workflows/dag/types.ts`
153
+ - `src/workflows/dag/validate.ts`
154
+ - `src/workflows/dag/runner.ts`
155
155
  - `src/workflows/dag/lifecycle.ts`
156
156
  - `src/workflows/dag/report.ts`
157
157
  - `src/workflows/dag/init-hybrid.ts`
@@ -1744,6 +1744,6 @@ https://code.claude.com/docs/en/workflows
1744
1744
 
1745
1745
  [3] 用户上传文档:`2026-07-02-repository-analysis.md`,关于当前 `loop-agent` 仓库结构、DAG 主路径、Loop 语义、治理边界与健康度的分析报告。
1746
1746
 
1747
- [4] 当前源码仓库历史 completed execution plan,关于删除 Level 1 fallback、抽取 shell verification、建立 DAG-oriented task read model 的完成记录;发布包只携带 execution plan 目录说明,不携带具体历史计划正文。
1747
+ [4] 当前源码仓库历史 completed execution plan,关于删除 Level 1 fallback、抽取 shell verification、建立 DAG-oriented task read model 的完成记录;发布包只携带 execution plan 目录说明,不携带具体历史计划正文。
1748
1748
 
1749
1749
  [5] 当前源码复核:`src/workflows/dag/types.ts`、`src/workflows/dag/validate.ts`、`src/workflows/dag/runner.ts`、`src/workflows/loop/actions.ts`、`src/task/read-model.ts`、`src/cli/catalog.ts`。
@@ -1,6 +1,6 @@
1
- # Execution Plans
1
+ # 执行计划
2
2
 
3
- - `active/README.md` lists currently active plans.
4
- - `completed/README.md` lists completed plans.
3
+ - `active/README.md` 当前进行中的计划
4
+ - `completed/README.md` 已完成的计划
5
5
 
6
- Use an execution plan for changes that affect multiple files, public command behavior, or repository governance.
6
+ 影响多文件、公开命令行为或仓库治理的变更应使用 execution plan
@@ -1,9 +1,7 @@
1
- # Active Execution Plans
2
-
3
- Use this directory for execution plans that are currently in progress.
4
-
5
- Source repositories may keep concrete active plan files next to this README. The npm package carries this README as a directory contract and does not copy loop-agent source-history active plans; target repositories generate their own active plans.
6
-
7
- Current active plans:
8
-
9
- - [2026-07-04-dag-role-skill-alignment.md](2026-07-04-dag-role-skill-alignment.md)
1
+ # 进行中的执行计划
2
+
3
+ 本目录存放当前进行中的 execution plan。
4
+
5
+ 源码仓库可在本 README 旁保留具体 active plan 文件。npm 包只携带本 README 作为目录契约,不复制 loop-agent 源码历史的 active plan;目标仓库自行生成 active plan。
6
+
7
+ 当前 active plan:无。
@@ -1,9 +1,11 @@
1
- # Completed Execution Plans
1
+ # 已完成的执行计划
2
2
 
3
- Completed plans are moved here after their implementation and verification finish.
4
-
5
- The npm package carries this README as a directory contract. Concrete completed plans are target-repository history and are not copied from loop-agent's source history.
6
-
7
- - [`2026-07-02-loop-agent-subject-restructure.md`](2026-07-02-loop-agent-subject-restructure.md) — promoted the former `tools/code-agent` runtime to the repository root, renamed it to `loop-agent`, and removed the old memory plugin product lines.
8
- - [`2026-07-04-remove-level1-fallback.md`](2026-07-04-remove-level1-fallback.md) — removed the historical sequential Level 1 fallback and converged the runtime, docs, and command surface on DAG execution.
9
- - [`2026-07-04-runtime-boundary-remediation.md`](2026-07-04-runtime-boundary-remediation.md) — consolidated CLI/skill/runtime boundaries, extracted DAG/Loop runtime seams, and centralized harness store/guard policy.
3
+ 实现与验证结束后,已完成计划移入此目录。
4
+
5
+ npm 包携带本 README 作为目录契约。具体 completed plan 属于目标仓库历史,不从 loop-agent 源码历史复制。
6
+
7
+ - [`2026-07-02-loop-agent-subject-restructure.md`](2026-07-02-loop-agent-subject-restructure.md) — 将原 `tools/code-agent` runtime 提升到仓库根、重命名为 `loop-agent`,移除旧 memory plugin 产品线
8
+ - [`2026-07-04-remove-level1-fallback.md`](2026-07-04-remove-level1-fallback.md) — 移除历史顺序 Level 1 fallbackruntime、文档与 command surface 收敛到 DAG 执行
9
+ - [`2026-07-04-runtime-boundary-remediation.md`](2026-07-04-runtime-boundary-remediation.md) — 整合 CLI/skill/runtime 边界,抽出 DAG/Loop runtime seam,集中 harness store/guard 策略
10
+ - [`2026-07-04-dag-role-skill-alignment.md`](2026-07-04-dag-role-skill-alignment.md) — 对齐 DAG/Dynamic Workflow role 与 repo-local vetted skills,新增 strict skill audit
11
+ - [`2026-07-06-production-readiness-hardening.md`](2026-07-06-production-readiness-hardening.md) — 冻结 Production Readiness v0.1,打磨 DAG 主路径 next steps、failure routing、doctor/report/failure handoff 与 dogfood 验证