@seanyao/roll 2026.509.3 → 2026.510.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.
package/bin/roll CHANGED
@@ -4,7 +4,7 @@ set -euo pipefail
4
4
  # Roll — AI Agent Convention Manager
5
5
  # Single source of truth for how all AI coding agents behave.
6
6
 
7
- VERSION="2026.509.3"
7
+ VERSION="2026.510.2"
8
8
  ROLL_HOME="${ROLL_HOME:-${HOME}/.roll}"
9
9
  ROLL_CONFIG="${ROLL_HOME}/config.yaml"
10
10
  ROLL_GLOBAL="${ROLL_HOME}/conventions/global"
@@ -592,6 +592,9 @@ cmd_update() {
592
592
  info "Re-syncing to AI tools... 正在重新同步到 AI 工具..."
593
593
  echo ""
594
594
  cmd_setup
595
+
596
+ echo ""
597
+ _show_changelog
595
598
  }
596
599
 
597
600
  # ─── Helper: merge global AGENTS.md into project (no type prompt) ────────────
@@ -1198,6 +1201,7 @@ cmd_status() {
1198
1201
  echo -e " ${RED}-${NC} $tpl (missing / 缺失)"
1199
1202
  fi
1200
1203
  done
1204
+
1201
1205
  }
1202
1206
 
1203
1207
  check_sync_status() {
@@ -1676,7 +1680,8 @@ main() {
1676
1680
  status) cmd_status "$@" ;;
1677
1681
  peer) cmd_peer "$@" ;;
1678
1682
  version|--version|-v) echo "roll v${VERSION}" ;;
1679
- help|--help|-h|"") usage ;;
1683
+ help|--help|-h) usage ;;
1684
+ "") usage; _show_changelog ;;
1680
1685
  *)
1681
1686
  err "Unknown command: $cmd 未知命令: $cmd"
1682
1687
  echo ""
@@ -1686,6 +1691,27 @@ main() {
1686
1691
  esac
1687
1692
  }
1688
1693
 
1694
+ # ─── Show recent changelog entries ────────────────────────────────────────────
1695
+ _show_changelog() {
1696
+ local changelog="${ROLL_PKG_DIR}/CHANGELOG.md"
1697
+ [[ -f "$changelog" ]] || return 0
1698
+
1699
+ echo -e "${BOLD}Recent Changes 最近更新:${NC}"
1700
+
1701
+ local count=0 in_section=false
1702
+ while IFS= read -r line; do
1703
+ if [[ "$line" =~ ^##\ ]]; then
1704
+ (( ++count > 3 )) && break
1705
+ in_section=true
1706
+ echo ""
1707
+ echo -e " ${CYAN}${line#\#\# }${NC}"
1708
+ elif [[ "$in_section" == true && -n "$line" ]]; then
1709
+ echo " $line"
1710
+ fi
1711
+ done < "$changelog"
1712
+ echo ""
1713
+ }
1714
+
1689
1715
  # ─── Version check (background, non-blocking, 24h cache) ─────────────────────
1690
1716
  _check_update_async() {
1691
1717
  local cache="${ROLL_HOME}/.update-check"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seanyao/roll",
3
- "version": "2026.509.3",
3
+ "version": "2026.510.2",
4
4
  "description": "Roll — Roll out features with AI agents",
5
5
  "scripts": {
6
6
  "test": "find tests/unit tests/integration -name '*.bats' | sort | xargs ./tests/helpers/bats-core/bin/bats"
@@ -23,14 +23,27 @@ After successful Build & Deploy, extracts completed Stories from BACKLOG.md to g
23
23
 
24
24
  ## Workflow
25
25
 
26
- ### 1. Read BACKLOG.md
26
+ ### 1. Check CHANGELOG.md
27
27
 
28
28
  ```
29
- Read BACKLOG.md from the project root directory.
30
- Extract Stories with status Completed / Done.
29
+ CHANGELOG.md exists?
30
+ ├── Yes Append mode (add current deploy's changes)
31
+ └── No → Create mode (backfill all historical completed Stories)
31
32
  ```
32
33
 
33
- ### 2. Filter for External Content
34
+ ### 2. Read BACKLOG.md
35
+
36
+ ```
37
+ Append mode:
38
+ Extract only the Story/Fix just deployed in this session.
39
+
40
+ Create mode:
41
+ Extract ALL Stories and Fixes with status ✅ Done.
42
+ Read each Story's docs/features/<feature>.md for Completed date.
43
+ Group entries by completion date, reverse chronological order.
44
+ ```
45
+
46
+ ### 3. Filter for External Content
34
47
 
35
48
  **Remove internal information:**
36
49
  - Progress tables, completion percentages
@@ -45,7 +58,23 @@ Extract Stories with status ✅ Completed / Done.
45
58
  - UX improvements (layout, interaction enhancements)
46
59
  - Performance/reliability improvements
47
60
 
48
- ### 3. Version Number Format
61
+ **语言:中文。** 所有 changelog 条目必须用中文撰写。
62
+
63
+ **Description format:** `功能名 — 做了什么 + 用在什么场景`,一句话,精简。
64
+
65
+ Good:
66
+ ```
67
+ - **Added**: roll-jot — 一句话快速记录 bug 或想法到 backlog,不打断当前工作
68
+ - **Fixed**: 同步时清理已删除文件,防止用户机器残留幽灵文件
69
+ ```
70
+
71
+ Bad:
72
+ ```
73
+ - **Added**: Add roll-jot skill for fast backlog capture
74
+ - **Fixed**: Sync prunes stale files to prevent ghost files
75
+ ```
76
+
77
+ ### 4. Version Number Format
49
78
 
50
79
  ```
51
80
  YYYY.MM.DD
@@ -53,23 +82,37 @@ YYYY.MM.DD-1 (multiple releases on the same day)
53
82
  YYYY.MM.DD-2
54
83
  ```
55
84
 
56
- ### 4. Generate CHANGELOG.md
85
+ ### 5. Generate CHANGELOG.md
86
+
87
+ **Create mode** (first time):
88
+ ```markdown
89
+ # Changelog
90
+
91
+ ## 2026.05.10
92
+ - **Added**: E2E 自动沉淀 — 每个 Story 交付时自动写一个端到端测试,项目逐步积累可回放的 E2E 套件
93
+ - **Fixed**: 同步时清理已删除文件,防止用户机器残留幽灵文件
94
+
95
+ ## 2026.05.04
96
+ - **Added**: BB 注入模式 — 对未集成 Black Box 的页面自动注入诊断探针,统一数据采集接口
97
+
98
+ ## 2026.04.28
99
+ - ...
100
+ ```
57
101
 
102
+ **Append mode** (subsequent):
58
103
  ```markdown
59
104
  # Changelog
60
105
 
61
- ## 2026.04.03
62
- - **Added**: <completed feature extracted from BACKLOG>
63
- - **Fixed**: <resolved bug>
64
- - **Improved**: <UX/performance optimization>
106
+ ## 2026.05.10 ← 新条目插入顶部
107
+ - **Added**: Changelog 自动生成 每次部署后自动更新,首次运行时回填全部历史记录
65
108
 
66
- ## 2026.04.01
109
+ ## 2026.05.04 ← 已有条目不动
67
110
  - ...
68
111
  ```
69
112
 
70
113
  **Ordering**: Most recent version first (reverse chronological)
71
114
 
72
- ### 5. Commit Update
115
+ ### 6. Commit Update
73
116
 
74
117
  ```bash
75
118
  git add CHANGELOG.md
@@ -205,6 +205,52 @@ If project lacks Playwright setup:
205
205
  4. Run to create baseline
206
206
  5. Commit as separate "test infrastructure" change
207
207
 
208
+ ## CI Failure Triage
209
+
210
+ When CI goes red, triage the failure into an actionable item instead of ignoring it.
211
+
212
+ ### Step 1: Read the CI Log
213
+
214
+ ```
215
+ CI failure
216
+
217
+ ├── Which step failed? (lint / build / test / e2e)
218
+ ├── What is the error message?
219
+ ├── Is it reproducible locally?
220
+ └── Is it flaky (passes on retry)?
221
+ ```
222
+
223
+ ### Step 2: Classify Severity
224
+
225
+ | Severity | Signal | Action |
226
+ |----------|--------|--------|
227
+ | Critical | Build or core tests fail, blocks all merges | Fix immediately via `$roll-fix` |
228
+ | High | E2E test fails on a key user flow | Create FIX-XXX, fix within current sprint |
229
+ | Medium | Visual regression, non-critical test failure | Create FIX-XXX, prioritize in backlog |
230
+ | Low | Lint warning, flaky test (passes on retry) | Create FIX-XXX or IDEA-XXX, fix when convenient |
231
+
232
+ ### Step 3: Create Backlog Entry
233
+
234
+ ```bash
235
+ # For fixable bugs — create FIX entry
236
+ $roll-jot fix "CI: {step} fails — {root cause summary}"
237
+
238
+ # For flaky/environmental issues — create IDEA entry
239
+ $roll-jot idea "CI: investigate flaky {test name}"
240
+ ```
241
+
242
+ ### Step 4: Execute Fix
243
+
244
+ ```
245
+ FIX-XXX created
246
+
247
+ ├── Critical / High → $roll-fix FIX-XXX (immediate)
248
+ ├── Medium → schedule in backlog, $roll-fix when ready
249
+ └── Low → backlog, fix opportunistically
250
+ ```
251
+
252
+ All fixes go through `$roll-fix` TCR workflow — test, fix, review, commit, push, CI green.
253
+
208
254
  ## References
209
255
 
210
256
  - [Playwright Docs](https://playwright.dev/)
@@ -263,6 +263,35 @@ MICRO-STEP {N}: {description of smallest testable change}
263
263
 
264
264
  Accumulate 3–5 micro-commits per Action. Each commit is a guaranteed working state.
265
265
 
266
+ ### Phase 5.5: E2E Deposit
267
+
268
+ After TCR micro-steps pass, deposit an E2E test for this Story's core user flow.
269
+
270
+ ```
271
+ E2E DEPOSIT
272
+
273
+ Step 1: Detect
274
+ └── Read project's existing E2E infrastructure
275
+ (test directories, config files, framework, naming conventions)
276
+
277
+ Step 2: Write
278
+ └── One E2E test covering the Story's golden path
279
+ (the critical user journey this Story delivers)
280
+
281
+ Step 3: Run
282
+ └── Execute the new E2E test
283
+
284
+ Step 4: TCR
285
+ ├── ✅ GREEN → git commit -m "tcr: e2e deposit for {story}"
286
+ └── ❌ RED → Fix via TCR cycle until green
287
+ ```
288
+
289
+ **Rules:**
290
+ - Follow whatever E2E patterns the project already uses — framework, directory, naming
291
+ - If no E2E infrastructure exists, reference `$roll-.qa` "Missing Test Infrastructure" section to bootstrap minimally, then deposit
292
+ - One test per Story — covers the golden path, not exhaustive edge cases (those are unit/integration from Phase 5)
293
+ - Each deposited E2E becomes a replayable case: CI runs it on every push, Sentinel can sample it against production
294
+
266
295
  ### Phase 6: Pre-Push CI Gate
267
296
 
268
297
  After all micro-steps, run full CI locally before pushing:
@@ -461,6 +490,7 @@ git push
461
490
  📊 TCR Stats: <success rate, revert count if any>
462
491
  📋 Review Gate: <self-review findings summary>
463
492
  📝 BACKLOG: <US-ID> marked ✅ Done
493
+ 📄 CHANGELOG: $roll-.changelog → updated
464
494
 
465
495
  🎉 Shipped.
466
496
 
@@ -523,6 +553,7 @@ Before creating any file or directory:
523
553
  - [ ] Story and Action clearly defined
524
554
  - [ ] Test design reviewed and approved
525
555
  - [ ] **TCR cycles completed** (all micro-steps via Test && Commit)
556
+ - [ ] **E2E deposited** (golden path test for this Story, committed via TCR)
526
557
  - [ ] All commits are green states (no broken commits)
527
558
  - [ ] Local CI checks passed (format + lint + build + test)
528
559
  - [ ] Self-code-review passed, blocking issues fixed via TCR
@@ -533,6 +564,7 @@ Before creating any file or directory:
533
564
  - [ ] **Verification Gate passed** (fresh evidence for tests, build, deploy, no regression)
534
565
  - [ ] **BACKLOG.md index status updated** (📋 → ✅, REQUIRED)
535
566
  - [ ] **`docs/features/<feature>.md` US section updated** (Completed date + [x] ACs, REQUIRED)
567
+ - [ ] **CHANGELOG.md updated** via `$roll-.changelog`
536
568
  - [ ] Summary reported to user
537
569
 
538
570
  ---
@@ -599,5 +631,6 @@ The agent must explicitly produce (in text) before or during execution:
599
631
  - **Test Design**: scenarios, edge cases, test types
600
632
  - **Test Design Review**: coverage validation result
601
633
  - **TCR Log**: micro-step descriptions and commit count
634
+ - **E2E Deposit**: golden path E2E test file for this Story
602
635
  - **Quality Review**: post-TCR code review result
603
636
  - **Deployment target**: where it will be verified
@@ -2,12 +2,12 @@
2
2
  name: roll-debug
3
3
  license: MIT
4
4
  allowed-tools: "Read, Edit, Write, Bash, Agent"
5
- description: Universal web debugger. Mounts a Black Box (BB) diagnostic probe on any page, collects rich diagnostics, analyzes root causes, and suggests fixes. Cleans up after itself.
5
+ description: Universal web debugger. Mounts a Black Box (BB) diagnostic probe on any page, collects rich diagnostics, analyzes root causes, and auto-fixes when the root cause is in project source. Cleans up after itself.
6
6
  ---
7
7
 
8
8
  # Roll Debug
9
9
 
10
- Web debugging tool that treats the **Black Box (BB) as a diagnostic probe** — mounted when needed, unmounted when done. Combines diagnostic collection and analysis into a single workflow: **Mount → Collect → Analyze → Unmount**.
10
+ Web debugging tool that treats the **Black Box (BB) as a diagnostic probe** — mounted when needed, unmounted when done. Combines diagnostic collection, analysis, and auto-repair into a single workflow: **Mount → Collect → Analyze → Unmount → Auto-Fix (when fixable) → Re-verify**.
11
11
 
12
12
  ## Philosophy
13
13
 
@@ -47,9 +47,6 @@ $roll-debug https://example.com/page --universal
47
47
  # Use a custom BB SDK instead of the built-in stub
48
48
  $roll-debug https://example.com/page --bb-sdk-url https://cdn.example.com/bb.js
49
49
 
50
- # Collect + analyze + auto-fix
51
- $roll-debug https://example.com/page --fix
52
-
53
50
  # Analyze an existing report file (skip collection)
54
51
  $roll-debug --report /tmp/bb-report.json
55
52
 
@@ -104,7 +101,37 @@ User: "Debug the page"
104
101
  └──────────────────┬──────────────────┘
105
102
 
106
103
 
107
- Fix suggestions (or --fix to apply)
104
+ ┌─────────────────────────────────────┐
105
+ │ 5. Auto-Fix Decision Gate │
106
+ │ ├── Assess root cause location │
107
+ │ │ and fixability │
108
+ │ ├── Fixable? │
109
+ │ │ ├── Yes (single-file, │
110
+ │ │ │ bounded scope) │
111
+ │ │ │ → enter $roll-fix TCR │
112
+ │ │ │ workflow automatically │
113
+ │ │ ├── Complex (cross-module, │
114
+ │ │ │ architectural) │
115
+ │ │ │ → create US-XXX │
116
+ │ │ │ → suggest $roll-build │
117
+ │ │ └── External (third-party │
118
+ │ │ API, infra) │
119
+ │ │ → report findings only │
120
+ │ └── Tell user what was found │
121
+ │ and what was done │
122
+ └──────────────────┬──────────────────┘
123
+ │ (if auto-fixed)
124
+
125
+ ┌─────────────────────────────────────┐
126
+ │ 6. Re-verify (after fix) │
127
+ │ ├── Re-mount BB probe │
128
+ │ ├── Collect + analyze again │
129
+ │ ├── Confirm issue is resolved │
130
+ │ └── Unmount BB probe │
131
+ └──────────────────┬──────────────────┘
132
+
133
+
134
+ Report to user (findings + actions taken)
108
135
  ```
109
136
 
110
137
  ## Collection Modes
@@ -187,9 +214,27 @@ Report: /tmp/bb-report.json
187
214
  useEffect dependency error causing content not to load.
188
215
  Dependency `[chapter?.id]` should be `[chapter?.number]`
189
216
 
190
- ### Suggested Fix
191
- Modify Player.tsx line 45, change useEffect dependency
192
- from `[chapter?.id]` to `[chapter?.number]`
217
+ ### Auto-Fix
218
+ Root cause is in project source (Player.tsx:45), single-file, bounded scope.
219
+ Entering $roll-fix TCR workflow...
220
+
221
+ 🧪 Test: added regression test for chapter content loading
222
+ 🔧 Fix: Player.tsx:45 — useEffect dep [chapter?.id] → [chapter?.number]
223
+ ✅ TCR: test green, committed
224
+ 🔍 Review: $roll-.review passed
225
+ 📤 Push: origin/main
226
+ ⏳ CI: green
227
+ 🚀 Deploy: https://yyy.up.railway.app
228
+
229
+ 🔄 Re-verifying...
230
+ 📡 Re-mounting BB probe...
231
+ 📊 Collecting data...
232
+ ├── Console: 0 errors
233
+ ├── contentLength: 2340
234
+ └── hasText: true
235
+ 🧹 Unmounting BB probe... done
236
+
237
+ ✅ Issue resolved. Content now loads correctly.
193
238
  ```
194
239
 
195
240
  ### Example 2: Reuse existing native BB
@@ -525,16 +570,38 @@ No page state is modified.
525
570
  4. **Native BB untouched** — if a page already has BB, it is reused but never unmounted.
526
571
  5. **CSP fallback** — if script injection fails (CSP), automatically falls back to Universal mode.
527
572
 
528
- ## Integration with Build Skills
529
-
530
- After `$roll-debug` finds issues:
573
+ ## Auto-Fix Behavior
531
574
 
532
- ```bash
533
- # For a single-file bug fix
534
- # → Create FIX-XXX in backlog
535
- # → $roll-fix FIX-XXX
575
+ After diagnosis, roll-debug automatically assesses whether the root cause can be fixed — **no flag needed**. The decision is context-driven:
536
576
 
537
- # For a complex multi-step fix
538
- # → Create US-XXX in backlog
539
- # → $roll-build US-XXX
540
577
  ```
578
+ Root cause identified
579
+
580
+ ├── In project source + single-file + bounded scope
581
+ │ └── AUTO-FIX: enter $roll-fix TCR workflow
582
+ │ ├── Write regression test (RED)
583
+ │ ├── Apply fix (GREEN)
584
+ │ ├── TCR commit
585
+ │ ├── $roll-.review staged
586
+ │ ├── Push → CI → Deploy
587
+ │ └── Re-mount BB → re-verify on page
588
+
589
+ ├── In project source + cross-module / architectural
590
+ │ └── ESCALATE: create US-XXX in BACKLOG.md
591
+ │ ├── Suggest: $roll-build US-XXX
592
+ │ └── Report diagnosis findings
593
+
594
+ └── External (third-party API, infra, CDN, DNS)
595
+ └── REPORT ONLY
596
+ ├── What was found
597
+ └── Suggested actions (manual or external)
598
+ ```
599
+
600
+ **Quality gates preserved**: When auto-fixing, all `$roll-fix` quality gates apply — TCR, `$roll-.review`, push, CI, deploy. No shortcuts.
601
+
602
+ **Re-verification**: After a successful auto-fix, roll-debug re-mounts the BB probe on the same page and re-runs diagnosis to confirm the issue is actually resolved. If the issue persists, it reports the remaining findings.
603
+
604
+ **User communication**: roll-debug always tells the user:
605
+ - What was found (root cause, severity)
606
+ - What was done (auto-fixed / escalated / reported)
607
+ - Why (fixability assessment reasoning)
@@ -318,7 +318,13 @@ Change the Status of the corresponding row from `📋 Todo` to `✅ Done`.
318
318
  - Change AC (if any) from `[ ]` to `[x]`
319
319
  - Update Files to reflect actual changed files
320
320
 
321
- ### 12. Report
321
+ ### 12. Update Changelog
322
+
323
+ ```bash
324
+ $roll-.changelog
325
+ ```
326
+
327
+ ### 13. Report
322
328
 
323
329
  Summarize:
324
330
  - shipped fix/enhancement
@@ -327,6 +333,7 @@ Summarize:
327
333
  - verification results
328
334
  - any residual risk
329
335
  - **BACKLOG.md updated** ✅
336
+ - **CHANGELOG.md updated** ✅
330
337
 
331
338
  ## Required Artifacts
332
339
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: roll-release
3
3
  license: MIT
4
- allowed-tools: "Read, Edit, Bash(git:*), Bash(npm:*), Bash(sed:*), Bash(date:*)"
4
+ allowed-tools: "Read, Edit, Bash(git:*), Bash(npm:*), Bash(sed:*), Bash(date:*), Bash(gh:*)"
5
5
  description: "Release skill for roll maintainers. Calculates next version (YYYY.MMDD.N format, auto-increments N from today's git tags), updates VERSION in bin/roll and package.json, commits, tags, and pushes to trigger npm auto-publish via GitHub Actions. Trigger: release, publish, 发版, 发布新版本."
6
6
  ---
7
7
 
@@ -79,7 +79,22 @@ git tag "v${version}"
79
79
  git push && git push --tags
80
80
  ```
81
81
 
82
- ### Step 5: Publish to npm
82
+ ### Step 5: Create GitHub Release
83
+
84
+ Extract the current version's changelog entries and create a GitHub Release:
85
+
86
+ ```bash
87
+ # Extract release notes from CHANGELOG.md (current version's section)
88
+ notes=$(sed -n "/^## ${version}$/,/^## /{ /^## ${version}$/d; /^## /d; p; }" CHANGELOG.md)
89
+
90
+ gh release create "v${version}" \
91
+ --title "v${version}" \
92
+ --notes "${notes:-Release v${version}}"
93
+ ```
94
+
95
+ This enables the background update check in `bin/roll` (`_check_update_async`), which queries the GitHub Releases API.
96
+
97
+ ### Step 6: Publish to npm
83
98
 
84
99
  ```bash
85
100
  npm publish --access public
@@ -87,13 +102,14 @@ npm publish --access public
87
102
 
88
103
  This will open a browser for 2FA verification. Wait for it to complete before continuing.
89
104
 
90
- ### Step 6: Confirm
105
+ ### Step 7: Confirm
91
106
 
92
107
  After publish, show:
93
108
  ```
94
109
  ✅ Released v{version}
95
110
  🏷 Tag: v{version} pushed to origin
96
111
  📦 npm published: {package_name}@{version} # package name read from package.json
112
+ 🐙 GitHub Release: https://github.com/{owner}/{repo}/releases/tag/v{version}
97
113
  🔗 https://www.npmjs.com/package/{package_name}
98
114
  ```
99
115
 
@@ -30,3 +30,6 @@ jobs:
30
30
 
31
31
  - name: Test
32
32
  run: npm run test -- --run
33
+
34
+ - name: E2E Tests
35
+ run: npm run test:e2e --if-present