@tea-agent/loop-agent 0.21.0 → 0.23.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 +42 -108
- package/CHANGELOG.md +114 -0
- package/README.md +7 -4
- package/bin/agent-worker.js +0 -0
- package/dist/adapters/loop-agent.js +52 -0
- package/dist/application/context-usage/skill-resolution-stats.js +263 -0
- package/dist/application/dag/generate-task-dag.js +17 -3
- package/dist/cli/command-definitions.js +8 -7
- package/dist/cli/program.js +17 -15
- package/dist/commands/doctor.js +269 -18
- package/dist/commands/init.js +198 -86
- package/dist/commands/stats.js +40 -11
- package/dist/executors/dag-pi-executor.js +2 -0
- package/dist/executors/shell-executor.js +162 -19
- package/dist/shared/openspec-spec.js +49 -0
- package/dist/shared/operator/capabilities.js +11 -1
- package/dist/worker/console/app-data.js +4 -0
- package/dist/worker/console/chat/instruction-skills.js +217 -0
- package/dist/worker/console/chat/model-resolver.js +106 -0
- package/dist/worker/console/chat/pi-runtime.js +605 -0
- package/dist/worker/console/chat/resource-loader.js +66 -0
- package/dist/worker/console/chat/routes.js +357 -0
- package/dist/worker/console/chat/session-store.js +238 -0
- package/dist/worker/console/chat/tool-adapter.js +238 -0
- package/dist/worker/console/chat/tools.js +171 -0
- package/dist/worker/console/server.js +55 -0
- package/dist/worker/console/static/assets/index-DVl7Jxt5.js +25 -0
- package/dist/worker/console/static/assets/index-lVcIr9Ju.css +1 -0
- package/dist/worker/console/static/index.html +2 -2
- package/dist/worker/feature/profile-schema.js +1 -1
- package/dist/worker/observability/read-model.js +21 -1
- package/dist/worker/observe/spec-evidence.js +12 -15
- package/dist/worker/observe/static/dag-helpers.js +22 -0
- package/dist/worker/observe/static/views/dag.js +5 -0
- package/dist/workflows/dag/backend-test-markdown-workflow.js +37 -0
- package/dist/workflows/dag/frontend-implementation-contract.js +141 -32
- package/dist/workflows/dag/frontend-lint-baseline.js +471 -0
- package/dist/workflows/dag/frontend-prewrite-gate.js +79 -16
- package/dist/workflows/dag/frontend-project-capability.js +11 -8
- package/dist/workflows/dag/frontend-repair.js +6 -4
- package/dist/workflows/dag/frontend-review-context.js +67 -0
- package/dist/workflows/dag/frontend-test-case-quality.js +105 -0
- package/dist/workflows/dag/frontend-test-result-contract.js +71 -66
- package/dist/workflows/dag/frontend-verification-trace.js +31 -1
- package/dist/workflows/dag/frontend-worktree-diff.js +81 -6
- package/dist/workflows/dag/init-hybrid.js +412 -84
- package/dist/workflows/dag/node-execution.js +38 -1
- package/dist/workflows/dag/output-protocol.js +89 -0
- package/dist/workflows/dag/prompt.js +35 -1
- package/dist/workflows/dag/recovery-recommendation.js +45 -0
- package/dist/workflows/dag/report.js +28 -1
- package/dist/workflows/dag/rerun-task.js +1 -1
- package/dist/workflows/dag/scheduler.js +9 -0
- package/dist/workflows/dag/types.js +74 -1
- package/dist/workflows/dag/validate.js +55 -0
- package/docs/README.md +73 -156
- package/docs/architecture/README.md +3 -2
- package/docs/architecture/dag-execution.md +2 -2
- package/docs/architecture/evolution.md +14 -12
- package/docs/architecture/system-overview.md +1 -1
- package/docs/architecture/worker-and-feature.md +3 -3
- package/docs/governance/README.md +15 -0
- package/docs/{harness-methodology-debugging.md → governance/harness-methodology-debugging.md} +27 -3
- package/docs/init-surface.manifest.json +22 -4
- package/docs/operations/README.md +12 -0
- package/docs/{local-development-environment.md → operations/local-development-environment.md} +1 -1
- package/docs/skills/vetted-skill-registry.md +23 -3
- package/docs/templates/README.md +55 -0
- package/docs/templates/agent-dag.schema.json +15 -5
- package/docs/templates/backend-test-dag.json +1 -1
- package/docs/templates/evaluation/agents-map-slim-v1.candidate.json +9 -0
- package/docs/templates/evaluation/agents-map-slim-v1.md +87 -0
- package/docs/templates/evaluation/agents-map-verbose-v0.candidate.json +9 -0
- package/docs/templates/evaluation/agents-map-verbose-v0.md +153 -0
- package/docs/templates/frontend-implementation-contract.schema.json +4 -3
- package/docs/templates/frontend-test-case-checklist.md +6 -2
- package/docs/templates/frontend-test-dag.json +2 -2
- package/docs/templates/hybrid-dag.json +1 -1
- package/docs/templates/progress-log.md +9 -2
- package/harness.json +5 -5
- package/package.json +5 -5
- package/scripts/kb-bootstrap-init-skeleton.sh +2 -2
- package/skills/agent-worker/SKILL.md +1 -1
- package/skills/frontend-design-review/SKILL.md +12 -10
- package/skills/frontend-design-review/references/review-checklist.md +4 -4
- package/skills/frontend-implementation/SKILL.md +2 -2
- package/skills/frontend-implementation/references/code-standards.md +4 -3
- package/skills/frontend-implementation/references/design-spec.md +19 -14
- package/skills/frontend-implementation/references/node-contracts.md +2 -2
- package/skills/frontend-review/SKILL.md +15 -28
- package/skills/frontend-review/references/review-findings.md +16 -18
- package/skills/frontend-verification/SKILL.md +16 -13
- package/skills/frontend-verification/references/verification-checklist.md +18 -30
- package/skills/grill-with-docs/SKILL.md +44 -52
- package/skills/grill-with-docs/adr-format.md +37 -26
- package/skills/grill-with-docs/context-format.md +18 -26
- package/skills/loop-agent/SKILL.md +28 -112
- package/skills/loop-agent/references/command-reference.md +9 -3
- package/skills/loop-agent/references/harness-policy.md +3 -3
- package/skills/loop-agent/references/hybrid-dag.md +1 -1
- package/skills/loop-agent/references/orchestrator-and-interventions.md +1 -1
- package/skills/loop-agent/references/task-workflow.md +2 -0
- package/skills/systematic-debugging/SKILL.md +20 -4
- package/skills/test-driven-development/SKILL.md +10 -3
- package/dist/worker/console/static/assets/index-CUDke82y.js +0 -18
- package/dist/worker/console/static/assets/index-wSEksVSO.css +0 -1
- /package/docs/{harness-methodology-tdd.md → governance/harness-methodology-tdd.md} +0 -0
- /package/docs/{harness-methodology-verification.md → governance/harness-methodology-verification.md} +0 -0
package/AGENTS.md
CHANGED
|
@@ -14,140 +14,74 @@
|
|
|
14
14
|
|
|
15
15
|
- 仓库是记录系统:决策、契约、计划、测试、报告优先落到仓库,而不是停留在聊天里。
|
|
16
16
|
- 一次只推进一个清晰工作块;主会话按 Orient → Select → Contract → Implement → Verify → Handoff 治理,runtime 真实流程以 `src/workflows/` 为准。
|
|
17
|
-
-
|
|
17
|
+
- 先验证基线,再叠加改动;完成定义必须可验证,不能靠删测试、降标准或模糊描述制造“完成”。
|
|
18
18
|
- Do not consider backward compatibility. Ignore legacy code/libraries.
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
- 除非用户明确要求,不要自行引入外部 SDD、spec-first、brainstorming 等方法论的强制设计文档、审批门或专用目录;本仓库的工作流程以本文件和 `docs/` 中的治理规则为准。
|
|
30
|
-
- 对非微小的实现或修复,`exec-plan` 只负责记录 Contract、进度和验证证据,不能替代 Agent DAG。除非用户明确要求 one-shot,或在计划中记录了适用的 escape hatch 与理由,否则在改动实现文件前必须完成 `new-task`、结构化 `allowedPaths` / `forbiddenPaths`、`dag run-task` 和 `dag validate`;随后按已校验的 DAG 执行并审查 writer `writeSet`。
|
|
31
|
-
- 禁止占位实现;除非 contract 明确约定为脚手架且标出后续闭环。
|
|
19
|
+
- 搜索先于实现;受治理 Agent runtime 只有 Pi(`implement-pi` / `repair-pi`);`cursor-prompt` 仅为显式手工 one-shot sidecar。
|
|
20
|
+
- DAG 标准路径:Contract → Scout → Plan → Implement → Verify → Closeout/Handoff。
|
|
21
|
+
- 机器校验契约真源:`docs/init-surface.manifest.json`、`docs/architecture/runtime-boundaries.md`、`src/cli/command-definitions.ts`、`skills/loop-agent/`、`scripts/check-*.sh`;本文件只指路。
|
|
22
|
+
- 本仓库既是源项目也是 init 默认模板;新增能力必须判断 npm 内置 vs `loop-agent init` 投影。
|
|
23
|
+
- 委托写入前必须结构化 `task.json.allowedPaths` / `forbiddenPaths`,并审查 DAG writer `writeSet`。
|
|
24
|
+
- Shell 搜索优先 `rg`,按名找文件优先 `fd`;脚本用 Git Bash / 兼容 Bash。
|
|
25
|
+
- 用 loop-agent 迭代本仓库时,控制器必须来自已发布 npm 包(记录实际版本);启动后不要中途升级;不要用工作区 `npm link` / `npm run dev` 控制可能改 CLI/runtime/package 的任务。
|
|
26
|
+
- 反复出现的约束固化为文档、脚本、检查、测试或模板;禁止占位实现(除非 contract 标明脚手架)。
|
|
27
|
+
- 非微小实现:`exec-plan` 不能替代 Agent DAG;除非用户要求 one-shot 或计划记录 escape hatch,否则改实现前完成 `new-task`、结构化路径、`dag run-task`、`dag validate` 与 writeSet 审查。
|
|
28
|
+
- 不要自行引入外部 SDD/spec-first 等强制平行治理树;以本文件与 `docs/` 为准(ADR 0006)。
|
|
32
29
|
|
|
33
30
|
## 开始顺序
|
|
34
31
|
|
|
35
32
|
改文件前必须先完成:
|
|
36
33
|
|
|
37
|
-
1.
|
|
38
|
-
2.
|
|
39
|
-
3.
|
|
40
|
-
4.
|
|
41
|
-
5.
|
|
42
|
-
6.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- `docs/verification-matrix.md`
|
|
46
|
-
7. 如果任务涉及命令入口、执行流程、executor、初始化投影、skills、脚本矩阵、发布包范围或治理检查,继续阅读:
|
|
47
|
-
- `docs/architecture/runtime-boundaries.md`
|
|
48
|
-
- `docs/loop-agent-harness.md`
|
|
49
|
-
8. 如果任务涉及测试纪律、验证声明或调试,继续阅读:
|
|
50
|
-
- `docs/harness-methodology-tdd.md`
|
|
51
|
-
- `docs/harness-methodology-verification.md`
|
|
52
|
-
- `docs/harness-methodology-debugging.md`
|
|
53
|
-
9. 查看最近提交、相关执行计划、progress/report,确认当前上下文。
|
|
54
|
-
10. 检查 `git status --short --branch`。
|
|
55
|
-
11. 运行本次任务相关的最小基线验证。
|
|
56
|
-
12. 如果用户提到"后端测试"、"接口测试"、"pytest"、"自动化测试",在任务 `task.json` 中设置 `taskKind: "backend-test"` 再 `dag run-task`;不要用 `--profile backend-test`(CLI 不接受该值,专用模板只走 taskKind)。知识回写用 `taskKind: "knowledge-sync"`(须 `featureId`),图谱开荒用 `taskKind: "knowledge-graph-bootstrap"`。`--profile` 仅表示治理强度:`auto|minimal|standard|reviewed|supervised`。
|
|
57
|
-
13. 如果用户提到"看板"、"observe"、"监控面板"、"启动看板",使用 `agent-worker console serve --repo . --port 8790` 启动统一 Operator Console;`/inspect/` 提供只读检视。`agent-worker observe serve --repo . --port 8787` 仅为兼容入口。
|
|
58
|
-
14. 如果用户要求“合并 `<source>` 到 `<target>`”或“合并 origin/main 到当前分支”,先阅读 `docs/branch-merge-guideline.md`,按影响自动选择快速、标准或深度模式;始终冻结 source SHA、审查双方功能、运行 merge-tree、生成 source-SHA 合并报告,并在提交前再次 fetch 防止主干前进。
|
|
34
|
+
1. `pwd` → 读 `README.md`、`harness.json`、`docs/README.md`;有 `CONTEXT.md` 则读术语表。
|
|
35
|
+
2. 实现类工作继续读:`docs/governance/development-principles.md`、`docs/governance/feature-workflow.md`、`docs/governance/verification-matrix.md`。
|
|
36
|
+
3. 涉及命令/executor/init/skills/发布包/治理检查时继续读:`docs/architecture/runtime-boundaries.md`、`docs/runtime/loop-agent-harness.md`。
|
|
37
|
+
4. 涉及测试纪律/验证声明/调试时继续读:`docs/governance/harness-methodology-*.md`。
|
|
38
|
+
5. 查看最近提交、相关 plan/progress/report;`git status --short --branch`;跑最小基线验证。
|
|
39
|
+
6. 后端/接口/pytest → `taskKind: "backend-test"`(不是 `--profile`);知识回写 `knowledge-sync`;图谱开荒 `knowledge-graph-bootstrap`。`--profile` 仅 `auto|minimal|standard|reviewed|supervised`。
|
|
40
|
+
7. 看板/observe → `agent-worker console serve --repo . --port 8790`(`/inspect/` 只读);`observe serve` 仅为兼容入口。
|
|
41
|
+
8. 分支合并 → 先读 `docs/operations/branch-merge-guideline.md`。
|
|
59
42
|
|
|
60
43
|
## 会话协议
|
|
61
44
|
|
|
62
|
-
1. Orient
|
|
63
|
-
2. Select:只选一个清晰工作块;避免把重构、新功能、文档迁移混在一轮里。
|
|
64
|
-
3. Contract:写清本轮交付物、非目标、完成标准、验证方法和失败条件。
|
|
65
|
-
4. Implement:做最小增量实现,同步维护必要文档、脚本和测试。
|
|
66
|
-
5. Verify:优先跑快速反馈,再跑必要的真实路径验证。
|
|
67
|
-
6. Converge Docs:检查 README、AGENTS.md、CHANGELOG.md、docs/README.md、相关治理文档、skills references、website docs、初始化模板和脚本说明是否仍与实际行为一致;只更新与本次变更相关的内容,不做顺手文档迁移。
|
|
68
|
-
7. Handoff:更新 progress/report/plan 中有长期价值的信息,写清风险、剩余项和下一步。
|
|
45
|
+
1. Orient → 2. Select(一块)→ 3. Contract → 4. Implement → 5. Verify → 6. Converge Docs → 7. Handoff。
|
|
69
46
|
|
|
70
|
-
|
|
47
|
+
这不是 DAG 节点序列。复杂实现默认 Agent DAG;主 agent 拆任务、写 contract、结构化路径、审查 DAG/writeSet/profile/shell verification。微小任务可用 one-shot escape hatch 并记录边界与验证证据。
|
|
71
48
|
|
|
72
49
|
## 项目地图
|
|
73
50
|
|
|
74
|
-
- `CONTEXT.md
|
|
75
|
-
- `src/`:loop-agent
|
|
76
|
-
- `
|
|
77
|
-
-
|
|
78
|
-
- `
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
- 保留无关的用户改动,不要回退自己没有做的修改。
|
|
88
|
-
- 优先沿用现有 helper、目录边界和局部模式,再考虑新增抽象。
|
|
89
|
-
- 长期决策写入 `docs/`,不要只留在聊天里。
|
|
90
|
-
- 分支合并遵循 `docs/branch-merge-guideline.md`;快速模式只用于可证明的低风险/no-op 合并,涉及冲突、init/package/runtime/release/public API 时必须升级为标准或深度模式。
|
|
91
|
-
- 后端测试、接口/API 测试、pytest 或明确的后端自动化测试,必须把 `.harness/tasks/<task-id>/task.json` 的 `taskKind` 设置为 `"backend-test"`,不得保留默认 `standard`。`backend-test` 是 `taskKind`,不是 `--profile` 的可选值;`dag run-task` 继续使用 `--profile auto` 选择治理等级。仅说“自动化测试”且前后端不明时,先根据任务源和项目技术栈判断,禁止无条件路由。
|
|
92
|
-
- 本地 Operator Console:`agent-worker console serve --repo . --port 8790`,访问 `http://127.0.0.1:8790/`;其中 `/inspect/` 为只读运行检视。默认绑定本机 `127.0.0.1`;可用 `--host 0.0.0.0` / `--debug`,不要直接暴露到公开网络。
|
|
93
|
-
- 面向使用者的新增、修改、删除或修复,应同步更新根目录 `CHANGELOG.md`;保持版本级摘要即可,不写过细技术细节。
|
|
94
|
-
- 面向用户的中文更新日志、README 和说明文档应使用自然、结果导向的表达:先说明用户能获得什么或问题如何改善,保留必要的命令和产品术语,避免逐字翻译、内部实现细节和无意义的中英混杂。
|
|
95
|
-
- 涉及 `loop-agent init` 或目标项目投影的改动,必须同步考虑目标项目生成物:`AGENTS.md`、`README.md`、`harness.json`、`ai_workspace/loop-agent/`、`scripts/`、`.agents/skills/`、`.harness/prompts`、`.gitignore`(loop-agent runtime managed block)和 npm 包内置 assets;目标项目根 `docs/` 和根 `skills/` 的旧投影需要由 `init update --apply-safe` 安全迁移或退役。
|
|
96
|
-
- 涉及初始化能力演化时,按 `docs/init-surface.manifest.json` 与 `scripts/check-init-evolution-needed.sh` 分级处理:小改 advisory,中等 surface-check,高影响才需要模型审查;不要把所有小改动升级成重流程。
|
|
97
|
-
- 通用脚本、skill 和模板可以复制或投影;项目相关 README、验证命令、发布/维护脚本必须基于模板和目标项目真实文件生成,不假定目标项目是 TypeScript、Node、前端、后端或工具项目。
|
|
98
|
-
- 涉及 CLI command、skill entry、runtime boundary、import 方向或发布包范围时,同步更新对应文档、catalog/definition、治理脚本和测试,避免 README、skill reference、CLI help、npm 包内容互相漂移。
|
|
99
|
-
- 完成相关更新后必须做文档收敛:如果 README、AGENTS.md、CHANGELOG.md、docs、skills、website、初始化生成模板或脚本说明不需要更新,应在交接里写明理由。
|
|
100
|
-
- 不提交占位实现。
|
|
101
|
-
- 没有新鲜验证证据时,不声明工作完成。
|
|
102
|
-
- 发现新 bug、技术债或契约漂移时,写回当前 plan、progress 或 report,而不是只在对话里提一句。
|
|
103
|
-
- 涉及 harness 流程变化时,优先把变化落到 `harness.json`、模板、脚本或治理文档,而不是只改提示词。
|
|
51
|
+
- `CONTEXT.md`:术语表
|
|
52
|
+
- `src/`:运行时;`test/`:Vitest;`bin/loop-agent.js`:CLI
|
|
53
|
+
- `skills/`:源仓库/npm 内置 skills;目标项目只生成 `.agents/skills/`
|
|
54
|
+
- `.harness/`:运行态(tasks/dag-runs/runs 等;init 会 gitignore 运行事实,保留 prompts 与占位)
|
|
55
|
+
- `docs/`:治理;`website/`:用户文档站;`scripts/`:检查与 CI
|
|
56
|
+
|
|
57
|
+
## 工作规则(增量约束)
|
|
58
|
+
|
|
59
|
+
- 保留无关用户改动;优先沿用现有 helper/目录边界。
|
|
60
|
+
- 长期决策写入 `docs/`;面向用户变更更新 `CHANGELOG.md`(结果导向中文)。
|
|
61
|
+
- init/投影变更必须同步目标项目生成物与 package assets;init evolution 按 `docs/init-surface.manifest.json` 分级。
|
|
62
|
+
- CLI/skill entry/runtime boundary/发布包变更同步 catalog、脚本与测试。
|
|
63
|
+
- 没有新鲜验证证据时不声明完成;新债写入 plan/progress/report。
|
|
104
64
|
|
|
105
65
|
## 验证
|
|
106
66
|
|
|
107
|
-
|
|
67
|
+
权威源:`docs/governance/verification-matrix.md`。常用:
|
|
108
68
|
|
|
109
69
|
```bash
|
|
110
|
-
npm run typecheck
|
|
111
|
-
npm test
|
|
112
|
-
npm run build
|
|
70
|
+
npm run typecheck && npm test && npm run build
|
|
113
71
|
node bin/loop-agent.js --help
|
|
114
72
|
bash scripts/check-repo.sh
|
|
115
73
|
bash scripts/ci.sh
|
|
116
74
|
```
|
|
117
75
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
文档站相关变更还需要按范围运行:
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
npm run docs:build
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
按变更类型补充定向验证:
|
|
127
|
-
|
|
128
|
-
- 初始化能力或目标项目投影:运行 `test/init-command.test.ts`,并在临时目标项目执行 `loop-agent init --profile full --merge`、`loop-agent init doctor`、`loop-agent inspect`、`loop-agent docs audit` 和目标项目 `bash scripts/check-repo.sh`。
|
|
129
|
-
- init surface 或初始化能力演化:运行 `bash scripts/check-init-evolution-needed.sh` 和 `bash scripts/check-init-surface.sh`;高影响或发布前按需使用 `--strict` 并参考 `skills/init-capability-evolution/` 与 `docs/templates/init-evolution-review.md`。
|
|
130
|
-
- runtime boundary / command registry / skill entry:运行 `bash scripts/check-architecture-boundaries.sh`、`bash scripts/check-command-registry-drift.sh`、`bash scripts/check-skill-entry.sh`,并确保 `bash scripts/check-repo.sh` 覆盖这些检查。
|
|
131
|
-
- 发布包范围:运行 `npm run build`、`node bin/loop-agent.js --help` 和 `npm pack --dry-run`,确认初始化所需静态资料在 package files 中。
|
|
76
|
+
文档站变更:`npm run docs:build`。init / architecture / skill entry / pack 定向验证见 verification-matrix。
|
|
132
77
|
|
|
133
78
|
## 交接
|
|
134
79
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
- 改了什么
|
|
138
|
-
- 为什么这样改
|
|
139
|
-
- 执行过哪些验证命令以及结果
|
|
140
|
-
- 是否影响契约、文档、测试或脚本
|
|
141
|
-
- 剩余风险
|
|
142
|
-
- 后续工作
|
|
80
|
+
记录:改了什么、为什么、验证命令与结果、契约/文档/测试影响、剩余风险、后续工作。
|
|
143
81
|
|
|
144
82
|
## 禁止事项
|
|
145
83
|
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
-
- 不要假设系统没有某个能力;先搜索再判断。
|
|
151
|
-
- 不要用 stub、假数据通路或注释承诺替代真正交付。
|
|
152
|
-
- 不要把个人机器的绝对路径写入仓库级 `AGENTS.md`、README、模板或发布包资料;个人工具配置应留在用户级配置或本机会话上下文。
|
|
153
|
-
- 不要只更新 loop-agent 本仓库体验而遗漏目标项目初始化体验;新增能力如果不能通过 npm 内置资料或 `loop-agent init` 到达目标项目,必须写清原因和替代入口。
|
|
84
|
+
- 未读相关文档就大改;一次混合无关重构/新功能/文档大迁移。
|
|
85
|
+
- 把对话约束当长期知识;缺验证宣称完成;假设系统没有某能力(先搜索)。
|
|
86
|
+
- stub/假数据通路替代交付;把本机绝对路径写入仓库级 AGENTS/README/模板/发布包。
|
|
87
|
+
- 只更新本仓库体验而遗漏目标项目 init 体验。
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,103 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.23.1] - 2026-07-26
|
|
6
|
+
|
|
7
|
+
### 重点更新
|
|
8
|
+
|
|
9
|
+
- **Console Phase 4 — General Operator Chat**:在 `agent-worker console` 内交付 Pi 驱动的自由对话入口,用自然语言多轮编排 loop-agent / agent-worker;暴露全部 operator action(registry 动态派生)+ 内置探查工具 bash/read/grep/find/ls,仍禁文件写入 coding tool;含两轮代码审查的 P1 修复(builtin tool 注册、schema↔dispatcher 契约、server 生命周期、tool policy 统一)与 followup 修复(缩进、SSE 错误兜底、文档同步、waitForIdle 超时+心跳)
|
|
10
|
+
- DAG 新增显式 failure-aware 依赖语义,允许只读恢复节点容忍上游 ERROR 并读取失败证据执行收敛
|
|
11
|
+
- review verdict 协议重试耗尽后支持确定性规范化,缺失或冲突时仍严格报错
|
|
12
|
+
- 新增 recovery recommendation 稳定下一步分类,为各类失败提供明确的修复或重试路由提示
|
|
13
|
+
- loop-agent doctor 新增机器可读 JSON 报告与只读上下文审计能力
|
|
14
|
+
- loop-agent stats context 提供近端 DAG 运行的上下文用量只读聚合统计
|
|
15
|
+
- AGENTS.md 与 init managed block 采用感知源码的精简策略,保留路由与硬约束不变
|
|
16
|
+
- 全面深化文档治理体系,引入目录状态语义、审查策略与外部方法论单轨融入
|
|
17
|
+
|
|
18
|
+
### 新增
|
|
19
|
+
|
|
20
|
+
- **Console Phase 4 — General Operator Chat(Pi SDK services 模式)**:
|
|
21
|
+
- 后端 `src/worker/console/chat/`:`pi-runtime.ts`(services 模式 SDK 包装 + session 隔离 + 显式注册 builtin 探查工具 `tools:[bash,read,grep,find,ls]`)、`tool-adapter.ts`(operator action → Pi tool schema,动态发现 fail-closed)、`session-store.ts`(Gate 3 per-call 授权 + per-session write chain)、`routes.ts`(SSE 流式 HTTP)、`tools.ts`(全 operator action 动态派生白名单)、`resource-loader.ts`(封闭 ResourceLoader)、`model-resolver.ts`(harness.json 动态解析,无硬编码)、`instruction-skills.ts`(9 个只读 skill 白名单)
|
|
22
|
+
- 前端 `OperatorChat.tsx` + `ChatMarkdown.tsx`:多行 composer、Markdown 气泡、可折叠工具侧栏、停止生成、智能贴底滚动;零依赖 Markdown 渲染
|
|
23
|
+
- 默认模型从 `harness.json executors.pi.MED` 动态解析,按「bare-id 优先 + 有凭证优先」选取 provider(无硬编码回退)
|
|
24
|
+
- 红队验证 V12/V14/V15/V16:文件写入 coding tool 必拒、credential 不回传、高风险 action 无 prepared receipt 必失败、模型伪报 complete 不覆盖 deterministic validation
|
|
25
|
+
- DAG 显式 failureAwareDependsOn 依赖语义,支持只读恢复等价节点显式声明容忍指定上游节点的 ERROR
|
|
26
|
+
- review verdict 协议重试耗尽后的确定性规范化:当恰好存在一个合法受支持且无冲突的 verdict 行时自动规范化为首行
|
|
27
|
+
- recovery recommendation 稳定下一步分类:为 nonzero-exit、protocol-invalid 等各类失败提供稳定的 repair/revision/retry 路由提示
|
|
28
|
+
- loop-agent doctor --json 输出单一可 JSON.parse 的 typed DoctorReport,供人与机器共享同一事实源
|
|
29
|
+
- loop-agent doctor --context 提供只读上下文审计,报告默认策略、技能清单与预算跳过情况
|
|
30
|
+
- loop-agent stats context [--last N] [--json] 只读聚合最近 DAG 运行的技能解析与节点结果
|
|
31
|
+
- 新增 scripts/eval-dogfood-context-engineering-ab.sh,支持复现演练 AGENTS map verbose→slim A/B 协议
|
|
32
|
+
- skill registry 增加 verification placement taxonomy(standalone/embedded/chained/PR-bound)创作词汇
|
|
33
|
+
- 新增 docs/architecture/agents-invariants.md 作为源 AGENTS 与 managed block 不变量合同的单一真源
|
|
34
|
+
- 新增 docs/templates/README.md 并纳入 package / full init / init check-update 面
|
|
35
|
+
- 新增文档治理任务式 README、机器可读 document-catalog.json 与 check-doc-governance.mjs 语义检查器
|
|
36
|
+
- 新增文档审查策略与三档 reviewTier freshness 策略,支持按 UTC 日期边界阻断过期文档
|
|
37
|
+
- 新增设计原则与范式转移起源文章,并发布到网站实践文档
|
|
38
|
+
|
|
39
|
+
### 改进
|
|
40
|
+
|
|
41
|
+
- supervised 模板的 process-supervisor-pi 可显式消费 soft-verify-shell 的 ERROR,使失败进入有界修复收敛链
|
|
42
|
+
- supervised 中间验证未显式配置时不再继承 verifyQuota: full,默认只取配额 1
|
|
43
|
+
- 生成 DAG 的验证命令默认单命令超时由 5 分钟提升为 30 分钟,避免全量测试误判为超时
|
|
44
|
+
- failure-aware 节点可在 upstream_context 中读取被容忍上游 ERROR 的 stdout/stderr 等作为失败证据
|
|
45
|
+
- loop-agent public skill 增加默认预算完整性回归,确保关键 entry 与 required references 在默认预算下完整解析
|
|
46
|
+
- skills/loop-agent/SKILL.md 将 command-reference.md 从 required 调整为按需 reference,保持在默认预算内
|
|
47
|
+
- doctor 与 stats context 的 JSON 模式不再输出 [loop-agent] banner,保证机器输出可直接解析
|
|
48
|
+
- 源仓库 AGENTS.md 与 init managed block 采用感知源码的精简,长解释指向 docs/,保留开工路由与硬约束
|
|
49
|
+
- 调试纪律要求先建立快速确定性反馈回路再进入根因调查;verifier skill 强调不得越过 writer 边界
|
|
50
|
+
- 任务与 TDD 明确采用垂直 tracer bullet(一测试一实现),避免水平层批处理
|
|
51
|
+
- ADR 增加三门槛过滤;CONTEXT.md 明确只承担术语表职责;grill-with-docs 按 governanceRoot 解析 decisions
|
|
52
|
+
- 外部工程方法论按单轨治理融入 docs/skills/init(ADR 0006),不引入平行状态树
|
|
53
|
+
- 文档治理完成当前权威与内容可信度审计,修正设计入口、能力摘要与网站 roadmap 中的归档状态表述
|
|
54
|
+
- 文档治理完成实际归位,工程规则、runtime 手册和维护操作分别进入清晰目录,当前设计与历史设计分开
|
|
55
|
+
- 文档入口版本与状态对齐 @tea-agent/loop-agent@0.22.0
|
|
56
|
+
- Pi 中等复杂度节点默认模型由 glm-5.2 调整为 gpt-5.5;LOW 与 HIGH 路由保持不变
|
|
57
|
+
|
|
58
|
+
### 修复
|
|
59
|
+
|
|
60
|
+
- DAG run-task 持久化 writer 草稿生成前强制要求 managed Task Contract,未管理时在写出前失败并提示人工处理流程
|
|
61
|
+
- Task source 指南修正 verifyCommands 示例为 { label, command, timeoutMs? }[],并补充旧字符串数组迁移说明
|
|
62
|
+
- 根 Vitest 配置排除 .worktrees/** 隔离 checkout,避免显式测试文件参数误收集旧副本
|
|
63
|
+
- 受监督的 DAG 失败收敛机制修复,确保在有监督失败时保持收敛性
|
|
64
|
+
- DAG bootstrap 合约反馈修复,确保引导阶段正确收敛
|
|
65
|
+
- 修复 check-doc-governance.mjs 未忽略 .DS_Store/Thumbs.db 等 OS 生成文件导致仓库目录测试失败的问题
|
|
66
|
+
- 修复 context-engineering 提案中指向 exec-plans/active/ 的过时链接,更新为实际的 completed/ 路径
|
|
67
|
+
- 校准 context-engineering 提案中的实现证据(测试计数与 AGENTS.md 行数)以匹配当前代码实际产出
|
|
68
|
+
- Console Phase 4 Chat 审查 followup:createSession 缩进规整;handleChatPrompt 加 try/catch+finally 兜底 SSE error 与 res.end;waitForIdle 超时 120s→45s 并新增每 10s heartbeat(SSE comment 帧)防代理超时;设计文档 §7.2.1/V25/§13 同步 widening 契约
|
|
69
|
+
- Console Phase 4 Chat P1 审查修复:`createSessionFromServices` 显式传 `tools:[bash,read,grep,find,ls]`(SDK 默认 builtin 不含 grep/find/ls,否则 setActiveToolsByName 静默 no-op);schema↔dispatcher 契约对齐(contractValidate/Diff 用 draftJson、workerTaskRetry 补 featureId、动态发现 fail-closed);server.close() 先 chatRuntime.disposeAll();resource-loader/system prompt 统一到 widening(hasBash:true)
|
|
70
|
+
- CI 治理:7 个 versionConsumer 文档版本漂移 0.22.0→0.23.0;check-task-pool-root.sh allowlist 增补 codify-constraints.md
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## [0.22.0] - 2026-07-24
|
|
74
|
+
|
|
75
|
+
### 重点更新
|
|
76
|
+
|
|
77
|
+
- 前端规范读取范围扩展,新增 ai_workspace 作为并列来源,并独立展示各类规范证据
|
|
78
|
+
- 前端实现 DAG 引入 lint 债务基线机制,精准区分存量与新增代码问题,减少误阻断
|
|
79
|
+
- 前端预写门禁增强,强制校验真实的规范读取事件,避免遗漏关键上下文
|
|
80
|
+
- 后端测试报告结构优化,新增 Markdown 报告并改进 HTML 报告的分层展示
|
|
81
|
+
|
|
82
|
+
### 新增
|
|
83
|
+
|
|
84
|
+
- 前端规范读取将 ai_workspace 目录与 openspec 相关目录作为并列来源,即使缺少 package.json 也能发现本地规范候选
|
|
85
|
+
- Dashboard 规范证据 API 与界面独立展示知识库查询、openspec 检索和成功读取三类证据
|
|
86
|
+
- 后端测试在同目录下新增生成 backend-test.md 报告,便于查阅测试结论与明细
|
|
87
|
+
|
|
88
|
+
### 改进
|
|
89
|
+
|
|
90
|
+
- 前端实现 DAG 允许未修改文件中的已知 lint 诊断作为基线债务继续,但对修改文件的新问题严格阻断
|
|
91
|
+
- 后端测试 HTML 报告采用更清晰的分层展示,新增稳定结论图标与可折叠的质量校验明细,移除了原稳定性指标
|
|
92
|
+
- 前端测试用例的内容完整性与证据检查降级为建议性反馈,不再因个别物料缺失阻断最终复盘
|
|
93
|
+
- 设计文档与研发 DAG 拓扑说明同步更新,澄清了 profile/workflow/type 三套正交概念与当前实现状态
|
|
94
|
+
|
|
95
|
+
### 修复
|
|
96
|
+
|
|
97
|
+
- 修复前端技能指令可能超出预算限制的问题
|
|
98
|
+
- 修复 DAG 未正确注册 DeepSeek Pi 模型提供者的问题
|
|
99
|
+
- 修复前端目标项目验证路由不够健壮的问题
|
|
100
|
+
- 修复后端测试中无法跨环境便携解析 Python 运行时的问题
|
|
101
|
+
|
|
5
102
|
## [0.21.0] - 2026-07-24
|
|
6
103
|
|
|
7
104
|
### 重点更新
|
|
@@ -18,6 +115,9 @@
|
|
|
18
115
|
|
|
19
116
|
- backend-test 第 7 节点现在只执行最终 Markdown `自动化映射` 明确声明且安全校验通过的 pytest 脚本,避免历史或无关 `test_*.py` 混入本轮 JUnit/HTML;空映射、缺失脚本或越界路径会 fail-closed。
|
|
20
117
|
- backend-test HTML 报告升级为更清晰的用例卡片:保留测试结论、质量状态和失败概览,直接展示简洁测试场景、自动化用例名称、结果与耗时,并为通过/失败用例都展示同次执行中脱敏且有界的接口请求参数与响应结果;HTML 不再附带技术证据章节,审计路径与哈希继续保留在 facts/JUnit。
|
|
118
|
+
- frontend-test 第四节点不再扫描或阻断 pytest、原生 Playwright、`npx playwright`、`@playwright/test` 或 Node Playwright API 等可执行工具指令;该节点只保留 manifest、Case/AC/path、非生产 URL 和标准 `playwright-cli open` 前缀等结构与安全门禁,并强烈建议浏览器执行优先使用 `playwright-cli`。
|
|
119
|
+
- frontend-test 用例内容、Case ID、AC 关联与 evidence 完整性检查改为 advisory:缺失或损坏的执行物料不再被自动改写为 blocked,也不阻断最终复盘;finding 汇入结构化结果,并在 Markdown retrospective 后生成中文 HTML 建议报告。路径越界、跨用例 evidence 引用、writeSet、生产环境与凭据安全仍保持硬门禁。
|
|
120
|
+
- frontend-test checklist JavaScript 通过 Base64 参数交给 Node 解码执行,并修正变量声明顺序与重复语句,避免 Git Bash 将 `\s` / `\d`、反引号或引号破坏后再交给 Node。
|
|
21
121
|
- 新初始化项目的 harness 指南同步 adaptive liveness、4h absolute max、stall 状态与 `termination-unconfirmed` 处置;旧项目可由 `init check-update` 识别未修改的受管指南,并通过 `init update --apply-safe` 安全刷新。
|
|
22
122
|
|
|
23
123
|
## [0.20.1] - 2026-07-24
|
|
@@ -63,6 +163,19 @@
|
|
|
63
163
|
|
|
64
164
|
### 新增
|
|
65
165
|
|
|
166
|
+
- 继续收紧前端实现证据门禁:禁止空 verification contract,校验验证目标与 requirement/UI state/授权路径绑定;新版 review context 缺失 writer baseline 时直接阻断,非 `not-needed` Mock 策略必须提供 endpoint 与 consumer 证据。
|
|
167
|
+
- 前端写入前重新校验 DAG 绑定源文件的 SHA-256;Mock endpoint 现在必须声明 fixture 与 consumer,且验证 trace 必须记录成功的 Mock 命令。
|
|
168
|
+
- 前端验证 bundle 现在冻结实际命令文本,并将实现契约 targets 限制在 writer writeSet 内,避免验证证据与可写范围漂移。
|
|
169
|
+
- 同步前端 prewrite/review context 的 DAG JSON Schema,避免生成 DAG 因 freshness、writeSet 或 baseline 字段漂移而被错误拒绝。
|
|
170
|
+
- 前端 prewrite 现在强制校验需求源新鲜度,验证 Schema 也要求声明实际命令文本,减少旧 DAG 和证据配置的隐式降级。
|
|
171
|
+
- 前端实现 DAG 的验证命令与侦察范围改为从目标项目自身的 package scripts、包管理器和允许路径推导,不再假设目标项目沿用 loop-agent 的目录与命令布局。
|
|
172
|
+
|
|
173
|
+
### 改进
|
|
174
|
+
|
|
175
|
+
- 前端实现 DAG 的验证命令与侦察范围改为从目标项目自身的 package scripts、包管理器和允许路径推导,不再假设目标项目沿用 loop-agent 的目录与命令布局。
|
|
176
|
+
- 后端测试用例默认生成中文 README 索引与模块用例卡片,步骤、预期、需求依据和自动化映射更便于测试、研发与评审人员阅读。
|
|
177
|
+
- 后端测试 HTML 主报告现在逐条展示用例编号、中文名称与场景、脚本、测试函数、结果、耗时和失败原因,完整技术详情可折叠查看。
|
|
178
|
+
|
|
66
179
|
- streamline implementation DAG (#61)
|
|
67
180
|
- improve human-readable artifacts
|
|
68
181
|
|
|
@@ -86,6 +199,7 @@
|
|
|
86
199
|
### 改进
|
|
87
200
|
|
|
88
201
|
- `frontend-implementation` 保留独立 contract/scout,并把 Mock 策略与 implementation contract 合入 plan,把写前授权、验证/失败评估、复验和 review context 分别收敛为组合 shell 节点。standard/high-risk 固定 15 个顶层节点、small-risk 13 个;绿色路径执行 11 个节点、7 次 Pi,同时保留唯一 prewrite 写入授权、同 writeSet repair、真实 diff review 与 fail-closed closeout。
|
|
202
|
+
- 加强前端实现节点的证据链:Trace 只绑定本次实际成功执行的验证命令,契约兼容转换不再补入占位文件或默认验证目标,Prewrite 要求上游节点明确完成,review context 校验 artifact 绑定,并以 writer 前工作区快照隔离既有用户改动。
|
|
89
203
|
- 优化操作与观测统一界面的导航与布局,合并确认与运行为「开始运行」,DAG 详情跳转路径更加准确
|
|
90
204
|
|
|
91
205
|
### 修复
|
package/README.md
CHANGED
|
@@ -127,8 +127,11 @@ agent-worker console doctor --repo .
|
|
|
127
127
|
|
|
128
128
|
- [`AGENTS.md`](AGENTS.md):开工协议与工作规则
|
|
129
129
|
- [`docs/README.md`](docs/README.md):治理文档总索引
|
|
130
|
-
- [`docs/
|
|
131
|
-
- [`docs/
|
|
130
|
+
- [`docs/governance/`](docs/governance/README.md):工程原则、工作流与验证方法
|
|
131
|
+
- [`docs/runtime/`](docs/runtime/README.md):DAG 运行、恢复与 runtime 手册
|
|
132
|
+
- [`docs/operations/`](docs/operations/README.md):本地环境、合并与协作操作
|
|
133
|
+
- [`docs/governance/feature-workflow.md`](docs/governance/feature-workflow.md):会话治理与 runtime workflow
|
|
134
|
+
- [`docs/governance/verification-matrix.md`](docs/governance/verification-matrix.md):验证命令选择
|
|
132
135
|
- [`docs/architecture/`](docs/architecture/README.md):架构、事实与演进边界
|
|
133
136
|
- [`CHANGELOG.md`](CHANGELOG.md):版本变化与 breaking changes
|
|
134
137
|
|
|
@@ -146,7 +149,7 @@ bash scripts/check-repo.sh
|
|
|
146
149
|
|
|
147
150
|
完整门禁和特定环境排障分别见:
|
|
148
151
|
|
|
149
|
-
- [`docs/verification-matrix.md`](docs/verification-matrix.md)
|
|
150
|
-
- [`docs/local-development-environment.md`](docs/local-development-environment.md)
|
|
152
|
+
- [`docs/governance/verification-matrix.md`](docs/governance/verification-matrix.md)
|
|
153
|
+
- [`docs/operations/local-development-environment.md`](docs/operations/local-development-environment.md)
|
|
151
154
|
|
|
152
155
|
发布和初始化 surface 变更还应运行 `npm pack --dry-run` 与 `bash scripts/check-init-surface.sh`。
|
package/bin/agent-worker.js
CHANGED
|
File without changes
|
|
@@ -63,6 +63,11 @@ function getVerifyCommands(repoRoot, options) {
|
|
|
63
63
|
if (manifestCommands) {
|
|
64
64
|
return applyQuota(manifestCommands, options);
|
|
65
65
|
}
|
|
66
|
+
if (options.taskConfig?.taskKind === 'frontend-implementation') {
|
|
67
|
+
const frontendCommands = getFrontendProjectVerifyCommands(repoRoot, options);
|
|
68
|
+
if (frontendCommands)
|
|
69
|
+
return frontendCommands;
|
|
70
|
+
}
|
|
66
71
|
const quickCommands = [
|
|
67
72
|
{
|
|
68
73
|
args: ['bash', 'scripts/check-repo.sh'],
|
|
@@ -91,6 +96,53 @@ function getVerifyCommands(repoRoot, options) {
|
|
|
91
96
|
: [...quickCommands, ...standardCommands, ...fullCommands];
|
|
92
97
|
return applyQuota(selectedCommands, options);
|
|
93
98
|
}
|
|
99
|
+
function getFrontendProjectVerifyCommands(repoRoot, options) {
|
|
100
|
+
let scripts;
|
|
101
|
+
try {
|
|
102
|
+
const packageJson = JSON.parse(readFileSync(path.join(repoRoot, 'package.json'), 'utf8'));
|
|
103
|
+
if (!packageJson.scripts || typeof packageJson.scripts !== 'object')
|
|
104
|
+
return undefined;
|
|
105
|
+
scripts = packageJson.scripts;
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
let packageManager = 'npm';
|
|
111
|
+
for (const [lockfile, manager] of [
|
|
112
|
+
['pnpm-lock.yaml', 'pnpm'],
|
|
113
|
+
['yarn.lock', 'yarn'],
|
|
114
|
+
['bun.lockb', 'bun'],
|
|
115
|
+
['bun.lock', 'bun'],
|
|
116
|
+
]) {
|
|
117
|
+
try {
|
|
118
|
+
readFileSync(path.join(repoRoot, lockfile));
|
|
119
|
+
packageManager = manager;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
// Try the next package-manager marker.
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const hasScript = (name) => typeof scripts[name] === 'string' && String(scripts[name]).trim().length > 0;
|
|
127
|
+
const commandFor = (name) => ({
|
|
128
|
+
args: name === 'test'
|
|
129
|
+
? [packageManager, 'test']
|
|
130
|
+
: [packageManager, 'run', name],
|
|
131
|
+
cwd: repoRoot,
|
|
132
|
+
label: `${packageManager} ${name === 'test' ? 'test' : `run ${name}`}`,
|
|
133
|
+
});
|
|
134
|
+
const collect = (names) => names.filter(hasScript).map(commandFor);
|
|
135
|
+
const staticCommands = collect(['typecheck', 'check-types', 'lint', 'check', 'build']);
|
|
136
|
+
const behaviorCommands = collect(['test:unit', 'test:frontend', 'test:component', 'test', 'test:e2e', 'e2e']);
|
|
137
|
+
if (staticCommands.length === 0 && behaviorCommands.length === 0)
|
|
138
|
+
return undefined;
|
|
139
|
+
const selected = options.phase === 'final'
|
|
140
|
+
? [...staticCommands, ...behaviorCommands]
|
|
141
|
+
: staticCommands;
|
|
142
|
+
if (selected.length === 0)
|
|
143
|
+
return behaviorCommands;
|
|
144
|
+
return applyQuota(selected, options);
|
|
145
|
+
}
|
|
94
146
|
function applyQuota(commands, options) {
|
|
95
147
|
if (options.phase === 'final' || !options.quota || options.quota === 'full') {
|
|
96
148
|
return commands;
|