@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,855 @@
1
+ # Roll FAQ
2
+
3
+ Honest answers to the questions people actually ask, organized by where you are
4
+ in your journey with Roll:
5
+
6
+ - **[A. Getting Started](#a-getting-started)** — before/while you try Roll
7
+ - **[B. How Roll Compares](#b-how-roll-compares)** — Roll vs. related projects
8
+ - **[C. Operating Roll](#c-operating-roll)** — what to do when something gets stuck
9
+
10
+ ---
11
+
12
+ ## A. Getting Started
13
+
14
+ > **Roll has two surfaces.** Keep them straight as you read this FAQ:
15
+ >
16
+ > - **CLI commands** — run in your terminal: `roll init`, `roll loop on`,
17
+ > `roll status`, `roll loop cycle`, etc. These manage state, scheduling, and
18
+ > observability. They do not write code themselves.
19
+ > - **Skills** — invoked inside your AI agent (Claude Code, Cursor, Codex,
20
+ > Pi, etc.): `$roll-build`, `$roll-design`, `$roll-fix`, `$roll-onboard`,
21
+ > etc. In Claude Code you type them as `/roll-build`; the `$` form is the
22
+ > tool-agnostic way we write them in docs. These are where the agent
23
+ > actually does work.
24
+ >
25
+ > When you see `roll loop on` in this FAQ, that's a shell command. When you
26
+ > see `$roll-build US-001`, that's a skill you invoke from your agent's
27
+ > prompt.
28
+
29
+ ### A1. Will Roll modify my code or break my main branch?
30
+
31
+ **Short answer:** Roll has real guardrails, but the safety story differs
32
+ between the two modes — be precise about which you're running.
33
+
34
+ **The universal guarantee — TCR.** Every commit runs your tests. If tests
35
+ fail, the commit is reverted automatically. No broken-test commit can land,
36
+ in either mode. This is the foundation everything else builds on.
37
+
38
+ **Manual mode (`$roll-build`, `$roll-fix`, etc., trunk-based):**
39
+
40
+ - TCR micro-commits as the agent works
41
+ - **Phase 6** runs your full CI locally before any push
42
+ - **Phase 7** runs an agent-driven code review of the diff before push
43
+ - **Phase 8** pushes to `main` directly — you're sitting in front of the
44
+ agent watching this happen and can stop it at any point
45
+ - Your remote CI is the last net: if it goes red after push, you see it
46
+ immediately and fix or revert
47
+
48
+ **Loop mode (`roll loop on`):**
49
+
50
+ - Builds on a branch (`loop/cycle-${CYCLE_ID}`) in a worktree
51
+ - Opens a PR with `gh pr create --base main`
52
+ - Calls `gh pr merge --auto --squash --delete-branch` — the PR auto-merges
53
+ **only when your required CI checks pass**. CI is the gate, not human
54
+ review (by default)
55
+ - To require human review before merge, configure required reviewers on
56
+ `main` in GitHub branch protection — `--auto` will then wait on you too
57
+
58
+ **Either way:** everything is in git history. `git revert` and `git reset`
59
+ work normally if you need to undo something.
60
+
61
+ **Try it manually first:** Open your AI agent (Claude Code, Cursor, Pi,
62
+ etc.) in your project and invoke the build skill on a single story:
63
+
64
+ ```text
65
+ $roll-build US-001 # in Claude Code: /roll-build US-001
66
+ ```
67
+
68
+ Watch design → TCR → local CI → review → push happen in front of you. See
69
+ exactly what Roll touches before you trust it with the autonomous loop.
70
+
71
+ ---
72
+
73
+ ### A2. I have an existing project — will Roll work, or will it pollute my code?
74
+
75
+ **Short answer:** Yes, Roll has a dedicated onboarding flow for legacy code,
76
+ and it only writes to its own directory.
77
+
78
+ **Details:** `roll init` in an existing repo detects existing code and routes
79
+ you to `$roll-onboard`. That skill reads your project, asks 9 questions across
80
+ cognition / scope / privacy, and writes `.roll/onboard-plan.yaml` as a contract
81
+ for `roll init --apply` to execute after review. `roll init --apply` prints the
82
+ planned operation checkpoint and waits for confirmation before writing.
83
+ Non-interactive automation must use `roll init --apply --auto`.
84
+
85
+ What Roll adds to your repo:
86
+
87
+ - `.roll/` — backlog, feature specs, config (commit this)
88
+ - `.claude/skills/` or equivalent — symlinks to Roll skills (commit this)
89
+ - A few entries in `.gitignore`
90
+
91
+ What Roll does **not** touch: your source code, unless an agent is executing a
92
+ story you wrote.
93
+
94
+ ---
95
+
96
+ ### A3. I don't want autonomous runs. Can I drive Roll manually, one story at a time?
97
+
98
+ **Short answer:** Yes. The loop is opt-in.
99
+
100
+ **Details:** Without `roll loop on`, Roll is a CLI + skill library. You write a
101
+ story in `.roll/backlog.md`, then invoke a skill from inside your AI agent:
102
+
103
+ ```text
104
+ $roll-build US-001 # execute a single user story end-to-end
105
+ $roll-fix FIX-002 # execute a single bugfix story
106
+ ```
107
+
108
+ (In Claude Code these are typed as `/roll-build US-001` and `/roll-fix FIX-002`.)
109
+
110
+ Each invocation runs design → TCR → local CI gate → agent self-review → push
111
+ to `main` in your foreground; you see every step and can stop at any point.
112
+ When the workflow earns your trust, run `roll loop on` in your terminal to
113
+ let it pick stories itself (loop mode goes through a PR instead of pushing
114
+ to `main` directly — see A1).
115
+
116
+ ---
117
+
118
+ ### A4. What does Roll change on my system, and how do I uninstall cleanly?
119
+
120
+ **Short answer:** Three places, and `./uninstall.sh` reverses all of them.
121
+
122
+ **Details:**
123
+
124
+ - **Global:** `~/.roll/` (your config), `~/.shared/roll/` (loop
125
+ state, `runs.jsonl`). Per-project agent routing lives in `.roll/agents.yaml`.
126
+ The npm binary lives where your global npm packages do.
127
+ - **Per project:** `.roll/`, plus symlinks under `.claude/skills/` (or
128
+ equivalent for other agents).
129
+ - **Per project, only with `roll loop on`:** a `launchd` plist on macOS that
130
+ triggers cycles.
131
+
132
+ To remove everything:
133
+
134
+ ```bash
135
+ npm uninstall -g @seanyao/roll
136
+ ~/.roll/uninstall.sh --dry-run # preview removals
137
+ ~/.roll/uninstall.sh # actually remove
138
+ ```
139
+
140
+ ---
141
+
142
+ ### A4b. I don't have npm or Node.js. Can I still install Roll?
143
+
144
+ **Short answer:** Yes. The curl install is self-contained and requires only
145
+ bash, curl, and tar — all preinstalled on macOS and Linux.
146
+
147
+ **Details:**
148
+
149
+ ```bash
150
+ curl -fsSL https://seanyao.github.io/roll/install | bash
151
+ ```
152
+
153
+ No Node.js, no npm, no package manager needed. The script downloads a tarball,
154
+ extracts it to `~/.local/share/roll/`, and symlinks `~/.local/bin/roll` into
155
+ your PATH. Updates and uninstalls work the same way — `roll update` re-downloads
156
+ the latest tarball; `rm -rf ~/.local/share/roll ~/.local/bin/roll` removes
157
+ everything.
158
+
159
+ To pin a specific version (recommended for production):
160
+
161
+ ```bash
162
+ curl -fsSL https://seanyao.github.io/roll/install | ROLL_VERSION=v3.610.1 bash
163
+ ```
164
+
165
+ ---
166
+
167
+ ### A5. How much does a Roll run cost? Can I see token usage?
168
+
169
+ **Short answer:** Yes — the dashboard shows model + cost per cycle at public
170
+ pricing.
171
+
172
+ **Details:** Since `v2026.521.1`, `roll loop status` shows the model used and
173
+ a cost number computed at public per-token pricing.
174
+ This is a comparable number, not your bill — your real cost depends on your
175
+ subscription tier (Claude Pro, etc.).
176
+
177
+ Typical ranges per story on Claude Opus 4.x: **$0.5 – $3**, depending on story
178
+ complexity and how many TCR iterations the agent burned. Switching to Kimi /
179
+ DeepSeek drops this 5–10× at the cost of slower convergence.
180
+
181
+ **Non-Claude agents:** token/cost capture is per-agent. As of the current
182
+ release, cycles run on **Claude, pi (DeepSeek), OpenAI (codex), Gemini, Kimi**
183
+ show real token counts and cost. Agents without a usage plugin yet —
184
+ notably **OpenCode** — still show `—/—` in the token/cost columns. Support for a
185
+ new agent does not appear automatically; it ships as a small per-agent plugin
186
+ (see `lib/agent_usage/README.md`).
187
+
188
+ **Try it:**
189
+
190
+ ```bash
191
+ roll loop status # scheduler snapshot with cost column
192
+ roll loop status --days 7 # last 7 days of cycles with cost
193
+ ```
194
+
195
+ ---
196
+
197
+ ### A6. Do I need to understand DDD / TCR / prompt engineering?
198
+
199
+ **Short answer:** No, but knowing how to write a good user story helps.
200
+
201
+ **Details:** Roll's methodology lives inside the skills, not in your head.
202
+ `$roll-design` walks you through DDD-style decomposition; `$roll-build` runs
203
+ TCR for you; the prompt engineering is encapsulated in the skill files (read
204
+ or tweak them if you're curious).
205
+
206
+ The one thing that matters in *your* head: **how clearly you describe what you
207
+ want**. INVEST-shape stories (Independent, Negotiable, Valuable, Estimable,
208
+ Small, Testable) work much better than "build me a feature." `$roll-design`
209
+ helps you get there from a fuzzy idea.
210
+
211
+ ---
212
+
213
+ ### A7. How detailed should my user stories be? Will Roll cope with a bad one?
214
+
215
+ **Short answer:** Detailed enough that *you* could code it. Fuzzy stories get
216
+ caught and refined before `$roll-build` touches code.
217
+
218
+ **Details:** A workable story has a value statement (`As X, I want Y, so that
219
+ Z`), 2–5 acceptance criteria, and any non-obvious constraints. Don't dictate
220
+ implementation — Roll figures that out.
221
+
222
+ - **Too vague** → `$roll-build`'s `$roll-.clarify` phase surfaces the gaps and
223
+ stops, asking for input.
224
+ - **Too complex** → the design phase suggests splitting into smaller stories.
225
+ - **Vague-but-runnable** → the agent makes best-effort choices. Often fine for
226
+ prototypes, riskier for production.
227
+
228
+ **Try it:** Run `$roll-design "add user logout"` and watch it expand a one-line
229
+ idea into an INVEST-shaped story with ACs.
230
+
231
+ ---
232
+
233
+ ### A8. What kind of projects is Roll a good fit for? What isn't?
234
+
235
+ **Good fit:**
236
+
237
+ - Has a real test suite (TCR depends on it)
238
+ - Uses git and a PR-based workflow
239
+ - Has CI (GitHub Actions or equivalent)
240
+ - Has work you can describe as 1–3 sentence stories
241
+ - TypeScript / Python / Go / Bash codebases (best-supported today)
242
+
243
+ **Bad fit:**
244
+
245
+ - One-off scripts or throwaway prototypes — overhead > value
246
+ - Highly specialized domains (low-level OS, embedded, formal verification)
247
+ where AI agents underperform
248
+
249
+ **Edge case — existing codebase with no tests:** This is a bootstrap problem,
250
+ not a disqualifier. TCR needs *something* to gate on, so the loop can't run
251
+ on a zero-test repo on day one — but recovering this kind of codebase is
252
+ exactly what Roll is built to drive. Workflow: run `$roll-onboard` to
253
+ reverse-engineer the existing code into a backlog, write
254
+ **characterization-test stories first** (pin current behavior with tests
255
+ before changing anything), then refactor under TCR once you have a net.
256
+ The first few stories are the bootstrap; everything after that runs like
257
+ any other Roll project.
258
+
259
+ ---
260
+
261
+ ### A9. Can I use Roll without CI or without GitHub Actions?
262
+
263
+ **Short answer:** Yes, but you lose the CI gate. TCR and PR still work locally.
264
+
265
+ **Details:** `roll status ci --wait` looks for GitHub Actions on the current commit.
266
+ If no CI is configured, Roll degrades gracefully: TCR remains the inner gate
267
+ (tests must pass for a commit to stick), PRs are still created, but the loop
268
+ won't wait on remote CI before marking a story done.
269
+
270
+ For pure-local use (no GitHub), Roll still works as a methodology + skill
271
+ layer — you just lose the "wait for green before next story" behavior.
272
+
273
+ ---
274
+
275
+ ### A10. Solo or team? How does multi-developer collaboration work?
276
+
277
+ **Short answer:** Built for solo and pair work first; team usage is possible
278
+ but pattern-by-pattern.
279
+
280
+ **Details:**
281
+
282
+ - **Solo:** the default. `.roll/backlog.md` is your personal queue.
283
+ - **Pair:** commit `.roll/`; your teammate's Roll reads the same backlog. Locks
284
+ are per-machine, so two people running loop in parallel won't collide on
285
+ state but may race on the same story.
286
+ - **Team:** treat `.roll/backlog.md` like any source file — coordinate via
287
+ PRs. `-peer` skill exists for cross-agent review (one agent reviews another's
288
+ PR). Multi-developer loop coordination (who picks what next) is still a
289
+ rough edge.
290
+
291
+ Realistic recommendation: in a team, run loop on your own branch/fork, merge
292
+ PRs upstream like any human contributor.
293
+
294
+ ---
295
+
296
+ ### A11. After a price update, do historical cycle costs change?
297
+
298
+ **Short answer:** No. Each cycle's cost is frozen at completion time.
299
+
300
+ **Details:** When a loop cycle finishes, Roll writes `cost_list_usd` (the
301
+ cost at that moment's prices) and `prices_version` (which snapshot was used)
302
+ into the usage event. The dashboard reads the frozen value first. Vendor price
303
+ changes, `roll config prices refresh`, and Roll upgrades never rewrite historical
304
+ costs.
305
+
306
+ Cycles from before this feature shipped (no `cost_list_usd` field) fall back
307
+ to computing with the *current* snapshot and show a dim `[legacy]` marker —
308
+ so you know those numbers might drift when prices change.
309
+
310
+ **Try it:**
311
+
312
+ ```bash
313
+ roll config prices show # see current snapshot
314
+ roll config prices refresh # fetch latest pricing, diff, snapshot if changed
315
+ roll loop status --days 7 # historical cycles use frozen costs
316
+ ```
317
+
318
+ ---
319
+
320
+ ### A12. How do I watch the loop from my phone while I'm away?
321
+
322
+ **Short answer:** Configure `roll_meta_dir`, then paste
323
+ `.roll/prompts/remote-watch.md` into Claude Code on your phone or browser.
324
+
325
+ **Details:** Once `roll_meta_dir` is set in `~/.roll/config.yaml`, your machine
326
+ pushes a `status/loop.md` snapshot to the roll-meta repo after every cycle
327
+ (≤35min fresh, idle cycles included as a heartbeat). The remote-watch prompt
328
+ reads that snapshot plus the GitHub API and reports loop health, backlog
329
+ progress, Dream results, and CI state — read-only, no local `roll` needed. See
330
+ [Remote Monitoring](loop.md#remote-monitoring) for setup and troubleshooting.
331
+
332
+ ### A13. What's that coloured summary block in the `.command` window?
333
+
334
+ **Short answer:** It's the cycle exit summary — a recap of what the cycle just
335
+ did, printed right before `press enter to close`.
336
+
337
+ **Details:** When a cycle ends, the `.command` window renders a
338
+ `─── Cycle <id> Summary ───` block covering five signals: the TerminalOutcome
339
+ result, CI status (`green` / `red` / `heal-attempting`), todo remaining, the
340
+ top phases by time, and any failure / alert highlights (`✗` red for failures,
341
+ `⚠` yellow for warnings). A fully green cycle prints in the default colour.
342
+ Set `NO_COLOR=1` to disable colour. The `press enter to close` prompt is
343
+ unchanged. See
344
+ [Cycle exit summary](loop.md#cycle-exit-summary) for the full breakdown.
345
+
346
+ ---
347
+
348
+ ## B. How Roll Compares
349
+
350
+ ### B1. vs. Claude Code's built-in `/loop`, skills, and tasks
351
+
352
+ **What Claude Code already has:** Skills (custom commands), tasks (in-session
353
+ todos), plan mode (review-before-execute), `/loop` (timer that fires a prompt
354
+ on an interval).
355
+
356
+ **Where Roll differs:**
357
+
358
+ - **Persistent backlog in git.** Roll's `.roll/backlog.md` survives sessions,
359
+ restarts, and model swaps. Claude Code tasks live for one session.
360
+ - **Delivery pipeline, not a scheduler.** `/loop` re-fires a prompt every N
361
+ minutes. Roll's loop selects the next ready story, runs DDD → TCR → PR → CI,
362
+ waits for green, then moves on.
363
+ - **TCR as a hard gate.** Claude Code's skills are advisory; Roll enforces
364
+ `test && commit || revert` at commit time.
365
+ - **Cross-agent.** The same backlog and skills run on Codex, Kimi, DeepSeek,
366
+ Pi, OpenCode. `/loop` only knows Claude.
367
+
368
+ **Who picks what:**
369
+
370
+ - Quick interactive sessions, ad-hoc work → Claude Code alone is plenty.
371
+ - Long-running projects, unattended progress, hard CI gates → add Roll.
372
+
373
+ Roll's `roll-*` skills *are* Claude Code skills. Roll layers on top of Claude
374
+ Code; it doesn't replace it.
375
+
376
+ ---
377
+
378
+ ### B2. vs. [superpowers](https://github.com/obra/superpowers) (obra)
379
+
380
+ **What superpowers does well:** A mature 7-stage methodology (brainstorm →
381
+ worktree → plan → execute → test → review → finish), broad agent support
382
+ (Claude Code, Cursor, Codex, Antigravity, Copilot, Factory, OpenCode), strong
383
+ RED-GREEN-REFACTOR enforcement, subagent-driven development. Roll's README
384
+ already acknowledges it — several Roll workflow patterns were inspired by it.
385
+
386
+ **Where Roll differs:**
387
+
388
+ - **Persistent backlog + autonomous loop.** Superpowers is session-driven —
389
+ you initiate each cycle. Roll has `roll loop on` for unattended runs where
390
+ the next story is picked automatically.
391
+ - **CI as a terminal gate.** Roll waits for GitHub Actions green before
392
+ marking a story Done; superpowers leaves CI integration to you.
393
+ - **PR-centric output.** Every Roll story ends in a PR linked to your CI.
394
+ Superpowers is more flexible about output shape.
395
+
396
+ **Who picks what:**
397
+
398
+ - You want to drive each session yourself with a strong methodology behind
399
+ you → **superpowers**.
400
+ - You want unattended forward progress on a backlog with hard CI gates →
401
+ **Roll**.
402
+
403
+ You can also run Roll alongside superpowers — they overlap but don't conflict.
404
+
405
+ ---
406
+
407
+ ### B3. vs. [oh-my-codex](https://github.com/Yeachan-Heo/oh-my-codex) (Yeachan Heo)
408
+
409
+ **What oh-my-codex does well:** A sophisticated harness for Codex CLI — tmux
410
+ HUD, hooks, agent teams (`$ralplan`, `$ralph`, `$ultragoal`), persistent state
411
+ under `.omx/`, durable multi-goal execution via ledger checkpoints. 29k stars,
412
+ very active.
413
+
414
+ **Where Roll differs:**
415
+
416
+ - **Not Codex-only.** Roll works with Claude / Codex / Kimi / DeepSeek / Pi /
417
+ OpenCode. oh-my-codex is intentionally Codex CLI focused.
418
+ - **TCR as a hard gate.** oh-my-codex recommends clarification → planning →
419
+ execution but doesn't enforce TDD/TCR at the commit level.
420
+ - **PR + CI as terminal output.** Roll's loop ends each story at "PR merged
421
+ when CI green." oh-my-codex ends at "agent says goal done."
422
+ - **Methodology shape.** oh-my-codex emphasizes durable multi-goal execution
423
+ and parallel teams. Roll emphasizes single-story atomicity (one INVEST
424
+ story → one PR → green CI → next).
425
+
426
+ **Who picks what:**
427
+
428
+ - Heavy Codex CLI user; want hooks / tmux HUD / multi-agent teams →
429
+ **oh-my-codex**.
430
+ - Want cross-agent portability and PR/CI as the success contract → **Roll**.
431
+
432
+ ---
433
+
434
+ ## C. Operating Roll
435
+
436
+ ### C1. Loop is stuck — a story stays "In Progress" and Done is never written
437
+
438
+ **Symptoms:** `roll loop status` shows `running`, a story sits at
439
+ `🔨 In Progress` in BACKLOG for longer than one cycle, or the agent ran
440
+ successfully (TCR commits exist) but the story isn't marked `✅ Done`.
441
+
442
+ **Why this happens:** Loop marks a story `🔨 In Progress` before invoking the
443
+ build skill, and only writes `✅ Done` after two hard gates pass: (1) TCR
444
+ commit count > 0, (2) CI green via `roll status ci --wait`. If the agent crashes mid-
445
+ cycle, the LOCK file goes stale, or CI fails, the story stays as-is — by
446
+ design, to avoid false-positive completions.
447
+
448
+ **Under the hood:** Each cycle acquires a per-project LOCK
449
+ (`~/.shared/roll/loop/.LOCK-<slug>`). A dead PID is auto-cleaned next cycle.
450
+ A live but hung process (e.g. stuck tmux) keeps the LOCK and blocks new
451
+ cycles.
452
+
453
+ **Fix:**
454
+
455
+ ```bash
456
+ roll loop status # check LOCK + PID
457
+ roll loop watch # read-only live view; Ctrl-C stops only the view
458
+ roll loop runs # last cycle outcomes and alerts
459
+ roll loop alert # any CI or TCR alerts?
460
+ roll loop reset # clear state + LOCK if truly stuck
461
+ roll loop now # trigger a fresh cycle
462
+ # If code is done and tests pass but Phase 11 didn't complete:
463
+ $roll-build US-XXX # finish the story manually
464
+ ```
465
+
466
+ ---
467
+
468
+ ### C2. PR has merge conflicts or rebase fails
469
+
470
+ **Symptoms:** `gh pr checks` shows "This branch has conflicts" or
471
+ `roll loop runs` reports a rebase-failure alert.
472
+
473
+ **Why this happens:** While the loop built in a worktree, another commit
474
+ landed on `main` that conflicts with the PR. The loop's PR inbox tries to
475
+ rebase; if both sides touched the same lines, rebase fails.
476
+
477
+ **Under the hood:** A rebase circuit breaker tracks attempts per PR — after 3
478
+ failures within 24 hours, further attempts are blocked and an ALERT is
479
+ written. This prevents infinite rebase loops on structural conflicts.
480
+
481
+ **Fix:**
482
+
483
+ ```bash
484
+ gh pr view <number> # see which files conflict
485
+ git fetch origin main
486
+ git checkout <pr-branch>
487
+ git rebase origin/main # resolve manually
488
+ git push --force-with-lease
489
+ # CI re-runs; PR auto-merges when green (if enabled)
490
+ ```
491
+
492
+ ---
493
+
494
+ ### C3. How do I see what loop did and how much it cost?
495
+
496
+ **Symptoms:** Loop ran while you were away; you want a quick read of what
497
+ happened and what it cost.
498
+
499
+ **Why this matters:** Roll writes structured records every cycle, but there
500
+ are multiple surfaces depending on what you need.
501
+
502
+ **Under the hood:** Each cycle appends a JSONL record to
503
+ `<project>/.roll/loop/runs.jsonl` with story ID, model, TCR commit count,
504
+ duration, outcome, and cost (public pricing). `roll status`, `roll loop cycle`, and
505
+ story-scoped attest reports read this — and the rest of the truth ledger — into
506
+ human-readable surfaces. The live watch view is read-only and combines
507
+ live activity with structured event facts; the tmux observe pane uses the same
508
+ watch entrypoint.
509
+
510
+ **The observability stack:**
511
+
512
+ | What you want | Command |
513
+ |---|---|
514
+ | Last N cycle summaries + cost | `roll loop status --days 7` |
515
+ | Total spent on one story across all cycles | `roll loop story <ID>` |
516
+ | Per-cycle JSONL records | `roll loop runs` |
517
+ | Phase breakdown for one cycle | `roll loop runs --detail <cycle_id>` |
518
+ | Snapshot dashboard with cost column | `roll loop status --days 7` |
519
+ | Watch the agent in real time | `roll loop watch` |
520
+ | Debug compact event facts | `roll loop watch --events` |
521
+ | Raw audit event JSON | `roll loop watch --raw-events` |
522
+ | Shipped / in-progress / queue / release readiness at a glance | `roll status` |
523
+ | Alerts that need attention | `roll loop alert` |
524
+ | Full cycle agent output (plain text) | `roll loop log` |
525
+ | Full agent transcript | `roll loop watch --verbose` or `roll loop log` |
526
+
527
+ `status` rolls the dashboard forward (default 3-day window). When a story took
528
+ several cycles spread over a week and you want the total — duration, tokens,
529
+ cost, every PR that came out of it — `roll loop story <ID>` reads the full
530
+ event stream (including rotated archives `.1` … `.4`) and prints a single panel.
531
+
532
+ ---
533
+
534
+ ### C6. A cycle says phase X took forever — how do I find what slowed it down?
535
+
536
+ **Symptoms:** `roll loop runs` shows `slowest=claude 96%` on a 45-minute cycle,
537
+ or `slowest=worktree_setup 40%` on one that seemed to finish quickly. You want
538
+ to know which step ate the time before deciding whether to tune anything.
539
+
540
+ **Why this matters:** Every cycle is sliced into six named phases
541
+ (`startup` / `preflight` / `worktree_setup` / `agent_invoke` / `publish_push` /
542
+ `cleanup`). The main loop no longer waits for merge (US-AUTO-044) — the
543
+ dedicated PR Loop handles that asynchronously — so the top-line duration is
544
+ now dominated by `agent_invoke` in almost every cycle.
545
+
546
+ **What to do:**
547
+
548
+ 1. Grab the cycle id from the `roll loop runs` row (or from `runs.jsonl`).
549
+ 2. Print the full breakdown with `roll loop runs --detail <cycle_id>` — phases
550
+ are sorted descending with seconds, percentage, and a bar chart.
551
+ 3. Common patterns:
552
+ - `agent_invoke` dominating → expected for a multi-file story; nothing
553
+ to tune unless you can split the story.
554
+ - PR sitting open / not merging → the dedicated PR Loop (every 5 min)
555
+ handles merge/rebase asynchronously; check the PR's CI or whether it's
556
+ gated on a missing review. This is no longer a main-loop phase.
557
+ - `worktree_setup` > 30 s → likely a slow `git fetch origin`; transient
558
+ network issue.
559
+ - `preflight` > 30 s → previous cycles left orphan worktrees; loop is
560
+ recovering them. Self-heals on next cycle.
561
+
562
+ The phase tracing data also lives in `runs.jsonl` under the `phases` key
563
+ (per-phase seconds), so you can post-process across many cycles.
564
+
565
+ ---
566
+
567
+ ### C4. Multiple projects running loop — are they interfering?
568
+
569
+ **Symptoms:** Two projects both have `roll loop on` and you suspect they're
570
+ stepping on each other.
571
+
572
+ **Why this happens:** They shouldn't. Each project gets its own LOCK file
573
+ (`~/.shared/roll/loop/.LOCK-<project-slug>`), its own `state.yaml` entries,
574
+ and its own launchd plist. The slug is `basename + md5(abs-path)`, so even
575
+ two projects with the same directory name on different paths get different
576
+ locks.
577
+
578
+ **Fix:**
579
+
580
+ ```bash
581
+ # Run in each project directory to see its scheduler + LOCK
582
+ roll loop status
583
+
584
+ # See all active locks across projects
585
+ ls ~/.shared/roll/loop/.LOCK-*
586
+
587
+ # If a stale lock from another project is blocking yours
588
+ roll loop reset
589
+ ```
590
+
591
+ ---
592
+
593
+ ### C5. When does loop auto-recover vs. need a human?
594
+
595
+ **Loop optimizes for forward progress on clear work. It pauses and tells you
596
+ when the work is ambiguous or the environment is broken — never guesses.**
597
+
598
+ **Auto-recovers (no human needed):**
599
+
600
+ - Network timeout → retries with backoff (2s, 4s, 8s, 16s)
601
+ - Role candidate unavailable (no PATH / auth / network / account) or token
602
+ exhausted → skipped for the current resolution and recorded as runtime health.
603
+ - Stale LOCK from a crashed process → next cycle cleans it up
604
+ - Orphan `🔨 In Progress` from a crashed cycle → next cycle reverts to
605
+ `📋 Todo`
606
+
607
+ **Needs you:**
608
+
609
+ - No candidate remains for the required role → an ALERT is written and the loop
610
+ stops. Fix env or narrow/update the role binding, then `roll loop resume`.
611
+ - CI persistently red → fix the failing test/build, then `roll loop now`
612
+ - Merge conflict on PR → resolve manually, push
613
+ - `gh` auth expired → `gh auth login`
614
+ - Story keeps reverting (TCR commit count = 0 every attempt) → the story
615
+ spec is likely unclear; rewrite ACs or run `$roll-build US-XXX` manually
616
+ to see where it stalls
617
+
618
+ For deeper operational topics (pause/resume, agent switching, gh scopes), see
619
+ [loop.md](loop.md) and [configuration.md](configuration.md).
620
+
621
+ ### C7. I changed loop_schedule but loop still runs at the old frequency
622
+
623
+ **Symptoms:** You updated `.roll/local.yaml` `loop_schedule`, but
624
+ `roll loop status` still shows the old trigger times.
625
+
626
+ **Why this happens:** The launchd plist is written once when you run
627
+ `roll loop on`. Changing the config file does not automatically update
628
+ the plist.
629
+
630
+ **Fix:**
631
+
632
+ ```bash
633
+ roll loop off && roll loop on # re-install the plist with new schedule
634
+ roll loop status # verify the new trigger times
635
+ ```
636
+
637
+ ### C8. My period_minutes setting is not taking effect
638
+
639
+ **Symptoms:** You set `period_minutes: 0` or `period_minutes: 1441` in
640
+ `.roll/local.yaml`, the loop still runs every hour, and `roll loop alert` shows
641
+ a scheduling ALERT.
642
+
643
+ **Why this happens:** `period_minutes` must be 1–1440.
644
+ Values outside this range are rejected.
645
+
646
+ **Under the hood:** `the schedule validator` validates the pair on every read.
647
+ An invalid pair triggers an ALERT to `~/.shared/roll/loop/ALERT-<slug>.md`
648
+ and falls back to the default (period=60, project-derived offset).
649
+
650
+ **Fix:**
651
+
652
+ ```bash
653
+ roll loop alert # check the exact error
654
+ # Edit .roll/local.yaml — use a value 1–1440
655
+ roll loop off && roll loop on # re-install
656
+ roll loop status # confirm the new schedule
657
+ ```
658
+
659
+ ### C9. What does "sync: offline" mean on the dashboard?
660
+
661
+ **Symptoms:** The dashboard footer shows `sync: offline` or you're wondering
662
+ why `sync: not configured` appears when you haven't set up cross-machine sync.
663
+
664
+ **Why this matters:** The dashboard sync indicator tells you whether cycle
665
+ records from other machines are being merged into your local view.
666
+
667
+ **Under the hood:** When `roll_records_remote` is configured in
668
+ `~/.roll/config.yaml`, every cycle pushes its record to a shared git repo, and
669
+ the dashboard pulls from it before rendering. The indicator has three states:
670
+
671
+ - `sync: ok (2m ago)` — remote reachable, all machines' records merged
672
+ - `sync: offline` — remote unreachable (network issue, auth expired); showing
673
+ local data only, other machines' cycles are invisible until connectivity
674
+ returns
675
+ - `sync: not configured` — `roll_records_remote` is not set; sync is off by
676
+ design, this is the normal state for single-machine use
677
+
678
+ **Fix for `sync: offline`:**
679
+
680
+ ```bash
681
+ # Check connectivity to the records repo
682
+ ssh -T git@github.com # or your git host
683
+
684
+ # Verify the remote is still accessible
685
+ git ls-remote $(roll config get roll_records_remote)
686
+
687
+ # If auth expired, re-authenticate
688
+ github.com → gh auth login
689
+ gitlab.com / self-hosted → check your SSH key
690
+
691
+ # The dashboard falls back to local-only data while offline —
692
+ # no data is lost, it just can't see other machines' cycles
693
+ # until connectivity is restored.
694
+ ```
695
+
696
+ ### C10. I ran roll-doc-audit — how do I know whether it did Phase 3a or Phase 3b?
697
+
698
+ **Symptoms:** You run `$roll-doc-audit` and want to know whether it stopped at the
699
+ directory-level fill (Phase 3a) or went on to the deep cross-directory read
700
+ (Phase 3b).
701
+
702
+ **Why this happens:** Phase 3a (the "Fill" phase) reads each gap directory in
703
+ isolation — up to 20 files per gap directory — and emits module READMEs.
704
+ Phase 3b ("Deep Read") only fires when the project has cross-directory
705
+ structure worth documenting: an import chain spanning ≥ 3 directories, a shared
706
+ `*State` / `*Status` enum, external endpoint calls, or a CI config file. A pure
707
+ docs-only project with no source gaps and no such characteristics skips
708
+ Phase 3b entirely.
709
+
710
+ **Read the Phase 4 report.** The end-of-run summary always prints both
711
+ sections:
712
+
713
+ ```
714
+ Phase 3 — Fill
715
+ 2 drafts generated: [src/commands/README.md, docs/CONVENTIONS.md]
716
+ Phase 3b — Deep Read
717
+ Symbol table: exports(42) imports(156) enums(7) external_urls(4) configs(3)
718
+ 2 topic documents generated:
719
+ - docs/data-flows.md (data-flow) source entries: 6
720
+ - docs/integrations.md (external-integration) source entries: 4
721
+ ```
722
+
723
+ If Phase 3b found nothing it prints exactly one line —
724
+ `Phase 3b: no subject-level drafts generated` — so the absence of any
725
+ `docs/data-flows.md` / `docs/state-machines.md` / `docs/integrations.md` /
726
+ `docs/deployment.md` output is the tell that only Phase 3a ran. Under
727
+ `--dry-run`, the same Phase 3b lines appear tagged `(plan)` and nothing is
728
+ written. Full breakdown: [roll-doc-audit.md](roll-doc-audit.md).
729
+
730
+
731
+ ---
732
+
733
+ ## Loop runs a cycle but the backlog appears empty
734
+
735
+ The loop picks stories from `.roll/backlog.md`. If the backlog looks empty
736
+ or shows no `📋 Todo` items, the most common causes:
737
+
738
+ **1. `.roll/` is out of date (new machine or OS reinstall)**
739
+
740
+ `.roll/` is a separate private git repo (`roll-meta`). After a fresh setup,
741
+ clone it manually and point the remote:
742
+
743
+ ```bash
744
+ # Replace with your actual roll-meta repo URL
745
+ git clone git@github.com:your-org/roll-meta.git .roll
746
+ ```
747
+
748
+ **2. SSH key not authorized**
749
+
750
+ ```bash
751
+ ssh -T git@github.com # should say "Hi <username>!"
752
+ ```
753
+
754
+ If it fails, re-add your SSH key to GitHub.
755
+
756
+ **3. Check sync status**
757
+
758
+ ```bash
759
+ git -C .roll remote get-url origin # empty = sync disabled
760
+ git -C .roll log --oneline -3 # shows last synced commits
761
+ ```
762
+
763
+ **4. Force a manual sync**
764
+
765
+ ```bash
766
+ git -C .roll fetch && git -C .roll reset --hard origin/main
767
+ ```
768
+
769
+ ### C5. Why is this cycle running on `<agent>`?
770
+
771
+ **Symptoms:** you expected one agent, but the loop selected another.
772
+
773
+ **Why this happens:** Roll resolves a scoped role binding, not a hidden default.
774
+ The Builder comes from `story.execute`; review and scoring come from
775
+ `story.evaluate`. The binding can be inherited from Machine Scope
776
+ (`~/.roll/agents.yaml`) or declared in Project Scope (`.roll/agents.yaml`).
777
+
778
+ **Inspect:**
779
+
780
+ ```bash
781
+ roll agent # Machine Scope, Project Scope, resolved roles, pool health
782
+ roll agent list # which agents this machine has installed
783
+ roll loop runs 20 # see recent cycle agents
784
+ ```
785
+
786
+ If the selected candidate is unavailable because of auth, network, VPN, account,
787
+ or a missing binary, Roll skips that candidate for the current resolution and
788
+ records the runtime fact. It does not silently rewrite the static pool.
789
+
790
+ ### C6. Why was my story flipped to 🚫 Hold instead of Done?
791
+
792
+ **Symptoms:** Backlog row shows `🚫 Hold → split to US-FOO-XXXa,US-FOO-XXXb`,
793
+ and there's an ALERT line about `self-downgrade` or `StorySplitCapHit`.
794
+
795
+ **Why this happens:** The agent's pre-flight self-check (in
796
+ `roll-build` / `roll-fix` SKILL) returned `verdict: too_big` — the story's
797
+ `est_min` exceeded the agent's capability range, OR `risk_zone` didn't match,
798
+ OR the agent's historical hit rate on that story type is below
799
+ `prefer_threshold` and there's downgrade budget left. The cycle then runs
800
+ `roll-design --from-story <id>` to write smaller sub-stories with
801
+ `chain_depth + 1`, flips the parent to 🚫 Hold, and exits cleanly.
802
+
803
+ The cap kicks in at `chain_depth ≥ 2` — the third consecutive auto-split is
804
+ refused (`StorySplitCapHit`) and ALERT is raised for you to triage manually.
805
+
806
+ **Fix:** Look at the sub-stories the agent created; they should be smaller and
807
+ should pass pre-flight on the next cycle. If you disagree with the split,
808
+ edit the sub-stories or flip the original back to 📋 Todo with a tighter
809
+ `est_min` / `risk_zone` profile.
810
+
811
+ ### C7. How do I send feedback (bug / idea / UX) without leaving the terminal?
812
+
813
+ Use the smallest target for the feedback: `roll idea` for the local Roll
814
+ backlog, or `gh issue create` when it should become a GitHub issue.
815
+
816
+ ```bash
817
+ roll idea "Safari login fails after redirect"
818
+ gh issue create --title "Login fails on Safari" --body "Repro: ..."
819
+ ```
820
+
821
+ `roll idea` writes to the Roll backlog. `gh issue create` writes to GitHub
822
+ and can include the Environment section (roll version / OS / agent / language /
823
+ project). See [feedback.md](feedback.md) for the split path.
824
+
825
+ ### C10. Where did my loop state / ALERT go after upgrading? (Phase 2.0)
826
+
827
+ **Short answer:** Into your project. Since Phase 2.0, a project's loop runtime
828
+ data lives at `<project>/.roll/loop/` instead of `~/.shared/roll/loop/`. Your
829
+ ALERT is now `<project>/.roll/loop/ALERT-<slug>.md`, state is
830
+ `state-<slug>.yaml`, run history is `runs.jsonl`.
831
+
832
+ **Do I need to migrate manually?** No. The next cycle migrates legacy files
833
+ automatically: `the legacy-path migration` copies state / ALERT / PAUSE / mute
834
+ into the project and marks each old file `.migrated-<timestamp>`; `runs.jsonl`
835
+ is split per project. During a 7-day window, reads fall back to the old home
836
+ path if the new one is missing — so nothing breaks mid-upgrade.
837
+
838
+ **How do I roll back?** The legacy files survive as `<name>.migrated-<timestamp>`
839
+ for 7 days. Rename one back (drop the suffix) and delete the project-local copy.
840
+
841
+ **Cleaning up debris:** `roll loop gc` retires orphan slugs (project deleted) and
842
+ sweeps expired `.migrated-*` markers, `runs.jsonl.tmp.*`, and old backups. Use
843
+ `roll loop gc --dry-run` to preview. Full details:
844
+ [Loop Data Layout](loop-data-layout.md).
845
+
846
+ ### C11. How does Roll choose language for CLI, docs, and agents?
847
+
848
+ `ROLL_LANG=en|zh` pins the current process. `roll config lang en|zh` saves a
849
+ preference, and `roll config lang --reset` returns to locale detection.
850
+ `roll help --lang en|zh <topic>` is a one-off override for help and guide reads.
851
+
852
+ These controls apply to user-facing surfaces only. Agent contracts, code, git
853
+ metadata, and schemas remain English. Owner conversation follows the language
854
+ used by the owner in the current task. Run `roll doctor language` to audit docs,
855
+ conventions, skills, and generated surfaces before release.