chore(web): add fail-closed unattended runner
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

This commit is contained in:
mes123456
2026-08-29 07:51:50 +08:00
parent 87d2818f40
commit e4c7fdedf6
17 changed files with 1288 additions and 12 deletions

View File

@@ -34,6 +34,7 @@ and (when authorized) repository push:
10. 任一命令失败、输入缺失、队列不一致、环境不可用或状态不明时,保持 `in_progress`/`blocked`,不得推进指针、伪造完成或重复未知结果的状态改变命令。
11. 每轮结束报告实现切片、当前任务、`nextTask`、最小检查退出码、原始 inventory、effective inventory 是否保持不变、提交/推送状态和剩余真实阻塞。
12. CONTINUOUS_LOOP_REQUIRED:成功交接后立即开始下一轮;不得在成功提交、推送或生成新 manifest 后等待用户确认、只写计划或只汇报状态。每轮必须重新运行 `print-task-context` 和 `check-task-context`,使用新 parent manifest 的 `nextTask`,不沿用上一轮上下文。
13. 可使用仓库内 unattended runner 保持进程级连续执行:`node tools/web/run-wbv2-continuous.mjs --max-iterations 0`。它只执行任务卡声明的入口;`0` 表示不限轮数,`--max-iterations N` 用于受控运行,`--commit --push` 才允许自动提交/推送。任何入口失败、退出 0 但队列未前进、治理失败或 push 失败都立即停止并保留 `tests/golden/<task>/continuous-runner.log`,不得重试未知结果。
```
## Resume Command
@@ -91,6 +92,17 @@ perform a second attempt after an unknown state-changing command. A root task
is itself an executable enabling task: run its declared root generator, then
continue from the generated child task in the same continuous run.
For process-level unattended execution, run:
```bash
node tools/web/run-wbv2-continuous.mjs --max-iterations 0
```
The runner is intentionally fail-closed. It derives the command from the
current task card, requires the queue to advance after a successful exit, and
writes one bounded log per task. It never invents a task, retries an unknown
state-changing result, or turns implementation output into parity completion.
## Activation Contract
The phrase activates implementation only when the queue is internally
@@ -230,12 +242,12 @@ Recorded: 2026-08-29 Asia/Shanghai
| Field | Value |
| --- | --- |
| Current task when this file was written | `WBV2-P38-001` |
| Current task when this file was written | `WBV2-P39-000` |
| Current task state | `in_progress` |
| Parent manifest | `tests/golden/WBV2-P38-000/manifest.json` |
| Current task card | `docs/tasks/WBV2-P38-001.md` |
| Current task-context nextTask | `WBV2-P38-002` |
| Focused command | `node tools/web/generate-wbv2-continuous-slice.mjs --task WBV2-P38-001 --write` |
| Parent manifest | `tests/golden/WBV2-P38-003/manifest.json` |
| Current task card | `docs/tasks/WBV2-P39-000.md` |
| Current task-context nextTask | `NONE` |
| Focused command | `node tools/web/generate-wbv2-continuous-root.mjs` |
The snapshot is informational and may become stale. On every resume, the queue,
parent manifest, and fresh `print-task-context` output win. Never infer a task