@seanyao/roll 3.618.3 → 3.620.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seanyao/roll",
3
- "version": "3.618.3",
3
+ "version": "3.620.1",
4
4
  "description": "Roll — Roll out features with AI agents",
5
5
  "packageManager": "pnpm@11.1.3",
6
6
  "scripts": {
package/skills/README.md CHANGED
@@ -27,9 +27,9 @@ roll 的**技能契约**仓——AI agent 在 roll 项目里工作时加载并
27
27
  - `roll-.review` / `roll-.qa` — TCR 内嵌自审与测试金字塔基准
28
28
 
29
29
  **Observation · 观察与汇报**
30
- - `roll-brief` — owner 简报;`roll-notes` — 项目日记
31
- - `roll-sentinel` — 生产抽查巡检;`roll-.dream` — 夜间架构/文档健康扫描
32
- - `roll-doctor` — 工具链体检;`roll-doc` — 存量文档自动化
30
+ - `roll-notes` — 项目日记
31
+ - `roll-.dream` — 夜间架构/文档健康扫描
32
+ - `roll-doctor` — 工具链体检;`roll-doc-audit` — 文档/产品一致性审计与存量文档自动化
33
33
 
34
34
  **Lifecycle & misc · 生命周期与杂项**
35
35
  - `roll-onboard` — 存量项目交互式接入
@@ -42,9 +42,10 @@ Every hub must include `## Gotchas` or `## Known Failure Modes`.
42
42
  - If a gotcha comes from a missed load, add a positive route case.
43
43
  - If a gotcha comes from an off-target load, add a negative route case.
44
44
  - Treat the section as append-mostly unless an entry is proven obsolete.
45
- - Never instruct agents to `source "$(command -v roll)"`: the TS-native `roll`
46
- is a bundled CLI, not a bash library, and sourcing it executes JS as shell
47
- (FIX-274). Skill steps call `roll <command>` directly.
45
+ - Never instruct agents to source the `roll` binary as if it were a shell
46
+ library: the TS-native `roll` is a bundled CLI, not a bash script, and
47
+ `source "$(command -v roll)"` executes JS as shell (FIX-274). Skill steps call
48
+ `roll <command>` directly.
48
49
  - Skills do NOT self-score (FIX-343). The working agent never scores its own
49
50
  story; the Review Score is a runner-side peer-review outcome, produced by a
50
51
  Reviewer in a FRESH, separate session (never a sub-agent of the builder's
@@ -32,7 +32,7 @@ The initial `SKILL.md` line baseline was 7,929 lines. Current hub-only
32
32
  | roll-build | 884 | 48 | `references/full-contract.md` |
33
33
  | roll-fix | 641 | 48 | `references/full-contract.md` |
34
34
  | roll-debug | 607 | 48 | `references/full-contract.md`, `assets/injectable-bb.js` |
35
- | roll-doc | 595 | 46 | `references/full-contract.md` |
35
+ | roll-doc-audit | 595 | 46 | `references/full-contract.md` |
36
36
  | roll-loop | 563 | 47 | `references/full-contract.md` |
37
37
  | roll-.changelog | 465 | 47 | `references/full-contract.md` |
38
38
  | roll-.dream | 374 | 47 | `references/full-contract.md` |
@@ -146,12 +146,12 @@ The catalog is auto-updated by the release script (maintainer-private at `roll-m
146
146
 
147
147
  ### Scan 6 — 文档新鲜度 (Doc Freshness)
148
148
 
149
- **Dependency gate**: Skip Scan 6 entirely when `$roll-doc` (US-SKILL-008) is not yet deployed.
150
- Check: `[ -f "$ROLL_HOME/skills/roll-doc/SKILL.md" ]`. If absent, log "Scan 6 skipped — roll-doc not deployed" in the dream log and stop. No fallback.
149
+ **Dependency gate**: Skip Scan 6 entirely when `$roll-doc-audit` (US-SKILL-008) is not yet deployed.
150
+ Check: `[ -f "$ROLL_HOME/skills/roll-doc-audit/SKILL.md" ]`. If absent, log "Scan 6 skipped — roll-doc-audit not deployed" in the dream log and stop. No fallback.
151
151
 
152
- When deployed, each finding produces a REFACTOR entry with `$roll-doc` as execution hint:
152
+ When deployed, each finding produces a REFACTOR entry with `$roll-doc-audit` as execution hint:
153
153
  ```markdown
154
- | REFACTOR-XXX | docs: <description> — flagged by dream <date> (hint: $roll-doc) | 📋 Todo |
154
+ | REFACTOR-XXX | docs: <description> — flagged by dream <date> (hint: $roll-doc-audit) | 📋 Todo |
155
155
  ```
156
156
 
157
157
  #### Check A — Stale Docs
@@ -84,32 +84,31 @@ reason: <one short line — which condition triggered, with numbers>
84
84
  ```
85
85
 
86
86
  When `verdict: ok` → continue to Step A2 normally.
87
- When `verdict: too_big` → go to **US-AGENT-008 self-downgrade path**, **but** first run the **US-AGENT-009 chain_depth cap check**:
88
-
89
- ```bash
90
- # 0a. Cap check: refuse the third consecutive auto-split.
91
- # exit 0 split allowed; exit 1 cap hit, take cap-hit path instead.
92
- if ! bash -c 'source "$(command -v roll)"; _loop_chain_depth_cap_check US-XXX-NNN'; then
93
- # Cap hit (chain_depth 2): hold + ALERT, exit cleanly.
94
- bash -c 'source "$(command -v roll)"; _loop_split_cap_hit US-XXX-NNN "depth >= 2, human triage required"'
95
- exit 0
96
- fi
97
-
98
- # 1. Invoke roll-design to re-split the story into smaller sub-stories.
99
- # Each sub-story carries chain_depth = (parent.chain_depth + 1).
100
- # Sub-stories land as 📋 Todo with depends-on:<parent> chained.
101
- Skill("roll-design", "--from-story US-XXX-NNN")
102
-
103
- # 2. After the sub-stories are written to BACKLOG, flip the parent
104
- # to 🚫 Hold and emit the downgrade event. The helper handles ALERT.
105
- bash -c 'source "$(command -v roll)"; _loop_self_downgrade US-XXX-NNN "too_big: <reason from verdict>" "US-XXX-NNNa,US-XXX-NNNb"'
106
-
107
- # 3. Exit cleanly no TCR commits this cycle. The next loop cycle picks
108
- # up the first sub-story (which is smaller and should pass pre-flight).
109
- exit 0
110
- ```
111
-
112
- If `roll-design` cannot produce ≥2 sub-stories (story is already irreducible), fall through to **US-AGENT-009 cap-hit path** by invoking `_loop_split_cap_hit` directly. The cap is purely about stopping infinite split chains; even on the first re-split, if the design step gives up, the cap-hit handler raises ALERT for human triage.
87
+ When `verdict: too_big` → **self-downgrade** rather than burn the cycle on a guaranteed miss:
88
+
89
+ 1. Invoke `roll-design` to re-split the story into ≥2 smaller sub-stories. Each
90
+ sub-story inherits the parent's ORIGINAL inbound dependencies **never** the
91
+ parent itself (depending on the about-to-be-parked parent would deadlock the
92
+ child forever).
93
+ 2. Hand the split to the loop with the v3 command:
94
+
95
+ ```bash
96
+ roll loop self-downgrade <story-id> "<one-line reason>" <subA,subB,...>
97
+ ```
98
+
99
+ It parks the parent at 🚫 Hold (a grouping row the picker skips), appends the
100
+ sub-stories as 📋 Todo rows (correct `depends-on`, `chain_depth = parent + 1`,
101
+ never pointing at the parent), closes any open PR for the parent and deletes
102
+ its branch (invariant I3), and records a `story:split` event for reconciliation.
103
+ 3. Exit cleanly **no TCR commits this cycle**. The next loop cycle picks up the
104
+ first sub-story (smaller, should pass pre-flight).
105
+
106
+ The command enforces the **chain-depth cap** (US-AGENT-009): a story whose chain
107
+ has already auto-split twice (`chain_depth 2`), or one that yields fewer than 2
108
+ sub-stories (irreducible), is **not** split again `roll loop self-downgrade`
109
+ parks the parent at 🚫 Hold and raises an ALERT for human triage (a `story:split`
110
+ with `capped: true`) instead of recursing. Pass the sub-ids you have (or none);
111
+ the command decides. The cap exists purely to stop infinite split chains.
113
112
 
114
113
  > Pre-flight is honest, not paranoid: a small story (est_min ≤ 8 — the `easy` tier — with chain_depth=0) should almost always go `ok`. The check pays off on the long tail — stories with a large `est_min` that, on inspection, plainly compose far more files and behaviours than one cycle can land green.
115
114
 
@@ -389,12 +388,7 @@ When any signal appears, **do not stop — flag it**:
389
388
 
390
389
  Then continue implementing the current Story normally.
391
390
 
392
- **Event emission** — after all TCR micro-steps for a Story complete, emit a `build` event so the cycle event stream reflects the work done:
393
-
394
- ```bash
395
- # _tcr_count = number of "tcr:" prefix commits made during this Story
396
- _loop_event build "$US_ID" "${_tcr_count} commits" "" 2>/dev/null || true
397
- ```
391
+ **Event emission** — after all TCR micro-steps for a Story complete, emit a `build` event so the cycle event stream reflects the work done. The v3 runner writes events natively; do not call the retired bash helper `_loop_event`.
398
392
 
399
393
  ### Phase 4: E2E Deposit
400
394
 
@@ -883,6 +877,28 @@ Verdict values:
883
877
  - `ok` — shipped but with at least one documented trade-off (use rationale).
884
878
  - `regression` — story landed but another behaviour broke (rare; open a FIX).
885
879
 
880
+ #### Reviewer-triggered resize (US-AGENT-041)
881
+
882
+ A low score (≤ 5) can mean two different things, and the Reviewer distinguishes
883
+ them. When the delivery fell short because of a **quality** problem (a bug, a
884
+ weak test), the Reviewer just scores low — the loop retries. But when it fell
885
+ short because the **scope was simply too large for one cycle** (whole ACs or
886
+ surfaces left uncovered, not defects), the Reviewer ALSO emits, alongside the
887
+ SCORE/VERDICT/RATIONALE lines:
888
+
889
+ ```
890
+ RESIZE: <one line — why the scope exceeds one cycle>
891
+ GAPS: <gap one; gap two; gap three>
892
+ ```
893
+
894
+ On a RESIZE signal (low score), the loop runs `roll loop review-resize <story>`:
895
+ `$roll-design` mints sub-stories from the gaps, ≥2 **heterogeneous** reviewers
896
+ gate the split by consensus (all agree → auto-land via `roll loop self-downgrade`,
897
+ which parks the parent at 🚫 Hold + appends the sub-stories; any objection →
898
+ pause + ALERT, backlog unchanged), and the chain-depth cap (US-AGENT-009) stops
899
+ runaway splits. The human is **on** the loop (alerted only on consensus failure
900
+ or the cap), not in it. A RESIZE is never emitted for a pure quality problem.
901
+
886
902
  ---
887
903
 
888
904
  ## TCR Recovery Patterns
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: roll-doc-audit
3
+ license: MIT
4
+ allowed-tools: "Read, Write, Edit, Glob, Grep, Bash(date:*,find:*,stat:*,wc:*)"
5
+ description: "Load when checking README, guides, site pages, CLI help, and docs against implemented behavior, or when auditing documentation inventory, docs/INDEX coverage, undocumented modules, and draft fills from code evidence."
6
+ ---
7
+ # Roll Doc Audit
8
+
9
+ This hub keeps the routing boundary, hard gates, and execution skeleton in the initial context. Load the heavier runbook only when the task actually needs the detailed contract.
10
+
11
+ ## Load
12
+
13
+ Load when checking README, guides, site pages, CLI help, and docs against implemented behavior. Also load when a project needs documentation inventory, docs/INDEX generation, undocumented module detection, or draft documentation fills for existing code.
14
+
15
+ ## When Not to Use
16
+
17
+ - Presentation deck generation; load roll-deck.
18
+ - Toolchain diagnosis; load roll-doctor.
19
+
20
+ ## Read On Demand
21
+
22
+ - Read [the full contract](references/full-contract.md) before executing the workflow end to end, recovering from failures, or checking exact output templates.
23
+ - Keep this hub in context for trigger boundaries and hard gates.
24
+
25
+ ## Workflow Skeleton
26
+
27
+ 0. Consistency audit (Phase 0, first): enumerate shipped surfaces (CLI `--help`, console pages, site copy) and assert each is documented + accurate; check changelog covers the release delta and `site/roll-data.js` matches the real guides/pages/skills. Emit the Consistency Report.
28
+ 1. Scan documentation, user guidance, site pages, CLI help, and code surfaces.
29
+ 2. Flag docs/product drift against implemented behavior.
30
+ 3. Generate or update docs/INDEX.md when inventory is part of the request.
31
+ 4. Identify undocumented modules.
32
+ 5. Draft fills from code evidence.
33
+
34
+ ## Hard Gates
35
+
36
+ - Do not invent behavior without source evidence.
37
+ - Keep docs linked and indexable.
38
+ - Treat README, guides, site pages, help output, and code behavior as one consistency surface.
39
+ - This skill is the judgment-heavy auditor/drafter; the deterministic subset is also enforced by the `roll release` consistency gate (`release-consistency.ts`). Run the skill to investigate/fix; the gate is the floor that blocks silent drift.
40
+
41
+ ## Gotchas
42
+
43
+ - Draft missing docs from current code evidence; do not hallucinate module behavior from filenames alone.
44
+ - Documentation inventory is not a product deck or owner brief.
45
+ - A release consistency audit should report drift clearly before drafting new docs.
46
+
47
+ ## Maintenance
48
+
49
+ - Description changes require updates in `route-cases/skills.json`.
50
+ - New observed failures should add a gotcha and the matching positive or negative route case.
51
+ - Heavy examples, templates, recovery paths, and deterministic snippets belong in `references/`, `assets/`, or `scripts/`, not in this hub.
@@ -4,9 +4,9 @@ This file preserves the detailed contract extracted from SKILL.md. Read it when
4
4
 
5
5
  ---
6
6
 
7
- # roll-doc
7
+ # roll-doc-audit
8
8
 
9
- Four-phase legacy documentation automation (plus deep-read Phase 3b): scan → index → gap analysis → fill (directory-level) → deep read (cross-directory topics).
9
+ Documentation/product consistency audit plus legacy documentation automation (and deep-read Phase 3b): consistency audit (Phase 0 — shipped surfaces vs docs) → scan docs, user guidance, site pages, CLI help, and code surfaces → index → gap analysis → fill (directory-level) → deep read (cross-directory topics).
10
10
 
11
11
  Works on any project root. No manual mode switching — reads the project state and decides what to do.
12
12
 
@@ -14,7 +14,8 @@ Works on any project root. No manual mode switching — reads the project state
14
14
 
15
15
  - Starting to work on a legacy project with scattered or missing documentation
16
16
  - `docs/INDEX.md` is out of date or doesn't exist yet
17
- - `roll-.dream` Scan 6 flagged undocumented modules (REFACTOR entry referencing roll-doc)
17
+ - README, guides, site pages, CLI help, or docs may be drifting from implemented behavior
18
+ - `roll-.dream` Scan 6 flagged undocumented modules (REFACTOR entry referencing roll-doc-audit)
18
19
  - You want a complete picture of what's documented and what isn't
19
20
 
20
21
  ## When Not to Use
@@ -26,11 +27,212 @@ Works on any project root. No manual mode switching — reads the project state
26
27
  ## Invocation
27
28
 
28
29
  ```
29
- $roll-doc # Full four-phase run
30
- $roll-doc --dry-run # Phases 1–2 only; print Phase 3 plan without writing any files
31
- $roll-doc --force # Re-generate drafts even for existing files
30
+ $roll-doc-audit # Full consistency/inventory run
31
+ $roll-doc-audit --dry-run # Phases 1–2 only; print Phase 3 plan without writing any files
32
+ $roll-doc-audit --force # Re-generate drafts even for existing files
32
33
  ```
33
34
 
35
+ ## Phase 0 — Consistency Audit
36
+
37
+ Run this phase **first**, before the inventory phases (1–3b). The inventory phases ask
38
+ *"what is undocumented?"*; Phase 0 asks the sharper release-time question: *"does every shipped
39
+ user-facing surface have a doc, and does that doc still tell the truth?"* It is the
40
+ judgment-heavy pass — enumerate the real surfaces, compare them against the docs, and draft the
41
+ drift fixes.
42
+
43
+ **Skill vs. gate.** This skill is the **investigator + drafter**: a human (or agent) runs it to
44
+ find drift and write the fix. The *deterministic, enumerable* subset of these same checks is
45
+ **also** enforced inside the `roll release` consistency gate (`release-consistency.ts`), so a
46
+ drift cannot silently ship even when nobody runs this skill. The gate is the **floor** (it
47
+ blocks the release on the mechanical mismatches it can prove); this skill is the **ceiling** (it
48
+ also catches the judgment cases — a description that is technically present but stale, a doc that
49
+ contradicts behavior — that a mechanical check cannot decide). Run the skill to investigate and
50
+ fix; trust the gate to keep the floor from dropping.
51
+
52
+ **Scope:** Phase 0 reads only — it never writes during the audit itself. Its output is the
53
+ **Consistency Report** (template at the end of this phase) plus a list of drafted fixes the
54
+ operator reviews and applies. As with every other phase, do not fabricate behavior: every
55
+ "Accurate?" verdict must cite the source (help text, code path, or guide line) it was checked
56
+ against.
57
+
58
+ This phase has three check-classes. Run all three.
59
+
60
+ ### 0.1 — Shipped-surface coverage
61
+
62
+ Enumerate every user-facing surface the product ships, then assert each one is **documented**
63
+ AND **described accurately** (the doc's description matches actual behavior, not a stale copy).
64
+
65
+ **Surface 1 — CLI commands.**
66
+
67
+ Gather the evidence:
68
+
69
+ ```
70
+ # every top-level command
71
+ roll --help # or: node dist/roll.mjs --help
72
+
73
+ # every subcommand of a command that has subcommands
74
+ roll <command> --help # e.g. roll loop --help, roll agent --help
75
+ ```
76
+
77
+ Parse the command/subcommand list and each one-line description out of the help output. For each
78
+ command, locate its documentation in `guide/{en,zh}/*.md` and/or `README.md` (grep the command
79
+ name).
80
+
81
+ - **Pass:** the command appears in at least one guide page or `README.md`, AND the documented
82
+ description does not contradict the `--help` description / actual behavior.
83
+ - **Fail (undocumented):** a command exists in `--help` but no guide/README mentions it.
84
+ - **Fail (stale):** a command is documented, but the doc's description disagrees with `--help`
85
+ or with the implemented behavior (e.g. renamed flag, removed option, changed default).
86
+
87
+ Draft the fix: for an undocumented command, draft the missing guide section (purpose, synopsis,
88
+ options) from the `--help` text and the command's source. For a stale description, draft the
89
+ corrected sentence and cite the `--help` line or code path that proves the new truth.
90
+
91
+ **Surface 2 — Web-console pages / machine-global breadcrumb entries.**
92
+
93
+ The product's console exposes a fixed set of machine-global pages (e.g. **Agents · Skills ·
94
+ Tools · Conventions · About**). Each shipped page must be reflected in the site copy
95
+ (`site/roll-data.js`) and in the guides.
96
+
97
+ Gather the evidence:
98
+
99
+ ```
100
+ # the breadcrumb / nav set as the site renders it
101
+ grep -nE "Agents|Skills|Tools|Conventions|About" site/roll-data.js
102
+
103
+ # the guide pages that should describe those surfaces
104
+ ls guide/en guide/zh
105
+ ```
106
+
107
+ - **Pass:** every shipped console page is present in `site/roll-data.js` and has a corresponding
108
+ guide treatment.
109
+ - **Fail:** a console page ships but `site/roll-data.js` (or the guide) never reflects it, or the
110
+ site lists a page that no longer exists.
111
+
112
+ Draft the fix: add/correct the `site/roll-data.js` entry and draft the guide paragraph for the
113
+ missing page; cite the page's source.
114
+
115
+ **Verdict for 0.1:** flag *any* shipped surface with **no doc**, or **a doc whose description
116
+ contradicts the implementation**. Each flag becomes a row in the Consistency Report.
117
+
118
+ ### 0.2 — Changelog coverage of the release delta
119
+
120
+ Assert that every user-facing card merged since the last release is reflected in `CHANGELOG.md`.
121
+
122
+ Gather the evidence:
123
+
124
+ ```
125
+ # latest release tag (roll tags look like v2026.601.4)
126
+ LATEST=$(git describe --tags --abbrev=0 --match 'v*')
127
+
128
+ # commits merged since that tag
129
+ git log "$LATEST"..HEAD --oneline
130
+
131
+ # card ids in the delta (US-/FIX-/REFACTOR-)
132
+ git log "$LATEST"..HEAD --format='%s%n%b' | grep -oE '(US|FIX|REFACTOR)-[0-9]+' | sort -u
133
+ ```
134
+
135
+ For each card id in the delta, decide whether it is **user-facing** (changes CLI behavior,
136
+ output, flags, console pages, or documented workflow) — purely internal refactors that change no
137
+ surface are out of scope. Then:
138
+
139
+ - **Pass:** the user-facing card has a `CHANGELOG.md` entry **or** its spec carries an explicit
140
+ `changelog_exempt:` marker (read the card's spec under `.roll/features/` to check).
141
+ - **Fail:** a user-facing delta card has neither a `CHANGELOG.md` entry nor a `changelog_exempt:`
142
+ marker — it would ship undocumented.
143
+
144
+ Check changelog presence:
145
+
146
+ ```
147
+ grep -nE '(US|FIX|REFACTOR)-[0-9]+' CHANGELOG.md
148
+ ```
149
+
150
+ Draft the fix: for each missing user-facing card, draft a plain-language `CHANGELOG.md` line
151
+ (what changed / what the user can now do) from the card's spec and merged diff — no internal
152
+ jargon. If the card is genuinely not user-facing, note that it needs a `changelog_exempt:`
153
+ marker rather than a changelog line, and say why.
154
+
155
+ **Verdict for 0.2:** report every user-facing delta card that would ship undocumented.
156
+
157
+ ### 0.3 — Site-copy ↔ generated-console consistency
158
+
159
+ Assert that `site/roll-data.js` matches reality on three axes. This is the class where a new
160
+ guide page or console page ships but the site index is never updated to link it.
161
+
162
+ Gather the evidence:
163
+
164
+ ```
165
+ # every guide file that exists on disk
166
+ ls guide/en guide/zh
167
+
168
+ # the guide nav / page list the site actually exposes
169
+ grep -nE "guide|slug|nav|page" site/roll-data.js
170
+
171
+ # the machine-global breadcrumb description and the skill tiles
172
+ grep -nE "Agents|Skills|Tools|Conventions|About|skill" site/roll-data.js
173
+ ```
174
+
175
+ Then check each axis:
176
+
177
+ 1. **Guide reachability** — every `guide/<lang>/*.md` file on disk is reachable from the site
178
+ guide nav defined in `site/roll-data.js`.
179
+ - **Fail:** a guide file exists but is not linked from the nav (orphaned page), or the nav
180
+ links a guide slug that has no file (dead link).
181
+ 2. **Breadcrumb completeness** — the machine-global breadcrumb description in `site/roll-data.js`
182
+ lists the **real** set of machine pages (the same set verified in 0.1, Surface 2).
183
+ - **Fail:** the breadcrumb omits a shipped page or lists a removed one.
184
+ 3. **Skill-tile correctness** — the skill tiles in `site/roll-data.js` match the actual skill
185
+ set (the `roll-*` skill directories that ship).
186
+ - **Fail:** a shipped skill has no tile, or a tile points to a retired skill.
187
+
188
+ Draft the fix: add the missing nav entry / breadcrumb item / skill tile to `site/roll-data.js`,
189
+ or remove the stale one; cite the on-disk file (or its absence) that proves the drift.
190
+
191
+ **Verdict for 0.3:** flag every stale or missing `site/roll-data.js` entry.
192
+
193
+ ### Consistency Report
194
+
195
+ After running 0.1–0.3, emit one report. One row per surface checked; group by check-class. The
196
+ `Fix` column states the drafted correction (and, for an undocumented surface, the path of the
197
+ draft).
198
+
199
+ ```markdown
200
+ > roll-doc-audit — Consistency Report (YYYY-MM-DD)
201
+ > Phase 0 read-only audit. Floor enforced by `roll release` consistency gate (release-consistency.ts).
202
+
203
+ ## 0.1 Shipped-surface coverage
204
+
205
+ | Surface | Documented? | Accurate? | Drift | Fix |
206
+ |---------|-------------|-----------|-------|-----|
207
+ | `roll loop` (CLI) | ✅ guide/en/loop.md | ❌ | guide says `--once`, help says `--single` | draft: rename flag in loop.md:42, cite `roll loop --help` |
208
+ | `roll agent swap` (CLI) | ❌ | — | command ships, no guide/README mention | draft guide/en/agents.md §swap from `roll agent swap --help` |
209
+ | Console: Tools page | ✅ guide | ❌ site | page ships, missing from site/roll-data.js | draft: add Tools entry to site/roll-data.js |
210
+
211
+ ## 0.2 Changelog coverage of the release delta
212
+
213
+ | Card | User-facing? | In CHANGELOG / exempt? | Drift | Fix |
214
+ |------|--------------|------------------------|-------|-----|
215
+ | US-AGENT-041 | yes | ❌ | merged since v2026.601.4, no entry | draft CHANGELOG line from spec |
216
+ | REFACTOR-118 | no | — | internal only | mark `changelog_exempt:` in spec |
217
+
218
+ ## 0.3 Site-copy ↔ generated-console consistency
219
+
220
+ | Surface | Documented? | Accurate? | Drift | Fix |
221
+ |---------|-------------|-----------|-------|-----|
222
+ | guide/zh/consistency.md | ✅ on disk | ❌ nav | file exists, not linked in site nav | draft: add nav entry to site/roll-data.js |
223
+ | Skill tile: roll-doc-audit | ✅ | ❌ | tile still labeled `roll-doc` | draft: update tile id in site/roll-data.js |
224
+
225
+ ## Summary
226
+
227
+ - Surfaces checked: N (CLI N / console N / changelog cards N / site entries N)
228
+ - Drift found: N (undocumented N / stale N / unlinked N)
229
+ - Drafted fixes: N — review and apply, then re-run.
230
+ ```
231
+
232
+ A clean run prints the report with no drift rows and the summary line `Drift found: 0`.
233
+
234
+ ---
235
+
34
236
  ## Phase 1 — Scan & Index
35
237
 
36
238
  Scan the project root for all `*.md` files and known convention files.
@@ -63,7 +265,7 @@ ARCHITECTURE.md ADR-*.md
63
265
  ```markdown
64
266
  # Documentation Index
65
267
 
66
- > Auto-generated by roll-doc on YYYY-MM-DD. Edit individual docs, not this file.
268
+ > Auto-generated by roll-doc-audit on YYYY-MM-DD. Edit individual docs, not this file.
67
269
 
68
270
  ## Index
69
271
 
@@ -139,7 +341,7 @@ When `AGENTS.md` has no `## Where to Look` section, generate and append one:
139
341
  Draft output format:
140
342
 
141
343
  ```markdown
142
- > **Draft** — auto-generated by roll-doc on YYYY-MM-DD. Review before treating as authoritative.
344
+ > **Draft** — auto-generated by roll-doc-audit on YYYY-MM-DD. Review before treating as authoritative.
143
345
 
144
346
  ## Where to Look
145
347
  - **Domain model**: `.roll/domain/context-map.md` — Contexts: {list from context-map, or "see file"}
@@ -151,7 +353,7 @@ Only include lines for directories that already exist in the project.
151
353
  **Every generated file starts with this exact header line:**
152
354
 
153
355
  ```
154
- > **Draft** — auto-generated by roll-doc on YYYY-MM-DD. Review before treating as authoritative.
356
+ > **Draft** — auto-generated by roll-doc-audit on YYYY-MM-DD. Review before treating as authoritative.
155
357
  ```
156
358
 
157
359
  **Minimum draft content:**
@@ -244,7 +446,7 @@ If no chain meets the ≥ 3 directory threshold, skip generation entirely (no em
244
446
  **Output document structure** (`docs/data-flows.md`):
245
447
 
246
448
  ```markdown
247
- > **Draft** — auto-generated by roll-doc on YYYY-MM-DD. Review before treating as authoritative.
449
+ > **Draft** — auto-generated by roll-doc-audit on YYYY-MM-DD. Review before treating as authoritative.
248
450
 
249
451
  # Data Flows
250
452
 
@@ -288,7 +490,7 @@ generation entirely (no empty `docs/state-machines.md`).
288
490
  **Output document structure** (`docs/state-machines.md`):
289
491
 
290
492
  ```markdown
291
- > **Draft** — auto-generated by roll-doc on YYYY-MM-DD. Review before treating as authoritative.
493
+ > **Draft** — auto-generated by roll-doc-audit on YYYY-MM-DD. Review before treating as authoritative.
292
494
 
293
495
  # State Machines
294
496
 
@@ -341,7 +543,7 @@ matches inside comments and test fixtures (`*.test.*`, `*.spec.*`, `tests/`,
341
543
  **Output document structure** (`docs/integrations.md`):
342
544
 
343
545
  ```markdown
344
- > **Draft** — auto-generated by roll-doc on YYYY-MM-DD. Review before treating as authoritative.
546
+ > **Draft** — auto-generated by roll-doc-audit on YYYY-MM-DD. Review before treating as authoritative.
345
547
 
346
548
  # External Integrations
347
549
 
@@ -386,7 +588,7 @@ fields of the symbol table.
386
588
  **Output document structure** (`docs/deployment.md`):
387
589
 
388
590
  ```markdown
389
- > **Draft** — auto-generated by roll-doc on YYYY-MM-DD. Review before treating as authoritative.
591
+ > **Draft** — auto-generated by roll-doc-audit on YYYY-MM-DD. Review before treating as authoritative.
390
592
 
391
593
  # Deployment
392
594
 
@@ -449,7 +651,7 @@ fewer than 3 subdirectories, skip — the project is too small to warrant a base
449
651
  **Output document structure** (`AGENTS.md`) — at minimum three required sections:
450
652
 
451
653
  ```markdown
452
- > **Draft** — auto-generated by roll-doc on YYYY-MM-DD. Review before treating as authoritative.
654
+ > **Draft** — auto-generated by roll-doc-audit on YYYY-MM-DD. Review before treating as authoritative.
453
655
 
454
656
  # {Project Name}
455
657
 
@@ -529,7 +731,7 @@ a claim, omit the row rather than invent a location.
529
731
  After all phases complete, output a summary:
530
732
 
531
733
  ```
532
- 📚 roll-doc complete
734
+ 📚 roll-doc-audit complete
533
735
 
534
736
  Phase 1 — Index
535
737
  N docs scanned, docs/INDEX.md updated
@@ -576,13 +778,13 @@ Phase 3b — Deep Read (plan)
576
778
  If no gaps were found:
577
779
 
578
780
  ```
579
- ✅ roll-doc: no gaps found. docs/INDEX.md updated.
781
+ ✅ roll-doc-audit: no gaps found. docs/INDEX.md updated.
580
782
  ```
581
783
 
582
784
  If `--dry-run`:
583
785
 
584
786
  ```
585
- 🔍 roll-doc --dry-run: N drafts would be generated (nothing written).
787
+ 🔍 roll-doc-audit --dry-run: N drafts would be generated (nothing written).
586
788
  ```
587
789
 
588
790
  ## Rules
@@ -127,20 +127,27 @@ the `hard`-tier boundary: a FIX estimated past it is a sanity signal that the
127
127
  Emit `verdict: ok` or `verdict: too_big` (with `reason:`) as the first cycle output line.
128
128
 
129
129
  - `ok` → continue with step 1 below normally
130
- - `too_big` → self-downgrade per US-AGENT-008, **gated by US-AGENT-009 cap check**:
130
+ - `too_big` → **self-downgrade** rather than TCR a half fix:
131
131
 
132
- ```bash
133
- # Cap check first (chain_depth 2 refuse third auto-split).
134
- if ! bash -c 'source "$(command -v roll)"; _loop_chain_depth_cap_check FIX-XXX-NNN'; then
135
- bash -c 'source "$(command -v roll)"; _loop_split_cap_hit FIX-XXX-NNN "depth >= 2"'
136
- exit 0
137
- fi
138
- Skill("roll-design", "--from-story FIX-XXX-NNN")
139
- bash -c 'source "$(command -v roll)"; _loop_self_downgrade FIX-XXX-NNN "too_big: <reason>" "FIX-XXX-NNNa,FIX-XXX-NNNb"'
140
- exit 0
141
- ```
132
+ 1. Invoke `roll-design --from-story FIX-XXX` to mint ≥2 smaller sub-stories.
133
+ Each inherits the original FIX's inbound dependencies never the FIX itself
134
+ (the parked parent would deadlock its children).
135
+ 2. Hand the split to the loop:
142
136
 
143
- Original FIX goes to 🚫 Hold with `→ split to ...` annotation; sub-stories carry `chain_depth + 1`. Cap-hit path raises ALERT for human triage. Do NOT TCR a half fix.
137
+ ```bash
138
+ roll loop self-downgrade FIX-XXX "<one-line reason>" <subA,subB,...>
139
+ ```
140
+
141
+ It parks the FIX at 🚫 Hold, appends the sub-stories as 📋 Todo rows (correct
142
+ `depends-on`, `chain_depth + 1`, never the parent), closes any open PR for
143
+ the FIX and deletes its branch (invariant I3), and records a `story:split`
144
+ event.
145
+ 3. Exit cleanly — **no TCR commits this cycle**.
146
+
147
+ The command enforces the chain-depth cap (US-AGENT-009): a FIX whose chain has
148
+ already auto-split twice, or one that yields fewer than 2 sub-stories, is parked
149
+ at 🚫 Hold with an ALERT for human triage (a `story:split` with `capped: true`)
150
+ rather than recursing. Do NOT TCR a half fix.
144
151
 
145
152
  Bug fixes are usually small (est_min ≤ 5), so pre-flight is mostly a sanity barrier for FIXes whose underlying issue turns out structural — e.g. a "simple null check" that requires touching 12 files. Catching that upfront is cheaper than burning a cycle.
146
153
 
@@ -535,6 +542,26 @@ Verdict values:
535
542
  - `ok` — shipped but with documented trade-offs (use rationale to explain).
536
543
  - `regression` — the fix re-broke something else (rare; consider re-opening).
537
544
 
545
+ #### Reviewer-triggered resize (US-AGENT-041)
546
+
547
+ A low score (≤ 5) splits two ways. A **quality** shortfall (weak test, narrow
548
+ fix) just scores low and the loop retries. But when the FIX turned out
549
+ **structurally too large for one cycle** (whole sub-problems uncovered, not
550
+ defects), the Reviewer ALSO emits, beside SCORE/VERDICT/RATIONALE:
551
+
552
+ ```
553
+ RESIZE: <one line — why the scope exceeds one cycle>
554
+ GAPS: <gap one; gap two; ...>
555
+ ```
556
+
557
+ On a RESIZE signal (low score) the loop runs `roll loop review-resize FIX-XXX`:
558
+ `$roll-design` mints sub-stories from the gaps, ≥2 **heterogeneous** reviewers
559
+ gate the split by consensus (all agree → auto-land via `roll loop self-downgrade`,
560
+ parking the FIX at 🚫 Hold + appending sub-stories; any objection → pause +
561
+ ALERT, backlog unchanged), with the chain-depth cap (US-AGENT-009) stopping
562
+ runaway splits. The human is on the loop (alerted only on consensus failure or
563
+ the cap), not in it. Never emit RESIZE for a pure quality problem.
564
+
538
565
  ## Rubric
539
566
 
540
567
  Quality evaluation for a completed fix. Score each dimension independently.