@seanyao/roll 4.706.1 → 4.708.2

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +6 -4
  3. package/dist/roll.mjs +4390 -2898
  4. package/docs/architecture.md +6 -1
  5. package/guide/en/acceptance-evidence.md +11 -6
  6. package/guide/en/loop.md +16 -4
  7. package/guide/zh/acceptance-evidence.md +7 -5
  8. package/guide/zh/loop.md +12 -3
  9. package/package.json +1 -1
  10. package/lib/__pycache__/changelog_audit.cpython-314.pyc +0 -0
  11. package/lib/__pycache__/changelog_generate.cpython-314.pyc +0 -0
  12. package/lib/__pycache__/github_sync.cpython-314.pyc +0 -0
  13. package/lib/__pycache__/loop-fmt.cpython-314.pyc +0 -0
  14. package/lib/__pycache__/loop_result_eval.cpython-314.pyc +0 -0
  15. package/lib/__pycache__/loop_unstick.cpython-314.pyc +0 -0
  16. package/lib/__pycache__/model_prices.cpython-314.pyc +0 -0
  17. package/lib/__pycache__/prices_fetcher.cpython-314.pyc +0 -0
  18. package/lib/__pycache__/roll-home.cpython-314.pyc +0 -0
  19. package/lib/__pycache__/roll-loop-status.cpython-314.pyc +0 -0
  20. package/lib/__pycache__/roll_git.cpython-314.pyc +0 -0
  21. package/lib/__pycache__/roll_render.cpython-314.pyc +0 -0
  22. package/lib/__pycache__/slides-render.cpython-314.pyc +0 -0
  23. package/lib/agent_usage/__pycache__/__init__.cpython-314.pyc +0 -0
  24. package/lib/agent_usage/__pycache__/gemini.cpython-314.pyc +0 -0
  25. package/lib/agent_usage/__pycache__/kimi.cpython-314.pyc +0 -0
  26. package/lib/agent_usage/__pycache__/openai.cpython-314.pyc +0 -0
  27. package/lib/agent_usage/__pycache__/pi.cpython-314.pyc +0 -0
  28. package/lib/agent_usage/__pycache__/pi_emit.cpython-314.pyc +0 -0
  29. package/lib/agent_usage/__pycache__/qwen.cpython-314.pyc +0 -0
@@ -131,6 +131,11 @@ no-TCR/gave-up、成功交付、成本档位和角色能力标签排序。运行
131
131
  [--json]` 暴露 route trace:候选池、ranked score/reasons、warnings、skipped 候选及原因、策略、
132
132
  近期使用输入、最终 agent 和 source 配置路径。
133
133
 
134
+ **Rig lifecycle**:quota、auth、network 和 agent stall 是运行级状态,不回写
135
+ `agents.yaml`。loop 把不可用 rig 写入 runtime lifecycle 文件并发出 `rig:suspended` /
136
+ `rig:recovered` 事件;挂起 rig 按恢复窗口轻量探活,恢复后自动回到候选池。若当前池全挂起,
137
+ cycle 写 `loop:pending`,只做恢复探测,不启动 Builder、不把卡记失败、不触发全局熔断。
138
+
134
139
  **反规则**:不因历史表现自动改写角色绑定。不做失败后的静默跨 agent 重试。指标可以*建议*
135
140
  策略变更,但绝不绕过 human-on-the-loop。
136
141
 
@@ -261,7 +266,7 @@ no-TCR/gave-up、成功交付、成本档位和角色能力标签排序。运行
261
266
  Roll 的运行模式只有两个:`guided` 和 `autonomous`。它们不是两套 agent 配置,而是同一套 backlog、truth、route profile、execution profile、attest evidence、Evaluator 和 release gates 之上的两种触发方式。
262
267
 
263
268
  - `guided`:owner 通过 `roll supervisor status/next/why` 理解状态和下一步,再显式运行 `roll loop go --cards <id>` 等命令。guided 模式不会静默启动长时间 Story 执行。
264
- - `autonomous`:`roll loop on` 安装 scheduler;scheduler 可以在 pause、budget、route、evidence、Evaluator 和 release gates 内领取合格 Todo。`roll loop pause` / `roll loop off` 回到 guided;`roll loop resume` / `roll loop on` 显式切回 autonomous。
269
+ - `autonomous`:`roll loop on` 安装 scheduler;scheduler 可以在 pause、budget、route、evidence、Evaluator 和 release gates 内领取合格 Todo。`roll loop pause` / `roll loop off` 回到 guided;`roll loop off --all` 是本机所有 `com.roll.*` LaunchAgent 的急停;`roll loop resume` / `roll loop on` 显式切回 autonomous。
265
270
  - 持久化来源只使用已有 loop/supervisor 状态:launchd plist、PAUSE/DORMANT marker、events/runs/backlog。不得新增独立 `mode.yaml` 之类的第二真相。
266
271
 
267
272
  ### BC9 · Supervisor 与执行剖面(v4)
@@ -40,8 +40,8 @@ the archive rebuild; they are a convenience/archive view, not the delivery-truth
40
40
  into `ROLL_EVIDENCE_DIR`; visual lanes write screenshots into
41
41
  `ROLL_SCREENSHOTS_DIR` when the surface requires inspection. The agent keeps
42
42
  `ac-map.json` in the story card root, mapping each AC to the evidence files
43
- that support it, with a status per AC: `pass` · `readonly` · `partial` ·
44
- `claimed` · `missing`.
43
+ that support it, with a status per AC: `pass` · `pass-with-evidence` ·
44
+ `readonly` · `partial` · `claimed` · `missing`.
45
45
  3. Close with the hard attest gate. The runner calls
46
46
  `roll attest <story-id> --run-dir "$ROLL_RUN_DIR"` at the end of delivery.
47
47
  `roll attest` sweeps the hard facts (TCR commits, latest CI run, optional
@@ -75,7 +75,10 @@ when any of these facts are true:
75
75
  card archive, except allowed GitHub PR/commit/check URLs for this repository;
76
76
  - an AC remains `claimed`, which means the Builder asserted completion without
77
77
  pass/fail evidence;
78
- - a positive AC has no real evidence reference;
78
+ - an AC remains `needs-confirmation`, which means the harness draft still needs
79
+ Builder review;
80
+ - a positive AC (`pass`, `pass-with-evidence`, `readonly`, or `partial`) has no
81
+ real evidence reference;
79
82
  - a non-exempt visual card has no captured screenshot or recorded machine
80
83
  capture skip;
81
84
  - a declared `deliverable_url`, `deliverable_cmd`, or `physical_terminal`
@@ -99,9 +102,11 @@ any issue exits 1 and lists the story IDs and missing references.
99
102
 
100
103
  ## The red line
101
104
 
102
- An AC with **zero evidence** can never claim `pass`: the renderer forces it
103
- down to 🟧 Claimed and lists it under **Discrepancies**. Verbal completion
104
- ("I confirmed it works") is exactly what this rules out.
105
+ An AC with **zero evidence** can never claim `pass` or `pass-with-evidence`: the
106
+ renderer forces it down to 🟧 Claimed and lists it under **Discrepancies**.
107
+ `pass-with-evidence` is a harness-confirmed status backed by strong on-disk
108
+ evidence; it is explicitly not the same as an agent-confirmed `pass`. Verbal
109
+ completion ("I confirmed it works") is exactly what this rules out.
105
110
 
106
111
  ## Declaring visual evidence at design time
107
112
 
package/guide/en/loop.md CHANGED
@@ -206,6 +206,7 @@ roll loop on # Install launchd scheduler (loop + pr + dream)
206
206
  roll loop off # Remove launchd scheduler
207
207
 
208
208
  roll loop now # Run one cycle immediately (same as launchd fires)
209
+ roll loop now --cards US-1,FIX-2 # Run one immediate cycle scoped to selected cards
209
210
  roll loop test # Quick smoke test: verify tmux/popup/stream chain works
210
211
 
211
212
  roll loop status # Show scheduler state and current loop state
@@ -275,6 +276,8 @@ gates still decide eligibility.
275
276
  `roll loop go` is a manual goal session, not a launchd scheduler tick. While it
276
277
  runs, Roll holds `.roll/loop/go.lock`; scheduled ticks yield when they see that
277
278
  lock, record `goal:tick_skipped`, and do not start another `roll loop run-once`.
279
+ `roll loop now --cards <ids>` uses the same card allow-list for its one-shot
280
+ runner, so a manual tick cannot silently pick a different backlog card.
278
281
 
279
282
  Goal mode can run when the scheduler is off because it starts its own session
280
283
  and does not depend on launchd. For paused projects, run `roll loop resume`
@@ -298,6 +301,12 @@ dirty, the goal pauses with `bootstrap_artifacts_unconfirmed` and prints the
298
301
  files to confirm. Commit or clean them, then run `roll loop go` again. This
299
302
  preflight does not start a cycle and does not count as no-progress.
300
303
 
304
+ For the Roll repository itself, `roll loop go`, `roll loop resume`, and
305
+ `roll loop now` print the runner binary and version before starting autonomous
306
+ work. They fail loud with `runner_stale_for_repo` if the repo-local
307
+ `@seanyao/roll` package version is newer than the running runner; install or
308
+ publish the local build before resuming autonomous work.
309
+
301
310
  `roll loop go` enforces safety only at cycle boundaries. `--budget <usd>` uses
302
311
  the effective run cost ledger and moves the goal to `budget_limited` when the
303
312
  budget is reached. An idle or aborted cycle that ran no agent counts as a known
@@ -390,10 +399,13 @@ defaults:
390
399
  candidate pool, runtime health notes, and any legacy compatibility inputs. Use
391
400
  `roll agent migrate --dry-run` to preview conversion from old agent files.
392
401
 
393
- Runtime health is not static policy. Auth, network, VPN, account, or missing
394
- binary failures skip a candidate for the current resolution and are recorded as
395
- runtime facts. If no candidate remains, loop pauses and writes an ALERT instead
396
- of silently rewriting the pool.
402
+ Runtime health is not static policy. Quota, auth, network, VPN, account, stall,
403
+ or missing binary failures suspend only the runtime rig and are recorded as
404
+ runtime facts; Roll does not rewrite `agents.yaml`. Suspended rigs are probed on
405
+ the recovery interval and return to the pool automatically when reachable. If no
406
+ candidate remains, the cycle records `loop:pending` and only runs recovery probes
407
+ instead of starting a Builder, charging the card's failure budget, or silently
408
+ rewriting the pool.
397
409
 
398
410
  For open casting, `health-aware` ranks the same visible pool across Builder,
399
411
  Designer, Evaluator, and Peer Reviewer roles. `roll supervisor route --role
@@ -35,7 +35,7 @@ HTML。那些归档页想看时用 归档重建 按需渲染,它们是便捷/
35
35
  2. 过程采集。`roll test` 把命令输出和摘要写入 `ROLL_EVIDENCE_DIR`;需要视觉
36
36
  验收的端面把截图写入 `ROLL_SCREENSHOTS_DIR`。agent 在故事卡根目录维护
37
37
  `ac-map.json`,把每条 AC 映射到支撑证据,并标注状态:`pass` ·
38
- `readonly` · `partial` · `claimed` · `missing`。
38
+ `pass-with-evidence` · `readonly` · `partial` · `claimed` · `missing`。
39
39
  3. 收尾硬闸。交付结束时 runner 调用
40
40
  `roll attest <story-id> --run-dir "$ROLL_RUN_DIR"`。`roll attest` 清扫硬事实
41
41
  (TCR commits、最新 CI、可选部署探针、test-pass 凭证),渲染验收 Review Page,把
@@ -65,7 +65,8 @@ soft 模式会记录缺口并发出同一类审计信号,但不阻塞本轮交
65
65
  - `ac-map.json` 引用的路径无法在本次 story run 或卡片归档下解析,除非是本仓允许的
66
66
  GitHub PR/commit/check URL;
67
67
  - AC 仍是 `claimed`,表示 Builder 只有完成声明,没有 pass/fail 证据;
68
- - positive AC 没有真实证据引用;
68
+ - AC 仍是 `needs-confirmation`,表示 harness 草稿还没被 Builder 处理;
69
+ - positive AC(`pass`、`pass-with-evidence`、`readonly` 或 `partial`)没有真实证据引用;
69
70
  - 无豁免的可视卡没有截图,也没有记录化的机器采集 skip;
70
71
  - 声明了 `deliverable_url`、`deliverable_cmd` 或 `physical_terminal`,但对应
71
72
  surface 没有真实采集;
@@ -86,9 +87,10 @@ roll attest audit --json
86
87
 
87
88
  ## 红线
88
89
 
89
- **零证据**的 AC 永远不能是 `pass`:渲染层强制降级为 🟧 仅声明,并列入
90
- **Discrepancies(证据缺口)**附录。"我确认它能跑"这类口头完成,正是被这条
91
- 红线挡住的东西。
90
+ **零证据**的 AC 永远不能是 `pass` `pass-with-evidence`:渲染层强制降级为
91
+ 🟧 仅声明,并列入 **Discrepancies(证据缺口)**附录。`pass-with-evidence`
92
+ 表示 harness 基于硬盘上强证据做出的确认,明确不同于 agent 亲自确认的 `pass`。
93
+ "我确认它能跑"这类口头完成,正是被这条红线挡住的东西。
92
94
 
93
95
  ## 设计期声明可视证据
94
96
 
package/guide/zh/loop.md CHANGED
@@ -176,6 +176,7 @@ roll loop on # 安装 launchd 调度器(loop + pr + dream 三个服
176
176
  roll loop off # 卸载 launchd 调度器
177
177
 
178
178
  roll loop now # 立即执行一次循环(与 launchd 触发的流程完全一致)
179
+ roll loop now --cards US-1,FIX-2 # 立即执行一次循环,但只允许指定卡片
179
180
  roll loop test # 快速冒烟测试:验证 tmux/弹窗/流式输出链路是否正常
180
181
 
181
182
  roll loop status # 显示调度器状态和当前 loop 状态
@@ -244,6 +245,8 @@ Hold、Cut、未满足依赖、skip-list、open PR、已合并交付和 pending-
244
245
  `roll loop go` 是手动 goal session,不是 launchd 定时 tick。运行期间 Roll 会持有
245
246
  `.roll/loop/go.lock`;定时 tick 看到该锁就让路,记录 `goal:tick_skipped`,不会再启动
246
247
  另一个 `roll loop run-once`。
248
+ `roll loop now --cards <ids>` 对它触发的单次 runner 使用同一份卡片 allow-list,
249
+ 所以手动 tick 不能静默改选其他 backlog 卡。
247
250
 
248
251
  goal mode 在 scheduler off 时也能运行,因为它自己启动会话,不依赖 launchd。loop 处于
249
252
  paused 状态时不建议直接启动:`PAUSE-<slug>` 标记仍会在 cycle 边界生效,所以应先执行
@@ -271,6 +274,11 @@ Roll-owned 文件提交并推送;如果历史版本或手工路径仍然只留
271
274
  `bootstrap_artifacts_unconfirmed` 暂停,并打印待确认文件。提交或清理后,再重新运行
272
275
  `roll loop go`。这个 preflight 不会启动 cycle,也不会累加 no-progress。
273
276
 
277
+ 在 Roll 仓自身里,`roll loop go`、`roll loop resume` 和 `roll loop now`
278
+ 开工前都会打印当前 runner 的 binary 与版本。repo-local `@seanyao/roll`
279
+ 包版本高于正在运行的 runner 时,它们会以 `runner_stale_for_repo`
280
+ fail-loud;先安装或发布本地构建,再恢复自治施工。
281
+
274
282
  每次安全闸触发都会记录 `goal:gate_tripped`,`roll loop goal` 会显示最近一次安全闸读数。
275
283
 
276
284
  ### `roll loop goal` 字段含义
@@ -343,9 +351,10 @@ defaults:
343
351
  以及 legacy compatibility 输入。用 `roll agent migrate --dry-run` 预览旧 agent
344
352
  文件迁移。
345
353
 
346
- 运行时健康不是静态策略。auth、网络、VPN、账号或 binary 缺失只会让候选在本次
347
- resolution 中被跳过,并记录为运行时事实。若没有候选可用,loop PAUSE + ALERT,
348
- 而不是悄悄改写静态 pool。
354
+ 运行时健康不是静态策略。quota、auth、网络、VPN、账号、stall binary 缺失只会
355
+ 挂起运行态 rig,并记录为运行时事实;Roll 不回写 `agents.yaml`。挂起 rig 按恢复窗口
356
+ 轻量探活,恢复后自动回到候选池。若没有候选可用,cycle 记录 `loop:pending`,只做
357
+ 恢复探测,不启动 Builder、不记入卡的失败账,也不悄悄改写静态 pool。
349
358
 
350
359
  ### Agent 工具链健康检查(US-V4-022)
351
360
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seanyao/roll",
3
- "version": "4.706.1",
3
+ "version": "4.708.2",
4
4
  "description": "Roll — Roll out features with AI agents",
5
5
  "packageManager": "pnpm@11.1.3",
6
6
  "scripts": {