@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.
- package/AGENTS.md +62 -45
- package/CHANGELOG.md +60 -28
- package/README.md +160 -124
- package/bin/loop-agent.js +21 -21
- package/dist/adapters/index.js +3 -2
- package/dist/adapters/loop-agent.js +44 -2
- package/dist/application/dag/args.js +420 -0
- package/dist/application/dag/generate-task-dag.js +280 -0
- package/dist/application/dag/report-dag.js +14 -0
- package/dist/application/dag/run-dag.js +106 -0
- package/dist/application/dag/validate-dag.js +102 -0
- package/dist/application/loop/run-action.js +23 -0
- package/dist/cli/catalog.js +2 -237
- package/dist/cli/command-definitions.js +571 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/program.js +65 -1
- package/dist/cli/router.js +13 -0
- package/dist/cli-governance/active-residue-check.js +38 -0
- package/dist/commands/dag-report.js +6 -107
- package/dist/commands/dag-run-task.js +8 -466
- package/dist/commands/dag-validate.js +7 -179
- package/dist/commands/examples.js +90 -0
- package/dist/commands/init.js +1518 -0
- package/dist/commands/loop.js +57 -31
- package/dist/commands/pi-prompt.js +2 -9
- package/dist/commands/run-dag.js +7 -180
- package/dist/executors/cursor-executor-artifacts.js +3 -4
- package/dist/executors/cursor-worker-client.js +13 -3
- package/dist/executors/dag-cursor-executor.js +2 -3
- package/dist/executors/dag-pi-executor.js +3 -4
- package/dist/executors/dag-static-executor.js +2 -5
- package/dist/executors/pi-defaults.js +9 -0
- package/dist/executors/shell-executor.js +12 -20
- package/dist/governance/manifest-types.js +1 -0
- package/dist/infrastructure/harness/active-residue-policy.js +73 -0
- package/dist/infrastructure/harness/artifact-store.js +72 -0
- package/dist/infrastructure/harness/atomic-write.js +49 -0
- package/dist/infrastructure/harness/completed-facts-guard.js +40 -0
- package/dist/infrastructure/harness/loop-action-store.js +23 -0
- package/dist/infrastructure/harness/loop-store.js +41 -0
- package/dist/infrastructure/harness/one-shot-run-store.js +94 -0
- package/dist/infrastructure/harness/task-store.js +77 -0
- package/dist/records/one-shot-runs.js +26 -61
- package/dist/records/promotion.js +3 -4
- package/dist/shared/artifacts-core.js +5 -5
- package/dist/shared/logger.js +9 -15
- package/dist/task/delegate.js +4 -4
- package/dist/task/runtime.js +5 -7
- package/dist/task/state.js +6 -20
- package/dist/workflows/dag/convergence/controller.js +277 -0
- package/dist/workflows/dag/dynamic-runtime/condition.js +48 -0
- package/dist/workflows/dag/dynamic-runtime/loop-until.js +156 -0
- package/dist/workflows/dag/dynamic-runtime/map.js +185 -0
- package/dist/workflows/dag/dynamic-runtime/reduction.js +72 -0
- package/dist/workflows/dag/dynamic-runtime/shared.js +133 -0
- package/dist/workflows/dag/failure-routing.js +82 -0
- package/dist/workflows/dag/lifecycle.js +101 -8
- package/dist/workflows/dag/node-execution.js +262 -0
- package/dist/workflows/dag/report.js +73 -1
- package/dist/workflows/dag/run-store.js +36 -0
- package/dist/workflows/dag/runner.js +82 -1341
- package/dist/workflows/dag/scheduler.js +84 -0
- package/dist/workflows/dag/upstream-artifacts.js +20 -18
- package/dist/workflows/loop/actions/cursor-fix.js +191 -0
- package/dist/workflows/loop/actions/dag-action.js +130 -0
- package/dist/workflows/loop/actions/pi-review.js +267 -0
- package/dist/workflows/loop/actions/shared.js +157 -0
- package/dist/workflows/loop/actions/shell-verify.js +82 -0
- package/dist/workflows/loop/actions/types.js +1 -0
- package/dist/workflows/loop/actions/workflow-action.js +255 -0
- package/dist/workflows/loop/actions.js +55 -1212
- package/dist/workflows/loop/closeout.js +5 -4
- package/dist/workflows/loop/context.js +2 -3
- package/dist/workflows/loop/events.js +3 -2
- package/dist/workflows/loop/policy/auto-policy.js +104 -0
- package/dist/workflows/loop/policy/cursor-fix-policy.js +31 -0
- package/dist/workflows/loop/rounds.js +3 -3
- package/dist/workflows/loop/signals.js +4 -7
- package/dist/workflows/loop/state.js +11 -11
- package/docs/README.md +47 -44
- package/docs/agent-dag-recovery-playbook.md +32 -6
- package/docs/agent-dag-runner.md +17 -17
- package/docs/architecture/runtime-boundaries.md +147 -0
- 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 +10 -5
- package/docs/exec-plans/completed/README.md +9 -5
- package/docs/feature-workflow.md +111 -109
- package/docs/harness-methodology-verification.md +18 -18
- 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/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/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 +5 -5
- package/package.json +62 -61
- package/skills/ai-engineering-context/SKILL.md +21 -21
- package/skills/loop-agent/SKILL.md +56 -171
- package/skills/loop-agent/references/README.md +6 -2
- package/skills/loop-agent/references/command-reference.md +107 -65
- package/skills/loop-agent/references/harness-policy.md +115 -115
- package/skills/loop-agent/references/hybrid-dag.md +30 -30
- package/skills/loop-agent/references/learned/README.md +13 -13
- package/skills/loop-agent/references/long-running-loop.md +59 -0
- 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/pi-subagent-assisted-mode.md +0 -2
- 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 +54 -0
- package/skills/requesting-code-review/SKILL.md +40 -40
- package/skills/requesting-code-review/code-reviewer.md +4 -4
- package/skills/systematic-debugging/CREATION-LOG.md +43 -43
- package/skills/systematic-debugging/SKILL.md +113 -113
- package/skills/systematic-debugging/condition-based-waiting.md +20 -20
- package/skills/systematic-debugging/defense-in-depth.md +27 -27
- package/skills/systematic-debugging/root-cause-tracing.md +38 -38
- package/skills/systematic-debugging/test-academic.md +6 -6
- package/skills/systematic-debugging/test-pressure-1.md +6 -6
- package/skills/systematic-debugging/test-pressure-2.md +2 -2
- package/skills/systematic-debugging/test-pressure-3.md +6 -6
- package/skills/verification-before-completion/SKILL.md +37 -37
|
@@ -2,52 +2,52 @@
|
|
|
2
2
|
|
|
3
3
|
需要 loop-agent 的精确 CLI 命令、setup 命令、task lifecycle 命令、docs helper、goal 命令或 stats 时使用本文。
|
|
4
4
|
|
|
5
|
-
## loop-agent 入口
|
|
6
|
-
|
|
7
|
-
**优先在目标 repo 目录内执行命令** — loop-agent 通过 `harness.json.project` 自动检测使用哪个 repo adapter。跨目录操作时显式加 `--repo-root <target-repo>`。
|
|
8
|
-
|
|
9
|
-
默认使用全局 CLI:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
loop-agent <command> ...
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
面向自举迭代和日常使用时,全局 CLI 应来自 npm 上已发布的安装包。首次安装或有意升级使用 `@latest`:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install -g @tea-agent/loop-agent@latest
|
|
19
|
-
npm list -g @tea-agent/loop-agent --depth=0
|
|
20
|
-
loop-agent doctor
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
一次自举任务启动后不要中途升级控制器;记录 `npm list -g` 显示的实际版本。不要在 DAG 节点中反复用 `npx @latest` 拉取,也不要使用当前工作区的 `npm link` 或 `npm run dev` 作为控制器去修改 loop-agent 本仓库的 CLI、DAG runtime、executor、package metadata 或 build output。`npm run dev -- <command> ...` 只用于源码调试和聚焦 CLI 开发。
|
|
24
|
-
|
|
25
|
-
发布包入口加载 `dist/cli.js`;开发入口加载 `src/cli.ts`。
|
|
26
|
-
|
|
27
|
-
发布包携带静态能力资料:`skills/`、`docs/*.md`、`docs/templates/` 和 `examples/`。`docs/progress/`、`docs/reports/`、`docs/exec-plans/`、`docs/decisions/` 的任务正文属于目标仓库运行中生成的事实,不从 npm 包复制;包内只保留这些目录的 README 说明。
|
|
28
|
-
|
|
29
|
-
## 命令参考
|
|
5
|
+
## loop-agent 入口
|
|
6
|
+
|
|
7
|
+
**优先在目标 repo 目录内执行命令** — loop-agent 通过 `harness.json.project` 自动检测使用哪个 repo adapter。跨目录操作时显式加 `--repo-root <target-repo>`。
|
|
8
|
+
|
|
9
|
+
默认使用全局 CLI:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
loop-agent <command> ...
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
面向自举迭代和日常使用时,全局 CLI 应来自 npm 上已发布的安装包。首次安装或有意升级使用 `@latest`:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g @tea-agent/loop-agent@latest
|
|
19
|
+
npm list -g @tea-agent/loop-agent --depth=0
|
|
20
|
+
loop-agent doctor
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
一次自举任务启动后不要中途升级控制器;记录 `npm list -g` 显示的实际版本。不要在 DAG 节点中反复用 `npx @latest` 拉取,也不要使用当前工作区的 `npm link` 或 `npm run dev` 作为控制器去修改 loop-agent 本仓库的 CLI、DAG runtime、executor、package metadata 或 build output。`npm run dev -- <command> ...` 只用于源码调试和聚焦 CLI 开发。
|
|
24
|
+
|
|
25
|
+
发布包入口加载 `dist/cli.js`;开发入口加载 `src/cli.ts`。
|
|
26
|
+
|
|
27
|
+
发布包携带静态能力资料:`skills/`、`docs/*.md`、`docs/templates/` 和 `examples/`。`docs/progress/`、`docs/reports/`、`docs/exec-plans/`、`docs/decisions/` 的任务正文属于目标仓库运行中生成的事实,不从 npm 包复制;包内只保留这些目录的 README 说明。
|
|
28
|
+
|
|
29
|
+
## 命令参考
|
|
30
30
|
|
|
31
31
|
## 默认选择模型
|
|
32
32
|
|
|
33
33
|
选择命令时按以下优先级:
|
|
34
34
|
|
|
35
|
-
1. **主路径 DAG**,用于常规 autonomous work:
|
|
36
|
-
```bash
|
|
37
|
-
loop-agent new-task <task-id> "Task Title"
|
|
38
|
-
loop-agent dag run-task <task-id> --profile auto --strict-models --output <temp-dir>/<task-id>-dag.json
|
|
39
|
-
loop-agent dag validate --dag <temp-dir>/<task-id>-dag.json --strict-models --strict-governance
|
|
40
|
-
loop-agent run-dag --dag <temp-dir>/<task-id>-dag.json --cwd <repo-root>
|
|
41
|
-
```
|
|
42
|
-
`<temp-dir>` 表示平台原生临时目录;也可以省略 `--output`,再使用命令 JSON 输出里的 `outputPath`。
|
|
43
|
-
2. **Operator 工具**,用于 recovery、诊断与 closeout:
|
|
44
|
-
```bash
|
|
35
|
+
1. **主路径 DAG**,用于常规 autonomous work:
|
|
36
|
+
```bash
|
|
37
|
+
loop-agent new-task <task-id> "Task Title"
|
|
38
|
+
loop-agent dag run-task <task-id> --profile auto --strict-models --output <temp-dir>/<task-id>-dag.json
|
|
39
|
+
loop-agent dag validate --dag <temp-dir>/<task-id>-dag.json --strict-models --strict-governance
|
|
40
|
+
loop-agent run-dag --dag <temp-dir>/<task-id>-dag.json --cwd <repo-root>
|
|
41
|
+
```
|
|
42
|
+
`<temp-dir>` 表示平台原生临时目录;也可以省略 `--output`,再使用命令 JSON 输出里的 `outputPath`。
|
|
43
|
+
2. **Operator 工具**,用于 recovery、诊断与 closeout:
|
|
44
|
+
```bash
|
|
45
45
|
loop-agent dag status --run-id <run-id>
|
|
46
46
|
loop-agent dag doctor
|
|
47
47
|
loop-agent dag report --latest --markdown
|
|
48
48
|
loop-agent dag closeout-draft --run-id <run-id>
|
|
49
49
|
loop-agent dag reconcile-tasks --glob '<pattern>' --markdown
|
|
50
|
-
loop-agent dag final-verification <task-id> --output <temp-dir>/<task-id>-final-verification-dag.json
|
|
50
|
+
loop-agent dag final-verification <task-id> --output <temp-dir>/<task-id>-final-verification-dag.json
|
|
51
51
|
loop-agent status <task-id> --json
|
|
52
52
|
loop-agent instructions task-artifacts --task <task-id> --json
|
|
53
53
|
loop-agent promote-run <task-id> --run-id <run-id>
|
|
@@ -60,14 +60,15 @@ loop-agent doctor
|
|
|
60
60
|
```bash
|
|
61
61
|
loop-agent delegate <task-id> --executor cursor
|
|
62
62
|
loop-agent harvest <task-id>
|
|
63
|
+
loop-agent cursor-prompt --cwd <repo-root> --file /tmp/bounded-task.md
|
|
63
64
|
loop-agent pi-prompt "Reply with exactly OK."
|
|
64
65
|
```
|
|
65
66
|
|
|
66
|
-
### Setup(首次)
|
|
67
|
-
```bash
|
|
68
|
-
npm install -g @tea-agent/loop-agent@latest
|
|
69
|
-
loop-agent --help
|
|
70
|
-
```
|
|
67
|
+
### Setup(首次)
|
|
68
|
+
```bash
|
|
69
|
+
npm install -g @tea-agent/loop-agent@latest
|
|
70
|
+
loop-agent --help
|
|
71
|
+
```
|
|
71
72
|
|
|
72
73
|
### 检查 repo harness
|
|
73
74
|
```bash
|
|
@@ -141,9 +142,9 @@ loop-agent --repo-root /path/to/target-repo study init <task-id> "Title" \
|
|
|
141
142
|
--reference-glob "codex-rs/**/goal*.rs"
|
|
142
143
|
|
|
143
144
|
# 编辑 source/需求.md + source/执行约束.md,然后走 DAG 路径:
|
|
144
|
-
loop-agent --repo-root <target-repo> dag run-task <task-id> --profile auto --strict-models --output <temp-dir>/<task-id>-dag.json
|
|
145
|
-
loop-agent --repo-root <target-repo> dag validate --dag <temp-dir>/<task-id>-dag.json --strict-models --strict-governance
|
|
146
|
-
loop-agent --repo-root <target-repo> run-dag --dag <temp-dir>/<task-id>-dag.json --cwd <target-repo>
|
|
145
|
+
loop-agent --repo-root <target-repo> dag run-task <task-id> --profile auto --strict-models --output <temp-dir>/<task-id>-dag.json
|
|
146
|
+
loop-agent --repo-root <target-repo> dag validate --dag <temp-dir>/<task-id>-dag.json --strict-models --strict-governance
|
|
147
|
+
loop-agent --repo-root <target-repo> run-dag --dag <temp-dir>/<task-id>-dag.json --cwd <target-repo>
|
|
147
148
|
```
|
|
148
149
|
|
|
149
150
|
目标 repo 需有 `.harness/prompts/feature-study-analyze.md` 与 `feature-study-plan.md`(缺失时从 loop-agent 复制)。
|
|
@@ -152,6 +153,13 @@ loop-agent --repo-root <target-repo> run-dag --dag <temp-dir>/<task-id>-dag.json
|
|
|
152
153
|
|
|
153
154
|
历史顺序式 `run analyze|plan|spec|implement|verify|retrospective|auto|loop|continue|study` 已移除。新任务不要使用这些命令,也不要在 prompt、skill 或 docs 中把它们描述为 fallback。
|
|
154
155
|
|
|
156
|
+
### Reference helpers(compatibility)
|
|
157
|
+
```bash
|
|
158
|
+
loop-agent reference index
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
`reference` 是 compatibility / feature-study 辅助入口,用于维护或检查参考资料索引。常规实现任务不要从 `reference` 起步;按 `new-task` + DAG 路径执行。
|
|
162
|
+
|
|
155
163
|
### Task goal lifecycle(compatibility-only / deprecated-candidate)
|
|
156
164
|
```bash
|
|
157
165
|
loop-agent goal set <task-id> "Objective text" [--token-budget <number|null>]
|
|
@@ -176,17 +184,17 @@ loop-agent goal clear <task-id>
|
|
|
176
184
|
|
|
177
185
|
### Agent DAG validation 与 execution
|
|
178
186
|
```bash
|
|
179
|
-
loop-agent dag validate --dag <temp-dir>/hybrid-dag.json # 常规 validation;无 .harness/dag-runs 副作用
|
|
180
|
-
loop-agent dag validate --dag <temp-dir>/hybrid-dag.json --strict-models # 非 canonical executorModels 时失败
|
|
181
|
-
loop-agent dag validate --dag <temp-dir>/hybrid-dag.json --strict-governance # governance warning 时失败
|
|
182
|
-
loop-agent dag validate --dag <temp-dir>/hybrid-dag.json --strict-governance --spine-task <task-id> # 同时消费 minimal spec spine audit
|
|
183
|
-
loop-agent dag validate --dag docs/templates/agent-dag.supervised-implementation.json --strict-models --strict-governance # role=supervisor + write-set-gate topology
|
|
184
|
-
cp docs/templates/agent-dag.supervised-implementation.json <temp-dir>/supervised-dag.json
|
|
185
|
-
(npx vitest run test/dag-supervised-template.test.ts test/dag-validate.test.ts test/dag-shell-executor.test.ts --reporter=dot) # supervised template + shell.verdictGate runtime
|
|
186
|
-
loop-agent dag validate --dag <temp-dir>/hybrid-dag.json --forbid-executor cursor # 存在 cursor node 时失败
|
|
187
|
-
loop-agent run-dag --dag <temp-dir>/hybrid-dag.json --cwd <repo-root> # 执行 Agent DAG
|
|
188
|
-
loop-agent run-dag --dag <temp-dir>/hybrid-dag.json --cwd <repo-root> --no-cursor # 执行前若存在 cursor node 则失败
|
|
189
|
-
loop-agent run-dag --dag <temp-dir>/hybrid-dag.json --init-only --canvas-path <temp-dir>/hybrid-dag.canvas.tsx # 可选 derived Canvas view
|
|
187
|
+
loop-agent dag validate --dag <temp-dir>/hybrid-dag.json # 常规 validation;无 .harness/dag-runs 副作用
|
|
188
|
+
loop-agent dag validate --dag <temp-dir>/hybrid-dag.json --strict-models # 非 canonical executorModels 时失败
|
|
189
|
+
loop-agent dag validate --dag <temp-dir>/hybrid-dag.json --strict-governance # governance warning 时失败
|
|
190
|
+
loop-agent dag validate --dag <temp-dir>/hybrid-dag.json --strict-governance --spine-task <task-id> # 同时消费 minimal spec spine audit
|
|
191
|
+
loop-agent dag validate --dag docs/templates/agent-dag.supervised-implementation.json --strict-models --strict-governance # role=supervisor + write-set-gate topology
|
|
192
|
+
cp docs/templates/agent-dag.supervised-implementation.json <temp-dir>/supervised-dag.json
|
|
193
|
+
(npx vitest run test/dag-supervised-template.test.ts test/dag-validate.test.ts test/dag-shell-executor.test.ts --reporter=dot) # supervised template + shell.verdictGate runtime
|
|
194
|
+
loop-agent dag validate --dag <temp-dir>/hybrid-dag.json --forbid-executor cursor # 存在 cursor node 时失败
|
|
195
|
+
loop-agent run-dag --dag <temp-dir>/hybrid-dag.json --cwd <repo-root> # 执行 Agent DAG
|
|
196
|
+
loop-agent run-dag --dag <temp-dir>/hybrid-dag.json --cwd <repo-root> --no-cursor # 执行前若存在 cursor node 则失败
|
|
197
|
+
loop-agent run-dag --dag <temp-dir>/hybrid-dag.json --init-only --canvas-path <temp-dir>/hybrid-dag.canvas.tsx # 可选 derived Canvas view
|
|
190
198
|
loop-agent dag init-hybrid <task-id> # 生成可审阅的 DAG draft
|
|
191
199
|
loop-agent dag run-task <task-id> # generate + validate(安全默认;无 dag-runs;standard-compatible)
|
|
192
200
|
loop-agent dag run-task <task-id> --profile auto # 推断 governanceProfile,经 workflowPolicy.dag.profileRouting 路由
|
|
@@ -213,9 +221,9 @@ loop-agent dag resume --run-id <run-id> # approve 后继续
|
|
|
213
221
|
**In-flight DAG governance**:shell verify node 内用 `HARNESS_ALLOW_ACTIVE_DAG_RUNS=1 bash scripts/check-repo.sh`;run 归档到 `completed/` 后,在 DAG 外跑裸 `bash scripts/check-repo.sh`。
|
|
214
222
|
|
|
215
223
|
- `dag validate` 做 schema/topology/ranks 检查;审 `warnings` 中的显式 `executorModels` drift 与 governance lint。
|
|
216
|
-
- 手写临时 DAG spec 执行前用 `dag validate --strict-models`,model-matrix drift 应 fail fast。
|
|
224
|
+
- 手写临时 DAG spec 执行前用 `dag validate --strict-models`,model-matrix drift 应 fail fast。
|
|
217
225
|
- read-only artifact-boundary 或 DAG 内 shell governance warning 应 fail fast 时用 `dag validate --strict-governance`。
|
|
218
|
-
- 人工 handoff 视图用 `dag report --markdown`(summary、node timeline、failures、四段 Recovery Plan、artifacts、建议 next action)。仅 derived、advisory;需保存时重定向到平台临时目录或 `docs/reports/`。
|
|
226
|
+
- 人工 handoff 视图用 `dag report --markdown`(summary、node timeline、failures、四段 Recovery Plan、artifacts、建议 next action)。仅 derived、advisory;需保存时重定向到平台临时目录或 `docs/reports/`。
|
|
219
227
|
- operator 聚焦最新 paused run 用 `dag report --paused-latest`(等同 `--lifecycle paused --latest`;勿与显式 `--lifecycle` 并用)。
|
|
220
228
|
- 需 operator 关注的 run 用 `dag report --failed-only`、`--latest`、`--action <recovery-action>` 收窄。category→action 映射见 `docs/agent-dag-recovery-playbook.md`。
|
|
221
229
|
- 只读扫描 `.harness/dag-runs/` 下所有 run 的生命周期 health issue 与建议 action 用 `dag doctor`(`advisoryOnly: true`;不 mutate facts)。
|
|
@@ -227,6 +235,18 @@ loop-agent dag resume --run-id <run-id> # approve 后继续
|
|
|
227
235
|
- 仅当有意在 `.harness/dag-runs/active/` 下要 active run snapshot 时用 `run-dag --dry-run`。
|
|
228
236
|
- task source 应从 `harness.json.workflowPolicy.dag.profileRouting` 与确定性 candidate `governanceProfile` 选 standard / review-gated / supervised template 时用 `dag run-task --profile auto`。无 `--profile` 仅用于旧 standard-compatible 输出;强制 template family 用 `--profile minimal|standard|reviewed|supervised`。
|
|
229
237
|
|
|
238
|
+
### Saved Dynamic Workflow operator UX
|
|
239
|
+
```bash
|
|
240
|
+
loop-agent workflow list
|
|
241
|
+
loop-agent workflow inspect <name>
|
|
242
|
+
loop-agent workflow save --from /tmp/<task-id>.workflow.json --name <name>
|
|
243
|
+
loop-agent workflow run <name-or-path> --cwd <repo-root>
|
|
244
|
+
loop-agent workflow diff <name> --against /tmp/<task-id>.workflow.json
|
|
245
|
+
loop-agent workflow replay <run-id>
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
`workflow` 是 Dynamic Workflow 的 saved/operator surface。它读取 `WorkflowSpec`,编译为 DAG,再进入同一套 `run-dag` runtime;不会新增 executor 能力或绕过 DAG governance。真实写入任务仍应检查 compiled DAG 的 executor、writeSet、shell gates 和 completed facts 边界。
|
|
249
|
+
|
|
230
250
|
### Cursor worker lifecycle
|
|
231
251
|
```bash
|
|
232
252
|
loop-agent cursor-worker status # enabled/running/child/entry path
|
|
@@ -259,14 +279,14 @@ loop-agent handoff coverage <task-id> [--json|--markdown]
|
|
|
259
279
|
|
|
260
280
|
### Pi runtime reuse benchmark / decision(无 live call)
|
|
261
281
|
```bash
|
|
262
|
-
loop-agent pi-reuse-benchmark \
|
|
263
|
-
--report docs/reports/<benchmark-report>.md \
|
|
264
|
-
--json
|
|
265
|
-
|
|
266
|
-
loop-agent pi-reuse-benchmark \
|
|
267
|
-
--report docs/reports/<benchmark-report>.md \
|
|
268
|
-
--off-executor /path/to/off/executor.jsonl \
|
|
269
|
-
--on-executor /path/to/on/executor.jsonl \
|
|
282
|
+
loop-agent pi-reuse-benchmark \
|
|
283
|
+
--report docs/reports/<benchmark-report>.md \
|
|
284
|
+
--json
|
|
285
|
+
|
|
286
|
+
loop-agent pi-reuse-benchmark \
|
|
287
|
+
--report docs/reports/<benchmark-report>.md \
|
|
288
|
+
--off-executor /path/to/off/executor.jsonl \
|
|
289
|
+
--on-executor /path/to/on/executor.jsonl \
|
|
270
290
|
--approval /path/to/approval.json \
|
|
271
291
|
--markdown
|
|
272
292
|
```
|
|
@@ -281,6 +301,19 @@ loop-agent loop-benchmark --markdown --output docs/reports/2026-06-30-loop-agent
|
|
|
281
301
|
|
|
282
302
|
生成 M0 deterministic baseline,对照 `single-repair`、`3-pass-convergence`、`3-pass-convergence+quota`。**不**跑 live Pi/Cursor call、不创建 task、不改 `convergence.enabled` 默认值。live dogfood 证据缺失时输出 `blocked` 并建议保持 opt-in。
|
|
283
303
|
|
|
304
|
+
### Long-running loop outer state(experimental)
|
|
305
|
+
```bash
|
|
306
|
+
loop-agent loop init <task-id>
|
|
307
|
+
loop-agent loop status <task-id>
|
|
308
|
+
loop-agent loop run <task-id> --action dag
|
|
309
|
+
loop-agent loop run <task-id> --action shell-verify --command "bash scripts/check-repo.sh"
|
|
310
|
+
loop-agent loop record-round <task-id> --decision continue --summary "..."
|
|
311
|
+
loop-agent loop add-signal <task-id> --kind note --message "..."
|
|
312
|
+
loop-agent loop closeout <task-id>
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
`loop` 是 Agent DAG 之上的长程状态和 evidence layer,记录 rounds、signals、verification summaries 和 closeout draft。它不是替代 `dag run-task` / `run-dag` 的实现路径;medium/large work 仍需要 DAG evidence 或明确 fallback reason。
|
|
316
|
+
|
|
284
317
|
### Minimal spec spine audit
|
|
285
318
|
```bash
|
|
286
319
|
loop-agent spine audit <task-id> --json
|
|
@@ -312,4 +345,13 @@ loop-agent worktree create|list|remove ...
|
|
|
312
345
|
|
|
313
346
|
用于 worktree 隔离的 cursor-direct 执行与 merge 收口。常规 autonomous work 应优先 Agent DAG;详见 `multi-worktree.md` 与 `docs/cursor-executor-usage.md`。
|
|
314
347
|
|
|
348
|
+
### One-shot Cursor sidecar(escape hatch)
|
|
349
|
+
```bash
|
|
350
|
+
loop-agent cursor-prompt --cwd <repo-root> "Review this task without editing files."
|
|
351
|
+
loop-agent cursor-prompt --cwd <repo-root> --file /tmp/bounded-cursor-task.md
|
|
352
|
+
loop-agent cursor-prompt --cwd <repo-root> --model composer-2.5 --timeout 1800000 --file /tmp/bounded-cursor-task.md
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
`cursor-prompt` 是 one-shot Cursor SDK helper。用于 bounded diagnosis、小修复或调试 executor;写入 prompt 必须包含 task id、objective、allowed paths、forbidden paths、verification 和 preserve-unrelated-changes 要求。需要 `CURSOR_API_KEY`。它会创建 one-shot run evidence,但 Cursor 自报成功不替代 shell verification。
|
|
356
|
+
|
|
315
357
|
> **Historical(已移除)**:`subagent list|start|wait|wakeup|attach|stop` 与 `dashboard` 已移除,不再出现在 CLI registry。
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# Shared loop-agent Harness Policy
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
本文件是跨仓库使用 `.` 的 canonical shared workflow policy。Repo-local harness docs 只应描述 local adapters:runtime 位置、governance root、适用的 verification commands。
|
|
4
4
|
|
|
5
5
|
## Canonical stance
|
|
6
6
|
|
|
7
|
-
- **Agent DAG**
|
|
8
|
-
-
|
|
9
|
-
- **Long-running `loop`**
|
|
10
|
-
- **Main session**
|
|
11
|
-
- **Executors**
|
|
12
|
-
- **Shell verification
|
|
7
|
+
- **Agent DAG** 是 medium/large、multi-file、architecture-sensitive、public-contract、CI/script 或 harness-runtime 工作的默认 implementation workflow。
|
|
8
|
+
- 历史顺序式 `run analyze|plan|spec|implement|verify|auto|loop|continue` workflow 已移除。不要将其作为 fallback path 呈现。
|
|
9
|
+
- **Long-running `loop`** 是 Agent DAG 之上的 outer state/evidence layer。它记录 rounds、context compression、signals、canonical refs;不得替代 complex work 的 DAG writeSet review、Decision Gate 或 shell verification。
|
|
10
|
+
- **Main session** 负责 orchestrate:选一个 work chunk、准备 source materials、review DAG/writeSet、monitor failures、跑 final verification、hand off。
|
|
11
|
+
- **Executors** 实现 bounded work:Pi 在 DAG nodes 做 read-only planning/review/diagnosis,并在节点声明 `toolProfile: "write"` 时做 bounded implementation/repair;Cursor 是显式启用的可选 bounded writer;shell 产出 deterministic verification facts。
|
|
12
|
+
- **Shell verification 是 completion fact source**。LLM review 或 advisory output 不能替代 command exit codes 与 archived evidence。
|
|
13
13
|
|
|
14
14
|
## Command surface tiers
|
|
15
15
|
|
|
@@ -21,7 +21,7 @@ This file is the canonical shared workflow policy for using `.` across repositor
|
|
|
21
21
|
| Escape hatch | Isolated delegation, one-shot diagnosis or bounded repair | `delegate`, `worktree`, `harvest`, `pi-prompt`, `cursor-prompt`, `cursor-worker` |
|
|
22
22
|
| Experimental | Long-running outer task state | `loop init|status|run|record-round|add-signal|closeout` |
|
|
23
23
|
|
|
24
|
-
Prompt templates
|
|
24
|
+
Prompt templates、README snippets、task instructions 应优先呈现 Primary + Operator。Compatibility 与 escape-hatch commands 仍可用,但须携带其 downgrade/fallback 含义。
|
|
25
25
|
|
|
26
26
|
## Entry selection decision tree
|
|
27
27
|
|
|
@@ -33,7 +33,7 @@ Is this only status, diagnosis, recovery, or closeout?
|
|
|
33
33
|
yes -> Agent DAG.
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
在以下任一 signal 适用时用 Agent DAG 而非 broad one-shot execution:
|
|
37
37
|
|
|
38
38
|
- loop-agent runtime, DAG schema, run facts, promotion/closeout, scripts/CI, public contract, or shared protocol is touched.
|
|
39
39
|
- The change needs multiple files, multiple scouts, review gates, Decision Gate, repair flow, or shell gate.
|
|
@@ -43,53 +43,53 @@ Use Agent DAG rather than broad one-shot execution when any of these signals app
|
|
|
43
43
|
|
|
44
44
|
## Agent DAG path
|
|
45
45
|
|
|
46
|
-
Minimum governed path
|
|
46
|
+
Minimum governed path:
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
49
|
loop-agent new-task <task-id> "Task Title" [--repo-root <target-repo>]
|
|
50
50
|
# write <target-repo>/.harness/tasks/<task-id>/source/需求.md
|
|
51
51
|
# write <target-repo>/.harness/tasks/<task-id>/source/执行约束.md
|
|
52
52
|
|
|
53
|
-
loop-agent dag run-task <task-id> \
|
|
54
|
-
--profile auto \
|
|
55
|
-
--strict-models \
|
|
56
|
-
--output <temp-dir>/<task-id>-dag.json \
|
|
57
|
-
[--repo-root <target-repo>]
|
|
58
|
-
|
|
59
|
-
loop-agent dag validate \
|
|
60
|
-
--dag <temp-dir>/<task-id>-dag.json \
|
|
61
|
-
--strict-models \
|
|
62
|
-
--strict-governance
|
|
63
|
-
|
|
64
|
-
loop-agent run-dag \
|
|
65
|
-
--dag <temp-dir>/<task-id>-dag.json \
|
|
66
|
-
--cwd <target-repo>
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
`loop-agent` is the preferred global CLI. For self-hosting loop-agent development, the controller must be an installed npm-published package. Use `npm install -g @tea-agent/loop-agent@latest` for first install or intentional upgrades, then treat the installed version as frozen for the current task and record `npm list -g @tea-agent/loop-agent --depth=0`. Do not repeatedly fetch `npx @latest` inside DAG nodes, and do not use the current working tree's `npm link` or `npm run dev` to control tasks that may edit CLI, DAG runtime, executors, package metadata, or build output. Use `npm run dev -- <args>` only for source debugging and focused CLI development.
|
|
70
|
-
|
|
71
|
-
The npm package carries static capability assets: `skills/`, top-level governance docs, `docs/templates/`, `examples/`, `harness.json`, `AGENTS.md`, `README.md`, and `CHANGELOG.md`. Generated or historical task facts under `docs/progress/`, `docs/reports/`, `docs/exec-plans/`, and `docs/decisions/` belong to the target repository; package only their directory README files, not prior run content.
|
|
72
|
-
|
|
73
|
-
For arbitrary target repositories, DAG skill instructions must not depend on loop-agent source history being copied into the target repo. Resolve configured, user, or target-local skills when present, then fall back to package-bundled `skills/` as the stable default capability set.
|
|
74
|
-
|
|
75
|
-
`<temp-dir>` means the platform-native temp directory. Use native paths for actual `--output`, `--dag`, and `--cwd` values on macOS and Windows; use `/` only for stable repo refs, JSON/Markdown evidence refs, and glob conventions.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
- `profileRouting
|
|
80
|
-
- `governanceProfile
|
|
81
|
-
- Writer nodes
|
|
82
|
-
- Shell gates
|
|
83
|
-
- Decision Gate mode
|
|
84
|
-
-
|
|
85
|
-
|
|
86
|
-
In-flight DAG shell checks
|
|
87
|
-
|
|
88
|
-
On Windows, run Bash scripts through Git Bash or a configured compatible Bash. Do not require WSL, `/tmp`, `which`, or other POSIX filesystem assumptions in loop-agent CLI behavior.
|
|
53
|
+
loop-agent dag run-task <task-id> \
|
|
54
|
+
--profile auto \
|
|
55
|
+
--strict-models \
|
|
56
|
+
--output <temp-dir>/<task-id>-dag.json \
|
|
57
|
+
[--repo-root <target-repo>]
|
|
58
|
+
|
|
59
|
+
loop-agent dag validate \
|
|
60
|
+
--dag <temp-dir>/<task-id>-dag.json \
|
|
61
|
+
--strict-models \
|
|
62
|
+
--strict-governance
|
|
63
|
+
|
|
64
|
+
loop-agent run-dag \
|
|
65
|
+
--dag <temp-dir>/<task-id>-dag.json \
|
|
66
|
+
--cwd <target-repo>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`loop-agent` is the preferred global CLI. For self-hosting loop-agent development, the controller must be an installed npm-published package. Use `npm install -g @tea-agent/loop-agent@latest` for first install or intentional upgrades, then treat the installed version as frozen for the current task and record `npm list -g @tea-agent/loop-agent --depth=0`. Do not repeatedly fetch `npx @latest` inside DAG nodes, and do not use the current working tree's `npm link` or `npm run dev` to control tasks that may edit CLI, DAG runtime, executors, package metadata, or build output. Use `npm run dev -- <args>` only for source debugging and focused CLI development.
|
|
70
|
+
|
|
71
|
+
The npm package carries static capability assets: `skills/`, top-level governance docs, `docs/templates/`, `examples/`, `harness.json`, `AGENTS.md`, `README.md`, and `CHANGELOG.md`. Generated or historical task facts under `docs/progress/`, `docs/reports/`, `docs/exec-plans/`, and `docs/decisions/` belong to the target repository; package only their directory README files, not prior run content.
|
|
72
|
+
|
|
73
|
+
For arbitrary target repositories, DAG skill instructions must not depend on loop-agent source history being copied into the target repo. Resolve configured, user, or target-local skills when present, then fall back to package-bundled `skills/` as the stable default capability set.
|
|
74
|
+
|
|
75
|
+
`<temp-dir>` means the platform-native temp directory. Use native paths for actual `--output`, `--dag`, and `--cwd` values on macOS and Windows; use `/` only for stable repo refs, JSON/Markdown evidence refs, and glob conventions.
|
|
76
|
+
|
|
77
|
+
Execution 前 review `dag run-task` JSON / `reviewPacket`:
|
|
78
|
+
|
|
79
|
+
- `profileRouting`:requested profile、selected profile/template、routing reasons。
|
|
80
|
+
- `governanceProfile`:process、delivery、code-change signals。
|
|
81
|
+
- Writer nodes:`writePolicy`、`writeSet`、`allowedPaths`、`forbiddenPaths`、broad entries、forbidden overlaps。
|
|
82
|
+
- Shell gates 与 verification commands。
|
|
83
|
+
- Decision Gate mode(`record-only` vs `pause-on-human`)。
|
|
84
|
+
- 执行前须 narrow 的 placeholder、`**` 或 repo-root writeSet。
|
|
85
|
+
|
|
86
|
+
In-flight DAG shell checks 在需要时用 repo active-run override(例如 `HARNESS_ALLOW_ACTIVE_DAG_RUNS=1 bash scripts/check-repo.sh`)。DAG archived 后,再不带 in-flight override 跑 repo check。
|
|
87
|
+
|
|
88
|
+
On Windows, run Bash scripts through Git Bash or a configured compatible Bash. Do not require WSL, `/tmp`, `which`, or other POSIX filesystem assumptions in loop-agent CLI behavior.
|
|
89
89
|
|
|
90
90
|
## Task source materials
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
每个 handoff-ready task 包含:
|
|
93
93
|
|
|
94
94
|
```text
|
|
95
95
|
.harness/tasks/<task-id>/
|
|
@@ -99,25 +99,25 @@ Every handoff-ready task has:
|
|
|
99
99
|
执行约束.md
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
`需求.md`
|
|
102
|
+
`需求.md` 应陈述 objective、scope、non-goals、acceptance criteria,并链接 repo-local specs 或 plans。
|
|
103
103
|
|
|
104
|
-
`执行约束.md`
|
|
104
|
+
`执行约束.md` 应陈述:
|
|
105
105
|
|
|
106
106
|
- allowed paths
|
|
107
107
|
- forbidden paths
|
|
108
|
-
-
|
|
109
|
-
- architecture boundaries
|
|
108
|
+
- 当前 dirty workspace / protected user changes(如有)
|
|
109
|
+
- architecture boundaries 与 invariants
|
|
110
110
|
- expected verification commands
|
|
111
111
|
- acceptance criteria / failure conditions
|
|
112
|
-
-
|
|
112
|
+
- 是否允许 DAG fallback,及若已知时的 fallback reason
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
若 `spec`、`plan` 或 DAG generation 后 source materials 变更,implementation 前 regenerate 或 revalidate plan/DAG。
|
|
115
115
|
|
|
116
116
|
## Long-running loop policy
|
|
117
117
|
|
|
118
|
-
`loop`
|
|
118
|
+
`loop` 用于 long-running outer task memory:objective/context projection、round records、signals、derived events、verification summaries、closeout draft。它不是 Agent DAG 的 substitute。
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
Governed work 的典型 loop path:
|
|
121
121
|
|
|
122
122
|
```bash
|
|
123
123
|
loop-agent loop init <task-id>
|
|
@@ -130,22 +130,22 @@ loop-agent loop run <task-id> --auto --max-rounds 3 --allow-cursor-fix
|
|
|
130
130
|
loop-agent loop closeout <task-id>
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
Loop action rules
|
|
133
|
+
Loop action rules:
|
|
134
134
|
|
|
135
|
-
- `shell-verify`
|
|
136
|
-
- `pi-review`
|
|
137
|
-
- `cursor-fix`
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
- `loop run --auto`
|
|
142
|
-
- `loop closeout`
|
|
143
|
-
-
|
|
144
|
-
- `record-round --decision complete`
|
|
135
|
+
- `shell-verify` 是 deterministic;exit code 决定 verification record。
|
|
136
|
+
- `pi-review` 是 read-only;tools 限于 `read,grep,find,ls`,output 为 structured advisory evidence。Structured JSON 须含 `findingSummary`、`failureCategory`、`nextHypothesis`、`recommendedAction`、`fixScope`、`rootCause`;`recommendedAction` exactly 为 `implement_fix|replan|pause|done`。
|
|
137
|
+
- `cursor-fix` 是 bounded write;须读 task `allowedPaths` / `forbiddenPaths`,reject empty `allowedPaths`、allowed/forbidden overlap,preserve unrelated files,且须 follow shell verification 或 review。
|
|
138
|
+
- 对 `task.json.complexity = medium | large`,`cursor-fix` additionally 需要:
|
|
139
|
+
- previous loop `dag` round,或
|
|
140
|
+
- explicit `task.json.dagFallbackReason` 说明为何不能用 DAG。
|
|
141
|
+
- `loop run --auto` 默认不 write。Auto `cursor-fix` 需要 `task.json.loopAutoWritePolicy="enabled"`,或 `loopAutoWritePolicy="approval-required"` 加 pending approval signal 或 `--allow-cursor-fix`;write guards 仍 fail closed 并 pause。
|
|
142
|
+
- `loop closeout` 须报告 workflow path:`dag`、`explicit-fallback`、`missing-dag-evidence` 或 `micro-or-small`。
|
|
143
|
+
- 无 DAG evidence 且无 `dagFallbackReason` 的 medium/large closeout 须将其列为 remaining risk。
|
|
144
|
+
- `record-round --decision complete` 仅是 loop-state candidate;completion 仍须 shell verification、review verdict、success-criteria coverage。
|
|
145
145
|
|
|
146
146
|
## Supervised DAG convergence
|
|
147
147
|
|
|
148
|
-
Supervised DAG convergence
|
|
148
|
+
Supervised DAG convergence 可选且由 task-config 驱动:
|
|
149
149
|
|
|
150
150
|
```json
|
|
151
151
|
{
|
|
@@ -160,13 +160,13 @@ Supervised DAG convergence is optional and task-config driven:
|
|
|
160
160
|
|
|
161
161
|
Rules:
|
|
162
162
|
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
- `dag report --json`
|
|
169
|
-
- Final completion authority
|
|
163
|
+
- 默认保持 single repair,除非 `convergence.enabled=true`;`HARNESS_DAG_CONVERGENCE=off` 是 rollback switch。
|
|
164
|
+
- Supervised process supervisor 须 emit 首行 `VERDICT:` 与 `REPAIR_ARTIFACT_JSON` fenced block。Repair prompts 应先消费 artifact `failureClass`、`rootCause`、`fixScope`、`invariant`;raw logs 仅在 artifact 允许时为 fallback evidence。
|
|
165
|
+
- 在 `maxPasses` 前 retryable `hard-verify-shell` failure 时,preserve current pass evidence 于 `convergence/pass-N/`,reset process-supervisor/process-gate/repair/hard-verify segment 及 blocked downstream nodes,再进入现有 DAG rank execution loop。
|
|
166
|
+
- 不要 retry write guards、timeout/spawn/auth failures 或 human-gate failures。
|
|
167
|
+
- 出现 conservative regression signals(如 lower shell success count)时 pause 而非 retry。
|
|
168
|
+
- `dag report --json` 与 markdown 须 expose `convergence.passHistory`。
|
|
169
|
+
- Final completion authority 仍是 full shell verification;quota/focused commands 仅为 intermediate cost controls。
|
|
170
170
|
|
|
171
171
|
## Structured repair, spine audit, and curator gates
|
|
172
172
|
|
|
@@ -177,17 +177,17 @@ Rules:
|
|
|
177
177
|
|
|
178
178
|
## SePO-lite prompt evolution
|
|
179
179
|
|
|
180
|
-
- Learned prompt deltas
|
|
181
|
-
- Prompt deltas
|
|
182
|
-
- Accepted learned guidance
|
|
183
|
-
-
|
|
184
|
-
- Learned guidance
|
|
180
|
+
- Learned prompt deltas 是 human-gated proposals;成为 reusable guidance 前须 review。
|
|
181
|
+
- Prompt deltas 为 Markdown-only process guidance;不得含 shell commands、credential handling、tool permission expansion 或 completion-authority bypass。
|
|
182
|
+
- Accepted learned guidance 位于 `./skill/references/learned/<repo>.md` 或 `default.md`。
|
|
183
|
+
- 已 request `loop-agent` 的 DAG implementer prompts 可 inline 最多三个 human-gated learned Markdown sections。
|
|
184
|
+
- Learned guidance 为 advisory,永不替代 writeSet governance、Decision Gate policy 或 shell verification。
|
|
185
185
|
|
|
186
186
|
## Sidecar interventions
|
|
187
187
|
|
|
188
|
-
`pi-prompt`
|
|
188
|
+
`pi-prompt` 与 `cursor-prompt` 是 sidecar interventions,不是 workflow state。
|
|
189
189
|
|
|
190
|
-
|
|
190
|
+
用 `pi-prompt` 做短时 read-only planning、log explanation 或 failure diagnosis。Read-only 时传 read-only tools 并写明不 edit files:
|
|
191
191
|
|
|
192
192
|
```bash
|
|
193
193
|
loop-agent pi-prompt \
|
|
@@ -197,7 +197,7 @@ loop-agent pi-prompt \
|
|
|
197
197
|
"Read the task source and diagnose the failure. Do not edit files."
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
用 `cursor-prompt` 做 bounded multi-file diagnosis 或 small repair,prompt 须含:
|
|
201
201
|
|
|
202
202
|
- task id
|
|
203
203
|
- exact objective
|
|
@@ -207,52 +207,52 @@ Use `cursor-prompt` for bounded multi-file diagnosis or small repair only when t
|
|
|
207
207
|
- expected verification
|
|
208
208
|
- instruction to preserve unrelated files
|
|
209
209
|
|
|
210
|
-
Sidecar output
|
|
210
|
+
Sidecar output 为 advisory。若须成为 task evidence,通过 loop-agent run/task artifacts promote 或 summarize;completed DAG 与 one-shot run facts 保持只读。
|
|
211
211
|
|
|
212
212
|
## Model and executor boundaries
|
|
213
213
|
|
|
214
|
-
- Agent DAG
|
|
215
|
-
- DAG `shell`
|
|
216
|
-
-
|
|
217
|
-
- `pi-prompt` / `cursor-prompt` models
|
|
218
|
-
- Pi DAG nodes
|
|
219
|
-
- Cursor nodes
|
|
220
|
-
- Shell nodes
|
|
214
|
+
- Agent DAG 用 DAG JSON `executorModels` 加 node `executor` / `complexity`;不要从 repo `harness.json.models` 推断 DAG models。
|
|
215
|
+
- DAG `shell` 与 `static` nodes 不用 models。
|
|
216
|
+
- `harness.json.models.<step>` 下 historical step models 是 legacy metadata,不是新 DAG work 的 routing。
|
|
217
|
+
- `pi-prompt` / `cursor-prompt` models 来自 CLI flags 或 runtime defaults,须 per intervention 选择。
|
|
218
|
+
- Pi DAG nodes 默认 read-only planning/review/diagnosis;声明 `toolProfile: "write"` 时是 bounded writers,须有 explicit write scope。
|
|
219
|
+
- Cursor nodes 是显式启用的可选 bounded writers,须有 explicit write scope。
|
|
220
|
+
- Shell nodes 产出 deterministic verification facts 与 gates。
|
|
221
221
|
|
|
222
222
|
## Artifacts and facts boundary
|
|
223
223
|
|
|
224
|
-
- `.harness/tasks/<task-id>/`
|
|
225
|
-
- `.harness/tasks/<task-id>/loop/`
|
|
226
|
-
- `.harness/dag-runs/{active,paused,completed}/<run-id>/`
|
|
227
|
-
- `.harness/runs/{active,completed,failed}/<run-id>/`
|
|
228
|
-
- Root `artifacts/`
|
|
229
|
-
- Long-term conclusions
|
|
224
|
+
- `.harness/tasks/<task-id>/` 是 task runtime state。
|
|
225
|
+
- `.harness/tasks/<task-id>/loop/` 是 loop runtime projection;不替代 task source 或 repo specs。
|
|
226
|
+
- `.harness/dag-runs/{active,paused,completed}/<run-id>/` 是 DAG run fact storage。Completed facts 为 read-only。
|
|
227
|
+
- `.harness/runs/{active,completed,failed}/<run-id>/` 是 one-shot Pi/Cursor evidence。Completed/failed facts 为 read-only。
|
|
228
|
+
- Root `artifacts/` 是 legacy/current-work summary space,不是 DAG read-only scratchpad,也不是新 DAG work 的 default handoff。
|
|
229
|
+
- Long-term conclusions 属于 repo governance docs、progress、reports、decisions、tests 或 scripts。
|
|
230
230
|
|
|
231
|
-
|
|
231
|
+
除非 task 显式 promote trimmed report 到 repo governance docs,不要提交 `.harness/dag-runs/`、`.harness/runs/` 或 `.harness/cache/` 的 runtime histories。
|
|
232
232
|
|
|
233
233
|
## Baseline, dirty workspace, and verification
|
|
234
234
|
|
|
235
|
-
|
|
235
|
+
Complex implementation 前:
|
|
236
236
|
|
|
237
|
-
1. Check current directory
|
|
238
|
-
2. Read repo entrypoints
|
|
239
|
-
3. Capture minimal baseline verification
|
|
240
|
-
4.
|
|
241
|
-
- isolated worktree
|
|
242
|
-
- explicit user confirmation
|
|
243
|
-
5. Record known baseline failures
|
|
237
|
+
1. Check current directory 与 target repo。
|
|
238
|
+
2. Read repo entrypoints(`README`、`AGENTS`、`harness.json`、governance index)。
|
|
239
|
+
3. Capture affected area 的 minimal baseline verification。
|
|
240
|
+
4. 若 workspace dirty,选一:
|
|
241
|
+
- isolated worktree,或
|
|
242
|
+
- explicit user confirmation 在当前 workspace 工作并 preserve/possibly include existing changes。
|
|
243
|
+
5. Record known baseline failures,足以区分 pre-existing failures 与 task regressions。
|
|
244
244
|
|
|
245
|
-
Verification
|
|
245
|
+
Verification 应从 target repo verification matrix 选择。Cross-repo documentation refactors 时在 each affected repo 跑 checks。
|
|
246
246
|
|
|
247
247
|
## Handoff requirements
|
|
248
248
|
|
|
249
|
-
|
|
249
|
+
每个 task handoff 应回答:
|
|
250
250
|
|
|
251
|
-
1. What changed and why
|
|
252
|
-
2.
|
|
253
|
-
3.
|
|
254
|
-
4. Executors used
|
|
255
|
-
5. Verification commands run
|
|
256
|
-
6. DAG / one-shot / loop refs
|
|
257
|
-
7. Remaining risks
|
|
258
|
-
8.
|
|
251
|
+
1. What changed and why。
|
|
252
|
+
2. 用了哪条 workflow path:DAG、sidecar 或 main-session surgical patch。
|
|
253
|
+
3. 若从 DAG downgrade,explicit reason 与 evidence。
|
|
254
|
+
4. Executors used 及其 boundaries。
|
|
255
|
+
5. Verification commands run 与 results。
|
|
256
|
+
6. DAG / one-shot / loop refs(如有)。
|
|
257
|
+
7. Remaining risks 与 follow-up tasks。
|
|
258
|
+
8. 是否应将 new rules promote 到 docs、tests、scripts 或 shared skill references。
|