@justjoshn/pi-pstack 0.15.36-pi.1 → 0.15.36-pi.11

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 (135) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +26 -21
  3. package/agents/ci-watcher.md +28 -0
  4. package/agents/thermo-nuclear-code-quality-review.md +23 -0
  5. package/assets/logo.png +0 -0
  6. package/automations/benny/FOR_AGENTS.md +2 -1
  7. package/automations/benny/README.md +2 -2
  8. package/automations/benny/skills/setup-benny/SKILL.md +10 -9
  9. package/automations/benny/templates/reproduce-automation-prompt.md +1 -1
  10. package/automations/benny/templates/triage-automation-prompt.md +1 -1
  11. package/bin/pstack-routines-supervisor +9 -0
  12. package/docs/guide/01-setup.md +2 -2
  13. package/docs/guide/07-overnight.md +1 -1
  14. package/docs/guide/09-make-it-yours.md +1 -1
  15. package/docs/guide/10-recipes-and-pitfalls.md +1 -1
  16. package/docs/native-gaps.md +14 -8
  17. package/docs/parity-reverse-engineering.md +94 -0
  18. package/docs/parity-status.md +113 -0
  19. package/package.json +41 -6
  20. package/packaging/install-supervisor-unit.sh +164 -0
  21. package/packaging/launchd/com.pstack.routines-supervisor.plist.example +24 -0
  22. package/packaging/systemd/pstack-routines-supervisor.service.example +15 -0
  23. package/skills/architect/SKILL.md +1 -1
  24. package/skills/architect/references/runner-prompt.md +1 -1
  25. package/skills/arena/SKILL.md +4 -4
  26. package/skills/check-compiler-errors/SKILL.md +23 -0
  27. package/skills/create-skill/SKILL.md +515 -29
  28. package/skills/fix-ci/SKILL.md +29 -0
  29. package/skills/fix-merge-conflicts/SKILL.md +32 -0
  30. package/skills/get-pr-comments/SKILL.md +23 -0
  31. package/skills/how/SKILL.md +1 -1
  32. package/skills/ketchup/SKILL.md +2 -2
  33. package/skills/ketchup-video/SKILL.md +2 -2
  34. package/skills/loop-on-ci/SKILL.md +50 -0
  35. package/skills/make-bot-ui/SKILL.md +2 -2
  36. package/skills/make-pr-easy-to-review/SKILL.md +59 -0
  37. package/skills/new-branch-and-pr/SKILL.md +29 -0
  38. package/skills/no-inline-imports/SKILL.md +12 -0
  39. package/skills/poteto-help/SKILL.md +4 -4
  40. package/skills/poteto-mode/SKILL.md +2 -2
  41. package/skills/poteto-mode/playbooks/bug-fix.md +1 -1
  42. package/skills/poteto-mode/playbooks/feature.md +1 -1
  43. package/skills/poteto-mode/playbooks/hillclimb.md +1 -1
  44. package/skills/poteto-mode/playbooks/multi-phase-plan.md +2 -2
  45. package/skills/poteto-mode/playbooks/orchestrate.md +2 -2
  46. package/skills/poteto-mode/playbooks/perf-issue.md +1 -1
  47. package/skills/poteto-mode/playbooks/refactoring.md +1 -1
  48. package/skills/pr-review-canvas/SKILL.md +176 -0
  49. package/skills/pr-review-canvas/renderer.js +170 -0
  50. package/skills/pr-review-canvas/styles.css +96 -0
  51. package/skills/pr-review-canvas/template.html +18 -0
  52. package/skills/reflect/SKILL.md +2 -2
  53. package/skills/review-and-ship/SKILL.md +41 -0
  54. package/skills/run-smoke-tests/SKILL.md +42 -0
  55. package/skills/setup-pstack/SKILL.md +13 -13
  56. package/skills/statechart/scripts/test/cli.test.ts +1 -1
  57. package/skills/swarm/SKILL.md +2 -2
  58. package/skills/thermo-nuclear-code-quality-review/SKILL.md +192 -0
  59. package/skills/typescript-exhaustive-switch/SKILL.md +10 -0
  60. package/skills/verify-this/SKILL.md +74 -0
  61. package/skills/weekly-review/SKILL.md +32 -0
  62. package/skills/what-did-i-get-done/SKILL.md +31 -0
  63. package/skills/why/SKILL.md +2 -2
  64. package/skills/workflow-from-chats/SKILL.md +50 -0
  65. package/src/child-env.ts +15 -2
  66. package/src/index.ts +18 -3
  67. package/src/loop.ts +63 -14
  68. package/src/mode.ts +31 -7
  69. package/src/path-skills.ts +104 -0
  70. package/src/paths.ts +18 -0
  71. package/src/pi-command.ts +12 -0
  72. package/src/plan.ts +109 -24
  73. package/src/rule.ts +4 -4
  74. package/src/sections.ts +21 -2
  75. package/src/subscriptions/durable-store.ts +531 -0
  76. package/src/subscriptions/durable-types.ts +69 -0
  77. package/src/subscriptions/ensure-supervisor.ts +67 -0
  78. package/src/subscriptions/index.ts +310 -282
  79. package/src/subscriptions/supervisor-main.ts +134 -0
  80. package/src/subscriptions/supervisor.ts +325 -0
  81. package/src/subscriptions/webhook.ts +82 -21
  82. package/src/task/card.ts +29 -0
  83. package/src/task/models.ts +7 -0
  84. package/src/task/progress.ts +112 -0
  85. package/src/task/records.ts +7 -9
  86. package/src/task/registry.ts +7 -3
  87. package/src/task/runner.ts +112 -23
  88. package/src/task/tool.ts +112 -43
  89. package/src/task/worktree.ts +5 -3
  90. package/src/todo.ts +8 -3
  91. package/scripts/live-e2e.mjs +0 -257
  92. package/test/aliases.test.ts +0 -57
  93. package/test/ask.test.ts +0 -85
  94. package/test/autocomplete.test.ts +0 -39
  95. package/test/e2e/aliases.e2e.test.ts +0 -81
  96. package/test/e2e/ask.e2e.test.ts +0 -135
  97. package/test/e2e/harness.ts +0 -179
  98. package/test/e2e/host.e2e.test.ts +0 -193
  99. package/test/e2e/lifecycle.e2e.test.ts +0 -99
  100. package/test/e2e/mode.e2e.test.ts +0 -160
  101. package/test/e2e/package.e2e.test.ts +0 -67
  102. package/test/e2e/task.e2e.test.ts +0 -734
  103. package/test/e2e/todo.e2e.test.ts +0 -59
  104. package/test/fixtures/cursor-askquestion-calls.json +0 -806
  105. package/test/fixtures/fake-pi.mjs +0 -96
  106. package/test/fixtures/image-model.ts +0 -16
  107. package/test/fixtures/list-models.ts +0 -15
  108. package/test/fixtures/readonly-shell-exit.ts +0 -17
  109. package/test/fixtures/scripted-model.ts +0 -113
  110. package/test/loop.test.ts +0 -209
  111. package/test/mode.test.ts +0 -143
  112. package/test/plan.test.ts +0 -126
  113. package/test/readonly-shell-security.test.ts +0 -84
  114. package/test/readonly-shell.test.ts +0 -44
  115. package/test/records.test.ts +0 -143
  116. package/test/registry.test.ts +0 -18
  117. package/test/resources.test.ts +0 -162
  118. package/test/rule.test.ts +0 -92
  119. package/test/scripts.test.ts +0 -182
  120. package/test/sections.test.ts +0 -56
  121. package/test/subscriptions-cron.test.ts +0 -60
  122. package/test/subscriptions.test.ts +0 -598
  123. package/test/task-agents.test.ts +0 -49
  124. package/test/task-card.test.ts +0 -34
  125. package/test/task-fork.test.ts +0 -233
  126. package/test/task-format.test.ts +0 -65
  127. package/test/task-model.test.ts +0 -141
  128. package/test/task-runner.test.ts +0 -259
  129. package/test/task-schema.test.ts +0 -50
  130. package/test/task-status.test.ts +0 -155
  131. package/test/task-worktree.test.ts +0 -106
  132. package/test/todo.test.ts +0 -74
  133. package/test/visualize.test.ts +0 -152
  134. package/tsconfig.json +0 -5
  135. package/vitest.config.ts +0 -16
@@ -0,0 +1,170 @@
1
+ function toggle(hdr) {
2
+ var b = hdr.nextElementSibling, c = hdr.querySelector('.chev');
3
+ b.classList.toggle('open'); c.classList.toggle('open');
4
+ }
5
+ function toggleBP(hdr) {
6
+ var b = hdr.nextElementSibling, c = hdr.querySelector('.chev');
7
+ b.classList.toggle('open'); c.classList.toggle('open');
8
+ }
9
+
10
+ function isImport(line) {
11
+ var s = line.replace(/^[+ -]/, '').trim();
12
+ return s.startsWith('import ') || s.startsWith('import{') || s.startsWith('} from ');
13
+ }
14
+
15
+ function isWhitespaceOnly(del, add) {
16
+ return del.replace(/^-/, '').replace(/\s/g, '') === add.replace(/^\+/, '').replace(/\s/g, '');
17
+ }
18
+
19
+ function esc(s) {
20
+ return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
21
+ }
22
+
23
+ function normWs(s) {
24
+ return s.replace(/\s+/g, ' ').trim();
25
+ }
26
+
27
+ function toLines(input) {
28
+ if (!input) return [];
29
+ if (Array.isArray(input)) return input;
30
+ if (typeof input === 'string') return input.split('\n');
31
+ return [];
32
+ }
33
+
34
+ function loadPrDiffs() {
35
+ var el = document.getElementById('pr-diffs-json');
36
+ if (!el) return null;
37
+ try {
38
+ return JSON.parse(el.textContent || '');
39
+ } catch (err) {
40
+ console.error('Failed to parse PR diff JSON payload', err);
41
+ return null;
42
+ }
43
+ }
44
+
45
+ function detectMoves(dels, adds) {
46
+ var TH = 3;
47
+ var md = {}, ma = {};
48
+ for (var di = 0; di < dels.length; di++) {
49
+ if (md[di]) continue;
50
+ var db = [di];
51
+ for (var d2 = di+1; d2 < dels.length && d2-di < 40; d2++) {
52
+ if (dels[d2].consecutive && !md[d2]) db.push(d2); else break;
53
+ }
54
+ if (db.length < TH) continue;
55
+ var dn = db.map(function(i){ return normWs(dels[i].code); });
56
+ for (var ai = 0; ai < adds.length; ai++) {
57
+ if (ma[ai]) continue;
58
+ var ab = [ai];
59
+ for (var a2 = ai+1; a2 < adds.length && a2-ai < 40; a2++) {
60
+ if (adds[a2].consecutive && !ma[a2]) ab.push(a2); else break;
61
+ }
62
+ if (ab.length < TH) continue;
63
+ var an = ab.map(function(i){ return normWs(adds[i].code); });
64
+ var ml = Math.min(dn.length, an.length), mc = 0;
65
+ for (var m = 0; m < ml; m++) { if (dn[m] === an[m]) mc++; }
66
+ if (mc >= TH && mc >= ml * 0.7) {
67
+ for (var k = 0; k < ml; k++) {
68
+ md[db[k]] = { exact: dn[k] === an[k] };
69
+ ma[ab[k]] = { exact: dn[k] === an[k] };
70
+ }
71
+ break;
72
+ }
73
+ }
74
+ }
75
+ return { movedDels: md, movedAdds: ma };
76
+ }
77
+
78
+ /**
79
+ * renderDiff(target, diffInput)
80
+ * target: DOM element, string ID, or CSS selector
81
+ * diffInput: array of diff lines, OR a single string (will be split on \n)
82
+ */
83
+ function renderDiff(target, diffInput) {
84
+ var el;
85
+ if (typeof target === 'string') {
86
+ el = document.getElementById(target) || document.querySelector(target);
87
+ } else {
88
+ el = target;
89
+ }
90
+ if (!el) return;
91
+
92
+ var lines = toLines(diffInput);
93
+ if (!lines.length) { el.innerHTML = '<div style="padding:12px;color:#777;font-size:12px;">No diff data</div>'; return; }
94
+
95
+ var filtered = lines.filter(function(l) {
96
+ if (l.startsWith('--- ') || l.startsWith('+++ ') || l.startsWith('@@') || l.startsWith('diff ')) return true;
97
+ return !isImport(l);
98
+ });
99
+
100
+ var wsOut = [];
101
+ for (var wi = 0; wi < filtered.length; wi++) {
102
+ if (filtered[wi].startsWith('-')) {
103
+ var dr = [filtered[wi]], wj = wi+1;
104
+ while (wj < filtered.length && filtered[wj].startsWith('-')) { dr.push(filtered[wj]); wj++; }
105
+ var ar = [], wk = wj;
106
+ while (wk < filtered.length && filtered[wk].startsWith('+')) { ar.push(filtered[wk]); wk++; }
107
+ if (dr.length === ar.length && dr.length > 0) {
108
+ var allWs = true;
109
+ for (var wc = 0; wc < dr.length; wc++) { if (!isWhitespaceOnly(dr[wc], ar[wc])) { allWs = false; break; } }
110
+ if (allWs) { for (var wx = 0; wx < ar.length; wx++) wsOut.push(' ' + ar[wx].slice(1)); wi = wk-1; continue; }
111
+ }
112
+ }
113
+ wsOut.push(filtered[wi]);
114
+ }
115
+
116
+ var dels = [], adds = [], parsed = [];
117
+ var oL = 0, nL = 0, pD = false, pA = false;
118
+ for (var pi = 0; pi < wsOut.length; pi++) {
119
+ var line = wsOut[pi];
120
+ if (line.startsWith('--- ') || line.startsWith('+++ ') || line.startsWith('diff ')) continue;
121
+ if (line.startsWith('@@')) {
122
+ var hm = line.match(/@@ -(\d+)(?:,\d+)? \+(\d+)/);
123
+ if (hm) { oL = parseInt(hm[1]); nL = parseInt(hm[2]); }
124
+ parsed.push({ type: 'hunk', text: line }); pD = false; pA = false; continue;
125
+ }
126
+ if (line.startsWith('+')) {
127
+ var ae = { type:'add', code:line.slice(1), newLine:nL, consecutive:pA, idx:parsed.length };
128
+ adds.push(ae); parsed.push(ae); nL++; pA = true; pD = false;
129
+ } else if (line.startsWith('-')) {
130
+ var de = { type:'del', code:line.slice(1), oldLine:oL, consecutive:pD, idx:parsed.length };
131
+ dels.push(de); parsed.push(de); oL++; pD = true; pA = false;
132
+ } else {
133
+ var c = line.startsWith(' ') ? line.slice(1) : line;
134
+ parsed.push({ type:'ctx', code:c, oldLine:oL, newLine:nL }); oL++; nL++; pD = false; pA = false;
135
+ }
136
+ }
137
+
138
+ var mv = detectMoves(dels, adds);
139
+ var rows = [];
140
+ for (var ri = 0; ri < parsed.length; ri++) {
141
+ var p = parsed[ri];
142
+ if (p.type === 'hunk') {
143
+ rows.push('<tr class="diff-hunk"><td class="diff-ln"></td><td class="diff-ln"></td><td class="diff-code">' + esc(p.text) + '</td></tr>');
144
+ } else if (p.type === 'add') {
145
+ var ai2 = -1; for (var fa=0;fa<adds.length;fa++) if(adds[fa].idx===p.idx){ai2=fa;break;}
146
+ var cls = (mv.movedAdds[ai2]) ? (mv.movedAdds[ai2].exact ? 'diff-moved-add' : 'diff-moved-add-edited') : 'diff-add';
147
+ rows.push('<tr class="'+cls+'"><td class="diff-ln"></td><td class="diff-ln">'+p.newLine+'</td><td class="diff-code">'+esc(p.code)+'</td></tr>');
148
+ } else if (p.type === 'del') {
149
+ var di2 = -1; for(var fd=0;fd<dels.length;fd++) if(dels[fd].idx===p.idx){di2=fd;break;}
150
+ var cls2 = (mv.movedDels[di2]) ? (mv.movedDels[di2].exact ? 'diff-moved-del' : 'diff-moved-del-edited') : 'diff-del';
151
+ rows.push('<tr class="'+cls2+'"><td class="diff-ln">'+p.oldLine+'</td><td class="diff-ln"></td><td class="diff-code">'+esc(p.code)+'</td></tr>');
152
+ } else {
153
+ rows.push('<tr class="diff-ctx"><td class="diff-ln">'+p.oldLine+'</td><td class="diff-ln">'+p.newLine+'</td><td class="diff-code">'+esc(p.code)+'</td></tr>');
154
+ }
155
+ }
156
+ el.innerHTML = '<table class="diff-table"><tbody>' + rows.join('') + '</tbody></table>';
157
+ }
158
+
159
+ /* Auto-discovery: after DOM loads, find all [data-diff] elements and render diffs from pr-diffs-json. */
160
+ document.addEventListener('DOMContentLoaded', function() {
161
+ var prDiffs = loadPrDiffs();
162
+ if (!prDiffs) return;
163
+ var els = document.querySelectorAll('[data-diff]');
164
+ for (var i = 0; i < els.length; i++) {
165
+ var key = els[i].getAttribute('data-diff');
166
+ if (key && Object.prototype.hasOwnProperty.call(prDiffs, key)) {
167
+ renderDiff(els[i], prDiffs[key]);
168
+ }
169
+ }
170
+ });
@@ -0,0 +1,96 @@
1
+ :root {
2
+ --bg: #1a1a1a;
3
+ --surface: #222;
4
+ --surface-raised: #2a2a2a;
5
+ --border: #333;
6
+ --text: #bbb;
7
+ --text-muted: #777;
8
+ --text-bright: #e5e5e5;
9
+ --accent: #7aa2f7;
10
+ --warning: #e0a458;
11
+ --success: #73b87e;
12
+ --danger: #e06060;
13
+ }
14
+ * { margin: 0; padding: 0; box-sizing: border-box; }
15
+ body {
16
+ background: var(--bg);
17
+ color: var(--text);
18
+ font-family: 'Inter', -apple-system, sans-serif;
19
+ font-size: 13px;
20
+ line-height: 1.5;
21
+ }
22
+ .header {
23
+ border-bottom: 1px solid var(--border);
24
+ padding: 24px 32px 20px;
25
+ }
26
+ .header h1 { font-size: 20px; font-weight: 600; color: var(--text-bright); margin-bottom: 4px; }
27
+ .header-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 16px; align-items: center; margin-top: 8px; }
28
+ .pill { display: inline-flex; padding: 1px 8px; border-radius: 10px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 500; }
29
+ .pill.add { background: #73b87e22; color: var(--success); }
30
+ .pill.del { background: #e0606022; color: var(--danger); }
31
+ .pill.files { background: #7aa2f722; color: var(--accent); }
32
+ .content { max-width: 900px; margin: 0 auto; padding: 24px 20px 60px; }
33
+ .summary { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 16px 20px; margin-bottom: 28px; font-size: 13px; line-height: 1.6; }
34
+ .summary strong { color: var(--text-bright); }
35
+ .summary ul { margin-top: 8px; padding-left: 18px; }
36
+ .summary li { margin-bottom: 4px; }
37
+ .section-title { font-size: 14px; font-weight: 600; color: var(--text-bright); margin: 28px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
38
+ .ic { font-family: 'IBM Plex Mono', monospace; font-size: 11px; background: var(--surface-raised); padding: 1px 5px; border-radius: 3px; color: var(--accent); }
39
+
40
+ .file-card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 12px; }
41
+ .file-hdr {
42
+ display: flex; align-items: center; justify-content: space-between;
43
+ padding: 8px 14px; background: var(--surface-raised); border-bottom: 1px solid var(--border);
44
+ cursor: pointer; user-select: none; position: sticky; top: 0; z-index: 12; border-radius: 6px 6px 0 0;
45
+ }
46
+ .file-hdr:hover { background: #303030; }
47
+ .file-hdr .fname { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--accent); }
48
+ .file-hdr .fstats { display: flex; gap: 6px; align-items: center; }
49
+ .file-hdr .chev { color: var(--text-muted); transition: transform 0.15s; font-size: 11px; margin-left: 10px; }
50
+ .file-hdr .chev.open { transform: rotate(90deg); }
51
+ .file-body { display: none; }
52
+ .file-body.open { display: block; }
53
+ .file-note {
54
+ padding: 10px 14px; font-size: 13px; color: var(--text); line-height: 1.55;
55
+ border-bottom: 1px solid var(--border); background: var(--surface);
56
+ position: sticky; top: 35px; z-index: 11;
57
+ }
58
+ .file-note strong { color: var(--text-bright); }
59
+ .file-note ul { margin-top: 6px; padding-left: 18px; }
60
+ .file-note li { margin-bottom: 3px; }
61
+
62
+ .bp-section { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px; }
63
+ .bp-hdr { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; cursor: pointer; user-select: none; font-size: 12px; color: var(--text-muted); }
64
+ .bp-hdr:hover { background: var(--surface-raised); }
65
+ .bp-hdr .chev { color: var(--text-muted); transition: transform 0.15s; font-size: 11px; }
66
+ .bp-hdr .chev.open { transform: rotate(90deg); }
67
+ .bp-body { display: none; border-top: 1px solid var(--border); }
68
+ .bp-body.open { display: block; }
69
+ .bp-note { padding: 8px 14px; font-size: 12px; color: var(--text-muted); line-height: 1.5; border-bottom: 1px solid var(--border); background: var(--bg); }
70
+
71
+ .diff-table { width: 100%; border-collapse: collapse; font-family: 'IBM Plex Mono', monospace; font-size: 12px; line-height: 20px; table-layout: fixed; tab-size: 4; }
72
+ .diff-table td { vertical-align: top; white-space: pre; }
73
+ .diff-ln { width: 40px; min-width: 40px; max-width: 40px; text-align: right; padding: 0 6px 0 0; color: #555; background: var(--surface); user-select: none; }
74
+ .diff-code { padding: 0 12px; color: var(--text); background: var(--bg); overflow-x: auto; }
75
+ tr.diff-add .diff-ln { color: #5a8a5a; background: #1a2a1a; }
76
+ tr.diff-add .diff-code { background: #1a2a1a; color: #c8e6c8; }
77
+ tr.diff-del .diff-ln { color: #8a5a5a; background: #2a1a1a; }
78
+ tr.diff-del .diff-code { background: #2a1a1a; color: #e6c8c8; }
79
+ tr.diff-ctx .diff-ln { background: var(--surface); }
80
+ tr.diff-ctx .diff-code { background: var(--bg); color: var(--text-muted); }
81
+ tr.diff-hunk td { background: var(--surface-raised); color: var(--text-muted); font-size: 11px; padding: 3px 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
82
+ tr.diff-hunk .diff-ln { background: var(--surface-raised); }
83
+ tr.diff-moved-del .diff-ln { color: #6a6a8a; background: #1a1a2a; }
84
+ tr.diff-moved-del .diff-code { background: #1a1a2a; color: #a8a8d0; }
85
+ tr.diff-moved-add .diff-ln { color: #6a6a8a; background: #1a1a2a; }
86
+ tr.diff-moved-add .diff-code { background: #1a1a2a; color: #a8a8d0; }
87
+ tr.diff-moved-del-edited .diff-ln { color: #7a6a8a; background: #221a2a; }
88
+ tr.diff-moved-del-edited .diff-code { background: #221a2a; color: #c0a8d0; }
89
+ tr.diff-moved-add-edited .diff-ln { color: #7a6a8a; background: #221a2a; }
90
+ tr.diff-moved-add-edited .diff-code { background: #221a2a; color: #c0a8d0; }
91
+
92
+ .verdict { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 16px 20px; margin-top: 28px; }
93
+ .verdict h3 { font-size: 14px; font-weight: 600; color: var(--text-bright); margin-bottom: 8px; }
94
+ .verdict ul { padding-left: 18px; }
95
+ .verdict li { font-size: 13px; margin-bottom: 6px; line-height: 1.5; }
96
+ .verdict li strong { color: var(--text-bright); }
@@ -0,0 +1,18 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
7
+ <style>
8
+ /* INJECT_CSS */
9
+ </style>
10
+ <script>
11
+ /* INJECT_JS */
12
+ </script>
13
+ </head>
14
+ <body>
15
+ <!-- INJECT_BODY -->
16
+ <script id="pr-diffs-json" type="application/json" data-pr-diffs>{"__PR_DIFFS_PLACEHOLDER__":true}</script>
17
+ </body>
18
+ </html>
@@ -24,12 +24,12 @@ That covers this workspace's Pi session files (`<sessions>/*.jsonl`) and subagen
24
24
 
25
25
  One message, three `Task` calls, `subagent_type: generalPurpose`, `readonly` unset (`readonly: false`). Reviewers need MCP access to look up the tickets, chat threads, and observability traces the transcript references, and readonly strips MCPs.
26
26
 
27
- Each reviewer and the synthesizer name a role line in the model rule (`~/.pi/agent/pstack/pstack-models.md`) and a default. Set `model` to that line's value, or to the default if the rule or the line is missing. Leave `model` unset when the value is `auto` or `inherit-parent`. If the Task tool rejects a slug, use the default and say so. If it rejects the default, use the closest valid slug of the same family from its error message. Pick each subagent's reasoning level (the `:<level>` suffix), and fast or standard speed when the model has a `-fast` variant, for the job, per the Subagents section of the **poteto-mode** skill.
27
+ Each reviewer and the synthesizer name a role line in the model rule at the path the system prompt names and a default. Set `model` to that line's value, or to the default if the rule or the line is missing. Leave `model` unset when the value is `auto` or `inherit-parent`. If the Task tool rejects a slug, use the default and say so. If it rejects the default, use the closest valid slug of the same family from its error message. Pick each subagent's reasoning level (the `:<level>` suffix), and fast or standard speed when the model has a `-fast` variant, for the job, per the Subagents section of the **poteto-mode** skill.
28
28
 
29
29
  | Lens | Role line | Default `model` | Prompt template |
30
30
  |---|---|---|---|
31
31
  | Judgment | `reflect judgment, divergent, synthesizer` | `claude-opus-5-5:xhigh` | `references/judgment-reviewer.md` |
32
- | Tooling | `reflect tooling` | `grok-4.7:xhigh` | `references/tooling-reviewer.md` |
32
+ | Tooling | `reflect tooling` | `grok-4.7[effort=xhigh,fast=true]` | `references/tooling-reviewer.md` |
33
33
  | Divergent | `reflect judgment, divergent, synthesizer` | `claude-opus-5-5:xhigh` | `references/divergent-reviewer.md` |
34
34
 
35
35
  Pass each template verbatim, substituting the transcript path or digest where marked. Reviewers return findings in the `Task` response body.
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: review-and-ship
3
+ description: Review the current branch for bugs, intent fit, and test coverage; run or write tests; commit focused work; open or update a PR.
4
+ ---
5
+
6
+ # Review and ship
7
+
8
+ ## Trigger
9
+
10
+ Reviewing changes before shipping. Close key issues, verify behavior, and open or update a PR.
11
+
12
+ ## Workflow
13
+
14
+ 1. Gather context: diff against base branch, uncommitted changes, recent commits, changed files, and user intent from recent relevant chats if useful.
15
+ 2. Run targeted tests for changed behavior. If no focused tests exist, decide whether to add them or document the gap.
16
+ 3. Review for correctness, regressions, security, and intent fit. Use parallel subagents for larger diffs.
17
+ 4. Fix critical issues before finalizing and re-run affected tests.
18
+ 5. Commit selective files with a concise message.
19
+ 6. Push branch and open or update a PR.
20
+
21
+ ## Suggested Checks
22
+
23
+ ```bash
24
+ git fetch origin main
25
+ git diff origin/main...HEAD
26
+ git status
27
+ gh pr checks --json name,bucket,state,workflow,link
28
+ ```
29
+
30
+ ## Guardrails
31
+
32
+ - Prioritize correctness, security, and regressions over style-only comments.
33
+ - Keep commits focused and avoid unrelated file changes.
34
+ - If pre-commit checks fail, fix the issues rather than bypassing hooks.
35
+ - Use `gh pr checks` instead of GitHub Actions-only commands when judging PR readiness.
36
+
37
+ ## Output
38
+
39
+ - Findings summary (critical, warning, note)
40
+ - Tests run and outcomes
41
+ - PR URL
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: run-smoke-tests
3
+ description: Run Playwright smoke tests, debug failures, and verify fixes
4
+ ---
5
+
6
+ # Run smoke tests
7
+
8
+ ## Trigger
9
+
10
+ Need end-to-end smoke verification before or after changes.
11
+
12
+ ## Workflow
13
+
14
+ 1. Build prerequisites for the target app.
15
+ 2. Run the relevant smoke suite or a focused test file.
16
+ 3. If failing, inspect traces/logs and isolate the root cause.
17
+ 4. Apply a minimal fix and rerun until stable.
18
+
19
+ ## Example Commands
20
+
21
+ ```bash
22
+ # Run full smoke suite
23
+ npm run smoketest
24
+
25
+ # Run a specific smoke test file
26
+ npm run smoketest -- path/to/test.spec.ts
27
+
28
+ # Faster iteration when build artifacts are ready
29
+ npm run smoketest-no-compile -- path/to/test.spec.ts
30
+ ```
31
+
32
+ ## Guardrails
33
+
34
+ - Prefer deterministic waits and assertions over brittle timeouts.
35
+ - Re-run passing fixes to reduce flaky false positives.
36
+ - Quarantine tests only when explicitly requested and documented.
37
+
38
+ ## Output
39
+
40
+ - Test results summary
41
+ - Root cause and fix
42
+ - Remaining flake risk (if any)
@@ -26,7 +26,7 @@ The default role-to-model mapping is the rule shape shown in step 5 below. If th
26
26
  - `medium — high reasoning`
27
27
  - `small — medium reasoning`
28
28
 
29
- **(b) Apply it.** Build the working table from the skill defaults, and on a re-run keep any role you changed by family, list, or alias (`inherit-parent`, `auto`). `unlimited`, `large`, `medium`, and `small` set the effort token of every real model spec, panel entries included, to `max`, `xhigh`, `high`, or `medium`. The effort token is the `:<level>` suffix, or `effort=<level>` inside `[...]` (a `fast=true` there is speed, not effort), on the ladder `max` > `xhigh` > `high` > `medium` > `low`. If the result is not a detected model at that level (Task rejects a level the model does not list), use the same family's detected model at the highest effort at or below the target, else mark the role as needing a choice. `inherit-parent` and `auto` do not change. So `unlimited` turns `claude-opus-5-5:xhigh` into `claude-opus-5-5:max`. Grok tops out at `xhigh`, so under `unlimited` the fallback puts Grok at `xhigh` and keeps `grok-4.7:xhigh` as it is. `large` keeps both defaults. `small` turns them into `claude-opus-5-5:medium` and `grok-4.7:medium`.
29
+ **(b) Apply it.** Build the working table from the skill defaults, and on a re-run keep any role you changed by family, list, or alias (`inherit-parent`, `auto`). `unlimited`, `large`, `medium`, and `small` set the effort token of every real model spec, panel entries included, to `max`, `xhigh`, `high`, or `medium`. The effort token is the `:<level>` suffix, or `effort=<level>` inside `[...]` (a `fast=true` there is speed, not effort), on the ladder `max` > `xhigh` > `high` > `medium` > `low`. If the result is not a detected model at that level (Task rejects a level the model does not list), use the same family's detected model at the highest effort at or below the target, else mark the role as needing a choice. `inherit-parent` and `auto` do not change. So `unlimited` turns `claude-opus-5-5:xhigh` into `claude-opus-5-5:max`. Grok tops out at `xhigh`, so under `unlimited` the fallback puts Grok at `xhigh` and keeps `grok-4.7[effort=xhigh,fast=true]` as it is. `large` keeps both defaults. `small` turns them into `claude-opus-5-5:medium` and `grok-4.7[effort=medium,fast=true]`.
30
30
 
31
31
  **(c) Show the roles and confirm.** Show every role with its model, marking any real model spec not in the detected set as needing a choice. Also list each line step 2 dropped. Ask whether to accept as-is or change specific roles, offering the detected models plus `inherit-parent` and `auto` (both mean: this role runs on the parent chat model, which is how a role follows the chat model when the user switches it) as the options. Prefer AskQuestion over free text. For panel roles (arena runners, architect runners, interrogate reviewers) the value is a list, and one subagent runs per entry, alias entries included, so the list length sets the count. `arena cross-judge pool` is also a list, but Arena runs one judge. It tries only values from a family other than the parent's, in list order, so order it by preference. An `inherit-parent` or `auto` value never judges. `swarm workers` is the default model for every worker unless a race or comparison assigns another model per arm.
32
32
 
@@ -42,23 +42,23 @@ Write the model rule at the path the system prompt names, as plain Markdown with
42
42
  # pstack model configuration. One line per role. Delete a line to fall back to the skill default.
43
43
  # `inherit-parent` or `auto` as a value: the role runs on the parent chat model (omit Task `model`). Alias entries in a panel list still count toward its fan-out.
44
44
  # budget: large (xhigh)
45
- feature, refactoring: grok-4.7:xhigh
46
- bug-fix: grok-4.7:xhigh
47
- perf-issue: grok-4.7:xhigh
48
- hillclimb: grok-4.7:xhigh
45
+ feature, refactoring: grok-4.7[effort=xhigh,fast=true]
46
+ bug-fix: grok-4.7[effort=xhigh,fast=true]
47
+ perf-issue: grok-4.7[effort=xhigh,fast=true]
48
+ hillclimb: grok-4.7[effort=xhigh,fast=true]
49
49
  judgment and prose: claude-opus-5-5:xhigh
50
50
  hardest tasks: claude-opus-5-5:xhigh
51
- how explorer: grok-4.7:xhigh
51
+ how explorer: grok-4.7[effort=xhigh,fast=true]
52
52
  how explainer: claude-opus-5-5:xhigh
53
- why investigators: grok-4.7:xhigh
53
+ why investigators: grok-4.7[effort=xhigh,fast=true]
54
54
  why synthesizer: claude-opus-5-5:xhigh
55
- reflect tooling: grok-4.7:xhigh
55
+ reflect tooling: grok-4.7[effort=xhigh,fast=true]
56
56
  reflect judgment, divergent, synthesizer: claude-opus-5-5:xhigh
57
- arena runners: claude-opus-5-5:xhigh, grok-4.7:xhigh
58
- arena cross-judge pool: claude-opus-5-5:xhigh, grok-4.7:xhigh
59
- swarm workers: grok-4.7:xhigh
60
- architect runners: claude-opus-5-5:xhigh, grok-4.7:xhigh
61
- interrogate reviewers: claude-opus-5-5:xhigh, grok-4.7:xhigh
57
+ arena runners: claude-opus-5-5:xhigh, grok-4.7[effort=xhigh,fast=true]
58
+ arena cross-judge pool: claude-opus-5-5:xhigh, grok-4.7[effort=xhigh,fast=true]
59
+ swarm workers: grok-4.7[effort=xhigh,fast=true]
60
+ architect runners: claude-opus-5-5:xhigh, grok-4.7[effort=xhigh,fast=true]
61
+ interrogate reviewers: claude-opus-5-5:xhigh, grok-4.7[effort=xhigh,fast=true]
62
62
  ```
63
63
 
64
64
  ### 6. Confirm
@@ -113,7 +113,7 @@ const launcherTools = () => {
113
113
  };
114
114
 
115
115
  const linkedLauncher = () => {
116
- const links = fs.mkdtempSync(path.join(os.tmpdir(), "statechart-links-"));
116
+ const links = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), "statechart-links-")));
117
117
  const [first, second] = [path.join(links, "a"), path.join(links, "b")];
118
118
  fs.mkdirSync(first);
119
119
  fs.mkdirSync(second);
@@ -19,12 +19,12 @@ Open a todolist with one entry per phase before launching anything.
19
19
 
20
20
  1. State the done predicate and the artifact or report the swarm must return.
21
21
  2. Choose the shape. Partition into slices, race N workers on identical briefs, or mix both. For a race or mixed shape, declare `first pass`, `rank all`, or `best-of` before spawning.
22
- 3. Pick the worker model from the `swarm workers` line in `~/.pi/agent/pstack/pstack-models.md`. If the rule or that line is missing, use `grok-4.7:xhigh`. For `auto` or `inherit-parent`, omit `model` so the workers run on the parent model. If the Task tool rejects a slug, use the default and say so. If it rejects the default, use the closest valid slug of the same family from its error message. For a model race, name each arm's model up front. Pick each subagent's reasoning level (the `:<level>` suffix), and fast or standard speed when the model has a `-fast` variant, for the job, per the Subagents section of the **poteto-mode** skill.
22
+ 3. Pick the worker model from the `swarm workers` line in the model rule at the path the system prompt names. If the rule or that line is missing, use `grok-4.7[effort=xhigh,fast=true]`. For `auto` or `inherit-parent`, omit `model` so the workers run on the parent model. If the Task tool rejects a slug, use the default and say so. If it rejects the default, use the closest valid slug of the same family from its error message. For a model race, name each arm's model up front. Pick each subagent's reasoning level (the `:<level>` suffix), and fast or standard speed when the model has a `-fast` variant, for the job, per the Subagents section of the **poteto-mode** skill.
23
23
  4. Give each worker its own writable output when it writes. When workers verify or measure commits, each brief names the exact SHAs. A measurement brief also names the method (sample count, what one sample is, order). The worker records both in its result.
24
24
 
25
25
  ## Phase B: Fan out
26
26
 
27
- Spawn all N workers in one message with `subagent_type: generalPurpose`, `environment: "cloud"`, `run_in_background: true`, and the step 3 model, left unset for `auto` or `inherit-parent`. Use `environment: "local"` only when the worker needs access to something on the user's computer.
27
+ Spawn all N workers in one message with `subagent_type: generalPurpose`, `environment: "cloud"`, `run_in_background: true`, and the step 3 model, left unset for `auto` or `inherit-parent`. Both environments run on the user's computer. `cloud` gives each worker a separate git worktree, not a VM or a credential boundary. Use `environment: "local"` only when the worker needs the existing checkout or its uncommitted state. For concurrent runtime lanes, each brief must assign distinct ports, output directories, and writable cache paths. If the task requires stronger machine isolation, report that requirement as unavailable rather than claiming a worktree provides it.
28
28
 
29
29
  When a worker must start from a non-default pushed branch, pass `cloud_base_branch`.
30
30