@seanyao/roll 3.606.2 → 3.607.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.606.2",
3
+ "version": "3.607.1",
4
4
  "description": "Roll \u2014 Roll out features with AI agents",
5
5
  "packageManager": "pnpm@11.1.3",
6
6
  "scripts": {
@@ -116,7 +116,7 @@ If `roll-design` cannot produce ≥2 sub-stories (story is already irreducible),
116
116
 
117
117
  ### Step 1: Read the Story
118
118
 
119
- 1. Open `.roll/backlog.md`, find the US row, follow the link to `.roll/features/<feature>.md`
119
+ 1. Open `.roll/backlog.md`, find the US row, follow the link to `.roll/features/<epic>/<story>/spec.md`
120
120
  2. Read the full AC / Files / Dependencies section
121
121
  3. If a plan doc (`<feature>-plan.md`) exists, read it for context
122
122
 
@@ -233,7 +233,7 @@ Wait for the user's response before editing files. If the user does not object w
233
233
 
234
234
  - Use `$roll-design` to split vague request into INVEST-compliant User Stories
235
235
  - Insert US into `.roll/backlog.md` under the relevant Epic > Feature group
236
- - If a new `.roll/features/<feature>.md` is needed, create it
236
+ - If a new story folder is needed, create `.roll/features/<epic>/<story>/spec.md` (with `roll idea` or manually)
237
237
 
238
238
  After creation, switch to **Story mode** and execute the first US immediately.
239
239
 
@@ -359,7 +359,7 @@ When any signal appears, **do not stop — flag it**:
359
359
  | REFACTOR-001 | {one-line plain-language description} | 📋 Todo |
360
360
  ```
361
361
 
362
- 描述写法:参见 AGENTS.md "Backlog descriptions" 规则。说清楚"什么需要改"以及"不改会怎样",技术细节写在 `.roll/features/autonomous-evolution/refactor-log.md`。
362
+ 描述写法:参见 AGENTS.md "Backlog descriptions" 规则。说清楚"什么需要改"以及"不改会怎样",技术细节写在 `.roll/features/<epic>/refactor-log.md`。
363
363
 
364
364
  **refactor-log.md entry format:**
365
365
 
@@ -576,18 +576,66 @@ Follow the repo's deployment path (Vercel / Railway / etc.) and record the deplo
576
576
 
577
577
  Runs ONLY on a ✅ Gate PASS (a FAIL retry must not mint a misleading report). Non-blocking: any failure here → WARN, continue to Phase 11.
578
578
 
579
+ 0. **Before/after pairing (owner ruling 2026-06-06)**: when the story CHANGES
580
+ existing behavior, capture the prior state (`screenshots/before-*.png`)
581
+ before building and the new state (`screenshots/after-*.png`) at acceptance —
582
+ contrast is the clearest evidence. Brand-new capability with no prior state:
583
+ skip the pair; capture the new surface only.
584
+
579
585
  1. **Dump raw evidence** produced in this session to story-level dirs:
580
- `.roll/verification/{ID}/evidence/*.txt` (command outputs, curl, logs) and
581
- `.roll/verification/{ID}/screenshots/*.png` (when the story has a UI surface web/iOS/Android per project type).
582
- 2. **Write the intent map** `.roll/verification/{ID}/ac-map.json` for EVERY AC (ids `{ID}:AC1..n`) pick `pass|readonly|partial|claimed|missing` and reference only evidence that exists (paths relative to the run dir; story-level dirs are reachable as `../evidence/...` / `../screenshots/...`):
586
+ `.roll/features/<epic>/{ID}/screenshots/*.png` the DEFAULT evidence class for
587
+ every surface, **CLI included** (US-ATTEST-010): text evidence is the agent's
588
+ own report (nothing stops a fabricated `echo "✓ passed" > evidence.txt`); a
589
+ screenshot is an OS-level capture of really-rendered pixels — an independent
590
+ channel with a categorically higher forgery cost. Combined with the
591
+ never-overwritten run dirs (D4) and the render-layer red line, it is the
592
+ strongest link in the evidence chain.
593
+ `.roll/features/<epic>/{ID}/evidence/*.txt` (resolve `<epic>` via `.roll/index.json`; `roll attest` writes the report there as `{ID}-report.html`) — supplementary (searchable,
594
+ copyable); keep raw command outputs here, but do not let a text file be the
595
+ ONLY evidence for an AC that has a visible surface.
596
+
597
+ **CLI capture recipe**: run the verifying command in a REAL terminal (the
598
+ tmux observation window `roll-loop-<slug>` is a natural target — display the
599
+ proof there), then `screencapture -x -R <window-rect>` (macOS) into
600
+ `screenshots/`. Capture ONLY the relevant work area — a focused window, not
601
+ the whole desktop. Unattended cycles: drive the capture from the dispatcher
602
+ (deterministic), never hand-craft an image; if the capture channel is
603
+ unavailable (no GUI session / no permission), fall back to text evidence and
604
+ mark the AC `partial` with a note — never fake a screenshot.
605
+ 2. **Write the intent map** `.roll/features/<epic>/{ID}/ac-map.json` — for EVERY AC (ids `{ID}:AC1..n`) pick `pass|readonly|partial|claimed|missing` and reference only evidence that exists (paths relative to the run dir; story-level dirs are reachable as `../evidence/...` / `../screenshots/...`):
583
606
 
584
607
  ```json
585
608
  [{ "ac": "{ID}:AC1", "status": "pass",
586
- "evidence": [{ "kind": "text", "label": "vitest", "textFile": "../evidence/vitest.txt" }] }]
609
+ "evidence": [
610
+ { "kind": "screenshot", "label": "terminal run (real pixels)", "href": "../screenshots/ac1-terminal.png" },
611
+ { "kind": "text", "label": "vitest (supplementary)", "textFile": "../evidence/vitest.txt" }
612
+ ] }]
587
613
  ```
588
614
 
589
615
  No evidence for an AC → say `claimed` yourself; the renderer enforces that downgrade anyway (red line) and lists it under Discrepancies.
590
- 3. **Run** `roll attest {ID}` (add `--deploy-url <url>` when one exists). The report lands at `.roll/verification/{ID}/latest/report.html`.
616
+ 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 + self-score).
617
+ 4. **Design QA checklist (US-ATTEST-013) — READABILITY ONLY**. After the report
618
+ renders, open it and run the checklist below. This is a presentation review of
619
+ the rendered HTML, NOT an evidence review.
620
+ **HARD RULE: this checklist NEVER changes any AC's status, evidence, or
621
+ `pass|readonly|partial|fail|blocked|claimed|missing` verdict.** Those are
622
+ fixed at step 2 (the ac-map) and enforced by the render-layer red line. If a
623
+ readability item fails, fix the *presentation* (a missing context field, an
624
+ uncropped screenshot, a layout overflow) — never edit a verdict to make the
625
+ report look cleaner.
626
+ - [ ] **首屏 10s 可懂** — a product/business reviewer grasps what shipped and
627
+ whether it passed within ten seconds, without scrolling into the technical fold.
628
+ - [ ] **390 / 320px 无横滚** — no horizontal scroll at mobile widths; before/after
629
+ pairs stack rather than overflow.
630
+ - [ ] **打印可读** — print preview (or print-to-PDF) is legible; AC cards don't
631
+ split awkwardly across pages.
632
+ - [ ] **状态不只靠颜色** — every status reads from its icon + bilingual word, not
633
+ color alone (colorblind-safe).
634
+ - [ ] **截图裁切与清晰度** — screenshots are cropped to the relevant work area and
635
+ legible; no full-desktop captures, no blurry/half-rendered frames.
636
+ If you cannot open the report (headless cycle), note that the design QA was
637
+ deferred and say so in the cycle report — do NOT silently skip it, and do NOT
638
+ substitute it for an evidence judgement.
591
639
 
592
640
  ### Phase 11: Write Back Status (REQUIRED)
593
641
 
@@ -599,13 +647,13 @@ Both locations must be updated — neither can be skipped:
599
647
 
600
648
 
601
649
  ```markdown
602
- | [US-{ID}](.roll/features/<feature>.md#us-{id}) | {Title} | ✅ Done · [evidence](.roll/verification/US-{ID}/latest/report.html) |
650
+ | [US-{ID}](.roll/features/<epic>/US-{ID}/spec.md) | {Title} | ✅ Done · [evidence](.roll/features/<epic>/US-{ID}/delivery/latest/report.html) |
603
651
  ```
604
652
 
605
653
  Change the Status from `📋 Todo` or `🔨 In Progress` (whichever the row currently shows) to `✅ Done`. When invoked by `roll-loop`, the row will already be `🔨 In Progress` — that is the expected starting state, and the transition is the same Edit operation.
606
654
  For Fly mode: first append an index row under the appropriate Epic > Feature group, then mark it done.
607
655
 
608
- **② Update `.roll/features/<feature>.md` US section:**
656
+ **② Update `.roll/features/<epic>/<story>/spec.md`:**
609
657
 
610
658
  ```markdown
611
659
  ## US-{ID} {Story Title} ✅
@@ -102,32 +102,40 @@ Bug Fix 信号:
102
102
 
103
103
  ## Workspace Configuration
104
104
 
105
- Document structure (two-layer separation):
105
+ Document structure (story-first layout, US-META-005):
106
106
 
107
107
  ```
108
- .roll/backlog.md # US index page (status + one-liner + link)
108
+ .roll/backlog.md # story index (status + one-liner)
109
109
  .roll/features/
110
- <feature>.md # US details (AC / Files / Dependencies)
111
- <feature>-plan.md # Design document (why / how)
112
- .roll/domain/ # DDD domain model (greenfield / cross-feature)
113
- context-map.md # Bounded Contexts + 关系图
114
- ubiquitous-language.md # 统一语言词汇表
115
- <context>-model.md # 每个 Context 的 Tactical Model
110
+ <epic>/ # epic folder
111
+ <feature>.md # feature design doc (optional, multi-story overview)
112
+ <feature>-plan.md # design plan (optional)
113
+ <story>/ # individual story folder (one per card)
114
+ spec.md # story definition (AC, depends-on, etc.)
115
+ index.html # auto-generated story portal
116
+ delivery/ # attest evidence (auto-generated on Done)
117
+ .roll/domain/ # DDD domain model
118
+ context-map.md
119
+ ubiquitous-language.md
116
120
  ```
117
121
 
118
122
  **Important rules:**
119
- 1. Plan files go in `.roll/features/<feature>-plan.md` (**no longer using** `docs/plans/`)
120
- 2. US details go in the corresponding `.roll/features/<feature>.md`
121
- 3. **FIX / IDEA detail files use ID-prefixed filenames**: `.roll/features/<epic>/FIX-097.md`, not `.roll/features/<epic>/some-descriptive-slug.md`. Reason: a single FIX is one card, not a long-lived feature; the ID is the most stable handle, descriptive slugs date quickly and break links. US can keep feature-slug naming (US lives inside a multi-Story feature file). Quick lookup: `ls .roll/features/<epic>/FIX-*.md` finds all bugs in that area without grepping content.
122
- 4. .roll/backlog.md only contains index rows (one row per US), **do not write** AC / Files / Notes
123
- 5. Domain model files go in `.roll/domain/` create on first greenfield design, update incrementally
124
- 6. **Do not** write to `~/.kimi/`, `~/.kimi-code/`, or any global config directory
125
-
126
- **File path resolution order:**
127
- 1. Determine Feature ownership (based on the requirement domain: compiler / ingest / qa / ...)
128
- 2. Feature file: `.roll/features/<feature>.md` (create if it doesn't exist)
129
- 3. Plan file: `.roll/features/<feature>-plan.md` (create if it doesn't exist)
130
- 4. .roll/backlog.md index row goes under the corresponding Epic > Feature group
123
+ 1. **Every story card gets its own folder**: `features/<epic>/<story>/`
124
+ 2. **spec.md is the single definition file** — contains full AC, Files, Dependencies
125
+ 3. **FIX / IDEA / US all follow the same folder layout** `features/<epic>/FIX-097/spec.md`
126
+ 4. **Feature design docs stay at epic root** `<feature>.md` and `<feature>-plan.md` are optional, multi-story design overviews
127
+ 5. **index.html is auto-generated** by `roll idea` (skeleton) and updated by `roll attest` (delivery section)
128
+ 6. **delivery/ is auto-created** by `roll attest` on Done do not create manually
129
+ 7. .roll/backlog.md only contains index rows (one row per story), **do not write** AC / Files there
130
+ 8. Domain model files go in `.roll/domain/`
131
+ 9. **Do not** write to `~/.kimi/`, `~/.kimi-code/`, or any global config directory
132
+
133
+ **File path resolution:**
134
+ 1. Determine epic from story ID prefix (e.g., US-META-* backlog-lifecycle, FIX-* → query index.json)
135
+ 2. Create story folder: `.roll/features/<epic>/<story>/`
136
+ 3. Write spec.md: `.roll/features/<epic>/<story>/spec.md` (full AC + details)
137
+ 4. Backlog row links to: `.roll/features/<epic>/<story>/spec.md`
138
+ 5. Design / plan docs (when needed): `.roll/features/<epic>/<feature>.md` + `<feature>-plan.md`
131
139
 
132
140
  ## Non-Interactive Mode
133
141
 
@@ -633,10 +641,10 @@ Do **not** infer "approach confirmed" from the user's reaction to the comparison
633
641
  FEATURE="compiler"
634
642
 
635
643
  # 2. Write Plan document (if there is a solution design)
636
- PLAN_FILE=".roll/features/${FEATURE}-plan.md"
644
+ PLAN_FILE=".roll/features/${EPIC}/${FEATURE}-plan.md"
637
645
 
638
- # 3. Append US section in .roll/features/<feature>.md (with full AC)
639
- FEATURE_FILE=".roll/features/${FEATURE}.md"
646
+ # 3. Write story spec: .roll/features/<epic>/<story>/spec.md (full AC)
647
+ # Story specs: .roll/features/<epic>/<story>/spec.md
640
648
 
641
649
  # 4. Append index row under the corresponding Epic > Feature group in .roll/backlog.md
642
650
  # | [US-XXX](.roll/features/compiler.md#us-xxx) | One-line description | 📋 Todo |
@@ -655,7 +663,7 @@ DOMAIN_DIR=".roll/domain/"
655
663
  **.roll/backlog.md index row (only write this one line):**
656
664
 
657
665
  ```markdown
658
- | [US-{DOMAIN}-{N}](.roll/features/<feature>.md#us-{domain}-{n}) | {one-line description} | 📋 Todo |
666
+ | [US-{DOMAIN}-{N}](.roll/features/<epic>/US-{DOMAIN}-{N}/spec.md) | {one-line description} | 📋 Todo |
659
667
  ```
660
668
 
661
669
  `{one-line description}` 写法:用户能读懂的一句话,说清楚"能做什么"或"解决了什么麻烦"。不写实现细节、文件路径、函数名。细节和 AC 写在 `.roll/features/` 里。写好了可以直接当 CHANGELOG 条目用。
@@ -770,11 +778,11 @@ Each story must be:
770
778
  ### Feature Name
771
779
  | Story | Description | Status |
772
780
  |-------|-------------|--------|
773
- | [US-XXX](.roll/features/<feature>.md#us-xxx) | One-line description | 📋 Todo |
774
- | [US-YYY](.roll/features/<feature>.md#us-yyy) | One-line description | ✅ Done |
781
+ | [US-XXX](.roll/features/<epic>/<story>/spec.md#us-xxx) | One-line description | 📋 Todo |
782
+ | [US-YYY](.roll/features/<epic>/<story>/spec.md#us-yyy) | One-line description | ✅ Done |
775
783
  ```
776
784
 
777
- **Note**: .roll/backlog.md only contains index rows; full AC / Files / Dependencies go in `.roll/features/<feature>.md`.
785
+ **Note**: .roll/backlog.md only contains index rows; full AC / Files / Dependencies go in `.roll/features/<epic>/<story>/spec.md`.
778
786
 
779
787
  ---
780
788
 
@@ -20,7 +20,7 @@ Use when:
20
20
  - It does not need to be split into multiple Stories / Actions to deliver
21
21
 
22
22
  **Workflow:**
23
- 1. Read .roll/backlog.md index → Find FIX/BUG row → Follow link to `.roll/features/<feature>.md`
23
+ 1. Read .roll/backlog.md index → Find FIX/BUG row → Follow link to `.roll/features/<epic>/<story>/spec.md`
24
24
  2. Single Action (no splitting)
25
25
  3. Execute via TCR workflow
26
26
  4. Write back: update .roll/backlog.md status column + update FIX section in Feature file
@@ -343,18 +343,69 @@ Verify the shipped fix on the deployed target:
343
343
 
344
344
  Runs ONLY on a ✅ Gate PASS (a FAIL retry must not mint a misleading report). Non-blocking: any failure here → WARN, continue to Step 11.
345
345
 
346
+ 0. **Before/after pairing (owner ruling 2026-06-06)**: for a FIX, capture the
347
+ BROKEN state at reproduction time (screenshot when the surface is visible —
348
+ terminal run, panel, page) into `screenshots/before-*.png`; after the fix
349
+ passes, capture the SAME surface into `screenshots/after-*.png`. The pair is
350
+ the strongest possible fix evidence — reviewers see the delta, not a claim.
351
+ Behavior-changing stories: same pattern where a prior state exists.
352
+ Brand-new capability with nothing to contrast: skip — never stage a fake
353
+ "before".
354
+
346
355
  1. **Dump raw evidence** produced in this session to story-level dirs:
347
- `.roll/verification/{ID}/evidence/*.txt` (command outputs, curl, logs) and
348
- `.roll/verification/{ID}/screenshots/*.png` (when the story has a UI surface web/iOS/Android per project type).
349
- 2. **Write the intent map** `.roll/verification/{ID}/ac-map.json` for EVERY AC (ids `{ID}:AC1..n`) pick `pass|readonly|partial|claimed|missing` and reference only evidence that exists (paths relative to the run dir; story-level dirs are reachable as `../evidence/...` / `../screenshots/...`):
356
+ `.roll/features/<epic>/{ID}/screenshots/*.png` the DEFAULT evidence class for
357
+ every surface, **CLI included** (US-ATTEST-010): text evidence is the agent's
358
+ own report (nothing stops a fabricated `echo "✓ passed" > evidence.txt`); a
359
+ screenshot is an OS-level capture of really-rendered pixels — an independent
360
+ channel with a categorically higher forgery cost. Combined with the
361
+ never-overwritten run dirs (D4) and the render-layer red line, it is the
362
+ strongest link in the evidence chain.
363
+ `.roll/features/<epic>/{ID}/evidence/*.txt` (resolve `<epic>` via `.roll/index.json`; `roll attest` writes the report there as `{ID}-report.html`) — supplementary (searchable,
364
+ copyable); keep raw command outputs here, but do not let a text file be the
365
+ ONLY evidence for an AC that has a visible surface.
366
+
367
+ **CLI capture recipe**: run the verifying command in a REAL terminal (the
368
+ tmux observation window `roll-loop-<slug>` is a natural target — display the
369
+ proof there), then `screencapture -x -R <window-rect>` (macOS) into
370
+ `screenshots/`. Capture ONLY the relevant work area — a focused window, not
371
+ the whole desktop. Unattended cycles: drive the capture from the dispatcher
372
+ (deterministic), never hand-craft an image; if the capture channel is
373
+ unavailable (no GUI session / no permission), fall back to text evidence and
374
+ mark the AC `partial` with a note — never fake a screenshot.
375
+ 2. **Write the intent map** `.roll/features/<epic>/{ID}/ac-map.json` — for EVERY AC (ids `{ID}:AC1..n`) pick `pass|readonly|partial|claimed|missing` and reference only evidence that exists (paths relative to the run dir; story-level dirs are reachable as `../evidence/...` / `../screenshots/...`):
350
376
 
351
377
  ```json
352
378
  [{ "ac": "{ID}:AC1", "status": "pass",
353
- "evidence": [{ "kind": "text", "label": "vitest", "textFile": "../evidence/vitest.txt" }] }]
379
+ "evidence": [
380
+ { "kind": "screenshot", "label": "terminal run (real pixels)", "href": "../screenshots/ac1-terminal.png" },
381
+ { "kind": "text", "label": "vitest (supplementary)", "textFile": "../evidence/vitest.txt" }
382
+ ] }]
354
383
  ```
355
384
 
356
385
  No evidence for an AC → say `claimed` yourself; the renderer enforces that downgrade anyway (red line) and lists it under Discrepancies.
357
- 3. **Run** `roll attest {ID}` (add `--deploy-url <url>` when one exists). The report lands at `.roll/verification/{ID}/latest/report.html`.
386
+ 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 + self-score). A FIX usually carries a before/after pair (`screenshots/before-*.png` + `after-*.png`) — the坏态/好态 contrast is the clearest proof a bug is gone.
387
+ 4. **Design QA checklist (US-ATTEST-013) — READABILITY ONLY**. After the report
388
+ renders, open it and run the checklist below. This is a presentation review of
389
+ the rendered HTML, NOT an evidence review.
390
+ **HARD RULE: this checklist NEVER changes any AC's status, evidence, or
391
+ `pass|readonly|partial|fail|blocked|claimed|missing` verdict.** Those are
392
+ fixed at step 2 (the ac-map) and enforced by the render-layer red line. If a
393
+ readability item fails, fix the *presentation* (a missing context field, an
394
+ uncropped screenshot, a layout overflow) — never edit a verdict to make the
395
+ report look cleaner.
396
+ - [ ] **首屏 10s 可懂** — a reviewer grasps what was fixed and whether it passed
397
+ within ten seconds, without scrolling into the technical fold.
398
+ - [ ] **390 / 320px 无横滚** — no horizontal scroll at mobile widths; before/after
399
+ pairs stack rather than overflow.
400
+ - [ ] **打印可读** — print preview (or print-to-PDF) is legible; AC cards don't
401
+ split awkwardly across pages.
402
+ - [ ] **状态不只靠颜色** — every status reads from its icon + bilingual word, not
403
+ color alone (colorblind-safe).
404
+ - [ ] **截图裁切与清晰度** — screenshots are cropped to the relevant work area and
405
+ legible; no full-desktop captures, no blurry/half-rendered frames.
406
+ If you cannot open the report (headless cycle), note that the design QA was
407
+ deferred and say so in the cycle report — do NOT silently skip it, and do NOT
408
+ substitute it for an evidence judgement.
358
409
 
359
410
  ### 11. Write Back Status (when tracking is needed)
360
411
 
@@ -368,12 +419,12 @@ Both locations must be updated — neither can be skipped:
368
419
 
369
420
 
370
421
  ```markdown
371
- | [FIX-{ID}](.roll/features/<feature>.md#fix-{id}) | {Title} | ✅ Done · [evidence](.roll/verification/FIX-{ID}/latest/report.html) |
422
+ | [FIX-{ID}](.roll/features/<epic>/FIX-{ID}/spec.md) | {Title} | ✅ Done · [evidence](.roll/features/<epic>/FIX-{ID}/delivery/latest/report.html) |
372
423
  ```
373
424
 
374
425
  Change the Status of the corresponding row from `📋 Todo` or `🔨 In Progress` (whichever the row currently shows) to `✅ Done`. When invoked by `roll-loop`, the row will already be `🔨 In Progress` — that is the expected starting state.
375
426
 
376
- **② Update `.roll/features/<feature>.md` FIX section:**
427
+ **② Update `.roll/features/<epic>/<story>/spec.md`:**
377
428
 
378
429
  ```markdown
379
430
  ## FIX-{ID} {description} ✅