@seanyao/roll 4.630.2 → 4.702.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 (108) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +65 -56
  3. package/conventions/global/AGENTS.md +8 -7
  4. package/dist/roll.mjs +12909 -8532
  5. package/docs/INDEX.md +32 -0
  6. package/docs/architecture.md +444 -0
  7. package/docs/difftest-freeze-paradigm.md +113 -0
  8. package/docs/live-console.md +203 -0
  9. package/docs/manifesto.md +65 -0
  10. package/docs/migration/role-taxonomy-v4.md +60 -0
  11. package/docs/verification.md +83 -0
  12. package/guide/INDEX.md +86 -0
  13. package/guide/assets/layouts/cards-2.png +0 -0
  14. package/guide/assets/layouts/cards-3.png +0 -0
  15. package/guide/assets/layouts/cards-4.png +0 -0
  16. package/guide/assets/layouts/compare.png +0 -0
  17. package/guide/assets/layouts/highlight.png +0 -0
  18. package/guide/assets/layouts/pipeline.png +0 -0
  19. package/guide/assets/layouts/plain.png +0 -0
  20. package/guide/assets/layouts/quote.png +0 -0
  21. package/guide/assets/layouts/timeline.png +0 -0
  22. package/guide/en/acceptance-evidence.md +231 -0
  23. package/guide/en/ai-agents.md +185 -0
  24. package/guide/en/backlog-github-sync.md +108 -0
  25. package/guide/en/changelog.md +66 -0
  26. package/guide/en/configuration.md +112 -0
  27. package/guide/en/consistency.md +58 -0
  28. package/guide/en/conventions.md +113 -0
  29. package/guide/en/dream.md +121 -0
  30. package/guide/en/faq.md +855 -0
  31. package/guide/en/feedback.md +31 -0
  32. package/guide/en/getting-started.md +103 -0
  33. package/guide/en/installation.md +86 -0
  34. package/guide/en/legacy-onboarding.md +195 -0
  35. package/guide/en/loop-data-layout.md +256 -0
  36. package/guide/en/loop-driven-architecture.md +186 -0
  37. package/guide/en/loop.md +1324 -0
  38. package/guide/en/methodology.md +715 -0
  39. package/guide/en/migration-2.0.md +154 -0
  40. package/guide/en/overview.md +190 -0
  41. package/guide/en/pairing.md +151 -0
  42. package/guide/en/patterns/README.md +76 -0
  43. package/guide/en/patterns/graft-pattern.md +110 -0
  44. package/guide/en/patterns/replant-pattern.md +114 -0
  45. package/guide/en/patterns/seed-pattern.md +132 -0
  46. package/guide/en/peer.md +71 -0
  47. package/guide/en/pr-review.md +62 -0
  48. package/guide/en/practices/engineering-common-sense.md +395 -0
  49. package/guide/en/pricing.md +116 -0
  50. package/guide/en/project-setup.md +126 -0
  51. package/guide/en/roll-doc-audit.md +98 -0
  52. package/guide/en/skills.md +206 -0
  53. package/guide/en/test-isolation.md +51 -0
  54. package/guide/en/testing/quality-rubric.md +340 -0
  55. package/guide/en/testing.md +123 -0
  56. package/guide/en/tools.md +173 -0
  57. package/guide/skills.md +30 -0
  58. package/guide/zh/acceptance-evidence.md +194 -0
  59. package/guide/zh/ai-agents.md +170 -0
  60. package/guide/zh/backlog-github-sync.md +105 -0
  61. package/guide/zh/changelog.md +57 -0
  62. package/guide/zh/configuration.md +99 -0
  63. package/guide/zh/consistency.md +48 -0
  64. package/guide/zh/conventions.md +96 -0
  65. package/guide/zh/dream.md +97 -0
  66. package/guide/zh/faq.md +773 -0
  67. package/guide/zh/feedback.md +30 -0
  68. package/guide/zh/getting-started.md +96 -0
  69. package/guide/zh/installation.md +83 -0
  70. package/guide/zh/legacy-onboarding.md +192 -0
  71. package/guide/zh/loop-data-layout.md +236 -0
  72. package/guide/zh/loop-driven-architecture.md +186 -0
  73. package/guide/zh/loop.md +1124 -0
  74. package/guide/zh/methodology.md +702 -0
  75. package/guide/zh/migration-2.0.md +154 -0
  76. package/guide/zh/overview.md +186 -0
  77. package/guide/zh/pairing.md +117 -0
  78. package/guide/zh/patterns/README.md +74 -0
  79. package/guide/zh/patterns/graft-pattern.md +108 -0
  80. package/guide/zh/patterns/replant-pattern.md +112 -0
  81. package/guide/zh/patterns/seed-pattern.md +130 -0
  82. package/guide/zh/peer.md +63 -0
  83. package/guide/zh/pr-review.md +54 -0
  84. package/guide/zh/practices/engineering-common-sense.md +393 -0
  85. package/guide/zh/pricing.md +97 -0
  86. package/guide/zh/project-setup.md +114 -0
  87. package/guide/zh/roll-doc-audit.md +90 -0
  88. package/guide/zh/skills.md +191 -0
  89. package/guide/zh/test-isolation.md +46 -0
  90. package/guide/zh/testing/quality-rubric.md +284 -0
  91. package/guide/zh/testing.md +116 -0
  92. package/guide/zh/tools.md +173 -0
  93. package/package.json +4 -1
  94. package/skills/README.md +1 -0
  95. package/skills/roll-.qa/SKILL.md +1 -1
  96. package/skills/roll-.review/SKILL.md +1 -1
  97. package/skills/roll-build/SKILL.md +1 -1
  98. package/skills/roll-build/references/full-contract.md +16 -13
  99. package/skills/roll-design/SKILL.md +3 -3
  100. package/skills/roll-design/references/full-contract.md +17 -13
  101. package/skills/roll-fix/SKILL.md +1 -1
  102. package/skills/roll-fix/references/full-contract.md +13 -10
  103. package/skills/roll-peer/SKILL.md +1 -1
  104. package/skills/roll-prime/SKILL.md +77 -0
  105. package/skills/roll-prime/references/explorer-annex.md +39 -0
  106. package/skills/roll-prime/references/supervisor-prompt.md +165 -0
  107. package/skills/route-cases/skills.json +10 -0
  108. package/template/AGENTS.md +3 -1
@@ -0,0 +1,173 @@
1
+ # Roll — 工具与策略
2
+
3
+ Roll 的 tools layer 是交付周期里执行副作用的受治理路径:shell 命令、浏览器检查、文件系统访问、git、GitHub、网络请求和 MCP 调用。
4
+
5
+ tools layer 不是 AI 客户端自己的工具白名单替代品。客户端的 `allowed-tools` 决定内层 agent 能请求什么。Roll 的 tools layer 决定外层 harness 注册哪些工具、怎样解析项目策略、记录哪些事件,以及成本怎样进入 cycle 证据。
6
+
7
+ 工具层设计方案见 [../../.roll/features/tools-layer/plan.md](../../.roll/features/tools-layer/plan.md)。
8
+
9
+ ## 核心概念
10
+
11
+ | 概念 | 含义 |
12
+ |------|------|
13
+ | 工具声明 | 工具的共享契约:id、kind、标题、默认值、依赖、输入输出 schema。 |
14
+ | 注册表 | core 里的统一路径:注册工具、解析 policy、调用 adapter、发事件、重试、记录成本快照。 |
15
+ | 适配器 | infra 里的具体实现,例如 `bash`、`browser.screenshot`、`git.push`、`network.fetch`。 |
16
+ | 策略 | 工具声明默认值与 `.roll/policy.yaml` 覆盖合成后的有效配置。 |
17
+ | 证据 | `tool:invoke`、`tool:result`、cycle 成本行、CLI 输出、attest report、dashboard 时间线。 |
18
+
19
+ 当前注册的工具族:
20
+
21
+ | 工具族 | 工具 id |
22
+ |--------|---------|
23
+ | Bash | `bash` |
24
+ | Browser | `browser.screenshot`、`browser.console`、`browser.dom-query` |
25
+ | Filesystem | `filesystem.stat`、`filesystem.read`、`filesystem.write` |
26
+ | Git | `git.status`、`git.commit`、`git.push`、`git.merge` |
27
+ | GitHub | `github.pr`、`github.ci` |
28
+ | MCP | `mcp.call` |
29
+ | Network | `network.fetch` |
30
+
31
+ 完整的内置工具清单——每个工具的能力、输入/输出契约、默认护栏与依赖——可在机器全局 **Tools** 页(`tools.html`)浏览,它是 `MACHINE › …` 面包屑里与 Agents、Skills 同级的页面之一。
32
+
33
+ ## 项目策略
34
+
35
+ 工具策略写在 `.roll/policy.yaml` 的 `tools:` 段里。
36
+
37
+ ```yaml
38
+ tools:
39
+ bash:
40
+ enabled: true
41
+ timeoutMs: 30000
42
+ maxInvocationsPerCycle: 20
43
+ sandbox:
44
+ allowedPaths: [.]
45
+ blockedCommands: [sudo]
46
+ maxOutputBytes: 65536
47
+
48
+ browser.screenshot:
49
+ timeoutMs: 60000
50
+ sandbox:
51
+ headlessOnly: true
52
+ allowedOrigins: [http://localhost:4173]
53
+
54
+ network.fetch:
55
+ retry:
56
+ attempts: 2
57
+ backoffMs: 250
58
+ sandbox:
59
+ network: restricted
60
+ allowedOrigins: [https://api.example.com]
61
+ ```
62
+
63
+ 支持字段:
64
+
65
+ | 字段 | 范围 | 含义 |
66
+ |------|------|------|
67
+ | `enabled` | 工具 | `false` 会通过 policy 阻断调用。 |
68
+ | `timeoutMs` | 工具 | adapter 使用的软超时;输入里更窄的限制可覆盖它。 |
69
+ | `retry.attempts` | 工具 | 支持重试的 adapter 的最大尝试次数。 |
70
+ | `retry.backoffMs` | 工具 | 两次重试之间的等待时间。 |
71
+ | `maxInvocationsPerCycle` | 工具 | registry 执行的单 cycle 调用预算。 |
72
+ | `sandbox.allowedPaths` | sandbox | 文件系统类 adapter 的路径白名单。 |
73
+ | `sandbox.blockedCommands` | sandbox | bash 的 advisory 命令阻断列表。 |
74
+ | `sandbox.hardTimeoutSec` | sandbox | 支持该字段的 adapter 的硬超时。 |
75
+ | `sandbox.maxOutputBytes` | sandbox | 输出截断上限。 |
76
+ | `sandbox.allowedOrigins` | sandbox | 网络或浏览器 origin 白名单。 |
77
+ | `sandbox.headlessOnly` | sandbox | 浏览器 lane 必须保持 headless。 |
78
+ | `sandbox.network` | sandbox | `inherit`、`restricted` 或 `blocked`。 |
79
+
80
+ 未知字段会告警但不会拒绝整个 policy 文件,方便新旧版本之间前向兼容。
81
+
82
+ ## CLI
83
+
84
+ 用 `roll doctor tools status` 查看当前项目已注册工具、输入契约、依赖就绪度和合成后的有效 policy 状态。
85
+
86
+ ```bash
87
+ roll doctor tools status
88
+ ```
89
+
90
+ 示例输出:
91
+
92
+ ```text
93
+ tool kind enabled readiness timeout limit contract sandbox
94
+ bash bash yes available 30000 - args?, command, cwd?, env? maxOutputBytes=65536
95
+ browser.screenshot browser yes available 60000 - screenshotPath?, url, viewport?, waitFor? headlessOnly=true,maxOutputBytes=2097152
96
+ network.fetch network yes available 30000 - body?, headers?, method?, timeoutMs?, url network=restricted
97
+ ```
98
+
99
+ 修改 `.roll/policy.yaml` 后,可以用它确认 Roll 读到的状态符合预期。
100
+
101
+ ## 完整示例
102
+
103
+ 这个示例把浏览器截图限制在本地 dev server,先确认有效 policy,再说明一次交付完成后应该去哪里看工具证据。
104
+
105
+ 1. 为项目配置 browser 和 network policy:
106
+
107
+ ```yaml
108
+ tools:
109
+ browser.screenshot:
110
+ timeoutMs: 60000
111
+ sandbox:
112
+ headlessOnly: true
113
+ allowedOrigins: [http://localhost:4173]
114
+
115
+ network.fetch:
116
+ timeoutMs: 10000
117
+ retry:
118
+ attempts: 2
119
+ backoffMs: 250
120
+ sandbox:
121
+ network: restricted
122
+ allowedOrigins: [http://localhost:4173]
123
+ ```
124
+
125
+ 2. 确认 Roll 解析到的 policy:
126
+
127
+ ```bash
128
+ roll doctor tools status
129
+ ```
130
+
131
+ 预期能看到这些行:
132
+
133
+ ```text
134
+ browser.screenshot browser yes 60000 - allowedOrigins=http://localhost:4173,headlessOnly=true,maxOutputBytes=2097152
135
+ network.fetch network yes 10000 - allowedOrigins=http://localhost:4173,network=restricted
136
+ ```
137
+
138
+ 3. 跑一个有可视网页面的交付。故事 spec 应声明要截图的页面:
139
+
140
+ ```yaml
141
+ ---
142
+ deliverable_url: http://localhost:4173
143
+ ---
144
+ ```
145
+
146
+ attest 阶段会通过 `browser.screenshot` 捕获这个页面。对 Roll 暴露的工具 id 是 `browser.screenshot`;底层可能使用 Playwright 或 Chrome,但 `playwright` 不是 policy key,也不是工具 id。
147
+
148
+ 4. 检查证据:
149
+
150
+ ```bash
151
+ roll loop cycle <cycle-id>
152
+ ```
153
+
154
+ 寻找类似这样的行:
155
+
156
+ ```text
157
+ tools browser.screenshot×1(2.0s) network.fetch×1(0.4s)
158
+ ```
159
+
160
+ Story attest report 和 cycle 视图会从同一条事件流展示:
161
+
162
+ | 证据 | 检查点 |
163
+ |------|--------|
164
+ | `tool:invoke` | 工具 id、调用 cycle、合成后的 policy。 |
165
+ | `tool:result` | 成功或 errorCode、耗时、输出路径。 |
166
+ | 截图链接 | `.roll/tool-dumps/...png` 或卡片目录里附加的截图路径。 |
167
+ | 成本行 | 保留 USD、CNY/RMB 或 `¥`;混合币种不会被折成一个假的总额。 |
168
+
169
+ ## 证据与成本
170
+
171
+ `roll loop status`、`roll loop cycle` 和 attest report 都会从事件流展示工具摘要。失败的工具调用保留 errorCode,截图工具可以直接链接到图片证据。
172
+
173
+ 工具成本保留原生币种。美元行仍是 USD。人民币行仍是 CNY/RMB 或 `¥`。Roll 不会把人民币计价的工具或模型成本标成美元,也不会把混合币种盲目加成一个数字。
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@seanyao/roll",
3
- "version": "4.630.2",
3
+ "version": "4.702.2",
4
4
  "description": "Roll — Roll out features with AI agents",
5
5
  "packageManager": "pnpm@11.1.3",
6
6
  "scripts": {
7
7
  "test": "bash scripts/test-ts.sh",
8
8
  "lint:story-ids": "node scripts/lint-story-ids.mjs",
9
+ "lint:role-taxonomy": "node scripts/audit-role-taxonomy.mjs",
9
10
  "test:e2e": "pnpm -r build && pnpm --filter @roll/cli exec vitest run test/critical-flows.e2e.test.ts",
10
11
  "test:cov": "pnpm -r exec vitest run --coverage.enabled --coverage.provider=v8 --coverage.include='src/**' --coverage.reporter=text-summary --coverage.reporter=text",
11
12
  "bundle": "node scripts/bundle.mjs",
@@ -31,6 +32,8 @@
31
32
  "files": [
32
33
  "dist/",
33
34
  "conventions/",
35
+ "docs/",
36
+ "guide/",
34
37
  "lib/",
35
38
  "skills/",
36
39
  "template/",
package/skills/README.md CHANGED
@@ -19,6 +19,7 @@ roll 的**技能契约**仓——AI agent 在 roll 项目里工作时加载并
19
19
  - `roll-fix` — 缺陷修复轻量链路(FIX 卡专用)
20
20
  - `roll-idea` — 一句话快速捕获 → 自动分类编号落 backlog
21
21
  - `roll-loop` — 无人值守 BACKLOG 执行器的工作流契约
22
+ - `roll-prime` — Supervisor(supervise 角色)协同领袖:对账、派卡、只读盯场、失败归因、meta reconcile
22
23
 
23
24
  **Quality · 质量与评审**
24
25
  - `roll-peer` — 跨 agent 协商评审(三态协议 + 时间盒)
@@ -48,4 +48,4 @@ Load when a build, fix, review, or story needs Roll QA coverage standards: test
48
48
 
49
49
  ## Role in v4 execution profiles
50
50
 
51
- These QA standards are an **Evaluator capability** in the `verified`/`planned` execution profiles: the independent Evaluator applies them to judge story satisfaction and produces an `eval-report.md` (blocking findings, advisory findings, score, attest/evidence status, recommendation) — distinct from CI feedback and from the Builder's self-report. (Roles: Supervisor Agent / Planner / Builder / Evaluator; never Prime/Watchman/Dispatcher/Governor.)
51
+ These QA standards are an **Evaluator capability** in the `verified`/`designed` execution profiles: the independent Evaluator applies them to judge story satisfaction and produces an `eval-report.md` (blocking findings, advisory findings, score, attest/evidence status, recommendation) — distinct from CI feedback and from the Builder's self-report. Roles: Supervisor / Designer / Builder / Evaluator.
@@ -149,4 +149,4 @@ In each micro-step of `$roll-build`:
149
149
 
150
150
  ## Role in v4 execution profiles
151
151
 
152
- Self-review is a TCR-step quality gate **within the Builder role** — it is NOT story acceptance. In the `verified`/`planned` execution profiles the independent **Evaluator** (a fresh session, never the Builder's) judges whether the delivery satisfies the contract; blocking review, score, and attest stay three SEPARATE dimensions (never one pass/fail). This skill is one Evaluator capability among review/qa/scoring. (Roles: Supervisor Agent / Planner / Builder / Evaluator; never Prime/Watchman/Dispatcher/Governor.)
152
+ Self-review is a TCR-step quality gate **within the Builder role** — it is NOT story acceptance. In the `verified`/`designed` execution profiles the independent **Evaluator** (a fresh session, never the Builder's) judges whether the delivery satisfies the contract; blocking review, score, and attest stay three SEPARATE dimensions (never one pass/fail). This skill is one Evaluator capability among review/qa/scoring. Roles: Supervisor / Designer / Builder / Evaluator.
@@ -57,4 +57,4 @@ same TCR, evidence, Evaluator, and release gates apply in both modes.
57
57
 
58
58
  ## Role in v4 execution profiles
59
59
 
60
- **roll-build is the Builder capability in every execution profile** (`standard` / `verified` / `planned`). Under `planned` it receives the Planner's `planner-contract.md` via artifact refs (no shared raw session). Under `verified`/`planned` an independent **Evaluator** (a fresh session) judges the delivery and may open a BOUNDED repair round — you address the blocking findings and write a repair note mapping findings → changes. `standard` is Builder-only. (Roles: Supervisor Agent / Planner / Builder / Evaluator; never Prime/Watchman/Dispatcher/Governor.)
60
+ **roll-build is the Builder capability in every execution profile** (`standard` / `verified` / `designed`). Under `designed` it receives the Designer's `design-contract.md` via artifact refs (no shared raw session). Under `verified`/`designed` an independent **Evaluator** (a fresh session) judges the delivery and may open a BOUNDED repair round — you address the blocking findings and write a repair note mapping findings → changes. `standard` is Builder-only. Roles: Supervisor / Designer / Builder / Evaluator.
@@ -117,7 +117,7 @@ the command decides. The cap exists purely to stop infinite split chains.
117
117
  1. Open `.roll/backlog.md`, find the US row, follow the link to `.roll/features/<epic>/<story>/spec.md`
118
118
  2. Read the full AC / Files / Dependencies section
119
119
  3. If a plan doc (`<feature>-plan.md`) exists, read it for context
120
- 4. **Read the Evaluation contract (US-SKILL-030)**: if the spec contains an `**Evaluation contract:**` block, read `expected_evidence` and `scorer_focus` before writing any code. This is the planner's artifact contract — use it to inform test design and evidence planning. Map each `expected_evidence` item to a planned Action or test; if an item is impossible given the actual scope, note the deviation in your report/ac-map. `builder_notes` carry planner hints — treat them as bounded guidance, not hidden requirements.
120
+ 4. **Read the Evaluation contract (US-SKILL-030)**: if the spec contains an `**Evaluation contract:**` block, read `expected_evidence` and `scorer_focus` before writing any code. This is the Designer's artifact contract — use it to inform test design and evidence planning. Map each `expected_evidence` item to a candidate Action or test; if an item is impossible given the actual scope, note the deviation in your report/ac-map. `builder_notes` carry Designer hints — treat them as bounded guidance, not hidden requirements.
121
121
 
122
122
  ### Step A3: Split into Actions
123
123
 
@@ -190,11 +190,11 @@ Before defining the verification, classify **each Action** on one axis:
190
190
  ```
191
191
  Action acceptance
192
192
  ├── YES (deterministic) → objective 4-stage loop ← DEFAULT
193
- Planner (AC/contract) → Tester (Phase 2 + write RED)
193
+ Designer/AC contract → Tester (Phase 2 + write RED)
194
194
  │ → Builder (Phase 3 TCR) → Evaluator (Phase 6, incl. Agent 4 test audit)
195
195
 
196
196
  └── NO (judgment-dependent) → subjective 3-stage loop
197
- Planner emits EXPLICIT evaluation criteria up front
197
+ Designer emits EXPLICIT evaluation criteria up front
198
198
  → Builder produces the output
199
199
  → an ISOLATED Evaluator scores the output against those criteria
200
200
  ```
@@ -542,7 +542,7 @@ Agent 3: Efficiency Review (receives: full diff)
542
542
  Agent 4: Test Adequacy Review (receives: AC/contract + test files ONLY)
543
543
  → Audit the TESTS, not the implementation. This agent does NOT receive
544
544
  the implementation diff or any builder reasoning — only (a) the Story's
545
- AC / interface contract (the Planner artifact) and (b) the test files.
545
+ AC / interface contract (the Designer artifact) and (b) the test files.
546
546
  → AC ↔ assertion coverage: every AC has at least one test that would fail
547
547
  if that AC regressed. Flag any AC with no corresponding assertion.
548
548
  → Tautological / vacuous assertions: tests that only assert "did not throw",
@@ -720,7 +720,7 @@ story (loop or manual Phase 10.6) and earn the report at delivery time.
720
720
  ] }]
721
721
  ```
722
722
 
723
- **Cross-reference with the Evaluation contract** (when present): each `expected_evidence` item in the contract maps to an AC via its `proves` field. When writing ac-map entries, ensure every `expected_evidence` item is addressed — the attest gate later surfaces a planned-vs-delivered delta from this mapping (US-SKILL-030).
723
+ **Cross-reference with the Evaluation contract** (when present): each `expected_evidence` item in the contract maps to an AC via its `proves` field. When writing ac-map entries, ensure every `expected_evidence` item is addressed — the attest gate later surfaces a design-contract-vs-delivered delta from this mapping (US-SKILL-030).
724
724
  No evidence for an AC → say `claimed` yourself; the renderer enforces that downgrade anyway (red line) and lists it under Discrepancies.
725
725
  3. **Run** `roll attest {ID}` (add `--deploy-url <url>` when one exists). The report lands at `.roll/features/<epic>/{ID}/latest/{ID}-report.html` (archive-per-card layout, US-META-001). The report is now layered (US-ATTEST-013): card context + conclusion/business badges + key screenshots up front, technical ANSI/command output folded into collapsed `<details>`, and a closing block (quality gate + evidence index + Review Score).
726
726
  4. **Design QA checklist (US-ATTEST-013) — READABILITY ONLY**. After the report
@@ -931,9 +931,10 @@ Reviewer that mints the Review Score (1..10 + verdict + rationale), recorded
931
931
  with `scoredBy` and the fresh-session id so independence is verifiable.
932
932
 
933
933
  Independence is about session/context, not vendor: a fresh same-vendor session
934
- is the minimum acceptable; a different agent+model+session (non-sub-agent) is
935
- encouraged (absolute heterogeneity). A score sharing the builder's session
936
- (including any sub-agent of it) is rejected as a self-score.
934
+ is the minimum acceptable; a different agent+model+session (non-sub-agent) is a
935
+ ranking preference unless the owner explicitly requested strict diversity. A
936
+ score sharing the builder's session (including any sub-agent of it) is rejected
937
+ as a self-score.
937
938
 
938
939
  Score guidance the Reviewer applies (integer 1..10):
939
940
  - **9..10** — story shipped cleanly: AC fully met, TCR rhythm tight, no
@@ -963,11 +964,13 @@ GAPS: <gap one; gap two; gap three>
963
964
  ```
964
965
 
965
966
  On a RESIZE signal (low score), the loop runs `roll loop review-resize <story>`:
966
- `$roll-design` mints sub-stories from the gaps, ≥2 **heterogeneous** reviewers
967
- gate the split by consensus (all agree auto-land via `roll loop self-downgrade`,
968
- which parks the parent at 🚫 Hold + appends the sub-stories; any objection →
969
- pause + ALERT, backlog unchanged), and the chain-depth cap (US-AGENT-009) stops
970
- runaway splits. The human is **on** the loop (alerted only on consensus failure
967
+ `$roll-design` mints sub-stories from the gaps, and ≥2 fresh-session reviewers
968
+ gate the split by consensus. Prefer diverse agents/models when available, but do
969
+ not block solely on matching brand/provider unless the owner requested strict
970
+ diversity. When all agree, auto-land via `roll loop self-downgrade`, which parks
971
+ the parent at 🚫 Hold + appends the sub-stories; any objection pause + ALERT,
972
+ backlog unchanged. The chain-depth cap (US-AGENT-009) stops runaway splits. The
973
+ human is **on** the loop (alerted only on consensus failure
971
974
  or the cap), not in it. A RESIZE is never emitted for a pure quality problem.
972
975
 
973
976
  ---
@@ -15,7 +15,7 @@ Load when the user wants to discuss approaches, design a solution, model domains
15
15
  ## Operating Modes
16
16
 
17
17
  Used in **guided** mode when the owner explicitly designs or splits work, and in
18
- **autonomous** mode only as the Planner capability selected by a `planned`
18
+ **autonomous** mode only as the Designer capability selected by a `designed`
19
19
  execution profile. It must never silently start Builder work.
20
20
 
21
21
  ## When Not to Use
@@ -43,7 +43,7 @@ execution profile. It must never silently start Builder work.
43
43
  - Backlog rows and spec files must stay consistent.
44
44
  - Peer review gates apply only when explicitly available/requested.
45
45
  - No story decomposition until a detailed design exists and the owner has signed off (proportional to risk). Decomposition slices an agreed design — it is NOT a substitute for designing. If you cannot show at least one complete worked sample of the intended output/behavior, the design is NOT done.
46
- - **Evaluation contract (US-SKILL-030 — planner-builder-evaluator artifact contract)**: every newly split story spec MUST include an `**Evaluation contract:**` block with `expected_evidence` (each item: `kind`, `target`, `proves`) and `scorer_focus`. This artifact is authored by the planner and consumed by builder (roll-build/roll-fix reads before coding) and evaluator (peer score prompt reads the contract; attest surfaces planned-vs-delivered mapping) — not a fixed three-agent collaboration model. Genuinely trivial/internal stories may carry a one-item minimal block, but never omit it. See `references/full-contract.md` for the full template and rules.
46
+ - **Evaluation contract (US-SKILL-030 — designer-builder-evaluator artifact contract)**: every newly split story spec MUST include an `**Evaluation contract:**` block with `expected_evidence` (each item: `kind`, `target`, `proves`) and `scorer_focus`. This artifact is authored by the Designer and consumed by Builder (roll-build/roll-fix reads before coding) and Evaluator (peer score prompt reads the contract; attest surfaces design-contract-vs-delivered mapping) — not a fixed three-agent collaboration model. Genuinely trivial/internal stories may carry a one-item minimal block, but never omit it. See `references/full-contract.md` for the full template and rules.
47
47
  - **Visual-evidence contract (FIX-311 — design-phase gate)**: every story spec is born honest. By default each story MUST carry one AC that captures its user-visible surface (web/CLI/TUI), and a web/visual card MUST declare the real product surface in its spec frontmatter — `deliverable_url:` (alias `screenshot_url:`) pointing at the actual deliverable page (e.g. `https://app.example.test/casting#board`), NEVER the card's own dossier/report/archive page. A card with genuinely no visual surface writes `screenshot_exempt: <reason>` (a naked `true`/`yes` is NOT a valid exemption — it must carry a reason). This is enforced, not advisory: `validateStoryVisualEvidence(specText)` in `packages/cli/src/lib/design-visual-evidence.ts` returns `ok:false` for a non-exempt spec with no visual-evidence AC, or one that declares a visual surface but no `deliverable_url`. Keyword matching may only RECOGNISE an exemption / an existing visual-evidence AC — it may NEVER be used to decide a card needs a screenshot (it always does, by default). This is the same contract the runtime enforce gate (FIX-309) and archive gate (FIX-334) hold; the three must agree.
48
48
 
49
49
  ## Gotchas
@@ -60,4 +60,4 @@ execution profile. It must never silently start Builder work.
60
60
 
61
61
  ## Role in v4 execution profiles
62
62
 
63
- In the `planned` execution profile, **roll-design is the Planner capability**: in a FRESH session before the Builder it writes a `planner-contract.md` (scope boundary, acceptance/evaluation contract, expected evidence, risks, out-of-scope items, resize/split guidance) that the Builder consumes via artifact refs. roll-design stays a skill — the TS engine owns orchestration and validates the contract fail-closed before the Builder starts. For pure design/backlog planning the user loads roll-design directly; it does not auto-trigger. (Roles: Supervisor Agent / Planner / Builder / Evaluator; never Prime/Watchman/Dispatcher/Governor.)
63
+ In the `designed` execution profile, **roll-design is the Designer capability**: in a FRESH session before the Builder it writes a `design-contract.md` (scope boundary, acceptance/evaluation contract, expected evidence, risks, out-of-scope items, resize/split guidance) that the Builder consumes via artifact refs. roll-design stays a skill — the TS engine owns orchestration and validates the contract fail-closed before the Builder starts. For pure design/backlog planning the user loads roll-design directly; it does not auto-trigger. Roles: Supervisor / Designer / Builder / Evaluator.
@@ -731,9 +731,9 @@ Note: `{DOMAIN}` maps to the Bounded Context name identified in DDD analysis.
731
731
  - builder_notes:
732
732
  - {bounded implementation/evidence hints; no hidden requirements}
733
733
 
734
- > **强制规则 — Evaluation contract 必须填**:每张新 story 必须带 `**Evaluation contract:**` 块(expected_evidence + scorer_focus)。这是 planner 写给 builderevaluator 的验收契约——builder 编码前读 contract、交付后把 ac-map 项映射回 contract 的 expected_evidence;evaluator(peer score / attest gate)读 contract 对账。不是固定三 agent 协同模型,是 artifact-based 契约。真正 trivial/internal 故事可放一项 minimal block,但不许省略。
734
+ > **强制规则 — Evaluation contract 必须填**:每张新 story 必须带 `**Evaluation contract:**` 块(expected_evidence + scorer_focus)。这是 Designer 写给 BuilderEvaluator 的验收契约——Builder 编码前读 contract、交付后把 ac-map 项映射回 contract 的 expected_evidence;Evaluator(peer score / attest gate)读 contract 对账。不是固定三 agent 协同模型,是 artifact-based 契约。真正 trivial/internal 故事可放一项 minimal block,但不许省略。
735
735
  >
736
- > **MUST fill** the `**Evaluation contract:**` block on every newly split story. This is an artifact contract authored by roll-design, consumed by builder (read before coding, map delivered evidence back) and evaluator (peer score prompt includes it, attest surfaces planned-vs-delivered). Genuinely trivial/internal stories may use a one-item minimal block, never omit it.
736
+ > **MUST fill** the `**Evaluation contract:**` block on every newly split story. This is an artifact contract authored by roll-design as the Designer, consumed by Builder (read before coding, map delivered evidence back) and Evaluator (peer score prompt includes it, attest surfaces design-contract-vs-delivered). Genuinely trivial/internal stories may use a one-item minimal block, never omit it.
737
737
 
738
738
  **Spec frontmatter (visual-evidence contract — FIX-311):**
739
739
  - A web/visual card MUST declare the real product surface it delivers:
@@ -771,9 +771,9 @@ Note: `{DOMAIN}` maps to the Bounded Context name identified in DDD analysis.
771
771
  >
772
772
  > **MUST fill** the `**Agent profile:**` block on every newly split US. `est_min` is the **sole loop-routing input** — `lib/loop_pick_agent.py` maps it onto a four-slot complexity tier (easy/default/hard/fallback) on the est_min axis alone (missing/illegal → default). Fill `risk_zone` too, but note it does NOT feed routing; it only informs the roll-build / roll-fix pre-flight self-eval (US-AGENT-007).
773
773
 
774
- > **强制规则 — Evaluation contract 必须填(US-SKILL-030)**:每张新 story spec 都必须包含 `**Evaluation contract:**` 块,明确列出 `expected_evidence`(每项 kind/target/proves 三字段)和 `scorer_focus`(peer scorer 评分口径)。纯内部/无可见面的 trivial story 可使用 one-item 最小块,但不可省略。该块由 planner(`roll-design`)撰写,供 builderevaluator 作为共享证据契约消费,不触发三 agent 协同会话。
774
+ > **强制规则 — Evaluation contract 必须填(US-SKILL-030)**:每张新 story spec 都必须包含 `**Evaluation contract:**` 块,明确列出 `expected_evidence`(每项 kind/target/proves 三字段)和 `scorer_focus`(peer scorer 评分口径)。纯内部/无可见面的 trivial story 可使用 one-item 最小块,但不可省略。该块由 Designer(`roll-design`)撰写,供 BuilderEvaluator 作为共享证据契约消费,不触发三 agent 协同会话。
775
775
 
776
- > **Evaluation contract is required (US-SKILL-030)**: every newly split story spec MUST carry an `**Evaluation contract:**` block with `expected_evidence` (each item: `kind`, `target`, `proves`) and `scorer_focus` (scorer rubric). Genuinely trivial/internal stories may use a one-item minimal block but must not omit the section entirely. This block is authored by the planner (`roll-design`) and consumed as a shared artifact contract by builder (`roll-build`/`roll-fix`) and evaluator (peer scorer, attest gate) — no three-agent chat pipeline is introduced.
776
+ > **Evaluation contract is required (US-SKILL-030)**: every newly split story spec MUST carry an `**Evaluation contract:**` block with `expected_evidence` (each item: `kind`, `target`, `proves`) and `scorer_focus` (scorer rubric). Genuinely trivial/internal stories may use a one-item minimal block but must not omit the section entirely. This block is authored by the Designer (`roll-design`) and consumed as a shared artifact contract by Builder (`roll-build`/`roll-fix`) and Evaluator (peer scorer, attest gate) — no three-agent chat pipeline is introduced.
777
777
  >
778
778
  > **Block template:**
779
779
  > ```markdown
@@ -790,13 +790,13 @@ Note: `{DOMAIN}` maps to the Bounded Context name identified in DDD analysis.
790
790
  >
791
791
  > **Rules**: (1) `expected_evidence` items are **binding for evidence expectations** — if an item becomes impossible, the builder updates the spec or explains the deviation in the report/ac-map. (2) `scorer_focus` items extend, not replace, the generic scoring rubric. (3) This block complements the visual-evidence contract; `deliverable_url`/`screenshot_exempt` rules are unchanged. (4) Legacy specs without the block degrade gracefully — builder and scorer fall back to the generic rubric with no behavior change.
792
792
 
793
- ### Closing Doc-Refresh Story Template — Phase N.M 收尾文档
793
+ ### Closing Doc-Refresh Story Template — Phase N.M Documentation Refresh
794
794
 
795
795
  When any preceding US in the batch changes user-visible behavior, append this template story at the end of the batch. Wire it as `depends-on:` against every preceding user-facing US so it runs last.
796
796
 
797
797
  ```markdown
798
798
  <a id="us-{domain}-{n}"></a>
799
- ## US-{DOMAIN}-{N} Phase {N.M} 用户文档刷新(中英双轨) 📋
799
+ ## US-{DOMAIN}-{N} Phase {N.M} documentation refresh 📋
800
800
 
801
801
  **Created**: {YYYY-MM-DD}
802
802
 
@@ -805,11 +805,12 @@ When any preceding US in the batch changes user-visible behavior, append this te
805
805
  - So that the next person reading the guide / README / `--help` does not hit a stale version
806
806
 
807
807
  **AC:**
808
- - [ ] Update each affected doc file listed below; **English line and Chinese line on separate lines**, never inline
808
+ - [ ] Update each affected doc file listed below; each rendered page is single-language for its locale
809
809
  - [ ] `roll <cmd> --help` output reflects new flags / commands / status semantics (paste verified output)
810
810
  - [ ] README index links to any new guide pages
811
811
  - [ ] Error-message changes are mirrored in troubleshooting / FAQ sections
812
812
  - [ ] Verified: no doc page still describes the pre-Phase behavior
813
+ - [ ] Locale resources/catalog entries stay consistent across affected `en` and `zh` surfaces
813
814
 
814
815
  **Files:**
815
816
  - `guide/en/{topic}.md`
@@ -875,7 +876,7 @@ emits no quality score; the agent just delivers the split + specs and stops.
875
876
  A design has **no executable pass/fail test** — correctness is judgment. So it is
876
877
  the canonical **3-stage loop**, and naming the stages keeps the roles honest:
877
878
 
878
- - **Planner / Builder = this design session.** Besides the split + specs, it must
879
+ - **Designer = this design session.** Besides the split + specs, it must
879
880
  emit **explicit evaluation criteria for the design itself** — the prose
880
881
  equivalent of a test contract: what would make this design wrong or incomplete
881
882
  (e.g. "every Bounded Context boundary is justified", "the worked sample covers
@@ -886,7 +887,8 @@ the canonical **3-stage loop**, and naming the stages keeps the roles honest:
886
887
  criteria, and **must not be seeded with the designer's reasoning** (roll-peer's
887
888
  Independent Judgment Rule already enforces exactly this — see the two
888
889
  `[peer]` checkpoints in the Workflow: Direction Review and Plan Review). A
889
- fresh same-vendor session is the minimum; a different agent+model is encouraged.
890
+ fresh same-vendor session is the minimum; a different agent+model is a ranking
891
+ preference unless the owner explicitly requested strict diversity.
890
892
 
891
893
  Until the runner's FIX-344 stage lands, the isolated Evaluator is the
892
894
  `$roll-peer` Plan Review checkpoint, not an automated score — but the criteria
@@ -975,19 +977,21 @@ guide notices.
975
977
  - 安全 / 隔离基础设施(沙箱配置、权限矩阵内部调整)
976
978
  - 测试基础设施 / fixture 数据更新
977
979
 
978
- **Checklist for the doc-refresh story (中英双语必需):**
980
+ **Checklist for the doc-refresh story (locale consistency required):**
979
981
  - [ ] `guide/en/<topic>.md` — English guide updated
980
982
  - [ ] `guide/zh/<topic>.md` — Chinese guide updated
981
983
  - [ ] `README.md` index links to any new doc page
982
984
  - [ ] `--help` output snapshot matches new flags / commands / status semantics
983
985
  - [ ] Error-message strings reflected in troubleshooting / FAQ
984
- - [ ] **Bilingual rule**: English and Chinese on **separate lines**, never inline
985
- (遵循 project CLAUDE.md Bilingual Output Convention)
986
+ - [ ] **Language surface rule**: each rendered page/output uses exactly one
987
+ locale; multilingual source resources stay behind `guide/en`, `guide/zh`,
988
+ or catalog boundaries
986
989
 
987
990
  **How to wire the doc-refresh story:**
988
991
  1. Place it **last** in the batch
989
992
  2. `depends-on:` lists **every** preceding user-facing US in the batch
990
- 3. Title "Phase N.M 用户文档刷新(中英双轨)" 模板(见 [Story Format](#story-format) 中的模板)
993
+ 3. Use the "Phase N.M documentation refresh" title template from
994
+ [Story Format](#story-format)
991
995
  4. Cite a worked example in its Dependencies note — current best reference is
992
996
  `features/authoring/slide-deck-generator.md` US-DECK-015 (roll slides Phase 1.5)
993
997
 
@@ -57,4 +57,4 @@ modes.
57
57
 
58
58
  ## Role in v4 execution profiles
59
59
 
60
- **roll-fix is the Builder capability for hot-fix scope** (a single issue), normally under the `standard` execution profile — the same TCR/test/attest flow as roll-build, with no Planner or Evaluator. A fix that turns out user-visible or evidence-risky is selected into `verified`; one that turns out cross-module or ambiguous into `planned`. (Roles: Supervisor Agent / Planner / Builder / Evaluator; never Prime/Watchman/Dispatcher/Governor.)
60
+ **roll-fix is the Builder capability for hot-fix scope** (a single issue), normally under the `standard` execution profile — the same TCR/test/attest flow as roll-build, with no Designer or Evaluator. A fix that turns out user-visible or evidence-risky is selected into `verified`; one that turns out cross-module or ambiguous into `designed`. Roles: Supervisor / Designer / Builder / Evaluator.
@@ -20,7 +20,7 @@ Use when:
20
20
 
21
21
  **Workflow:**
22
22
  1. Read .roll/backlog.md index → Find FIX/BUG row → Follow link to `.roll/features/<epic>/<story>/spec.md`
23
- 2. **Read the Evaluation contract (US-SKILL-030)** if the spec contains an `**Evaluation contract:**` block. Read `expected_evidence` and `scorer_focus` before writing code; use them to guide test design and evidence collection. Map each evidence item to a planned change and map delivered evidence back to the contract in the ac-map; note any deviation if an item turns out to be N/A for a fix.
23
+ 2. **Read the Evaluation contract (US-SKILL-030)** if the spec contains an `**Evaluation contract:**` block. Read `expected_evidence` and `scorer_focus` before writing code; use them to guide test design and evidence collection. Map each evidence item to a candidate change and map delivered evidence back to the contract in the ac-map; note any deviation if an item turns out to be N/A for a fix.
24
24
  3. Single Action (no splitting)
25
25
  4. Execute via TCR workflow
26
26
  5. Write back: update .roll/backlog.md status column + update FIX section in Feature file
@@ -526,9 +526,10 @@ Review Score (1..10 + verdict + rationale), recorded with `scoredBy` and the
526
526
  fresh-session id so independence is verifiable.
527
527
 
528
528
  Independence is about session/context, not vendor: a fresh same-vendor session
529
- is the minimum acceptable; a different agent+model+session (non-sub-agent) is
530
- encouraged (absolute heterogeneity). A score sharing the builder's session
531
- (including any sub-agent of it) is rejected as a self-score.
529
+ is the minimum acceptable; a different agent+model+session (non-sub-agent) is a
530
+ ranking preference unless the owner explicitly requested strict diversity. A
531
+ score sharing the builder's session (including any sub-agent of it) is rejected
532
+ as a self-score.
532
533
 
533
534
  Score guidance the Reviewer applies (integer 1..10):
534
535
  - **9..10** — clean root-cause fix; regression test added; TCR cycle smooth.
@@ -556,12 +557,14 @@ GAPS: <gap one; gap two; ...>
556
557
  ```
557
558
 
558
559
  On a RESIZE signal (low score) the loop runs `roll loop review-resize FIX-XXX`:
559
- `$roll-design` mints sub-stories from the gaps, ≥2 **heterogeneous** reviewers
560
- gate the split by consensus (all agree auto-land via `roll loop self-downgrade`,
561
- parking the FIX at 🚫 Hold + appending sub-stories; any objection → pause +
562
- ALERT, backlog unchanged), with the chain-depth cap (US-AGENT-009) stopping
563
- runaway splits. The human is on the loop (alerted only on consensus failure or
564
- the cap), not in it. Never emit RESIZE for a pure quality problem.
560
+ `$roll-design` mints sub-stories from the gaps, and ≥2 fresh-session reviewers
561
+ gate the split by consensus. Prefer diverse agents/models when available, but do
562
+ not block solely on matching brand/provider unless the owner requested strict
563
+ diversity. When all agree, auto-land via `roll loop self-downgrade`, parking the
564
+ FIX at 🚫 Hold + appending sub-stories; any objection pause + ALERT, backlog
565
+ unchanged. The chain-depth cap (US-AGENT-009) stops runaway splits. The human is
566
+ on the loop (alerted only on consensus failure or the cap), not in it. Never emit
567
+ RESIZE for a pure quality problem.
565
568
 
566
569
  ## Rubric
567
570
 
@@ -48,4 +48,4 @@ Load when the user explicitly asks for peer review, cross-agent negotiation, /pe
48
48
 
49
49
  ## Role in v4 execution profiles
50
50
 
51
- Cross-agent peer review is an **Evaluator capability**: an independent fresh-session reviewer (never the Builder's session) scores the delivery. The Evaluator's judgment is binding for story satisfaction; peer negotiation is the mechanism. In `verified`/`planned` profiles this feeds the `eval-report.md`. (Roles: Supervisor Agent / Planner / Builder / Evaluator; never Prime/Watchman/Dispatcher/Governor.)
51
+ Cross-agent peer review is an **Evaluator capability**: an independent fresh-session reviewer (never the Builder's session) scores the delivery. The Evaluator's judgment is binding for story satisfaction; peer negotiation is the mechanism. In `verified`/`designed` profiles this feeds the `eval-report.md`. Fresh-session independence is required; agent/model diversity is a preference or explicit owner-requested mode, not a default brand rejection. Roles: Supervisor / Designer / Builder / Evaluator.
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: roll-prime
3
+ license: MIT
4
+ allowed-tools: "Read, Glob, Grep, Bash(git:*), Bash(roll:*), Bash(node:*), Bash(tmux:*), Bash(tail:*), Bash(rg:*), Skill, Agent"
5
+ description: "Load when coordinating a Roll project as Supervisor (supervise role): reconcile backlog truth, advise the owner, dispatch the Delta Team, watch cycles read-only, diagnose structural failures, and reconcile .roll meta — not when implementing a Story as Builder."
6
+ ---
7
+ # Roll Supervisor
8
+
9
+ Supervisor is the project-level leader of the Roll harness: set direction, keep the
10
+ team aligned, watch the field, and say **"Agents, roll out"** — dispatch the Delta
11
+ Team (Designer / Builder / Evaluator) and Peers to execute Stories. You
12
+ coordinate with the owner; you are not the default Builder.
13
+
14
+ This hub keeps the role boundary, hard gates, and runbook skeleton in context.
15
+ Load the full supervisor contract only when you are actively coordinating.
16
+
17
+ ## Load
18
+
19
+ Load when coordinating a Roll project as **Supervisor** (`supervise` role) in guided
20
+ mode: clearing backlog scope, watching loop cycles, diagnosing failures,
21
+ salvaging gates, or reconciling `.roll` meta — **not** when implementing a
22
+ Story as Builder (`roll-build` / `roll-fix`).
23
+
24
+ ## Operating Modes
25
+
26
+ - **Guided (default for Supervisor)**: owner + Supervisor collaborate. Read
27
+ `roll supervisor next/why --json`, reconcile truth, then dispatch with
28
+ `roll loop go`. Watch read-only; confirm before mutating project state.
29
+ - **Autonomous**: `roll loop on` runs the scheduler. Supervisor still advises and
30
+ escalates; do not fight the scheduler without `roll loop pause` and owner
31
+ alignment.
32
+ - Pair with **`roll-loop`** for scheduler/loop mechanics; Supervisor owns
33
+ coordination discipline, not runner internals.
34
+
35
+ ## When Not to Use
36
+
37
+ - Implementing a US/FIX/REFACTOR card as Builder → `roll-build` / `roll-fix`.
38
+ - One-shot code review on a diff → `roll-peer` / `roll-review-pr`.
39
+ - Designing or splitting new stories from vague input → `roll-design`.
40
+
41
+ ## Read On Demand
42
+
43
+ - [Supervisor prompt](references/supervisor-prompt.md) — full Supervisor operating
44
+ contract (US-V4-021 aligned).
45
+ - [Explorer annex](references/explorer-annex.md) — read-only sub-session for
46
+ deep failure diagnosis.
47
+ - Project overlay: `.roll/prime.local.md` when present (roll-meta).
48
+
49
+ ## Workflow Skeleton
50
+
51
+ 1. Lock explicit backlog scope (US + FIX + REFACTOR unless owner narrows).
52
+ 2. Reconcile truth (`supervisor next/why`, git main + `.roll`, events, PRs).
53
+ 3. Select next card; explain cast (Designer / Builder / Evaluator / Peers).
54
+ 4. Clean gate → `roll loop go --cards <id> --max-cycles 1`.
55
+ 5. Watch cycles read-only (events + worktree; 0 TCR ≠ auto-fail if still moving).
56
+ 6. Stop on structural failure; diagnose before blind retry.
57
+ 7. Salvage deliberately (`repair-evidence`, recover, independent evaluator).
58
+ 8. Reconcile `.roll` meta after product truth (PR/CI/main).
59
+
60
+ ## Hard Gates
61
+
62
+ - Facts from `roll supervisor --json` and events — not Builder self-report.
63
+ - Never bypass TCR, peer, evaluator, attest, PR, CI, merge, or release gates.
64
+ - Never `git push` / `gh pr create` as Supervisor during a Builder cycle.
65
+ - Persistent policy changes need owner confirmation.
66
+ - Pause live workers before hand-editing `.roll/backlog.md` or specs.
67
+
68
+ ## Gotchas
69
+
70
+ - Do not load this skill for Builder implementation; mixing Supervisor coordination and
71
+ Builder TCR on the same card blurs gates and pollutes worktrees.
72
+ - `roll supervisor live` is a snapshot board, not Supervisor itself; prefer
73
+ `supervisor next/why --json` plus `roll loop watch` for ongoing cycles.
74
+ - When CLI JSON and narrative disagree, trust structured supervisor output and
75
+ `events.ndjson`, then explain the delta to the owner.
76
+ - Spawn explorer sub-sessions for deep diagnosis; do not turn Supervisor into a
77
+ 200-command polling loop without decisions.
@@ -0,0 +1,39 @@
1
+ # Supervisor Explorer Annex — Read-Only Deep Diagnosis
2
+
3
+ Use when Supervisor needs evidence-heavy investigation without polluting the main
4
+ coordination session.
5
+
6
+ ## When to spawn
7
+
8
+ - Repeated or structural cycle failure (3+ angles: events, worktree, agent log).
9
+ - Gate floor mismatches (attest produced but gate says missing structured content).
10
+ - `handoff_without_tcr`, leaked commits, rescue branches, outcome vs terminal drift.
11
+
12
+ ## Explorer rules
13
+
14
+ - **Read-only.** No edits to product repo, Builder worktrees, or `.roll` meta.
15
+ - **No dispatch.** Do not `loop go`, `recover`, or `repair-evidence`.
16
+ - **Evidence only.** Output: conclusion + file:line + event refs + recommended
17
+ Supervisor action (recover / salvage / FIX card / owner).
18
+
19
+ ## Suggested commands
20
+
21
+ ```bash
22
+ rg -n "<cycle-id>" .roll/loop/events.ndjson | tail -200
23
+ git -C .roll/loop/worktrees/cycle-<id> status --short
24
+ git -C .roll/loop/worktrees/cycle-<id> diff --stat
25
+ tail -n 80 .roll/loop/cycle-logs/<cycle-id>.agent.log
26
+ nl -ba packages/... | sed -n '...' # only when classifying harness bugs
27
+ ```
28
+
29
+ ## Handback to Supervisor
30
+
31
+ Return a short brief:
32
+
33
+ 1. **Verdict** (one line)
34
+ 2. **Root cause class** (runner / agent / toolchain / card scope / gate contract)
35
+ 3. **Artifacts** (paths + line refs)
36
+ 4. **Recommended next move** (exact `roll` command or backlog card)
37
+
38
+ Supervisor synthesizes for the owner; explorer does not speak to the owner directly
39
+ unless Supervisor delegates.