@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.
- package/AGENTS.md +43 -24
- package/CHANGELOG.md +72 -44
- package/README.md +177 -164
- package/bin/loop-agent.js +21 -21
- package/dist/application/dag/args.js +6 -0
- package/dist/application/dag/generate-task-dag.js +5 -3
- package/dist/application/dag/run-dag.js +17 -1
- package/dist/application/dag/validate-dag.js +41 -0
- package/dist/cli/command-definitions.js +2 -2
- package/dist/cli/program.js +24 -4
- package/dist/commands/init.js +1036 -461
- package/dist/workflows/dag/dynamic-runtime/loop-until.js +2 -1
- package/dist/workflows/dag/dynamic-runtime/map.js +1 -0
- package/dist/workflows/dag/failure-routing.js +82 -0
- package/dist/workflows/dag/init-hybrid.js +3 -3
- package/dist/workflows/dag/lifecycle.js +95 -3
- package/dist/workflows/dag/report.js +73 -1
- package/dist/workflows/dag/skills.js +3 -3
- package/dist/workflows/dag/types.js +2 -0
- package/dist/workflows/dynamic/compile.js +11 -0
- package/dist/workflows/dynamic/spec.js +1 -0
- package/docs/README.md +50 -45
- package/docs/agent-dag-recovery-playbook.md +32 -6
- package/docs/agent-dag-runner.md +19 -17
- package/docs/architecture/runtime-boundaries.md +1 -1
- package/docs/cursor-executor-usage.md +5 -5
- package/docs/decisions/README.md +2 -2
- package/docs/design/README.md +24 -24
- package/docs/development-principles.md +50 -50
- package/docs/dynamic-workflow-dag-engine-roadmap.md +6 -6
- package/docs/exec-plans/README.md +4 -4
- package/docs/exec-plans/active/README.md +7 -9
- package/docs/exec-plans/completed/README.md +10 -8
- package/docs/feature-workflow.md +111 -109
- package/docs/harness-methodology-verification.md +18 -18
- package/docs/init-surface.manifest.json +175 -0
- package/docs/loop-agent-harness.md +36 -36
- package/docs/production-readiness.md +96 -0
- package/docs/progress/README.md +2 -2
- package/docs/reports/README.md +4 -2
- package/docs/skills/README.md +6 -0
- package/docs/skills/vetted-skill-registry.md +26 -0
- package/docs/templates/agent-dag-decision-gate-dogfood-report.md +1 -1
- package/docs/templates/agent-dag-process-supervisor.prompt.md +2 -2
- package/docs/templates/agent-dag-report.schema.json +33 -2
- package/docs/templates/agent-dag-review-verdict.prompt.md +1 -1
- package/docs/templates/agent-dag.base.json +195 -195
- package/docs/templates/agent-dag.final-verification.json +190 -190
- package/docs/templates/agent-dag.schema.json +17 -17
- package/docs/templates/agent-dag.supervised-implementation.json +500 -500
- package/docs/templates/hybrid-dag.json +193 -193
- package/docs/templates/init-evolution-review.md +33 -0
- package/docs/templates/production-readiness-checklist.md +57 -0
- package/docs/templates/progress-log.md +7 -7
- package/docs/templates/project-start-checklist.md +8 -8
- package/docs/templates/qa-report.md +17 -11
- package/docs/templates/sprint-contract.md +19 -19
- package/docs/verification-matrix.md +37 -26
- package/examples/example-dag.json +51 -51
- package/examples/hybrid-loop-agent-dag.json +194 -194
- package/harness.json +10 -8
- package/package.json +60 -58
- package/skills/code-review-core/SKILL.md +20 -0
- package/skills/codebase-scout/SKILL.md +19 -0
- package/skills/init-capability-evolution/SKILL.md +69 -0
- package/skills/loop-agent/SKILL.md +35 -35
- package/skills/loop-agent/references/command-reference.md +125 -65
- package/skills/loop-agent/references/harness-policy.md +30 -30
- package/skills/loop-agent/references/hybrid-dag.md +30 -30
- package/skills/loop-agent/references/model-routing.md +1 -1
- package/skills/loop-agent/references/orchestrator-and-interventions.md +1 -1
- package/skills/loop-agent/references/pi-prompt.md +9 -9
- package/skills/loop-agent/references/post-implementation-and-patterns.md +7 -7
- package/skills/loop-agent/references/task-workflow.md +19 -19
- package/skills/loop-agent/references/verification-and-failure-handling.md +36 -0
- package/skills/test-driven-development/SKILL.md +20 -0
- package/skills/webapp-testing/SKILL.md +19 -0
package/docs/README.md
CHANGED
|
@@ -1,62 +1,67 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 文档索引
|
|
2
2
|
|
|
3
|
-
`docs/`
|
|
3
|
+
`docs/` 是 loop-agent 的治理根目录,包含工作流规则、方法论、验证规则、执行计划、报告、进度日志、决策记录和可复用模板。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
顶层 `AGENTS.md` 是操作地图。长期知识应落在此处:决策、契约、计划、验证证据、调试笔记和可复用流程规则应记录在 `docs/` 下,而不是只留在聊天里。
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 核心文档
|
|
8
8
|
|
|
9
|
-
- `development-principles.md` —
|
|
10
|
-
- `architecture/runtime-boundaries.md` — runtime
|
|
11
|
-
- `feature-workflow.md` —
|
|
12
|
-
- `verification-matrix.md` —
|
|
13
|
-
- `
|
|
14
|
-
- `agent-
|
|
15
|
-
- `
|
|
16
|
-
- `
|
|
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
|
-
##
|
|
20
|
+
## 方法论
|
|
19
21
|
|
|
20
|
-
- `harness-methodology-tdd.md` —
|
|
21
|
-
- `harness-methodology-verification.md` —
|
|
22
|
-
- `harness-methodology-debugging.md` —
|
|
22
|
+
- `harness-methodology-tdd.md` — 行为变更与 bug 修复的 TDD 纪律
|
|
23
|
+
- `harness-methodology-verification.md` — 完成声明前的验证纪律
|
|
24
|
+
- `harness-methodology-debugging.md` — 修复前的系统化调试工作流
|
|
23
25
|
|
|
24
|
-
##
|
|
26
|
+
## 产物目录
|
|
25
27
|
|
|
26
|
-
- `design/README.md` —
|
|
27
|
-
- `exec-plans/active/README.md` —
|
|
28
|
-
- `exec-plans/completed/README.md` —
|
|
29
|
-
- `progress/README.md` —
|
|
30
|
-
- `reports/README.md` —
|
|
31
|
-
- `decisions/README.md` —
|
|
32
|
-
- `
|
|
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
|
-
##
|
|
37
|
+
## 仓库 Skills
|
|
35
38
|
|
|
36
|
-
- `../skills/loop-agent/` — loop-agent
|
|
37
|
-
-
|
|
39
|
+
- `../skills/loop-agent/` — loop-agent 自身的 skill 指令与参考资料
|
|
40
|
+
- 每个额外 skill 在仓库根 `../skills/` 下使用独立子目录;这些本地副本由 DAG 模板引用,维护不依赖外部 agent skill 目录
|
|
38
41
|
|
|
39
|
-
##
|
|
42
|
+
## 模板
|
|
40
43
|
|
|
41
|
-
- `templates/project-start-checklist.md` —
|
|
42
|
-
- `templates/feature-spec.md` —
|
|
43
|
-
- `templates/sprint-contract.md` —
|
|
44
|
-
- `templates/exec-plan.md` —
|
|
45
|
-
- `templates/progress-log.md` —
|
|
46
|
-
- `templates/qa-report.md` —
|
|
47
|
-
- `templates/
|
|
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
|
-
##
|
|
54
|
+
## 维护
|
|
50
55
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
bash scripts/check-repo.sh
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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 |
|
package/docs/agent-dag-runner.md
CHANGED
|
@@ -1,40 +1,42 @@
|
|
|
1
1
|
# Agent DAG Runner
|
|
2
2
|
|
|
3
|
-
Agent DAG
|
|
3
|
+
Agent DAG 是 loop-agent 的声明式编排 runtime。DAG 将工作拆为节点、按序执行 eligible ranks、记录 artifacts,并用 gate 做 review 与验证。
|
|
4
4
|
|
|
5
|
-
##
|
|
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>`
|
|
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
|
|
18
|
-
- `shell
|
|
19
|
-
- `pi
|
|
20
|
-
- `cursor
|
|
17
|
+
- `static`:确定性生成的 artifacts 或 notes
|
|
18
|
+
- `shell`:验证与文件系统检查
|
|
19
|
+
- `pi`:规划、review、诊断;节点设 `toolProfile: "write"` 时有界写入
|
|
20
|
+
- `cursor`:显式启用时的可选有界写后端
|
|
21
21
|
|
|
22
22
|
## Skills
|
|
23
23
|
|
|
24
|
-
DAG
|
|
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
|
-
|
|
28
|
+
`loop-agent` skill 位于 `skills/loop-agent/SKILL.md`。遗留根路径 `skill/SKILL.md` 仅为旧 worktree 保留兼容 fallback。
|
|
27
29
|
|
|
28
30
|
## Artifacts
|
|
29
31
|
|
|
30
|
-
DAG artifacts
|
|
32
|
+
DAG artifacts 位于:
|
|
31
33
|
|
|
32
34
|
```text
|
|
33
35
|
.harness/dag-runs/<state>/<run-id>/artifacts/<node-id>/
|
|
34
36
|
```
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
根目录 `artifacts/` 不是有效的默认 DAG artifact 位置。
|
|
37
39
|
|
|
38
40
|
## Shell Gates
|
|
39
41
|
|
|
40
|
-
- `shell.verdictGate`
|
|
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
|
|
115
|
+
## Governance 钩子
|
|
116
116
|
|
|
117
117
|
以下脚本由 `scripts/check-repo.sh` 调用(Phase 0 起):
|
|
118
118
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# Cursor Executor
|
|
1
|
+
# Cursor Executor 用法
|
|
2
2
|
|
|
3
|
-
Cursor
|
|
3
|
+
Cursor 用于有界写实现。每个 Cursor 写任务必须显式定义 scope。
|
|
4
4
|
|
|
5
|
-
##
|
|
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
|
-
-
|
|
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
|
-
|
|
25
|
+
Cursor 返回后,主会话必须检查 diff 并运行相关验证命令。
|
package/docs/decisions/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 决策
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
本目录存放架构决策记录(ADR)。
|
package/docs/design/README.md
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 设计笔记
|
|
2
2
|
|
|
3
|
-
`docs/design/`
|
|
3
|
+
`docs/design/` 存放将 `loop-agent` 作为更大产品线 agent 平台内仓库本地 runtime 的规划笔记。这些是设计输入,不是 `src/` 已具备该能力的证明。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 文档
|
|
6
6
|
|
|
7
|
-
|
|
|
7
|
+
| 文档 | 用途 |
|
|
8
8
|
|---|---|
|
|
9
|
-
| `产品线共享知识库.md` |
|
|
10
|
-
| `研发模式.md` | 10
|
|
11
|
-
| `1个月规划.md` |
|
|
12
|
-
| `1月wbs.md` |
|
|
13
|
-
| `六个月规划.md` |
|
|
14
|
-
| `taskspec-to-loop-agent-mapping.md` |
|
|
15
|
-
| `state-and-failure-taxonomy.md` |
|
|
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
|
-
##
|
|
17
|
+
## 当前实现边界
|
|
18
18
|
|
|
19
|
-
`loop-agent`
|
|
19
|
+
`loop-agent` 当前拥有:仓库本地 harness、Agent DAG 生成/验证/执行、shell 验证、artifacts、reports、Loop state。它不是产品线 Task Pool、Orchestrator、docs-sync 服务、Git/CI 平台或 artifact store。
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
设计文档使用两类 profile 名称:
|
|
22
22
|
|
|
23
|
-
- Business task profiles
|
|
24
|
-
-
|
|
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
|
-
|
|
26
|
+
除非 CLI 显式扩展支持,否则不要把 business task profile 直接传给 `loop-agent dag run-task --profile`。用 `taskspec-to-loop-agent-mapping.md` 将 business profile 路由到当前 governance profile。
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## 维护规则
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
设计笔记变更时:
|
|
31
31
|
|
|
32
|
-
1.
|
|
33
|
-
2.
|
|
34
|
-
3.
|
|
35
|
-
4.
|
|
36
|
-
5.
|
|
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
|
-
#
|
|
1
|
+
# 开发原则
|
|
2
2
|
|
|
3
|
-
loop-agent
|
|
3
|
+
loop-agent 是面向 agentic coding 的工作流 runtime。仓库应保持小而显式、可验证。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 操作立场
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
项目采用「人类掌舵、智能体执行」的工程模型。Agent 可实现、验证与总结,但持久意图与完成证据必须落在仓库中。
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
- `AGENTS.md`
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
9
|
+
- 仓库是记录系统。决策、契约、计划、测试、报告与交接属于 tracked files。
|
|
10
|
+
- `AGENTS.md` 是操作地图,不是知识 dump。长期方法论与决策属于 `docs/`。
|
|
11
|
+
- 工作以小步、可逆、可验证的增量推进。
|
|
12
|
+
- 状态不确定时,先跑基线验证再开新工。
|
|
13
|
+
- 完成由新鲜证据定义,而非意图或信心。
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## 原则
|
|
16
16
|
|
|
17
|
-
1.
|
|
18
|
-
2.
|
|
19
|
-
3. Shell
|
|
20
|
-
4. Runtime
|
|
21
|
-
5. Pi writer
|
|
22
|
-
6. Pi review/planning
|
|
23
|
-
7.
|
|
24
|
-
8.
|
|
25
|
-
9.
|
|
26
|
-
10.
|
|
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
|
-
##
|
|
28
|
+
## 仓库结构
|
|
29
29
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
- Skill
|
|
33
|
-
-
|
|
34
|
-
-
|
|
30
|
+
- 源码:`src/`
|
|
31
|
+
- 测试:`test/`
|
|
32
|
+
- Skill 指令:`skills/`
|
|
33
|
+
- 验证与维护脚本:`scripts/`
|
|
34
|
+
- 治理与交接产物:`docs/`
|
|
35
35
|
|
|
36
|
-
##
|
|
36
|
+
## 变更纪律
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
行为变更要更新测试;工作流或命令变更要更新文档与示例;治理变更要更新 `harness.json` 与相关检查脚本。
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
当工作影响需求、行为、跨命令契约或 harness 规则时,更新对应持久产物:
|
|
41
41
|
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
- progress
|
|
45
|
-
-
|
|
46
|
-
-
|
|
42
|
+
- 设计/契约文档 — 变更后的预期
|
|
43
|
+
- 测试或验证脚本 — 变更后的行为
|
|
44
|
+
- progress log 或 report — 非平凡交接证据
|
|
45
|
+
- ADR — 架构或公开契约决策
|
|
46
|
+
- 模板 — 重复流程可复用时
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
除非 contract 明确说明必须一起移动,否则不要在一个工作块里混合无关重构、新功能与大规模文档迁移。
|
|
49
49
|
|
|
50
|
-
##
|
|
50
|
+
## 搜索与复用
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
实现前先检视现有系统:
|
|
53
53
|
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
54
|
+
- 仓库已索引且任务需要理解代码时,优先用 CodeGraph。
|
|
55
|
+
- 可用时用 `rg` 做文本搜索、`fd` 找文件。
|
|
56
|
+
- 引入新 helper 前先读邻近测试与 helper。
|
|
57
|
+
- 优先结构化 parser 与现有本地 API,避免 ad hoc 字符串处理。
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
在搜索证明否则之前,假设系统可能已有部分解法。
|
|
60
60
|
|
|
61
|
-
##
|
|
61
|
+
## 完成纪律
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
完成声明必须回答:
|
|
64
64
|
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
65
|
+
- 改了什么
|
|
66
|
+
- 为何选此方案
|
|
67
|
+
- 哪条命令验证、结果如何
|
|
68
|
+
- 是否影响契约、文档、测试或脚本
|
|
69
|
+
- 剩余风险或后续项
|
|
70
70
|
|
|
71
|
-
|
|
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
|
-
#
|
|
1
|
+
# 执行计划
|
|
2
2
|
|
|
3
|
-
- `active/README.md`
|
|
4
|
-
- `completed/README.md`
|
|
3
|
+
- `active/README.md` — 当前进行中的计划
|
|
4
|
+
- `completed/README.md` — 已完成的计划
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
影响多文件、公开命令行为或仓库治理的变更应使用 execution plan。
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
#
|
|
1
|
+
# 已完成的执行计划
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- [`2026-07-02-loop-agent-subject-restructure.md`](2026-07-02-loop-agent-subject-restructure.md) —
|
|
8
|
-
- [`2026-07-04-remove-level1-fallback.md`](2026-07-04-remove-level1-fallback.md) —
|
|
9
|
-
- [`2026-07-04-runtime-boundary-remediation.md`](2026-07-04-runtime-boundary-remediation.md) —
|
|
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 策略
|
|
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 验证
|