@seanyao/roll 4.703.2 → 4.706.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.
@@ -73,6 +73,26 @@ diff <(v2.0-bash <cmd>) <(v3-ts <cmd>)
73
73
  - **回收**:`roll loop gc` 按阈值清理陈旧 run(保最近 N 次 + M 天内,二者满足其一即留;只删「又旧又超额」的尾部)。阈值 `--keep-latest`(默认 10)/`--keep-days`(默认 30),`--dry-run` 预演。
74
74
  - **读取兼容**:迁移窗口内旧布局 `.roll/verification/<ID>/` 仍可读(attest gate、ac-map、报告解析都先查卡夹再回落旧树);存量迁移与兼容代码移除由 US-META-002 收尾。
75
75
 
76
+ ## 证据可见性模型(US-PHYSICAL-008)
77
+
78
+ 截图/图片类证据涉及隐私,因此在 `git add` 之前必须确认目标仓库的远程可见性:
79
+
80
+ | 布局 | 目标仓库 | 判定策略 | 图片证据 |
81
+ |------|----------|----------|----------|
82
+ | 独立 roll-meta | `.roll` 自身所在的私有仓 | `gh api repos/<slug>` 或 `git ls-remote`;判定为 private 则放行 | 私有仓放行 |
83
+ | 公开产品仓 + 独立 roll-meta | 产品仓本身不接收 `.roll` 证据;证据进私有 roll-meta | 同 roll-meta | 私有仓放行 |
84
+ | in-repo `.roll` | 产品主仓(`.roll` 随代码一起 tracked) | 检查主仓 remote 可见性 | public / 未知 一律拒绝 |
85
+
86
+ 保守规则:判定失败(无 remote、`gh` 不可用、API 失败、非 GitHub 且无法推断可见性)一律按 **public** 处理,拒绝图片证据并触发 ALERT。
87
+
88
+ 逃生口:owner 可在 `.roll/local.yaml` 中显式声明
89
+
90
+ ```yaml
91
+ evidence_public_waiver: true
92
+ ```
93
+
94
+ 放行公开仓的图片证据,同时留下审计痕迹。in-repo 项目首次成功判定后会把 `evidence_visibility` + `evidence_remote` 写入同一文件;remote URL 变化时自动重判。
95
+
76
96
  ## 门
77
97
 
78
98
  | 门 | 条件 | 频率 |
@@ -107,6 +107,11 @@ down to 🟧 Claimed and lists it under **Discrepancies**. Verbal completion
107
107
 
108
108
  `roll story validate` checks, at design time, that a spec is *born* with a
109
109
  visual-evidence AC (and, for a web surface, a declared product page to capture).
110
+ If the spec has a visual-evidence AC but no declared surface
111
+ (`deliverable_url`, `deliverable_cmd`, `physical_terminal`, or
112
+ `screenshot_exempt`), validation prints a soft must-declare warning and still
113
+ exits 0. Runtime gates carry the same must-declare signal as a diagnostic only;
114
+ they do not block or mark the delivery skipped for that reason alone.
110
115
  Two rules decide what the validator recognises:
111
116
 
112
117
  - **The `[visual-evidence]` marker is authoritative.** An AC item that opens with
@@ -179,6 +184,19 @@ at startup:
179
184
  screenshot requests. If readiness is unavailable, `roll attest` records an
180
185
  honest skip with the setup reason instead of blocking report generation; if
181
186
  the provider times out, the report surfaces timeout as its own failure reason.
187
+ On macOS npm installs, Roll tries to install the app from the latest
188
+ `seanyao/roll-capture` Release into `~/Applications`; `roll setup` can retry
189
+ that repair unless `--no-capture-install` is set.
190
+
191
+ **Capture default strategy (US-PHYSICAL-006):** Physical screenshot requests
192
+ default to **window-level** capture — they only capture the tested application's
193
+ window (Terminal.app for terminal/CLI evidence, Google Chrome for web evidence),
194
+ not the full screen. Full-screen capture requires an explicit
195
+ `capture_fullscreen: true` frontmatter declaration in the card spec. This
196
+ privacy-first design prevents evidence chains from including irrelevant on-screen
197
+ content (chat, email, other projects). If the target window is not found, Roll
198
+ Capture.app returns a documented fallback with the reason recorded in the
199
+ response and evidence ledger — no silent expansion of capture scope.
182
200
  - `Playwright Chromium` — optional headless web capture for `roll attest` and
183
201
  archive screenshots. Install with `npx playwright install chromium`.
184
202
 
@@ -21,6 +21,7 @@ shared conventions.
21
21
  | `ROLL_LOOP_GC_RETENTION_DAYS` | `30` | Override the GC retention period for `roll loop gc`. Takes precedence over `loop_gc.retention_days` in `.roll/local.yaml`. |
22
22
  | `ROLL_FEED_BUDGET_BYTES` | `16384` | Byte budget for the context feed handed to the inner agent each cycle. Set it to a positive integer to dial the feed to the inner agent's capacity; non-numeric or non-positive values fall back to the default. |
23
23
  | `ROLL_AGENT_NUDGE` | `1` (on) | Compatibility agent preference switch. The scoped role binding is the primary selector; set this to `0` (or `off`/`false`/`no`) to disable legacy history preference. |
24
+ | `ROLL_SKIP_CAPTURE_INSTALL` | unset | Set to `1` to skip the best-effort macOS `Roll Capture.app` install during npm postinstall and setup repair. |
24
25
  | `ROLL_RUN_DIR` | unset | Canonical acceptance-evidence run directory. The loop runner sets it before agent spawn; `roll attest --run-dir` and standalone `roll attest` can also consume it. |
25
26
  | `ROLL_EVIDENCE_DIR` | derived from `ROLL_RUN_DIR` | Directory for raw command/test artifacts inside the open evidence frame. Normally set by the runner or `roll test`, not by hand. |
26
27
  | `ROLL_SCREENSHOTS_DIR` | derived from `ROLL_RUN_DIR` | Directory for visual proof inside the open evidence frame. Normally set by the runner or capture lane, not by hand. |
@@ -22,7 +22,18 @@ curl -fsSL https://seanyao.github.io/roll/install | ROLL_VERSION=v3.610.1 bash
22
22
  npm install -g @seanyao/roll
23
23
  ```
24
24
 
25
- Requires Node.js 16+.
25
+ Requires Node.js 22+.
26
+
27
+ On macOS, the npm package runs a best-effort postinstall that downloads
28
+ `Roll-Capture.app.zip` from the latest `seanyao/roll-capture` GitHub Release,
29
+ validates the asset, and installs `Roll Capture.app` into `~/Applications`.
30
+ Open the app once and grant Screen Recording permission before relying on
31
+ physical screenshots. CI, headless sessions, non-macOS hosts, offline failures,
32
+ sudo/root shells, and `ROLL_SKIP_CAPTURE_INSTALL=1` skip the app install without
33
+ failing npm. If npm ran under sudo/root, run `roll setup` again as a regular user
34
+ so Roll installs the app into that user's `~/Applications`, not `/var/root`.
35
+ GitHub download requests respect `HTTP_PROXY`/`HTTPS_PROXY`/`NO_PROXY` when the
36
+ current Node runtime exposes the matching fetch dispatcher.
26
37
 
27
38
  After installation via either method, run setup to sync conventions and skills into your AI tools:
28
39
 
@@ -30,6 +41,10 @@ After installation via either method, run setup to sync conventions and skills i
30
41
  roll setup
31
42
  ```
32
43
 
44
+ `roll setup --no-capture-install` keeps setup from attempting the same Roll
45
+ Capture.app repair. `roll doctor tools` reports whether the app, permission
46
+ proxy, and inbox are ready.
47
+
33
48
  ## Verify
34
49
 
35
50
  ```bash
@@ -93,7 +93,11 @@ roll attest audit --json
93
93
  ## 设计期声明可视证据
94
94
 
95
95
  `roll story validate` 在设计期就检查一张卡是否**生而诚实**——带可视证据 AC,
96
- 且 web 面要声明可截的产品页。校验器靠两条规则识别:
96
+ 且 web 面要声明可截的产品页。若卡有可视证据 AC,但没有声明任何交付面
97
+ (`deliverable_url`、`deliverable_cmd`、`physical_terminal` 或
98
+ `screenshot_exempt`),validate 只打印 must-declare 软警告,仍以 0 退出。
99
+ 运行时 gate 也只把同一信号作为诊断携带,不会仅因此阻断或把交付标成 skipped。
100
+ 校验器靠两条规则识别:
97
101
 
98
102
  - **`[visual-evidence]` 标记即定论。** 以字面 `[visual-evidence]` 标记开头的 AC
99
103
  条目**本身**就是可视证据 AC,无论后面写什么词——不必再额外写"截图 / screenshot":
@@ -153,6 +157,15 @@ evidence、已有证据暴露 rendering/layout 风险;升级原因必须记录
153
157
  - `Roll Capture.app` / `physical.screenshot` —— 物理截图请求的 provider 通道。
154
158
  就绪度不可用时,`roll attest` 记录带设置原因的 honest skip,不阻断报告生成;
155
159
  provider 超时时,报告把 timeout 作为独立失败原因展示。
160
+ macOS npm 安装会尝试从 `seanyao/roll-capture` 最新 Release 安装 app 到
161
+ `~/Applications`;`roll setup` 可重试这条修复路径,除非传入
162
+ `--no-capture-install`。
163
+
164
+ **截图默认策略 (US-PHYSICAL-006):** 物理截图请求默认使用**窗口级**截取——
165
+ 只截被测应用的窗口(终端/CLI 证据截 Terminal.app,网页证据截 Google Chrome),
166
+ 不再默认全屏。全屏截图必须在卡片 spec 中显式声明 `capture_fullscreen: true`。
167
+ 这个隐私优先的设计防止证据链夹带屏幕上无关的隐私内容(聊天记录、邮件、其他项目)。
168
+ 如果目标窗口找不到,Roll Capture.app 会返回带有原因的降级记录——不允许静默扩大截取范围。
156
169
  - `Playwright Chromium` —— 可选的 headless web 截图工具,用于 `roll attest`
157
170
  和归档截图。安装命令是 `npx playwright install chromium`。
158
171
 
@@ -20,6 +20,7 @@ Roll 在启动时解析三个环境变量。在运行 `roll` 之前覆盖任意
20
20
  | `ROLL_LOOP_GC_RETENTION_DAYS` | `30` | 覆盖 `roll loop gc` 的保留天数。优先级高于 `.roll/local.yaml` 中的 `loop_gc.retention_days`。 |
21
21
  | `ROLL_FEED_BUDGET_BYTES` | `16384` | 每个周期交给内层 agent 的上下文 feed 字节预算。设为正整数即可调节容量;非数字或非正数回落默认值。 |
22
22
  | `ROLL_AGENT_NUDGE` | `1`(开启) | 兼容期的 agent 偏好开关。新模型优先通过 scoped role binding 选择候选;设为 `0`(或 `off`/`false`/`no`)关闭历史偏好。 |
23
+ | `ROLL_SKIP_CAPTURE_INSTALL` | 未设置 | 设为 `1` 时,跳过 npm postinstall 和 setup 修复里的 macOS `Roll Capture.app` 尽力安装。 |
23
24
  | `ROLL_RUN_DIR` | 未设置 | 验收证据 run 目录的标准入口。loop runner 在 agent 启动前设置;`roll attest --run-dir` 与独立 `roll attest` 也会读取它。 |
24
25
  | `ROLL_EVIDENCE_DIR` | 从 `ROLL_RUN_DIR` 派生 | 已打开证据框中的原始命令/测试产物目录。通常由 runner 或 `roll test` 设置,不需要手写。 |
25
26
  | `ROLL_SCREENSHOTS_DIR` | 从 `ROLL_RUN_DIR` 派生 | 已打开证据框中的视觉证据目录。通常由 runner 或截图通道设置,不需要手写。 |
@@ -22,7 +22,16 @@ curl -fsSL https://seanyao.github.io/roll/install | ROLL_VERSION=v3.610.1 bash
22
22
  npm install -g @seanyao/roll
23
23
  ```
24
24
 
25
- 需要 Node.js 16+。
25
+ 需要 Node.js 22+。
26
+
27
+ macOS 上,npm 包会在 postinstall 中尽力从 `seanyao/roll-capture` 最新 GitHub
28
+ Release 下载 `Roll-Capture.app.zip`,校验后安装 `Roll Capture.app` 到
29
+ `~/Applications`。使用物理截图前,请打开一次应用并授予 Screen Recording 权限。
30
+ CI、headless、非 macOS、sudo/root shell、离线失败以及
31
+ `ROLL_SKIP_CAPTURE_INSTALL=1` 都会跳过 app 安装,且不会让 npm 安装失败。若 npm
32
+ 是在 sudo/root 下运行,请再以普通用户跑 `roll setup` 安装,避免装进
33
+ `/var/root`。当前 Node runtime 暴露对应 fetch dispatcher 时,GitHub 下载请求会遵守
34
+ `HTTP_PROXY`/`HTTPS_PROXY`/`NO_PROXY`。
26
35
 
27
36
  无论哪种方式安装,完成后运行 setup 将约定和技能同步到你的 AI 工具:
28
37
 
@@ -30,6 +39,9 @@ npm install -g @seanyao/roll
30
39
  roll setup
31
40
  ```
32
41
 
42
+ `roll setup --no-capture-install` 会禁止 setup 尝试同一套 Roll Capture.app 修复。
43
+ `roll doctor tools` 会报告 app、权限代理和 inbox 是否就绪。
44
+
33
45
  ## 验证
34
46
 
35
47
  ```bash
package/lib/i18n/init.sh CHANGED
@@ -46,8 +46,8 @@ _i18n_set en init.plan_validation_failed_see_errors_above "Plan validation faile
46
46
  _i18n_set zh init.plan_validation_failed_see_errors_above "校验失败。"
47
47
  _i18n_set en init.applying_onboard_plan "Applying onboard plan..."
48
48
  _i18n_set zh init.applying_onboard_plan "正在应用 onboard 计划..."
49
- _i18n_set en init.added_roll_to_gitignore "Added .roll/ to .gitignore"
50
- _i18n_set zh init.added_roll_to_gitignore "已将 .roll/ 加入 .gitignore"
49
+ _i18n_set en init.added_roll_to_gitignore "Added Roll runtime ignores to .gitignore"
50
+ _i18n_set zh init.added_roll_to_gitignore "已将 Roll 运行时忽略项加入 .gitignore"
51
51
  _i18n_set en init.syncing_conventions_to_ai_tools "Syncing conventions to AI tools..."
52
52
  _i18n_set zh init.syncing_conventions_to_ai_tools "正在同步约定到 AI 工具..."
53
53
  _i18n_set en init.onboard_apply_complete_onboard "Onboard apply complete. Onboard"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seanyao/roll",
3
- "version": "4.703.2",
3
+ "version": "4.706.1",
4
4
  "description": "Roll — Roll out features with AI agents",
5
5
  "packageManager": "pnpm@11.1.3",
6
6
  "scripts": {
@@ -10,6 +10,7 @@
10
10
  "test:e2e": "pnpm -r build && pnpm --filter @roll/cli exec vitest run test/critical-flows.e2e.test.ts",
11
11
  "test:cov": "pnpm -r exec vitest run --coverage.enabled --coverage.provider=v8 --coverage.include='src/**' --coverage.reporter=text-summary --coverage.reporter=text",
12
12
  "bundle": "node scripts/bundle.mjs",
13
+ "postinstall": "node scripts/postinstall-roll-capture.mjs",
13
14
  "prepack": "pnpm -r build && pnpm bundle"
14
15
  },
15
16
  "keywords": [
@@ -35,6 +36,7 @@
35
36
  "docs/",
36
37
  "guide/",
37
38
  "lib/",
39
+ "scripts/postinstall-roll-capture.mjs",
38
40
  "skills/",
39
41
  "template/",
40
42
  "README.md",
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ try {
3
+ await import("../dist/postinstall.mjs");
4
+ } catch (error) {
5
+ // The source checkout may not have been bundled yet. Published tarballs carry
6
+ // dist/postinstall.mjs; either way npm install must never fail here.
7
+ const reason = error instanceof Error ? error.message : String(error);
8
+ process.stderr.write(`postinstall skipped: ${reason}\n`);
9
+ }