@tea-agent/loop-agent 0.24.11-beta.0 → 0.25.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/CHANGELOG.md +28 -5
- package/dist/commands/init.js +16 -2
- package/dist/executors/dag-pi-executor.js +74 -13
- package/dist/executors/pi-executor.js +25 -7
- package/dist/executors/pi-prompt-transport.js +198 -0
- package/dist/executors/pi-sdk-executor.js +1 -1
- package/dist/executors/process-tree.js +33 -0
- package/dist/executors/shell-executor.js +332 -24
- package/dist/executors/shell-verification.js +4 -2
- package/dist/infrastructure/harness/task-store.js +31 -0
- package/dist/shared/operator/capabilities.js +6 -0
- package/dist/verification/maven/cache.js +142 -0
- package/dist/verification/maven/index.js +120 -0
- package/dist/verification/maven/plan-commands.js +421 -0
- package/dist/verification/maven/pom-static.js +136 -0
- package/dist/verification/maven/scope-resolve.js +153 -0
- package/dist/verification/maven/stale.js +130 -0
- package/dist/verification/maven/types.js +23 -0
- package/dist/verification/maven/workspace-graph.js +322 -0
- package/dist/worker/cli.js +236 -21
- package/dist/worker/delivery/final-verification.js +12 -0
- package/dist/worker/delivery/git-transaction.js +32 -7
- package/dist/worker/delivery/package.js +9 -5
- package/dist/worker/delivery/verification-bundle.js +26 -5
- package/dist/worker/feature/advance.js +301 -0
- package/dist/worker/feature/doctor.js +223 -0
- package/dist/worker/feature/next-action.js +11 -3
- package/dist/worker/feature/scaffold.js +798 -0
- package/dist/worker/observe/dag-run-artifacts.js +90 -0
- package/dist/worker/observe/node-input.js +444 -0
- package/dist/worker/observe/routes.js +17 -0
- package/dist/worker/observe/static/api.js +9 -0
- package/dist/worker/observe/static/constants.js +9 -0
- package/dist/worker/observe/static/state.js +14 -0
- package/dist/worker/observe/static/styles.css +74 -0
- package/dist/worker/observe/static/views/dag-inspector.js +371 -15
- package/dist/worker/outcomes/projector.js +5 -1
- package/dist/worker/runner/run-ready.js +41 -1
- package/dist/workflows/dag/backend-test-markdown-workflow.js +202 -9
- package/dist/workflows/dag/backend-test-result-contract.js +103 -0
- package/dist/workflows/dag/failure-category.js +5 -1
- package/dist/workflows/dag/frontend-implementation-contract.js +4 -0
- package/dist/workflows/dag/frontend-prewrite-gate.js +0 -17
- package/dist/workflows/dag/frontend-test-result-contract.js +106 -41
- package/dist/workflows/dag/init-hybrid.js +220 -32
- package/dist/workflows/dag/node-execution.js +3 -2
- package/dist/workflows/dag/reconcile-run.js +24 -0
- package/dist/workflows/dag/types.js +46 -0
- package/dist/workflows/dag/validate.js +19 -2
- package/docs/architecture/dag-execution.md +5 -1
- package/docs/architecture/runtime-boundaries.md +11 -1
- package/docs/architecture/worker-and-feature.md +2 -0
- package/docs/templates/backend-test-dag.json +3 -3
- package/docs/templates/product-line/README.md +17 -1
- package/docs/templates/product-line/feature-scaffold-batch.example.yaml +31 -0
- package/docs/templates/product-line/scaffold-samples/README.md +36 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/acceptance.yaml +13 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/design.md +14 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/feature.yaml +3 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/requirement.md +6 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/tasks/BE-IMPL-001.yaml +83 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/tasks/task-graph.yaml +14 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/acceptance.yaml +15 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/design.md +18 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/feature.yaml +3 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/requirement.md +6 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/tasks/BE-IMPL-001.yaml +84 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/tasks/CONTRACT-001.yaml +84 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/tasks/FE-IMPL-001.yaml +86 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/tasks/task-graph.yaml +40 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/acceptance.yaml +13 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/design.md +14 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/feature.yaml +3 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/requirement.md +6 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/tasks/FE-IMPL-001.yaml +85 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/tasks/task-graph.yaml +14 -0
- package/examples/l5-report-coms-process-definition.html +322 -0
- package/package.json +1 -1
- package/skills/agent-worker/references/agent-worker-operator.md +84 -0
- package/skills/frontend-implementation/references/node-contracts.md +2 -2
- package/skills/loop-agent/SKILL.md +8 -8
- package/skills/loop-agent/references/command-reference.md +14 -2
- package/skills/loop-agent/references/harness-policy.md +22 -0
- package/skills/loop-agent/references/task-workflow.md +5 -0
|
@@ -31,6 +31,8 @@ Leaf DAG nodes 不得递归启动 `agent-worker`。Worker 负责 DAG 之外的 s
|
|
|
31
31
|
|
|
32
32
|
## Feature and Task Pool Flow
|
|
33
33
|
|
|
34
|
+
0. **新建 Packet(确定性脚手架,无模型)** — 包内自洽说明见下节 *Feature Packet Scaffold*;不依赖 website 文档站。
|
|
35
|
+
|
|
34
36
|
1. 阅读 Feature Packet,校验其 TaskSpecs 与 dependency graph。
|
|
35
37
|
2. 从持久化的 Task Pool state 推导下一步动作;不要从 chat history 重建 lifecycle state。canonical state 键是 `{ featureId, taskId }`(路径 `.harness/task-pool/states/<featureId>/<taskId>.json`)。
|
|
36
38
|
3. 对可写 batch 只冻结一次 controller,并将其 identity 传播到下游 evidence。
|
|
@@ -55,6 +57,88 @@ Leaf DAG nodes 不得递归启动 `agent-worker`。Worker 负责 DAG 之外的 s
|
|
|
55
57
|
8. Inspect(原 Observe)只读:推荐 `agent-worker console serve` 的 `/inspect/#/...`;兼容 `observe serve|snapshot`。canonical Task 路由为 `/api/features/:featureId/tasks/:taskId` 与 `#/feature/:featureId/task/:taskId`。8790 `/api/health` 为 `OperatorSurfaceHealthV1`;8787 仍为 `ObserveHealthV1`。
|
|
56
58
|
9. Official Console:`agent-worker console serve|doctor`(默认 loopback;可 `--host 0.0.0.0` / `--debug`)。Recovery CTA 为 report/doctor/decision/resume/reconcile/regenerate/打开检视;无 Cancel、无主 CTA「直接改代码」。主会话 Compatibility Assist 不得替代 Console/CLI 执法。
|
|
57
59
|
|
|
60
|
+
## Feature Packet Scaffold
|
|
61
|
+
|
|
62
|
+
确定性入口:一个纯 BE/FE 需求 → 一个 `features/F-YYYY-NNN/` Packet → Task Pool 串行掘进。主会话只跑 CLI,不手写 TaskGraph。
|
|
63
|
+
|
|
64
|
+
### 边界(v1)
|
|
65
|
+
|
|
66
|
+
| 做 | 不做 |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| 模板 + 槽位确定性生成 | 一键 LLM 生成完整合同 |
|
|
69
|
+
| `profile: generic` 短图 | 默认 `fullstack-v1` / 复制 `F-2026-005` 全图 |
|
|
70
|
+
| 显式 `--verify-command` | 猜测项目测试命令 |
|
|
71
|
+
| 一需求一 Feature 目录 | 跨 Feature 自动 depends / 并行 Pool |
|
|
72
|
+
| 写盘前同源 `task validate-feature` | 读/写 `.harness/**` 或构造 `LoopAgentClient` |
|
|
73
|
+
|
|
74
|
+
### 三模板
|
|
75
|
+
|
|
76
|
+
| 模板 | 最小图 |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| `backend-only` | `BE-IMPL-001`(需 ≥1 `--be-path`) |
|
|
79
|
+
| `frontend-only` | `FE-IMPL-001`(需 ≥1 `--fe-path`) |
|
|
80
|
+
| `fe-with-api` | `CONTRACT-001` → `BE-IMPL-001` + `FE-IMPL-001`(consumers 仅实现节点;两端 path 都要) |
|
|
81
|
+
|
|
82
|
+
v1 **不**生成 `BE-TEST` / `FE-TEST` / `FINAL-VERIFY`。`feature_id` 强制 `F-YYYY-NNN`(≥3 位序号)。输出固定 `<repo>/features/<feature-id>`;无 `--force` / `--out`;已存在目录(含空目录)一律拒绝。
|
|
83
|
+
|
|
84
|
+
### 日常命令
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
# 可选 dry-run:完整 parse/render/validate,零写入
|
|
88
|
+
agent-worker feature scaffold --repo <repo> --template backend-only \
|
|
89
|
+
--feature-id F-2026-010 --title "..." \
|
|
90
|
+
--be-path services/example/** \
|
|
91
|
+
--verify-command "npm run typecheck" --verify-command "npm test" \
|
|
92
|
+
--dry-run --json
|
|
93
|
+
|
|
94
|
+
agent-worker feature scaffold --repo <repo> --template frontend-only \
|
|
95
|
+
--feature-id F-2026-011 --title "..." \
|
|
96
|
+
--fe-path apps/web/src/settings/** \
|
|
97
|
+
--verify-command "npm test" --json
|
|
98
|
+
|
|
99
|
+
agent-worker feature scaffold --repo <repo> --template fe-with-api \
|
|
100
|
+
--feature-id F-2026-012 --title "..." \
|
|
101
|
+
--be-path services/api/** --fe-path apps/web/src/api/** \
|
|
102
|
+
[--contract-path docs/contracts/F-2026-012/api.md] \
|
|
103
|
+
--verify-command "npm test" --json
|
|
104
|
+
|
|
105
|
+
# 机器门禁 → 只读决策 → 串行掘进(固定 published controller)
|
|
106
|
+
agent-worker task validate-feature features/F-2026-010
|
|
107
|
+
agent-worker feature review --feature-dir features/F-2026-010 --repo <repo> --json
|
|
108
|
+
agent-worker feature run --feature-dir features/F-2026-010 --repo <repo> \
|
|
109
|
+
--loop-agent-bin <published> \
|
|
110
|
+
--expected-controller-version <version> \
|
|
111
|
+
--expected-controller-fingerprint sha256:<hex> \
|
|
112
|
+
--git-mode checkpoint --limit 1 --json
|
|
113
|
+
|
|
114
|
+
# Failed 只走官方恢复
|
|
115
|
+
agent-worker task retry <taskId> --feature-id F-2026-010 --repo <repo> --reason "..."
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Batch
|
|
119
|
+
|
|
120
|
+
```text
|
|
121
|
+
agent-worker feature scaffold --repo <repo> --batch <yaml-or-json> [--dry-run] [--json]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
- 与单条 flags 互斥;每条必须显式 `feature_id` / `title` / `template` / `verify_commands`。
|
|
125
|
+
- 任一非法、冲突、目标已存在或写盘失败 → **整批零写入**(已提交目录回滚)。
|
|
126
|
+
- 示例形状(包内模板若存在):`docs/templates/product-line/feature-scaffold-batch.example.yaml`。
|
|
127
|
+
- 三模板生成快照(只读、防漂移,非 live Feature):`docs/templates/product-line/scaffold-samples/{backend-only,frontend-only,fe-with-api}/`。
|
|
128
|
+
|
|
129
|
+
### 多需求策略
|
|
130
|
+
|
|
131
|
+
1. 一个需求条目 → 一个 Feature 目录。
|
|
132
|
+
2. 多个 FE/BE 需求:batch scaffold 后 **串行** `feature run --limit 1`(先完 F-010 再 F-011)。
|
|
133
|
+
3. 后端可独立交付时:先 `backend-only`,再 `frontend-only`(跨 Feature 依赖只写文档,不做自动 depends_on)。
|
|
134
|
+
4. 同 Feature 内 BE+FE 原子交付用 `fe-with-api`。
|
|
135
|
+
|
|
136
|
+
### 内容与完成定义
|
|
137
|
+
|
|
138
|
+
- scaffold 只给骨架;`requirement.md` / AC 文案由人或后续「只填槽、不改 graph」skill 填充。
|
|
139
|
+
- v1 完成 = Packet 可 scaffold 且 Pool 可掘进到图内 Task **Done**;`verify-final` / Delivery / Closeout 为 v1.5(ADR 0007),非 scaffold 必经。
|
|
140
|
+
- 已知恢复限制:mid-run `SIGKILL` 可能导致 Pool `Running` 且 `runs.jsonl` 缺失时 reconcile 失败(FC-B);勿对 worker 随意 SIGKILL;Failed 后用 `task retry`。
|
|
141
|
+
|
|
58
142
|
## Versioned Self-Hosting
|
|
59
143
|
|
|
60
144
|
- Published version N 是整个 maintenance batch 的 controller;不要在任务中途切换。
|
|
@@ -6,8 +6,8 @@ Pre-write nodes are read-only. Preserve IDs, labels, commands, language, require
|
|
|
6
6
|
|
|
7
7
|
- **`frontend-contract-pi`**: `Scope`, `Non-goals`, `Acceptance Criteria`, `UI States`, `Target Runtime Environment`, `Risks`, `Verification Expectations`. No guessed requirements.
|
|
8
8
|
- **`frontend-scout-pi`**: routes, components, tokens, data/API/Mock, scripts, tests, assets. Fact vs inference vs gap. Query the knowledge base when available and always search+read `openspec/schemas/`, `openspec/project-specs/`, and `ai_workspace/` before repo fallback. Output stack, routes, components, styling, conventions, state/data, test entry points, reuse, risks.
|
|
9
|
-
- **`frontend-plan-pi` + conditional design loop**: AC → explicit observable `expectedOutcome`, interactions → explicit `trigger` + `expectedBehavior`, then steps, in-bound files, applicable UI states, reuse, deps, Mock/API strategy, activation/rollback, frozen verify entrypoints, real-integration gap, and exactly one `frontend-implementation-contract-v1` JSON object. IDs plus file paths are not sufficient behavior semantics. Use `uiStates: []` for logic-only changes with no user-visible UI state; do not invent UI states. Applicable states require behavior/implementation/verification, while non-applicable states require a reason and omit empty behavior placeholders. Prefer native Mock; browser intercept only with existing e2e; request-adapter only for a reversible seam. `auto`
|
|
10
|
-
- **`frontend-prewrite-gate-shell`**: the sole write authorization. Resolve effective plan/review, require exact pass, retain every REQ/BR/AC id, enforce Mock policy, validate schema/source binding, and materialize `contracts/frontend-implementation-contract.json`. Fallback is allowed only when a conditional primary is absent; an existing malformed primary fails closed. Generation-time blocked Mock produces one deterministic blocking shell node and no writer.
|
|
9
|
+
- **`frontend-plan-pi` + conditional design loop**: AC → explicit observable `expectedOutcome`, interactions → explicit `trigger` + `expectedBehavior`, then steps, in-bound files, applicable UI states, reuse, deps, Mock/API strategy, activation/rollback, frozen verify entrypoints, real-integration gap, and exactly one `frontend-implementation-contract-v1` JSON object. IDs plus file paths are not sufficient behavior semantics. Use `uiStates: []` for logic-only changes with no user-visible UI state; do not invent UI states. Applicable states require behavior/implementation/verification, while non-applicable states require a reason and omit empty behavior placeholders. Prefer native Mock; browser intercept only with existing e2e; request-adapter only for a reversible seam. `auto` with absent/ambiguous project Mock capability must select `not-needed`, keep real requests default, and record the gap; `required` cannot select `not-needed`. Initial design pass uses the original plan; only exact `request-revision` runs read-only revision plus final review. Small-risk runs one design review only.
|
|
10
|
+
- **`frontend-prewrite-gate-shell`**: the sole write authorization. Resolve effective plan/review, require exact pass, retain every REQ/BR/AC id, enforce Mock policy, validate schema/source binding and writeSet containment, and materialize `contracts/frontend-implementation-contract.json`. A planned fixture or consumer may be a future writer output and need not exist before authorization. Fallback is allowed only when a conditional primary is absent; an existing malformed primary fails closed. Generation-time blocked Mock produces one deterministic blocking shell node and no writer.
|
|
11
11
|
- **`frontend-implement-pi`**: sole regular exclusive writer and consumer of `frontend-bounded-implement`, not this discovery skill. Stay in `writeSet`; real requests default-on; Mock reversible, dev/test-only, production-off. Atomic handler/intercept/adapter with consumer+tests. Stop on forbidden paths or guesses. First line must be `IMPLEMENTATION_OUTCOME: changed|already-satisfied|blocked`; runtime checks it against the attributed diff. Optional mock-verify when frozen; static+behavior always; behavior must prove page consumption. Skipped-Mock `not-needed` keeps real integration pending unless the real backend path has fresh evidence.
|
|
12
12
|
|
|
13
13
|
## Contract / trace / stages (M1–M2)
|
|
@@ -13,13 +13,12 @@ references:
|
|
|
13
13
|
|
|
14
14
|
# loop-agent Workflow
|
|
15
15
|
|
|
16
|
-
Entry
|
|
16
|
+
Entry: routing and hard rules. Required details come from frontmatter references;`command-reference.md` stays optional below.
|
|
17
17
|
|
|
18
18
|
## 默认立场
|
|
19
19
|
|
|
20
20
|
- 主入口是 **Agent DAG**(经 `loop-agent` / 可选 `agent-worker` CLI)。
|
|
21
|
-
-
|
|
22
|
-
- **主会话 = operator-only**:编排 CLI、审 writeSet、只读 status/doctor/report、记 human gate、跑 Shell verification 与 handoff。
|
|
21
|
+
- 宿主仅作 **Compatibility / Operator Assist**:主会话编排 CLI、审 writeSet、读 status/doctor/report、处理 human gate、验证与 handoff;不写业务代码。
|
|
23
22
|
- **严禁**主会话绕过 CLI 用宿主 Edit/Write 改业务实现,或 CLI 失败后「救火改文件」。
|
|
24
23
|
- DAG `pi` executor 默认 read-only;`toolProfile: "write"` 时为 bounded writer;sidecar 须 per call 收窄。
|
|
25
24
|
- Shell verification 是事实源;长期结论写回 `ai_workspace/loop-agent/`、`docs/decisions/` 或 `skills/`。
|
|
@@ -51,13 +50,14 @@ CLI `src/cli/`;DAG `src/workflows/dag/`;loop `src/workflows/loop/`;executo
|
|
|
51
50
|
|
|
52
51
|
## Hard Rules
|
|
53
52
|
|
|
54
|
-
1.
|
|
53
|
+
1. Use vertical tracer bullets across real integration layers;each needs independent acceptance and verification.
|
|
55
54
|
2. Autonomy ≠ governance profile: declare AFK/HITL in human gate; choose `--profile` by risk.
|
|
56
55
|
3. Source materials mandatory: `source/需求.md`、`source/执行约束.md`、优先 `source/references/*` originals。
|
|
57
|
-
4.
|
|
58
|
-
5.
|
|
59
|
-
6.
|
|
60
|
-
7.
|
|
56
|
+
4. Structured task config only: `referenceDocs` uses `{ path, name? }[]`, never a string array;`verifyCommands` uses `{ label, command, timeoutMs? }[]`, never a string array。
|
|
57
|
+
5. Agent DAG is the implementation workflow;review three-way checks references + derived source + implementation。
|
|
58
|
+
6. 主会话不绕过 CLI 直接写业务代码;失败只走 doctor/reconcile/human gate/重跑。
|
|
59
|
+
7. DAG `pi` executor read-only unless `toolProfile: "write"`;completed run facts read-only;不得从 read-only DAG/sidecar 写 root `artifacts/`。
|
|
60
|
+
8. No hidden state in chat only;verify before completion.
|
|
61
61
|
|
|
62
62
|
## References
|
|
63
63
|
|
|
@@ -162,6 +162,8 @@ loop-agent import-prd <task-id> --file ai_workspace/loop-agent/path/to-prd.md [-
|
|
|
162
162
|
|
|
163
163
|
把用户原始 PRD **原样复制** 到 `.harness/tasks/<task-id>/source/references/`,并写入 `source/source-manifest.json`(含 SHA-256)与 `task.json.referenceDocs`。此步骤不调用模型、不改写内容。随后再写派生的 `source/需求.md` 执行契约;冲突时以 `source/references/*` 为准。
|
|
164
164
|
|
|
165
|
+
`referenceDocs` 是 `{ path, name? }[]` 对象数组,不是路径字符串数组;`import-prd` 会确定性写入正确结构。
|
|
166
|
+
|
|
165
167
|
### Task Contract / operator machine surface
|
|
166
168
|
|
|
167
169
|
```bash
|
|
@@ -514,10 +516,17 @@ loop-agent knowledge query --mode search --text "keyword" --json
|
|
|
514
516
|
agent-worker task validate <task.yaml> # 三层校验 TaskSpec,输出 JSON
|
|
515
517
|
agent-worker task explain-profile <task.yaml> # 解释业务 type/risk -> DAG governance profile 映射
|
|
516
518
|
agent-worker task validate-feature <feature-dir> # 校验完整 feature packet 的验收、依赖、TaskSpec 和验证命令
|
|
519
|
+
agent-worker feature scaffold --repo <repo-root> --template <backend-only|frontend-only|fe-with-api> \
|
|
520
|
+
--feature-id F-YYYY-NNN --title "..." \
|
|
521
|
+
[--be-path <pattern> ...] [--fe-path <pattern> ...] [--contract-path <path>] \
|
|
522
|
+
--verify-command <cmd> [--verify-command <cmd> ...] \
|
|
523
|
+
[--batch <yaml-or-json>] [--dry-run] [--json]
|
|
517
524
|
agent-worker feature review --feature-dir <feature-dir> --repo <repo-root> [--json]
|
|
518
525
|
agent-worker feature run --feature-dir <feature-dir> --repo <repo-root> [--dry-run] [--git-mode checkpoint] [--keep-failed-diff] [--json]
|
|
526
|
+
agent-worker feature doctor --feature-dir <feature-dir> --repo <repo-root> [--json]
|
|
527
|
+
agent-worker feature advance --feature-dir <feature-dir> --repo <repo-root> [--task-id <FINAL-VERIFY-id>] [--loop-agent-bin loop-agent] [--dry-run] [--apply --owner <owner>] [--json]
|
|
519
528
|
agent-worker feature verify-final --feature-dir <feature-dir> --repo <repo-root> --task-id <qa-execute-id> [--json]
|
|
520
|
-
agent-worker feature delivery --feature-dir <feature-dir> --repo <repo-root> --qa-evidence <path> --final-verification <path> [--waivers <path>] [--dry-run] [--json]
|
|
529
|
+
agent-worker feature delivery --feature-dir <feature-dir> --repo <repo-root> [--qa-evidence <path>] [--final-verification <path>] [--waivers <path>] [--dry-run] [--json]
|
|
521
530
|
agent-worker feature closeout --feature-dir <feature-dir> --repo <repo-root> [--apply --owner <owner>] [--json]
|
|
522
531
|
agent-worker report metrics --repo <repo-root> --month <YYYY-MM> [--json]
|
|
523
532
|
agent-worker task draft-followup <task-id> --worker-run-id <id> --feature-dir <feature-dir> --repo <repo-root> [--json]
|
|
@@ -552,12 +561,15 @@ agent-worker observe snapshot --repo <repo-root> # 输出 GlobalSnapshot JSON
|
|
|
552
561
|
- Worker runtime state 落在目标 repo 的 `.harness/task-pool/`(artifacts、JSONL/state、晨报、failure handoffs)。自 0.8.0 起该目录是唯一受支持的 Task Pool runtime root;旧路径不读取、不迁移、不合并、不重映射。
|
|
553
562
|
- preflight 在 `new-task` 前跑 `loop-agent --version`、`inspect`、`docs-audit`、`git status --short --branch`,可选 `--check-repo`。一次夜间批处理期间不升级控制器,记录实际 `loop-agent` 版本。
|
|
554
563
|
- `batch run-ready` 默认在 stderr 输出人类可读进度(批次起止、每个 task 的阶段与耗时、report 决策),stdout 只保留最终 JSON,便于管道取用;加 `--quiet` 可关闭进度。
|
|
564
|
+
- `feature scaffold` 确定性生成 Feature Packet(`backend-only` / `frontend-only` / `fe-with-api`),默认 `profile: generic`,输出到 `<repo>/features/<feature-id>`;写盘前同源 `validate-feature`;`--batch` 全有或全无;不调用模型、不碰 `.harness/**`。
|
|
555
565
|
- `feature review` 只读派生 Feature 状态、required AC 覆盖、阻塞、证据和唯一下一步。默认输出简洁的人类摘要,`--json` 输出 schemaVersion 1 JSON;损坏事实会显式降级,不会写 Feature Packet 或 Task Pool。
|
|
556
566
|
- `feature run` 薄编排 validation、preflight、现有 run-ready、morning report、Observe snapshot 和最终 review。`--dry-run` 零写入;Git checkpoint 可用前单次最多推进一个 Ready 写任务。
|
|
557
567
|
- `feature run` 遇到业务 Task 失败时仍刷新证据,但返回 `needs-action` 和非零退出码;无 Ready 是正常结果,并通过 `noReadyReason` 说明 Closed、Deliverable、AwaitingQA、NeedsAction、依赖阻塞或空 Feature。
|
|
558
568
|
- `feature run --git-mode checkpoint` 是唯一 checkpoint 授权:要求 clean repo,在本地 `agent/<feature-id>` 分支按成功 Task commit;失败先保存 patch/untracked/boundary audit 再恢复 clean。默认不 commit;从不 stash/push/merge/创建远程 PR。`--keep-failed-diff` 会停止 Feature,不继续后续 Task。
|
|
569
|
+
- `feature doctor` 只读诊断 Feature 交付就绪:Task Pool 状态、dirty worktree、canonical evidence / Delivery manifest 是否存在,并给出下一步命令建议(不自动修复)。
|
|
570
|
+
- `feature advance`(ADR 0007)编排 `verify-final → delivery → closeout preview[/apply]`:默认 evidence 路径取自 verify-final;`--dry-run` 时 Delivery 不写盘且不 apply closeout;`--apply --owner` 在 closeout preview ready 后原子 apply。不执行实现链 Ready tasks(仍用 `feature run`)。
|
|
559
571
|
- `feature verify-final` 在 clean Delivery HEAD 上复用已完成的 `qa-execute` TaskSpec 运行独立 DAG,跳过 promotion/closeout,原子生成 canonical QA aggregate 和 HEAD-bound final verification;相同 HEAD 的 canonical 成功 run 可幂等复用。
|
|
560
|
-
- `feature delivery` 复用 transaction record,校验 Git history/trailers/changed files、成功 run、canonical QA/final verification 和 required AC,原子生成 manifest、coverage 与 `PR.md`;`--dry-run` 零写入。`feature closeout` 默认只读复验全部 gates,显式 `--apply --owner` 才原子写回,stale facts 或 post-validation 失败会整体回滚。
|
|
572
|
+
- `feature delivery` 复用 transaction record,校验 Git history/trailers/changed files、成功 run、canonical QA/final verification 和 required AC,原子生成 manifest、coverage 与 `PR.md`;省略 evidence 路径时默认 `.harness/task-pool/evidence/<featureId>/{qa-pass,final-verification}.json`;`--dry-run` 零写入。`feature closeout` 默认只读复验全部 gates,显式 `--apply --owner` 才原子写回,stale facts 或 post-validation 失败会整体回滚。
|
|
561
573
|
- `report metrics` 按 UTC 月去重投影 Feature/Failure/Follow-up/Delivery/AC/decision/recovery/boundary 指标,同时写 JSON 与 Markdown;每项保留 numerator、denominator、sampleSize 和 missingData。
|
|
562
574
|
- `task draft-followup` 会按全部 failure category 生成 TaskDraft 或人工行动卡:ProductBug/TestBug/FlakyTest/DependencyFailure 可批准;EnvFailure 连续两次后才生成 ENV-CHECK;Spec/Contract/Risk/Human/Unknown 只给行动卡。人工以 `feature approve-followup --dry-run` 预览,再带非空 `--owner` 批准 TaskDraft;行动卡不能批准。批准在 staging validation 后写 TaskSpec、graph、Ready/approval/event,原失败事实不改写,并有 rename/state/approval/index/event 回滚门禁。
|
|
563
575
|
- `task retry` 是失败 Task 的唯一重试入口。它会保留原有运行记录和 failure handoff,并让下一次 `batch run-ready` 使用新的 `workerRunId`;不要删除运行态文件或手动修改状态来重试。
|
|
@@ -124,6 +124,28 @@ On Windows, run Bash scripts through Git Bash or a configured compatible Bash. D
|
|
|
124
124
|
|
|
125
125
|
若 `spec`、`plan` 或 DAG generation 后 source materials 变更,implementation 前 regenerate 或 revalidate plan/DAG。
|
|
126
126
|
|
|
127
|
+
`task.json` 中以下字段必须是结构化对象数组,不能写成字符串数组:
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"referenceDocs": [
|
|
132
|
+
{
|
|
133
|
+
"name": "requirement",
|
|
134
|
+
"path": "docs/requirement.md"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"verifyCommands": [
|
|
138
|
+
{
|
|
139
|
+
"label": "tests",
|
|
140
|
+
"command": "npm test",
|
|
141
|
+
"timeoutMs": 120000
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
`referenceDocs` 每项至少包含 `path`,可选 `name`;`verifyCommands` 每项至少包含 `label` 与 `command`,可选正整数 `timeoutMs`。持久化入口会在写盘前校验完整 TaskConfig,格式错误不会留下部分 `task.json`。
|
|
148
|
+
|
|
127
149
|
## Long-running loop policy
|
|
128
150
|
|
|
129
151
|
`loop` 用于 long-running outer task memory:objective/context projection、round records、signals、derived events、verification summaries、closeout draft。它不是 Agent DAG 的 substitute。
|
|
@@ -75,6 +75,11 @@ loop-agent --repo-root /path/to/target-repo <command>
|
|
|
75
75
|
- `verifyCommands` / adapter verification settings
|
|
76
76
|
- `dagFallbackReason`,仅用于记录为何某个长期 loop 缺少 DAG round evidence
|
|
77
77
|
|
|
78
|
+
结构化数组字段:
|
|
79
|
+
|
|
80
|
+
- `referenceDocs` 必须是 `{ path, name? }[]`,不能是路径字符串数组。
|
|
81
|
+
- `verifyCommands` 必须是 `{ label, command, timeoutMs? }[]`,不能是命令字符串数组。
|
|
82
|
+
|
|
78
83
|
切片形状:每个 task 应是可独立验证的垂直 tracer bullet,而不是某一层的水平批处理。Autonomy(AFK/HITL)与 governance profile(`minimal`/`standard`/`reviewed`/`supervised`)分开声明;默认 `--profile auto`。
|
|
79
84
|
|
|
80
85
|
## Verification
|