@tea-agent/loop-agent 0.1.0 → 0.2.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 (143) hide show
  1. package/AGENTS.md +62 -45
  2. package/CHANGELOG.md +60 -28
  3. package/README.md +160 -124
  4. package/bin/loop-agent.js +21 -21
  5. package/dist/adapters/index.js +3 -2
  6. package/dist/adapters/loop-agent.js +44 -2
  7. package/dist/application/dag/args.js +420 -0
  8. package/dist/application/dag/generate-task-dag.js +280 -0
  9. package/dist/application/dag/report-dag.js +14 -0
  10. package/dist/application/dag/run-dag.js +106 -0
  11. package/dist/application/dag/validate-dag.js +102 -0
  12. package/dist/application/loop/run-action.js +23 -0
  13. package/dist/cli/catalog.js +2 -237
  14. package/dist/cli/command-definitions.js +571 -0
  15. package/dist/cli/index.js +2 -0
  16. package/dist/cli/program.js +65 -1
  17. package/dist/cli/router.js +13 -0
  18. package/dist/cli-governance/active-residue-check.js +38 -0
  19. package/dist/commands/dag-report.js +6 -107
  20. package/dist/commands/dag-run-task.js +8 -466
  21. package/dist/commands/dag-validate.js +7 -179
  22. package/dist/commands/examples.js +90 -0
  23. package/dist/commands/init.js +1518 -0
  24. package/dist/commands/loop.js +57 -31
  25. package/dist/commands/pi-prompt.js +2 -9
  26. package/dist/commands/run-dag.js +7 -180
  27. package/dist/executors/cursor-executor-artifacts.js +3 -4
  28. package/dist/executors/cursor-worker-client.js +13 -3
  29. package/dist/executors/dag-cursor-executor.js +2 -3
  30. package/dist/executors/dag-pi-executor.js +3 -4
  31. package/dist/executors/dag-static-executor.js +2 -5
  32. package/dist/executors/pi-defaults.js +9 -0
  33. package/dist/executors/shell-executor.js +12 -20
  34. package/dist/governance/manifest-types.js +1 -0
  35. package/dist/infrastructure/harness/active-residue-policy.js +73 -0
  36. package/dist/infrastructure/harness/artifact-store.js +72 -0
  37. package/dist/infrastructure/harness/atomic-write.js +49 -0
  38. package/dist/infrastructure/harness/completed-facts-guard.js +40 -0
  39. package/dist/infrastructure/harness/loop-action-store.js +23 -0
  40. package/dist/infrastructure/harness/loop-store.js +41 -0
  41. package/dist/infrastructure/harness/one-shot-run-store.js +94 -0
  42. package/dist/infrastructure/harness/task-store.js +77 -0
  43. package/dist/records/one-shot-runs.js +26 -61
  44. package/dist/records/promotion.js +3 -4
  45. package/dist/shared/artifacts-core.js +5 -5
  46. package/dist/shared/logger.js +9 -15
  47. package/dist/task/delegate.js +4 -4
  48. package/dist/task/runtime.js +5 -7
  49. package/dist/task/state.js +6 -20
  50. package/dist/workflows/dag/convergence/controller.js +277 -0
  51. package/dist/workflows/dag/dynamic-runtime/condition.js +48 -0
  52. package/dist/workflows/dag/dynamic-runtime/loop-until.js +156 -0
  53. package/dist/workflows/dag/dynamic-runtime/map.js +185 -0
  54. package/dist/workflows/dag/dynamic-runtime/reduction.js +72 -0
  55. package/dist/workflows/dag/dynamic-runtime/shared.js +133 -0
  56. package/dist/workflows/dag/failure-routing.js +82 -0
  57. package/dist/workflows/dag/lifecycle.js +101 -8
  58. package/dist/workflows/dag/node-execution.js +262 -0
  59. package/dist/workflows/dag/report.js +73 -1
  60. package/dist/workflows/dag/run-store.js +36 -0
  61. package/dist/workflows/dag/runner.js +82 -1341
  62. package/dist/workflows/dag/scheduler.js +84 -0
  63. package/dist/workflows/dag/upstream-artifacts.js +20 -18
  64. package/dist/workflows/loop/actions/cursor-fix.js +191 -0
  65. package/dist/workflows/loop/actions/dag-action.js +130 -0
  66. package/dist/workflows/loop/actions/pi-review.js +267 -0
  67. package/dist/workflows/loop/actions/shared.js +157 -0
  68. package/dist/workflows/loop/actions/shell-verify.js +82 -0
  69. package/dist/workflows/loop/actions/types.js +1 -0
  70. package/dist/workflows/loop/actions/workflow-action.js +255 -0
  71. package/dist/workflows/loop/actions.js +55 -1212
  72. package/dist/workflows/loop/closeout.js +5 -4
  73. package/dist/workflows/loop/context.js +2 -3
  74. package/dist/workflows/loop/events.js +3 -2
  75. package/dist/workflows/loop/policy/auto-policy.js +104 -0
  76. package/dist/workflows/loop/policy/cursor-fix-policy.js +31 -0
  77. package/dist/workflows/loop/rounds.js +3 -3
  78. package/dist/workflows/loop/signals.js +4 -7
  79. package/dist/workflows/loop/state.js +11 -11
  80. package/docs/README.md +47 -44
  81. package/docs/agent-dag-recovery-playbook.md +32 -6
  82. package/docs/agent-dag-runner.md +17 -17
  83. package/docs/architecture/runtime-boundaries.md +147 -0
  84. package/docs/cursor-executor-usage.md +5 -5
  85. package/docs/decisions/README.md +2 -2
  86. package/docs/design/README.md +24 -24
  87. package/docs/development-principles.md +50 -50
  88. package/docs/dynamic-workflow-dag-engine-roadmap.md +6 -6
  89. package/docs/exec-plans/README.md +4 -4
  90. package/docs/exec-plans/active/README.md +10 -5
  91. package/docs/exec-plans/completed/README.md +9 -5
  92. package/docs/feature-workflow.md +111 -109
  93. package/docs/harness-methodology-verification.md +18 -18
  94. package/docs/loop-agent-harness.md +36 -36
  95. package/docs/production-readiness.md +96 -0
  96. package/docs/progress/README.md +2 -2
  97. package/docs/reports/README.md +4 -2
  98. package/docs/templates/agent-dag-decision-gate-dogfood-report.md +1 -1
  99. package/docs/templates/agent-dag-process-supervisor.prompt.md +2 -2
  100. package/docs/templates/agent-dag-report.schema.json +33 -2
  101. package/docs/templates/agent-dag-review-verdict.prompt.md +1 -1
  102. package/docs/templates/agent-dag.base.json +195 -195
  103. package/docs/templates/agent-dag.final-verification.json +190 -190
  104. package/docs/templates/agent-dag.schema.json +17 -17
  105. package/docs/templates/agent-dag.supervised-implementation.json +500 -500
  106. package/docs/templates/hybrid-dag.json +193 -193
  107. package/docs/templates/production-readiness-checklist.md +57 -0
  108. package/docs/templates/progress-log.md +7 -7
  109. package/docs/templates/project-start-checklist.md +8 -8
  110. package/docs/templates/qa-report.md +17 -11
  111. package/docs/templates/sprint-contract.md +19 -19
  112. package/docs/verification-matrix.md +37 -26
  113. package/examples/example-dag.json +51 -51
  114. package/examples/hybrid-loop-agent-dag.json +194 -194
  115. package/harness.json +5 -5
  116. package/package.json +62 -61
  117. package/skills/ai-engineering-context/SKILL.md +21 -21
  118. package/skills/loop-agent/SKILL.md +56 -171
  119. package/skills/loop-agent/references/README.md +6 -2
  120. package/skills/loop-agent/references/command-reference.md +107 -65
  121. package/skills/loop-agent/references/harness-policy.md +115 -115
  122. package/skills/loop-agent/references/hybrid-dag.md +30 -30
  123. package/skills/loop-agent/references/learned/README.md +13 -13
  124. package/skills/loop-agent/references/long-running-loop.md +59 -0
  125. package/skills/loop-agent/references/model-routing.md +1 -1
  126. package/skills/loop-agent/references/orchestrator-and-interventions.md +1 -1
  127. package/skills/loop-agent/references/pi-prompt.md +9 -9
  128. package/skills/loop-agent/references/pi-subagent-assisted-mode.md +0 -2
  129. package/skills/loop-agent/references/post-implementation-and-patterns.md +7 -7
  130. package/skills/loop-agent/references/task-workflow.md +19 -19
  131. package/skills/loop-agent/references/verification-and-failure-handling.md +54 -0
  132. package/skills/requesting-code-review/SKILL.md +40 -40
  133. package/skills/requesting-code-review/code-reviewer.md +4 -4
  134. package/skills/systematic-debugging/CREATION-LOG.md +43 -43
  135. package/skills/systematic-debugging/SKILL.md +113 -113
  136. package/skills/systematic-debugging/condition-based-waiting.md +20 -20
  137. package/skills/systematic-debugging/defense-in-depth.md +27 -27
  138. package/skills/systematic-debugging/root-cause-tracing.md +38 -38
  139. package/skills/systematic-debugging/test-academic.md +6 -6
  140. package/skills/systematic-debugging/test-pressure-1.md +6 -6
  141. package/skills/systematic-debugging/test-pressure-2.md +2 -2
  142. package/skills/systematic-debugging/test-pressure-3.md +6 -6
  143. package/skills/verification-before-completion/SKILL.md +37 -37
@@ -0,0 +1,147 @@
1
+ # Runtime Boundaries
2
+
3
+ 本文定义 loop-agent 各 runtime 层的 module interface、允许的依赖方向,以及治理检查 hook。目标是把「命令、文档、import 架构」从多处维护收敛为可机器校验的边界契约,而不在本阶段改变 runtime 行为。
4
+
5
+ ## 分层概览
6
+
7
+ ```text
8
+ Skill layer
9
+ └─ 入口策略、reference 路由、硬规则(skills/loop-agent/SKILL.md + references/)
10
+
11
+ CLI layer (src/cli/)
12
+ └─ argv 解析、adapter 解析、调用 application / command handler、格式化输出
13
+
14
+ Application layer (src/application/,逐步引入)
15
+ └─ 一次用户意图的 typed use-case interface,供 CLI、Loop、Workflow 复用
16
+
17
+ Workflow runtime (src/workflows/)
18
+ └─ DAG / Dynamic / Loop 核心执行规则;不应依赖 commands
19
+
20
+ Executors (src/executors/)
21
+ └─ Cursor / Pi / Shell 等外部工具适配;不应依赖 commands 或 CLI formatting
22
+
23
+ Infrastructure / Store (src/infrastructure/,逐步引入)
24
+ └─ .harness 文件系统副作用、run lifecycle、原子写入规则
25
+
26
+ Governance (scripts/check-*.sh, src/governance/)
27
+ └─ 防止 command registry、skill entry、import architecture 漂移
28
+ ```
29
+
30
+ ## 各层职责
31
+
32
+ ### Skill layer
33
+
34
+ - **位置**:`skills/loop-agent/SKILL.md` 及 `skills/loop-agent/references/**`
35
+ - **职责**:定义 agent 何时启用 loop-agent、默认执行路径(Agent DAG)、硬规则与 reference 路由;不承载完整操作手册。
36
+ - **禁止**:在入口 skill 中重复维护 CLI command 列表或与 `src/cli/catalog.ts` 冲突的事实源。
37
+
38
+ ### CLI layer
39
+
40
+ - **位置**:`src/cli.ts`、`src/cli/**`
41
+ - **职责**:解析全局 flag(如 `--repo-root`)、解析 top-level / subcommand、调用 command handler、输出 help / JSON / Markdown。
42
+ - **允许依赖**:`src/commands/**`(handler wiring)、`src/adapters/**`、`src/shared/**`、逐步引入的 `src/application/**`。
43
+ - **禁止**:在 router 中维护与 catalog 独立的 command 事实源(Phase 1 整改目标)。
44
+
45
+ ### Application layer
46
+
47
+ - **位置**:`src/application/**`(按计划逐步引入)
48
+ - **职责**:封装一次用户意图的 typed result(如 validate DAG、run DAG、report),供 CLI 与 workflow runtime 共用。
49
+ - **允许依赖**:`src/workflows/**`、`src/infrastructure/**`、`src/task/**`、`src/records/**`。
50
+ - **禁止**:直接承担 CLI formatting 或 argv 解析。
51
+
52
+ ### Workflow runtime
53
+
54
+ - **位置**:`src/workflows/dag/**`、`src/workflows/dynamic/**`、`src/workflows/loop/**`
55
+ - **职责**:DAG spec 校验与执行、dynamic workflow 编译与 expansion、Loop 状态机与 action 编排。
56
+ - **允许依赖**:`src/executors/**`、`src/task/**`、`src/records/**`、`src/shared/**`、application use-case(目标态)。
57
+ - **禁止**:`import` 来自 `src/commands/**`(见下方过渡例外)。
58
+
59
+ ### Executors
60
+
61
+ - **位置**:`src/executors/**`
62
+ - **职责**:封装 Cursor SDK/CLI、Pi SDK/CLI、shell 执行与 write guard。
63
+ - **允许依赖**:`src/shared/**`、外部 SDK。
64
+ - **禁止**:依赖 `src/commands/**` 或 CLI 输出格式。
65
+
66
+ ### Infrastructure / Store
67
+
68
+ - **位置**:`src/infrastructure/harness/**`(按计划逐步引入);过渡期部分逻辑仍在 `src/workflows/dag/lifecycle.ts`、`src/records/**`。
69
+ - **职责**:`.harness/tasks`、`.harness/dag-runs`、`.harness/runs`、loop state 的集中读写;completed run facts 只读约束。
70
+ - **禁止**:把 raw path mutation 扩散给 runner、loop action 或 command handler。
71
+
72
+ ### Governance
73
+
74
+ - **位置**:`scripts/check-repo.sh` 及子脚本、`src/governance/**`、相关 Vitest。
75
+ - **职责**:在 CI / in-flight DAG 中检测文档链接、exec plan 状态、架构 import、command registry 漂移、skill entry 完整性。
76
+
77
+ ## 允许的依赖方向
78
+
79
+ ```text
80
+ Skill (docs) ──advisory──> CLI catalog / command-reference(人类可读,机器 drift check)
81
+
82
+ CLI ──────────> Application (目标态)
83
+ CLI ──────────> Commands (handler 薄层)
84
+ Commands ──────────> Application / Workflows / Infrastructure
85
+
86
+ Workflow runtime ──────────> Executors / Task / Records / Application (目标态)
87
+ Workflow runtime ──X──> Commands (目标态禁止;见过渡例外)
88
+
89
+ Executors ──────────> Shared / 外部 SDK
90
+ Executors ──X──> Commands / CLI
91
+
92
+ Application ──────────> Workflows / Infrastructure / Task / Records
93
+ Application ──X──> CLI formatting
94
+
95
+ Infrastructure ──────────> Shared / node:fs
96
+ Runner / Loop ──(迁移中)──> 逐步改为仅经 Store / Application
97
+ ```
98
+
99
+ **规则摘要**
100
+
101
+ | From | May import | Must not import |
102
+ |------|------------|-----------------|
103
+ | `src/commands/**` | application, workflows, infrastructure, task, records, executors, shared | — |
104
+ | `src/workflows/**` | executors, task, records, shared, application(目标) | `src/commands/**` |
105
+ | `src/executors/**` | shared, 外部 SDK | `src/commands/**`, `src/cli/**` |
106
+ | `src/cli/**` | commands, adapters, shared, application(目标) | — |
107
+ | `skills/**` | (Markdown 引用,非 TS import) | 运行时 TS 模块 |
108
+
109
+ ## 已知过渡耦合
110
+
111
+ 当前没有允许的 `src/workflows/**` 或 `src/executors/**` → `src/commands/**` TypeScript import。
112
+
113
+ `scripts/check-architecture-boundaries.sh` 的 transitional allowlist 保持为空。任何新增的 `workflows/executors -> commands` import 必须导致检查 **exit 1**;如果未来确有临时例外,必须先写入 active exec plan,说明移除时间和验证门禁。
114
+
115
+ ## Governance 钩子
116
+
117
+ 以下脚本由 `scripts/check-repo.sh` 调用(Phase 0 起):
118
+
119
+ | Script | 检查内容 | 失败条件 |
120
+ |--------|----------|----------|
121
+ | `scripts/check-architecture-boundaries.sh` | `workflows` / `executors` → `commands` import | 新的未 allowlist violation |
122
+ | `scripts/check-command-registry-drift.sh` | `command-reference.md` 中的 top-level command vs `src/cli/catalog.ts` | 文档引用未注册 command |
123
+ | `scripts/check-skill-entry.sh` | `SKILL.md` reference 文件存在、行数阈值 | reference 缺失(fail);行数 > 220(warn) |
124
+
125
+ 相关 exec plan:`docs/exec-plans/active/2026-07-04-runtime-boundary-remediation.md`。
126
+
127
+ ### 验证命令
128
+
129
+ ```bash
130
+ bash scripts/check-repo.sh
131
+ bash scripts/check-architecture-boundaries.sh
132
+ bash scripts/check-command-registry-drift.sh
133
+ bash scripts/check-skill-entry.sh
134
+ ```
135
+
136
+ Runtime 变更另需 `npm run typecheck` 及对应 targeted Vitest(见 exec plan 各 Phase 验证关口)。
137
+
138
+ ## 演进里程碑
139
+
140
+ | Phase | 边界变化 |
141
+ |-------|----------|
142
+ | 0(当前) | 文档 + 机器 guard;已知 loop/actions.ts 耦合 advisory |
143
+ | 1 | CLI command definition 单源 |
144
+ | 2 | Skill entry 瘦身 + frontmatter references |
145
+ | 3 | DAG application use-case;Loop 开始脱离 command JSON |
146
+ | 6 | `workflows → commands` import check 已从 advisory 改为 **fail** |
147
+ | 7 | Harness Store / Repository 集中 `.harness` 副作用 |
@@ -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,5 +1,10 @@
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.
1
+ # 进行中的执行计划
2
+
3
+ 本目录存放当前进行中的 execution plan。
4
+
5
+ 源码仓库可在本 README 旁保留具体 active plan 文件。npm 包只携带本 README 作为目录契约,不复制 loop-agent 源码历史的 active plan;目标仓库自行生成 active plan。
6
+
7
+ 当前 active plan:
8
+
9
+ - [2026-07-04-dag-role-skill-alignment.md](2026-07-04-dag-role-skill-alignment.md)
10
+ - [2026-07-06-production-readiness-hardening.md](2026-07-06-production-readiness-hardening.md)
@@ -1,5 +1,9 @@
1
- # Completed Execution Plans
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.
1
+ # 已完成的执行计划
2
+
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 fallback,runtime、文档与 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 策略