@tea-agent/loop-agent 0.35.0 → 0.35.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +108 -108
- package/CHANGELOG.md +30 -0
- package/README.md +165 -165
- package/bin/agent-worker.js +0 -0
- package/bin/loop-agent.js +21 -21
- package/dist/application/task-lifecycle/advance.js +1 -0
- package/dist/commands/cursor-prompt.js +6 -6
- package/dist/commands/init-upgrade.js +351 -19
- package/dist/commands/init.js +14 -67
- package/dist/commands/loop-benchmark.js +11 -11
- package/dist/commands/pi-reuse-benchmark.js +16 -16
- package/dist/commands/run-dag-progress.js +14 -0
- package/dist/commands/task-advance.js +33 -3
- package/dist/shared/operator/capabilities.js +38 -1
- package/dist/sidecars/cursor-prompt/executor.js +1 -1
- package/dist/worker/console/chat/pi-runtime.js +41 -25
- package/dist/worker/console/chat/routes.js +27 -4
- package/dist/worker/console/operation-runner.js +24 -0
- package/dist/worker/console/operation-wait.js +241 -0
- package/dist/worker/console/operator-actions.js +58 -0
- package/dist/worker/console/static/assets/{index-hJqCPs_g.css → index-Dups4sSM.css} +1 -1
- package/dist/worker/console/static/assets/index-SjjjZnV3.js +56 -0
- package/dist/worker/console/static/index.html +2 -2
- package/dist/worker/console/static-src/operator-chat/slash-palette-nav.js +141 -0
- package/dist/worker/console/static-src/operator-chat/useChatSessions.js +13 -2
- package/dist/worker/console/static-src/operator-chat/useComposer.js +30 -7
- package/dist/worker/observe/static/copy.js +67 -67
- package/dist/worker/observe/static/dag-layout.d.ts +36 -36
- package/dist/worker/observe/static/dom.js +220 -220
- package/dist/worker/observe/static/relations.js +133 -133
- package/dist/worker/observe/static/run-processing.js +148 -148
- package/dist/worker/observe/static/views/batch.js +227 -227
- package/dist/worker/observe/static/views/failures.js +143 -143
- package/dist/worker/observe/static/views/feature.js +492 -492
- package/dist/worker/observe/static/views/run.js +453 -453
- package/dist/worker/observe/static/views/shell.js +7 -7
- package/dist/worker/observe/static/views/timeline.js +163 -163
- package/dist/workflows/dag/canvas-observer.js +275 -275
- package/docs/architecture/evolution.md +73 -73
- package/docs/architecture/system-overview.md +100 -100
- package/docs/architecture/worker-and-feature.md +122 -122
- package/docs/skills/README.md +7 -7
- package/docs/templates/adr.md +60 -60
- package/docs/templates/agent-dag-authority-surface-audit.prompt.md +94 -94
- package/docs/templates/agent-dag-decision-envelope.schema.json +213 -213
- package/docs/templates/agent-dag-decision-gate.prompt.md +246 -246
- package/docs/templates/agent-dag-process-supervisor.prompt.md +98 -98
- package/docs/templates/agent-dag-report.schema.json +473 -473
- package/docs/templates/agent-dag-review-verdict.prompt.md +68 -68
- package/docs/templates/backend-test-result.schema.json +99 -99
- package/docs/templates/evaluation/agents-map-slim-v1.md +87 -87
- package/docs/templates/evaluation/agents-map-verbose-v0.md +153 -153
- package/docs/templates/feature-spec.md +53 -53
- package/docs/templates/frontend-design-contract.md +42 -42
- package/docs/templates/frontend-eval/fixtures/failures/01-type-build-error.md +17 -17
- package/docs/templates/frontend-eval/fixtures/failures/02-unit-component-test-fail.md +16 -16
- package/docs/templates/frontend-eval/fixtures/failures/03-fixture-schema-drift.md +16 -16
- package/docs/templates/frontend-eval/fixtures/failures/04-missing-loading-empty-error-state.md +16 -16
- package/docs/templates/frontend-eval/fixtures/failures/05-forbidden-write-writeset-expansion.md +16 -16
- package/docs/templates/frontend-eval/fixtures/failures/06-unapproved-dependency-add.md +16 -16
- package/docs/templates/frontend-eval/fixtures/failures/07-mock-production-on.md +21 -21
- package/docs/templates/frontend-eval/fixtures/functional/01-simple-component-style.md +29 -29
- package/docs/templates/frontend-eval/fixtures/functional/02-form-validation.md +28 -28
- package/docs/templates/frontend-eval/fixtures/functional/03-list-detail-page.md +28 -28
- package/docs/templates/frontend-eval/fixtures/functional/04-api-mock.md +29 -29
- package/docs/templates/frontend-eval/fixtures/functional/05-permission-auth-gated-ui.md +27 -27
- package/docs/templates/frontend-eval/fixtures/functional/06-ssr-server-client-boundary.md +28 -28
- package/docs/templates/frontend-eval/fixtures/functional/07-shared-public-component-api.md +28 -28
- package/docs/templates/frontend-eval/fixtures/functional/08-pure-local-no-remote.md +27 -27
- package/docs/templates/frontend-eval/metrics.md +138 -138
- package/docs/templates/frontend-eval/smoke-targets.md +53 -53
- package/docs/templates/frontend-task-constraints.md +35 -35
- package/docs/templates/frontend-task-requirement.md +70 -70
- package/docs/templates/init-evolution-review.md +35 -35
- package/docs/templates/init-managed-agents.md +156 -154
- package/docs/templates/interactive-ui-round2-experiment.md +66 -66
- package/docs/templates/knowledge-graph-bootstrap-dag.json +118 -118
- package/docs/templates/knowledge-sync-dag.json +178 -178
- package/docs/templates/knowledge-sync-draft.schema.json +71 -71
- package/docs/templates/product-line/closeout.yaml +9 -9
- package/docs/templates/product-line/design.md +13 -13
- package/docs/templates/product-line/links.md +10 -10
- package/docs/templates/product-line/requirement.md +17 -17
- package/docs/templates/product-line/test-plan.md +7 -7
- package/docs/templates/project-start-checklist.md +9 -9
- package/docs/templates/qa-report.md +48 -48
- package/docs/templates/sprint-contract.md +29 -29
- package/docs/templates/worker-dogfood-evidence.md +80 -80
- package/docs/templates/worker-dogfood-setup.md +68 -68
- package/harness.json +5 -2
- package/package.json +1 -1
- package/scripts/kb-bootstrap-init-skeleton.sh +0 -0
- package/scripts/kb-graph-incremental-prepare.mjs +0 -0
- package/scripts/kb-graph-materialize.mjs +105 -105
- package/scripts/kb-graph-promote.mjs +164 -164
- package/scripts/kb-query.mjs +554 -554
- package/skills/agent-worker/SKILL.md +48 -48
- package/skills/agent-worker/references/agent-worker-operator.md +159 -159
- package/skills/ai-engineering-context/SKILL.md +48 -48
- package/skills/analyze-product-dependencies/scripts/test-validators.mjs +0 -0
- package/skills/analyze-product-dependencies/scripts/validate-api-documentation.mjs +0 -0
- package/skills/analyze-product-dependencies/scripts/validate-dependency-analysis.mjs +0 -0
- package/skills/analyze-product-dependencies/scripts/validate-product-requirement-input.mjs +0 -0
- package/skills/analyze-product-requirements/scripts/compute-source-identity.mjs +0 -0
- package/skills/analyze-product-requirements/scripts/test-validators.mjs +0 -0
- package/skills/analyze-product-requirements/scripts/validate-product-analysis.mjs +0 -0
- package/skills/analyze-product-requirements/scripts/validate-product-requirement.mjs +0 -0
- package/skills/analyze-product-requirements/scripts/validate-requirement-clarification.mjs +0 -0
- package/skills/browser-tools/browser-content.js +103 -103
- package/skills/browser-tools/browser-cookies.js +35 -35
- package/skills/browser-tools/browser-eval.js +53 -53
- package/skills/browser-tools/browser-hn-scraper.js +108 -108
- package/skills/browser-tools/browser-nav.js +44 -44
- package/skills/browser-tools/browser-pick.js +162 -162
- package/skills/browser-tools/browser-screenshot.js +34 -34
- package/skills/browser-tools/browser-start.js +86 -86
- package/skills/browser-tools/package-lock.json +2556 -2556
- package/skills/browser-tools/package.json +19 -19
- package/skills/code-review-core/SKILL.md +20 -20
- package/skills/codebase-scout/SKILL.md +19 -19
- package/skills/grill-me/SKILL.md +10 -10
- package/skills/local-jacoco-coverage/scripts/run-coverage-analysis.sh +0 -0
- package/skills/local-jacoco-coverage/scripts/start-jacoco-agent.sh +0 -0
- package/skills/loop-agent/SKILL.md +1 -0
- package/skills/loop-agent/references/command-reference.md +641 -639
- package/skills/loop-agent/references/docs-converge.md +126 -126
- package/skills/loop-agent/references/learned/README.md +21 -21
- package/skills/loop-agent/references/pi-prompt.md +23 -23
- package/skills/loop-agent/references/pi-subagent-assisted-mode.md +84 -84
- package/skills/playwright-cli/references/element-attributes.md +23 -23
- package/skills/playwright-cli/references/playwright-tests.md +39 -39
- package/skills/playwright-cli/references/request-mocking.md +87 -87
- package/skills/playwright-cli/references/running-code.md +241 -241
- package/skills/playwright-cli/references/session-management.md +225 -225
- package/skills/playwright-cli/references/storage-state.md +275 -275
- package/skills/playwright-cli/references/test-generation.md +433 -433
- package/skills/requesting-code-review/SKILL.md +101 -101
- package/skills/requesting-code-review/code-reviewer.md +168 -168
- package/skills/systematic-debugging/CREATION-LOG.md +119 -119
- package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -158
- package/skills/systematic-debugging/condition-based-waiting.md +115 -115
- package/skills/systematic-debugging/defense-in-depth.md +122 -122
- package/skills/systematic-debugging/find-polluter.sh +63 -63
- package/skills/systematic-debugging/root-cause-tracing.md +169 -169
- package/skills/systematic-debugging/test-academic.md +14 -14
- package/skills/systematic-debugging/test-pressure-1.md +58 -58
- package/skills/systematic-debugging/test-pressure-2.md +68 -68
- package/skills/systematic-debugging/test-pressure-3.md +69 -69
- package/skills/using-git-worktrees/SKILL.md +215 -215
- package/skills/verification-before-completion/SKILL.md +154 -154
- package/skills/webapp-testing/SKILL.md +19 -19
- package/dist/worker/console/static/assets/index-fsjzREob.js +0 -56
|
@@ -1,154 +1,156 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Source template for target-project AGENTS.md managed block.
|
|
3
|
-
Rendered by src/commands/init.ts (buildManagedAgentsBlock).
|
|
4
|
-
|
|
5
|
-
Placeholders (must keep exact spelling):
|
|
6
|
-
- __LOOP_AGENT_PROJECT_NAME__
|
|
7
|
-
- __LOOP_AGENT_GOVERNANCE_ROOT__
|
|
8
|
-
|
|
9
|
-
Markers LOOP_AGENT_INIT_START / LOOP_AGENT_INIT_END (HTML comments) are required as the sole body wrapper.
|
|
10
|
-
Phrase invariants: docs/architecture/agents-invariants.md (section 二).
|
|
11
|
-
This file is package-only: shipped in npm, NOT copied into target governance templates/.
|
|
12
|
-
-->
|
|
13
|
-
<!-- LOOP_AGENT_INIT_START -->
|
|
14
|
-
## loop-agent 治理
|
|
15
|
-
|
|
16
|
-
本仓库已初始化为 `__LOOP_AGENT_PROJECT_NAME__` 的 loop-agent harness 项目。
|
|
17
|
-
|
|
18
|
-
### 默认立场
|
|
19
|
-
|
|
20
|
-
- 仓库是记录系统:决策、契约、计划、验证、报告和交接应进入可追踪文件。
|
|
21
|
-
- 一次只推进一个有边界、可验证的工作块;实现前先搜索现有代码、文档、脚本和测试。
|
|
22
|
-
- Shell 验证是完成依据;模型建议不能替代命令证据。
|
|
23
|
-
- 保留无关的用户改动,不要回退自己没有做的修改。
|
|
24
|
-
- 委托模型写入前,必须把写入边界写成结构化 `task.json.allowedPaths` / `task.json.forbiddenPaths`,再审查生成 DAG 的 writer `writeSet`;不要只依赖 `source/执行约束.md` 的自然语言约束。
|
|
25
|
-
- 本仓库对 openCode 等主会话的定位是 **Compatibility / Operator Assist**:主会话编排 CLI 与只读诊断,**不是**默认实现 agent。
|
|
26
|
-
|
|
27
|
-
### 主会话硬约束(Compatibility / Operator Assist)
|
|
28
|
-
|
|
29
|
-
主会话(含 openCode、Cursor Chat、其他宿主 agent)= **operator-only**;skills 与本文件是纪律文档,**不能**替代 `task.json` / DAG `writeSet` / runtime 执法。
|
|
30
|
-
|
|
31
|
-
| 类别 | 规则 |
|
|
32
|
-
| --- | --- |
|
|
33
|
-
| **允许** | 已发布 `loop-agent` / `agent-worker` CLI;只读 status/doctor/report/inspect/observe;准备 `source/*` 与 `task.json` 边界;human gate;shell 验证与 handoff。 |
|
|
34
|
-
| **禁止** | 绕过 CLI 用宿主 Edit/Write/ApplyPatch 直接改业务实现;CLI/DAG 失败后「救火改文件」;用聊天自述代替 shell 验证。 |
|
|
35
|
-
| **失败时** | 先 `dag report` / `dag doctor`;优先 `dag rerun --from-node` 安全子图续跑;仅契约/源真变或 plan 不合格时同 task 重 advance / `dag rerun-task`;paused 用 approve→`dag resume`。 |
|
|
36
|
-
| **实现写入** | 业务代码 **只** 经受治理 DAG writer(`implement-pi` / `repair-pi`)经 `task advance`(批准 writeSet gate
|
|
37
|
-
|
|
38
|
-
**永远不要**:`loop-agent` / `agent-worker` 失败 ⇒ 主会话直接改仓库实现;也勿因 provider 抖动或只读节点失败**新建无关 task-id**。
|
|
39
|
-
|
|
40
|
-
### 自然语言入口路由
|
|
41
|
-
|
|
42
|
-
| 用户表达 | 入口 | 执行动作 |
|
|
43
|
-
| --- | --- | --- |
|
|
44
|
-
| loop-agent 初始化 / loop agent 初始化 / loop agent初始化 / 初始化 loop-agent | 初始化 | 完成确定性初始化闭环 |
|
|
45
|
-
| loop-agent初始化更新 / loop-agent 初始化更新 / 更新 loop-agent 初始化内容 / 升级 loop-agent 初始化 | 初始化升级闭环 | 直接运行 `init upgrade`;自动安全更新、返回单文件语义合并任务并 `--continue` 至稳定终态,禁止停在只读检查或 `needs-model-merge` |
|
|
46
|
-
| 初始化更新校验 / 检查初始化更新 / loop-agent 初始化更新校验 / loop agent初始化更新校验 / 只检查,不要修改 | 更新校验 | 严格只读报告,不创建 upgrade run、不写入 |
|
|
47
|
-
| 初始化对齐 / 升级后对齐 / reconcile 初始化 / loop-agent 初始化对齐 | 初始化升级闭环 | 直接运行 `init upgrade`,而非拼接低层 safe-update 命令 |
|
|
48
|
-
| 初始化安全更新 / 应用初始化更新 / loop-agent 初始化安全更新 / loop agent初始化安全更新 | 初始化升级闭环 | 直接运行 `init upgrade`,由 controller 处理安全更新与验证 |
|
|
49
|
-
| loop-agent 帮我完成 / 帮我实现 / 帮我修复 / 帮我开发 <需求>;使用 loop-agent 完成 <X>;按 loop-agent 流程处理 <X> | 通用需求实现 | 先提供 PRD 与 `allowedPaths` / `forbiddenPaths` / verify,再 `task advance` → 审查 writeSet gate → `task advance --approve-gate`;主会话不得直接修改业务实现 |
|
|
50
|
-
| 从失败节点继续 / 续跑 / 不要重开任务 / 从 plan 或 code-review 接着跑 | DAG 中途恢复 | **不是**新 `task advance`:`dag report` → `dag rerun --from-node … --plan` → 带 `plan-hash` 执行(见失败默认恢复序) |
|
|
51
|
-
|
|
52
|
-
**初始化升级闭环(写入型)**:主会话收到上述写入型表达时自动调用统一入口,并在 controller 返回的具体单文件 `allowedPaths` 内完成必要语义合并后使用 `--continue`。不得停在 `check-update`、`needs-safe-update`、`needs-model-merge` 或 `verification-pending`。默认安装/合并项目 `.opencode/plugins/`、`.pi/extensions/` 与 `.pi/settings.json`;Pi 必须 trust 项目才能加载,默认严禁写 `~/.pi/agent/settings.json`。
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
loop-agent init upgrade --repo-root . --json
|
|
56
|
-
loop-agent init upgrade --repo-root . --run-id <run-id> --continue --json
|
|
57
|
-
loop-agent init upgrade --repo-root . --run-id <run-id> --report --markdown
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
**更新校验(只读)**:只读执行下面命令;**不得自动**执行 `apply-safe`、模型合并或创建 upgrade run。
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
loop-agent init check-update --repo-root . --markdown
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
**低层兼容命令(仅诊断/恢复,不是自然语言写入入口)**:`init reconcile`、`init update --bootstrap-surface` 与 `init update --apply-safe` 保留给 controller 诊断、旧自动化和人工排障。主会话收到任何写入型“初始化更新 / 初始化对齐 / 安全更新”表达时,必须唯一进入 `init upgrade`,不得改为直接调用这些低层命令,也不得在它们返回 `needs-model-merge` 后停止。surface 缺失、human decisions、活跃 DAG/Worker 或 Worker 状态无法确认时仍必须零写入。
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
# 只读诊断
|
|
70
|
-
loop-agent init check-update --repo-root . --markdown
|
|
71
|
-
# 低层兼容恢复;不得替代写入型自然语言的统一 init upgrade 入口
|
|
72
|
-
loop-agent init reconcile --repo-root .
|
|
73
|
-
loop-agent init update --repo-root . --bootstrap-surface
|
|
74
|
-
loop-agent init update --repo-root . --apply-safe
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### 初始化闭环
|
|
78
|
-
|
|
79
|
-
当用户要求初始化 loop-agent(“初始化 loop-agent”“loop agent 初始化”“loop agent初始化”“loop-agent 初始化”),或发现 `README.md` / `__LOOP_AGENT_GOVERNANCE_ROOT__/verification-matrix.md` 仍停留在通用初始化状态时,模型应在同一轮工作中完成初始化闭环,不要把补全文档和验证矩阵留给用户交互。
|
|
80
|
-
|
|
81
|
-
1. 运行 `loop-agent init instructions --repo-root .`。
|
|
82
|
-
2. 运行 `loop-agent init --repo-root . --profile full --merge`。
|
|
83
|
-
3. 基于真实项目文件补全根 `README.md`、`__LOOP_AGENT_GOVERNANCE_ROOT__/verification-matrix.md`,必要时适配 `scripts/ci-tests.sh`。
|
|
84
|
-
4. 运行 `loop-agent init doctor --repo-root .`、`loop-agent inspect`、`loop-agent docs audit` 并完成 quick verification。
|
|
85
|
-
|
|
86
|
-
信息不足时写明尚未识别到的事实;不要留下泛化占位符。
|
|
87
|
-
|
|
88
|
-
### 文档收敛
|
|
89
|
-
|
|
90
|
-
完成实现和验证后,必须检查 `README.md`、`AGENTS.md`、`CHANGELOG.md`(如果目标项目维护)、治理文档、skills references、初始化模板和脚本说明是否仍与实际行为一致。只更新与本次变更相关的内容;如果决定不更新,应在交接里写明理由。
|
|
91
|
-
|
|
92
|
-
### 开始顺序
|
|
93
|
-
|
|
94
|
-
pwd → `README.md` → `harness.json` → `__LOOP_AGENT_GOVERNANCE_ROOT__/README.md` → 实现类再读 principles/feature-workflow/verification-matrix;测试纪律读 harness-methodology-*;`git status`;最小基线验证。
|
|
95
|
-
|
|
96
|
-
### Agent DAG 路径
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
loop-agent task advance <task-id> "任务标题" \
|
|
100
|
-
--prd <path-to-prd.md> \
|
|
101
|
-
--allowed-path "<glob>" \
|
|
102
|
-
--forbidden-path ".harness/**" \
|
|
103
|
-
--verify "<label>:<command>" \
|
|
104
|
-
--json
|
|
105
|
-
# 审查 writeSet gate digest 后:
|
|
106
|
-
loop-agent task advance <task-id> --approve-gate "write-set-review:<digest>" --json
|
|
107
|
-
loop-agent task status <task-id> --json
|
|
108
|
-
# 非微小或跨会话任务(推荐):loop-agent plan create <plan-id> "<title>"
|
|
109
|
-
# 有 plan 时收尾:loop-agent plan complete <plan-id> --summary "..."
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
`
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
- `
|
|
125
|
-
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
1
|
+
<!--
|
|
2
|
+
Source template for target-project AGENTS.md managed block.
|
|
3
|
+
Rendered by src/commands/init.ts (buildManagedAgentsBlock).
|
|
4
|
+
|
|
5
|
+
Placeholders (must keep exact spelling):
|
|
6
|
+
- __LOOP_AGENT_PROJECT_NAME__
|
|
7
|
+
- __LOOP_AGENT_GOVERNANCE_ROOT__
|
|
8
|
+
|
|
9
|
+
Markers LOOP_AGENT_INIT_START / LOOP_AGENT_INIT_END (HTML comments) are required as the sole body wrapper.
|
|
10
|
+
Phrase invariants: docs/architecture/agents-invariants.md (section 二).
|
|
11
|
+
This file is package-only: shipped in npm, NOT copied into target governance templates/.
|
|
12
|
+
-->
|
|
13
|
+
<!-- LOOP_AGENT_INIT_START -->
|
|
14
|
+
## loop-agent 治理
|
|
15
|
+
|
|
16
|
+
本仓库已初始化为 `__LOOP_AGENT_PROJECT_NAME__` 的 loop-agent harness 项目。
|
|
17
|
+
|
|
18
|
+
### 默认立场
|
|
19
|
+
|
|
20
|
+
- 仓库是记录系统:决策、契约、计划、验证、报告和交接应进入可追踪文件。
|
|
21
|
+
- 一次只推进一个有边界、可验证的工作块;实现前先搜索现有代码、文档、脚本和测试。
|
|
22
|
+
- Shell 验证是完成依据;模型建议不能替代命令证据。
|
|
23
|
+
- 保留无关的用户改动,不要回退自己没有做的修改。
|
|
24
|
+
- 委托模型写入前,必须把写入边界写成结构化 `task.json.allowedPaths` / `task.json.forbiddenPaths`,再审查生成 DAG 的 writer `writeSet`;不要只依赖 `source/执行约束.md` 的自然语言约束。
|
|
25
|
+
- 本仓库对 openCode 等主会话的定位是 **Compatibility / Operator Assist**:主会话编排 CLI 与只读诊断,**不是**默认实现 agent。
|
|
26
|
+
|
|
27
|
+
### 主会话硬约束(Compatibility / Operator Assist)
|
|
28
|
+
|
|
29
|
+
主会话(含 openCode、Cursor Chat、其他宿主 agent)= **operator-only**;skills 与本文件是纪律文档,**不能**替代 `task.json` / DAG `writeSet` / runtime 执法。
|
|
30
|
+
|
|
31
|
+
| 类别 | 规则 |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| **允许** | 已发布 `loop-agent` / `agent-worker` CLI;只读 status/doctor/report/inspect/observe;准备 `source/*` 与 `task.json` 边界;human gate;shell 验证与 handoff。 |
|
|
34
|
+
| **禁止** | 绕过 CLI 用宿主 Edit/Write/ApplyPatch 直接改业务实现;CLI/DAG 失败后「救火改文件」;用聊天自述代替 shell 验证。 |
|
|
35
|
+
| **失败时** | 先 `dag report` / `dag doctor`;优先 `dag rerun --from-node` 安全子图续跑;仅契约/源真变或 plan 不合格时同 task 重 advance / `dag rerun-task`;paused 用 approve→`dag resume`。 |
|
|
36
|
+
| **实现写入** | 业务代码 **只** 经受治理 DAG writer(`implement-pi` / `repair-pi`)经 `task advance`(批准 writeSet gate 后长跑)由 Console operation 后台持有;主会话**不得**在前台 Bash 直接执行 `task advance --approve-gate`,不得把长跑命令管道到 `tail`/`head`,不得自行拼接 `nohup` / `Start-Process` / `start`。 |
|
|
37
|
+
|
|
38
|
+
**永远不要**:`loop-agent` / `agent-worker` 失败 ⇒ 主会话直接改仓库实现;也勿因 provider 抖动或只读节点失败**新建无关 task-id**。
|
|
39
|
+
|
|
40
|
+
### 自然语言入口路由
|
|
41
|
+
|
|
42
|
+
| 用户表达 | 入口 | 执行动作 |
|
|
43
|
+
| --- | --- | --- |
|
|
44
|
+
| loop-agent 初始化 / loop agent 初始化 / loop agent初始化 / 初始化 loop-agent | 初始化 | 完成确定性初始化闭环 |
|
|
45
|
+
| loop-agent初始化更新 / loop-agent 初始化更新 / 更新 loop-agent 初始化内容 / 升级 loop-agent 初始化 | 初始化升级闭环 | 直接运行 `init upgrade`;自动安全更新、返回单文件语义合并任务并 `--continue` 至稳定终态,禁止停在只读检查或 `needs-model-merge` |
|
|
46
|
+
| 初始化更新校验 / 检查初始化更新 / loop-agent 初始化更新校验 / loop agent初始化更新校验 / 只检查,不要修改 | 更新校验 | 严格只读报告,不创建 upgrade run、不写入 |
|
|
47
|
+
| 初始化对齐 / 升级后对齐 / reconcile 初始化 / loop-agent 初始化对齐 | 初始化升级闭环 | 直接运行 `init upgrade`,而非拼接低层 safe-update 命令 |
|
|
48
|
+
| 初始化安全更新 / 应用初始化更新 / loop-agent 初始化安全更新 / loop agent初始化安全更新 | 初始化升级闭环 | 直接运行 `init upgrade`,由 controller 处理安全更新与验证 |
|
|
49
|
+
| loop-agent 帮我完成 / 帮我实现 / 帮我修复 / 帮我开发 <需求>;使用 loop-agent 完成 <X>;按 loop-agent 流程处理 <X> | 通用需求实现 | 先提供 PRD 与 `allowedPaths` / `forbiddenPaths` / verify,再 `task advance` → 审查 writeSet gate → `task advance --approve-gate`;主会话不得直接修改业务实现 |
|
|
50
|
+
| 从失败节点继续 / 续跑 / 不要重开任务 / 从 plan 或 code-review 接着跑 | DAG 中途恢复 | **不是**新 `task advance`:`dag report` → `dag rerun --from-node … --plan` → 带 `plan-hash` 执行(见失败默认恢复序) |
|
|
51
|
+
|
|
52
|
+
**初始化升级闭环(写入型)**:主会话收到上述写入型表达时自动调用统一入口,并在 controller 返回的具体单文件 `allowedPaths` 内完成必要语义合并后使用 `--continue`。不得停在 `check-update`、`needs-safe-update`、`needs-model-merge` 或 `verification-pending`。默认安装/合并项目 `.opencode/plugins/`、`.pi/extensions/` 与 `.pi/settings.json`;Pi 必须 trust 项目才能加载,默认严禁写 `~/.pi/agent/settings.json`。
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
loop-agent init upgrade --repo-root . --json
|
|
56
|
+
loop-agent init upgrade --repo-root . --run-id <run-id> --continue --json
|
|
57
|
+
loop-agent init upgrade --repo-root . --run-id <run-id> --report --markdown
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**更新校验(只读)**:只读执行下面命令;**不得自动**执行 `apply-safe`、模型合并或创建 upgrade run。
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
loop-agent init check-update --repo-root . --markdown
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**低层兼容命令(仅诊断/恢复,不是自然语言写入入口)**:`init reconcile`、`init update --bootstrap-surface` 与 `init update --apply-safe` 保留给 controller 诊断、旧自动化和人工排障。主会话收到任何写入型“初始化更新 / 初始化对齐 / 安全更新”表达时,必须唯一进入 `init upgrade`,不得改为直接调用这些低层命令,也不得在它们返回 `needs-model-merge` 后停止。surface 缺失、human decisions、活跃 DAG/Worker 或 Worker 状态无法确认时仍必须零写入。
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# 只读诊断
|
|
70
|
+
loop-agent init check-update --repo-root . --markdown
|
|
71
|
+
# 低层兼容恢复;不得替代写入型自然语言的统一 init upgrade 入口
|
|
72
|
+
loop-agent init reconcile --repo-root .
|
|
73
|
+
loop-agent init update --repo-root . --bootstrap-surface
|
|
74
|
+
loop-agent init update --repo-root . --apply-safe
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 初始化闭环
|
|
78
|
+
|
|
79
|
+
当用户要求初始化 loop-agent(“初始化 loop-agent”“loop agent 初始化”“loop agent初始化”“loop-agent 初始化”),或发现 `README.md` / `__LOOP_AGENT_GOVERNANCE_ROOT__/verification-matrix.md` 仍停留在通用初始化状态时,模型应在同一轮工作中完成初始化闭环,不要把补全文档和验证矩阵留给用户交互。
|
|
80
|
+
|
|
81
|
+
1. 运行 `loop-agent init instructions --repo-root .`。
|
|
82
|
+
2. 运行 `loop-agent init --repo-root . --profile full --merge`。
|
|
83
|
+
3. 基于真实项目文件补全根 `README.md`、`__LOOP_AGENT_GOVERNANCE_ROOT__/verification-matrix.md`,必要时适配 `scripts/ci-tests.sh`。
|
|
84
|
+
4. 运行 `loop-agent init doctor --repo-root .`、`loop-agent inspect`、`loop-agent docs audit` 并完成 quick verification。
|
|
85
|
+
|
|
86
|
+
信息不足时写明尚未识别到的事实;不要留下泛化占位符。
|
|
87
|
+
|
|
88
|
+
### 文档收敛
|
|
89
|
+
|
|
90
|
+
完成实现和验证后,必须检查 `README.md`、`AGENTS.md`、`CHANGELOG.md`(如果目标项目维护)、治理文档、skills references、初始化模板和脚本说明是否仍与实际行为一致。只更新与本次变更相关的内容;如果决定不更新,应在交接里写明理由。
|
|
91
|
+
|
|
92
|
+
### 开始顺序
|
|
93
|
+
|
|
94
|
+
pwd → `README.md` → `harness.json` → `__LOOP_AGENT_GOVERNANCE_ROOT__/README.md` → 实现类再读 principles/feature-workflow/verification-matrix;测试纪律读 harness-methodology-*;`git status`;最小基线验证。
|
|
95
|
+
|
|
96
|
+
### Agent DAG 路径
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
loop-agent task advance <task-id> "任务标题" \
|
|
100
|
+
--prd <path-to-prd.md> \
|
|
101
|
+
--allowed-path "<glob>" \
|
|
102
|
+
--forbidden-path ".harness/**" \
|
|
103
|
+
--verify "<label>:<command>" \
|
|
104
|
+
--json
|
|
105
|
+
# 审查 writeSet gate digest 后:
|
|
106
|
+
loop-agent task advance <task-id> --approve-gate "write-set-review:<digest>" --json
|
|
107
|
+
loop-agent task status <task-id> --json
|
|
108
|
+
# 非微小或跨会话任务(推荐):loop-agent plan create <plan-id> "<title>"
|
|
109
|
+
# 有 plan 时收尾:loop-agent plan complete <plan-id> --summary "..."
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
长跑 DAG 采用 `prepareDagExecution → runDag → operationId` 异步 operation 路径(`--approve-gate` 不在前台 Bash 中同步等待);监督退避 60 → 90 → 120 → 180 秒,状态变化后重置为 60 秒,疑似 stall 用 30–60 秒复查。
|
|
113
|
+
|
|
114
|
+
`--verify` 命令应取项目 `AGENTS.md` / `__LOOP_AGENT_GOVERNANCE_ROOT__/verification-matrix.md` 登记的验证命令(不要假定 `npm run typecheck` 存在);`--verify` 可选,省略时自动从 package.json scripts 或既有 managed `task.json.verifyCommands` 推导建议。
|
|
115
|
+
|
|
116
|
+
`source/需求.md` 与 `source/执行约束.md` 仍必需(M8/M9),但默认由 `task advance --prd` 投影生成,而不是主会话手写。`plan create` 不是 `task advance` 的硬依赖。写入前同步 `task.json.allowedPaths` / `task.json.forbiddenPaths` 并审查 writer `writeSet`。高级任意 DagSpec 才用 `dag validate|execute|report`,不进入标准 happy path。
|
|
117
|
+
|
|
118
|
+
凡是影响项目公共契约、执行入口、交付流水线、自动化/治理、数据模型、安全或权限模型、跨模块行为、用户可见工作流的改动,都必须在编辑实现文件前先通过 `task advance` 建立 managed contract / writeSet gate,并审查 gate digest。
|
|
119
|
+
|
|
120
|
+
### 任务类型路由(taskKind)
|
|
121
|
+
|
|
122
|
+
- 用户明确提出后端测试、接口/API 测试、pytest,或语境明确为后端的自动化测试时,必须把 `.harness/tasks/<task-id>/task.json` 的 `taskKind` 设置为 `"backend-test"`,不得保留默认 `standard`。
|
|
123
|
+
- `backend-test` 是 `taskKind`,不是 `--profile` 的可选值;运行 `task advance` 时继续使用 `--profile auto`。
|
|
124
|
+
- 仅出现“自动化测试”且无法判断前后端时,先阅读任务源与目标项目技术栈再决定,禁止无条件路由到 `backend-test`。
|
|
125
|
+
- 用户提示词明确是前端实现需求(例如前端页面、UI、组件或交互开发)时,必须把 `.harness/tasks/<task-id>/task.json` 的 `taskKind` 设置为 `"frontend-implementation"`,不得保留默认 `standard`。
|
|
126
|
+
- `frontend-implementation` 是 `taskKind`,不是 `--profile` 的可选值;运行 `task advance` 时继续使用 `--profile auto`,也可按需显式选择 `minimal` / `standard` / `reviewed` / `supervised`,不要把业务模板名当作 profile。
|
|
127
|
+
- 前端自动化测试(浏览器/UI 自动化、Playwright、E2E)继续使用 `taskKind: "frontend-test"`,不得设置为 `frontend-implementation`。
|
|
128
|
+
|
|
129
|
+
### 运行看板(只读)
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
agent-worker console # 默认 repo=当前目录,port=8790;本地图形环境 listen 后默认打开浏览器
|
|
133
|
+
agent-worker console --no-open # 只启动服务,不打开浏览器
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
浏览器打开 `http://127.0.0.1:8790/`;检视面为 `http://127.0.0.1:8790/inspect/`。默认绑定本机 `127.0.0.1`;不要直接暴露到公开网络。端口被占用时不会自动更换,请用 `--port <port>` 显式指定。`agent-worker observe serve` 已下线(REMOVED / exit 2)。
|
|
137
|
+
|
|
138
|
+
### DAG 诊断与收口
|
|
139
|
+
|
|
140
|
+
live run 先用 `loop-agent dag status --run-id <run-id>` 看 lifecycle 与 liveness;用 `loop-agent dag report --run-id <run-id> --markdown` 读 facts;失败/paused 用 `loop-agent dag doctor --run-id <run-id> --markdown`。生命周期对齐先只读运行 `loop-agent dag reconcile-run --run-id <run-id>`;只有 runner 已停止且 operator 明确提供 `--action supersede|abandon --reason "..."` 时才允许变更。失败 run 用 `loop-agent dag closeout-draft --run-id <run-id>` 生成 failure handoff,不要写成成功 closeout。
|
|
141
|
+
|
|
142
|
+
**失败默认恢复序**:`dag report`/`dag doctor` → 优先 `dag rerun --from-node <node> --plan` 再带 `--plan-hash`(provider 抖动、plan/review/verify 安全下游;writer/decision/fingerprint 不合格勿硬跑)→ paused:approve→`dag resume` → 契约/源真变或 R1 不合格:同 task `task advance` / `dag rerun-task`(禁无理由新建 task-id)→ Worker-owned:`agent-worker task retry`。
|
|
143
|
+
|
|
144
|
+
Operator 须监控 live run 至终态(FINISHED / FAILED / partial_failed)或 Decision Gate 需要 approve;监督退避 60 → 90 → 120 → 180 秒(状态变化后重置 60 秒,疑似 stall 用 30–60 秒复查),长跑 DAG 由 Console operation 后台持有(`prepareDagExecution → runDag → operationId`),禁止前台 Bash 直接 `task advance --approve-gate`、禁止管道 `tail`/`head`、禁止自行拼接 `nohup` / `Start-Process` / `start`;可在节点/rank 变化、verify/closeout、stall 或需 approve 时简短汇报(告知非请求确认)。判活须组合 runner heartbeat、session events 与 `dag doctor` liveness/provider meaningful progress(heartbeat alone ≠ progress)。bounded writer 运行期间不得并发修改工作区(write guard / write-guard 会把越界 diff 错误归因到 writer);只读 status/doctor/report 与 approve/reject/resume 仍允许。恢复:report/doctor → **优先** `dag rerun --from-node` → 必要时 rerun-task/同 task advance → shell verify。**禁止**把主会话直接 Edit 业务代码当作恢复手段。
|
|
145
|
+
|
|
146
|
+
### 运行态与验证
|
|
147
|
+
|
|
148
|
+
- `.harness/tasks/`、`.harness/dag-runs/`、`.harness/runs/` 保存运行事实;已完成事实只读。
|
|
149
|
+
- `.agents/skills/` 为本地 skills;缺失时可回退 npm 包内置。
|
|
150
|
+
- 验证命令选择:`__LOOP_AGENT_GOVERNANCE_ROOT__/verification-matrix.md`。常用:`bash scripts/check-repo.sh`、`bash scripts/ci.sh`、`loop-agent inspect`、`loop-agent doctor`、`loop-agent docs audit`。
|
|
151
|
+
- `scripts/ci-tests.sh` 必须反映目标项目真实工具链。Windows 脚本用 Git Bash;仓库引用用 `/`。
|
|
152
|
+
|
|
153
|
+
### 交接
|
|
154
|
+
|
|
155
|
+
交接写清变更、原因、验证证据、影响面、风险与下一步;长期结论进入 `__LOOP_AGENT_GOVERNANCE_ROOT__/progress`、reports、exec-plans、decisions。
|
|
156
|
+
<!-- LOOP_AGENT_INIT_END -->
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
# Interactive UI Round-2 A/B/C Experiment
|
|
2
|
-
|
|
3
|
-
## Frozen inputs
|
|
4
|
-
|
|
5
|
-
- Target repo / commit:
|
|
6
|
-
- Controller version:
|
|
7
|
-
- TaskSpec / acceptance hash:
|
|
8
|
-
- Base DAG:
|
|
9
|
-
- Model matrix:
|
|
10
|
-
|
|
11
|
-
Prepare the fixture and three DAGs after installing a published controller that contains `interactive-ui` support:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
bash scripts-local/setup-drill-round2-react.sh /tmp/drill-round2-react-target
|
|
15
|
-
npm run build
|
|
16
|
-
node scripts-local/prepare-round2-ui-experiment.mjs \
|
|
17
|
-
/tmp/drill-round2-react-target \
|
|
18
|
-
features/F-2026-001/tasks/FE-001.yaml \
|
|
19
|
-
/tmp/round2-ui-experiment \
|
|
20
|
-
loop-agent
|
|
21
|
-
node scripts-local/build-round2-ui-variants.mjs \
|
|
22
|
-
/tmp/round2-ui-experiment/round2-ui-base.json \
|
|
23
|
-
/tmp/round2-ui-experiment/variants
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Validate every generated variant with the same frozen controller before running it. Use a unique run ID for A, B, and C; do not rewrite `executorModels`.
|
|
27
|
-
|
|
28
|
-
## Variants
|
|
29
|
-
|
|
30
|
-
| Variant | Writer prompt | Writer tier | Run ID | Result |
|
|
31
|
-
| --- | --- | --- | --- | --- |
|
|
32
|
-
| A | interactive-ui contract | MED | | |
|
|
33
|
-
| B | default contract | HIGH | | |
|
|
34
|
-
| C | interactive-ui contract | HIGH | | |
|
|
35
|
-
|
|
36
|
-
## Metrics
|
|
37
|
-
|
|
38
|
-
| Metric | A | B | C |
|
|
39
|
-
| --- | --- | --- | --- |
|
|
40
|
-
| First-pass review gate pass | | | |
|
|
41
|
-
| Framework-native `.tsx` component | | | |
|
|
42
|
-
| Route/parent integration | | | |
|
|
43
|
-
| DOM interaction tests | | | |
|
|
44
|
-
| Helper-only escape | | | |
|
|
45
|
-
| Duration | | | |
|
|
46
|
-
| Tokens | | | |
|
|
47
|
-
|
|
48
|
-
## Required evidence per run
|
|
49
|
-
|
|
50
|
-
- DAG JSON and run ID
|
|
51
|
-
- implement/repair writer model and prompt profile
|
|
52
|
-
- changed component path
|
|
53
|
-
- integration path
|
|
54
|
-
- interaction test path
|
|
55
|
-
- DOM assertions mapped to AC-FE-001
|
|
56
|
-
- review verdict and deterministic test output
|
|
57
|
-
- diff boundary audit
|
|
58
|
-
|
|
59
|
-
## Decision
|
|
60
|
-
|
|
61
|
-
- Production default:
|
|
62
|
-
- Evidence:
|
|
63
|
-
- Cost/quality trade-off:
|
|
64
|
-
- Follow-up:
|
|
65
|
-
|
|
66
|
-
Do not conclude from a single run when provider or environment failures occurred. Re-run the affected variant with the same frozen inputs and a new run ID.
|
|
1
|
+
# Interactive UI Round-2 A/B/C Experiment
|
|
2
|
+
|
|
3
|
+
## Frozen inputs
|
|
4
|
+
|
|
5
|
+
- Target repo / commit:
|
|
6
|
+
- Controller version:
|
|
7
|
+
- TaskSpec / acceptance hash:
|
|
8
|
+
- Base DAG:
|
|
9
|
+
- Model matrix:
|
|
10
|
+
|
|
11
|
+
Prepare the fixture and three DAGs after installing a published controller that contains `interactive-ui` support:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
bash scripts-local/setup-drill-round2-react.sh /tmp/drill-round2-react-target
|
|
15
|
+
npm run build
|
|
16
|
+
node scripts-local/prepare-round2-ui-experiment.mjs \
|
|
17
|
+
/tmp/drill-round2-react-target \
|
|
18
|
+
features/F-2026-001/tasks/FE-001.yaml \
|
|
19
|
+
/tmp/round2-ui-experiment \
|
|
20
|
+
loop-agent
|
|
21
|
+
node scripts-local/build-round2-ui-variants.mjs \
|
|
22
|
+
/tmp/round2-ui-experiment/round2-ui-base.json \
|
|
23
|
+
/tmp/round2-ui-experiment/variants
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Validate every generated variant with the same frozen controller before running it. Use a unique run ID for A, B, and C; do not rewrite `executorModels`.
|
|
27
|
+
|
|
28
|
+
## Variants
|
|
29
|
+
|
|
30
|
+
| Variant | Writer prompt | Writer tier | Run ID | Result |
|
|
31
|
+
| --- | --- | --- | --- | --- |
|
|
32
|
+
| A | interactive-ui contract | MED | | |
|
|
33
|
+
| B | default contract | HIGH | | |
|
|
34
|
+
| C | interactive-ui contract | HIGH | | |
|
|
35
|
+
|
|
36
|
+
## Metrics
|
|
37
|
+
|
|
38
|
+
| Metric | A | B | C |
|
|
39
|
+
| --- | --- | --- | --- |
|
|
40
|
+
| First-pass review gate pass | | | |
|
|
41
|
+
| Framework-native `.tsx` component | | | |
|
|
42
|
+
| Route/parent integration | | | |
|
|
43
|
+
| DOM interaction tests | | | |
|
|
44
|
+
| Helper-only escape | | | |
|
|
45
|
+
| Duration | | | |
|
|
46
|
+
| Tokens | | | |
|
|
47
|
+
|
|
48
|
+
## Required evidence per run
|
|
49
|
+
|
|
50
|
+
- DAG JSON and run ID
|
|
51
|
+
- implement/repair writer model and prompt profile
|
|
52
|
+
- changed component path
|
|
53
|
+
- integration path
|
|
54
|
+
- interaction test path
|
|
55
|
+
- DOM assertions mapped to AC-FE-001
|
|
56
|
+
- review verdict and deterministic test output
|
|
57
|
+
- diff boundary audit
|
|
58
|
+
|
|
59
|
+
## Decision
|
|
60
|
+
|
|
61
|
+
- Production default:
|
|
62
|
+
- Evidence:
|
|
63
|
+
- Cost/quality trade-off:
|
|
64
|
+
- Follow-up:
|
|
65
|
+
|
|
66
|
+
Do not conclude from a single run when provider or environment failures occurred. Re-run the affected variant with the same frozen inputs and a new run ID.
|