pan-wizard 3.5.2 → 3.8.0

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 (98) hide show
  1. package/README.md +28 -9
  2. package/agents/pan-executor.md +18 -0
  3. package/agents/pan-experiment-runner.md +126 -0
  4. package/agents/pan-phase-researcher.md +16 -0
  5. package/agents/pan-plan-checker.md +80 -0
  6. package/agents/pan-planner.md +19 -0
  7. package/agents/pan-reviewer.md +2 -0
  8. package/agents/pan-verifier.md +41 -0
  9. package/bin/install-lib.cjs +55 -0
  10. package/bin/install.js +71 -22
  11. package/commands/pan/debug.md +1 -1
  12. package/commands/pan/experiment.md +219 -0
  13. package/commands/pan/health.md +1 -1
  14. package/commands/pan/learn.md +15 -1
  15. package/commands/pan/links.md +102 -0
  16. package/commands/pan/optimize.md +13 -0
  17. package/commands/pan/patches.md +10 -1
  18. package/commands/pan/phase-tests.md +1 -4
  19. package/commands/pan/todo-add.md +1 -1
  20. package/commands/pan/todo-check.md +1 -1
  21. package/hooks/dist/pan-cost-logger.js +54 -4
  22. package/hooks/dist/pan-trace-logger.js +72 -3
  23. package/package.json +67 -66
  24. package/pan-wizard-core/bin/lib/codebase.cjs +2 -0
  25. package/pan-wizard-core/bin/lib/commands.cjs +8 -0
  26. package/pan-wizard-core/bin/lib/config.cjs +13 -2
  27. package/pan-wizard-core/bin/lib/context-budget.cjs +73 -0
  28. package/pan-wizard-core/bin/lib/core.cjs +13 -0
  29. package/pan-wizard-core/bin/lib/doc-lint/frontmatter.js +270 -0
  30. package/pan-wizard-core/bin/lib/doc-lint/reporter.js +45 -0
  31. package/pan-wizard-core/bin/lib/doc-lint/schema.js +202 -0
  32. package/pan-wizard-core/bin/lib/doc-lint/validate.js +190 -0
  33. package/pan-wizard-core/bin/lib/doc-lint/walk.js +135 -0
  34. package/pan-wizard-core/bin/lib/doc-lint.cjs +287 -0
  35. package/pan-wizard-core/bin/lib/experiment.cjs +502 -0
  36. package/pan-wizard-core/bin/lib/learn-index.cjs +235 -0
  37. package/pan-wizard-core/bin/lib/learn-lint.cjs +292 -0
  38. package/pan-wizard-core/bin/lib/links.cjs +549 -0
  39. package/pan-wizard-core/bin/lib/optimize.cjs +474 -1
  40. package/pan-wizard-core/bin/lib/runner.cjs +473 -0
  41. package/pan-wizard-core/bin/lib/verify.cjs +23 -0
  42. package/pan-wizard-core/bin/pan-tools.cjs +247 -3
  43. package/pan-wizard-core/learnings/README.md +70 -0
  44. package/pan-wizard-core/learnings/index.json +540 -0
  45. package/pan-wizard-core/learnings/internal/.gitkeep +2 -0
  46. package/pan-wizard-core/learnings/internal/experiment-runner.md +81 -0
  47. package/pan-wizard-core/learnings/internal/external-research.md +93 -0
  48. package/pan-wizard-core/learnings/internal/loop-design.md +33 -0
  49. package/pan-wizard-core/learnings/internal/pan-dev-bugs.md +181 -0
  50. package/pan-wizard-core/learnings/universal/.gitkeep +2 -0
  51. package/pan-wizard-core/learnings/universal/atomic-state.md +21 -0
  52. package/pan-wizard-core/learnings/universal/binary-io.md +21 -0
  53. package/pan-wizard-core/learnings/universal/comment-syntax.md +21 -0
  54. package/pan-wizard-core/learnings/universal/composition.md +33 -0
  55. package/pan-wizard-core/learnings/universal/concurrency.md +33 -0
  56. package/pan-wizard-core/learnings/universal/dag-scheduler.md +33 -0
  57. package/pan-wizard-core/learnings/universal/data-driven-design.md +21 -0
  58. package/pan-wizard-core/learnings/universal/design-process.md +21 -0
  59. package/pan-wizard-core/learnings/universal/empirical-spike.md +21 -0
  60. package/pan-wizard-core/learnings/universal/error-handling.md +23 -0
  61. package/pan-wizard-core/learnings/universal/error-paths.md +21 -0
  62. package/pan-wizard-core/learnings/universal/glob-semantics.md +21 -0
  63. package/pan-wizard-core/learnings/universal/idempotency.md +21 -0
  64. package/pan-wizard-core/learnings/universal/invariants.md +21 -0
  65. package/pan-wizard-core/learnings/universal/io-patterns.md +21 -0
  66. package/pan-wizard-core/learnings/universal/numeric-edge-cases.md +21 -0
  67. package/pan-wizard-core/learnings/universal/output-conventions.md +21 -0
  68. package/pan-wizard-core/learnings/universal/parser-design.md +21 -0
  69. package/pan-wizard-core/learnings/universal/phase-locking.md +21 -0
  70. package/pan-wizard-core/learnings/universal/pipe-friendly-cli.md +21 -0
  71. package/pan-wizard-core/learnings/universal/schema-design.md +21 -0
  72. package/pan-wizard-core/learnings/universal/secret-handling.md +21 -0
  73. package/pan-wizard-core/learnings/universal/streaming-io.md +21 -0
  74. package/pan-wizard-core/learnings/universal/test-patterns.md +57 -0
  75. package/pan-wizard-core/learnings/universal/test-strategy.md +33 -0
  76. package/pan-wizard-core/learnings/universal/unicode.md +21 -0
  77. package/pan-wizard-core/learnings/universal/vendor-pattern.md +21 -0
  78. package/pan-wizard-core/references/guardrails.md +58 -0
  79. package/pan-wizard-core/references/handoff-decisions.md +156 -0
  80. package/pan-wizard-core/references/schemas/pan-command.schema.yml +39 -0
  81. package/pan-wizard-core/references/verification-patterns.md +31 -0
  82. package/pan-wizard-core/templates/config.json +2 -1
  83. package/pan-wizard-core/templates/idea.md +52 -0
  84. package/pan-wizard-core/templates/summary-complex.md +14 -5
  85. package/pan-wizard-core/templates/summary-minimal.md +6 -0
  86. package/pan-wizard-core/templates/summary-standard.md +14 -3
  87. package/pan-wizard-core/workflows/discuss-phase.md +108 -1
  88. package/pan-wizard-core/workflows/exec-phase.md +37 -1
  89. package/pan-wizard-core/workflows/execute-plan.md +14 -0
  90. package/pan-wizard-core/workflows/health.md +23 -0
  91. package/pan-wizard-core/workflows/new-project.md +65 -81
  92. package/pan-wizard-core/workflows/plan-phase.md +58 -0
  93. package/pan-wizard-core/workflows/transition.md +102 -7
  94. package/pan-wizard-core/workflows/verify-phase.md +14 -0
  95. package/scripts/build-hooks.js +7 -1
  96. package/scripts/generate-skills-docs.py +10 -8
  97. package/scripts/git-hooks/pre-commit +40 -0
  98. package/scripts/release-check.js +184 -0
@@ -0,0 +1,540 @@
1
+ {
2
+ "schema_version": 1,
3
+ "generated_at": "2026-05-03T06:35:05.956Z",
4
+ "topics": [
5
+ {
6
+ "name": "experiment-runner",
7
+ "scope": "internal",
8
+ "file": "pan-wizard-core/learnings/internal/experiment-runner.md",
9
+ "patterns": [
10
+ "P-EXP-001",
11
+ "P-EXP-002",
12
+ "P-EXP-003",
13
+ "P-EXP-004",
14
+ "P-EXP-005",
15
+ "P-NPRS-005"
16
+ ],
17
+ "size_bytes": 8889,
18
+ "size_tokens_est": 2223,
19
+ "agent_relevance": {
20
+ "planner": "low",
21
+ "executor": "low",
22
+ "verifier": "low",
23
+ "reviewer": "low"
24
+ }
25
+ },
26
+ {
27
+ "name": "external-research",
28
+ "scope": "internal",
29
+ "file": "pan-wizard-core/learnings/internal/external-research.md",
30
+ "patterns": [
31
+ "P-RES-001",
32
+ "P-RES-002",
33
+ "P-RES-003",
34
+ "P-RES-004",
35
+ "P-RES-005",
36
+ "P-RES-006",
37
+ "P-RES-007"
38
+ ],
39
+ "size_bytes": 10306,
40
+ "size_tokens_est": 2577,
41
+ "agent_relevance": {
42
+ "planner": "medium",
43
+ "executor": "low",
44
+ "verifier": "low",
45
+ "reviewer": "medium"
46
+ }
47
+ },
48
+ {
49
+ "name": "loop-design",
50
+ "scope": "internal",
51
+ "file": "pan-wizard-core/learnings/internal/loop-design.md",
52
+ "patterns": [
53
+ "P-1303",
54
+ "P-1403"
55
+ ],
56
+ "size_bytes": 2781,
57
+ "size_tokens_est": 696,
58
+ "agent_relevance": {
59
+ "planner": "medium",
60
+ "executor": "low",
61
+ "verifier": "low",
62
+ "reviewer": "low"
63
+ }
64
+ },
65
+ {
66
+ "name": "pan-dev-bugs",
67
+ "scope": "internal",
68
+ "file": "pan-wizard-core/learnings/internal/pan-dev-bugs.md",
69
+ "patterns": [
70
+ "P-101",
71
+ "P-102",
72
+ "P-301",
73
+ "P-1301",
74
+ "P-1302",
75
+ "P-1304",
76
+ "P-1401",
77
+ "P-1402",
78
+ "P-1404",
79
+ "P-1501",
80
+ "P-1502",
81
+ "P-1701",
82
+ "P-1501-r2",
83
+ "P-1501-r3"
84
+ ],
85
+ "size_bytes": 16824,
86
+ "size_tokens_est": 4206,
87
+ "agent_relevance": {
88
+ "planner": "low",
89
+ "executor": "low",
90
+ "verifier": "low",
91
+ "reviewer": "low"
92
+ }
93
+ },
94
+ {
95
+ "name": "atomic-state",
96
+ "scope": "universal",
97
+ "file": "pan-wizard-core/learnings/universal/atomic-state.md",
98
+ "patterns": [
99
+ "P-1201"
100
+ ],
101
+ "size_bytes": 1593,
102
+ "size_tokens_est": 399,
103
+ "agent_relevance": {
104
+ "planner": "medium",
105
+ "executor": "high",
106
+ "verifier": "high",
107
+ "reviewer": "medium"
108
+ }
109
+ },
110
+ {
111
+ "name": "binary-io",
112
+ "scope": "universal",
113
+ "file": "pan-wizard-core/learnings/universal/binary-io.md",
114
+ "patterns": [
115
+ "P-1101"
116
+ ],
117
+ "size_bytes": 1339,
118
+ "size_tokens_est": 335,
119
+ "agent_relevance": {
120
+ "planner": "low",
121
+ "executor": "high",
122
+ "verifier": "medium",
123
+ "reviewer": "low"
124
+ }
125
+ },
126
+ {
127
+ "name": "comment-syntax",
128
+ "scope": "universal",
129
+ "file": "pan-wizard-core/learnings/universal/comment-syntax.md",
130
+ "patterns": [
131
+ "P-501"
132
+ ],
133
+ "size_bytes": 1516,
134
+ "size_tokens_est": 379,
135
+ "agent_relevance": {
136
+ "planner": "low",
137
+ "executor": "medium",
138
+ "verifier": "low",
139
+ "reviewer": "medium"
140
+ }
141
+ },
142
+ {
143
+ "name": "composition",
144
+ "scope": "universal",
145
+ "file": "pan-wizard-core/learnings/universal/composition.md",
146
+ "patterns": [
147
+ "P-602",
148
+ "P-802"
149
+ ],
150
+ "size_bytes": 2931,
151
+ "size_tokens_est": 733,
152
+ "agent_relevance": {
153
+ "planner": "high",
154
+ "executor": "medium",
155
+ "verifier": "low",
156
+ "reviewer": "medium"
157
+ }
158
+ },
159
+ {
160
+ "name": "concurrency",
161
+ "scope": "universal",
162
+ "file": "pan-wizard-core/learnings/universal/concurrency.md",
163
+ "patterns": [
164
+ "P-1204",
165
+ "P-NPRS-003"
166
+ ],
167
+ "size_bytes": 3400,
168
+ "size_tokens_est": 850,
169
+ "agent_relevance": {
170
+ "planner": "medium",
171
+ "executor": "high",
172
+ "verifier": "high",
173
+ "reviewer": "medium"
174
+ }
175
+ },
176
+ {
177
+ "name": "dag-scheduler",
178
+ "scope": "universal",
179
+ "file": "pan-wizard-core/learnings/universal/dag-scheduler.md",
180
+ "patterns": [
181
+ "P-1206",
182
+ "P-NPRS-002"
183
+ ],
184
+ "size_bytes": 3316,
185
+ "size_tokens_est": 829,
186
+ "agent_relevance": {
187
+ "planner": "high",
188
+ "executor": "medium",
189
+ "verifier": "low",
190
+ "reviewer": "medium"
191
+ }
192
+ },
193
+ {
194
+ "name": "data-driven-design",
195
+ "scope": "universal",
196
+ "file": "pan-wizard-core/learnings/universal/data-driven-design.md",
197
+ "patterns": [
198
+ "P-403"
199
+ ],
200
+ "size_bytes": 1186,
201
+ "size_tokens_est": 297,
202
+ "agent_relevance": {
203
+ "planner": "high",
204
+ "executor": "medium",
205
+ "verifier": "low",
206
+ "reviewer": "medium"
207
+ }
208
+ },
209
+ {
210
+ "name": "design-process",
211
+ "scope": "universal",
212
+ "file": "pan-wizard-core/learnings/universal/design-process.md",
213
+ "patterns": [
214
+ "P-203"
215
+ ],
216
+ "size_bytes": 1499,
217
+ "size_tokens_est": 375,
218
+ "agent_relevance": {
219
+ "planner": "high",
220
+ "executor": "low",
221
+ "verifier": "low",
222
+ "reviewer": "medium"
223
+ }
224
+ },
225
+ {
226
+ "name": "empirical-spike",
227
+ "scope": "universal",
228
+ "file": "pan-wizard-core/learnings/universal/empirical-spike.md",
229
+ "patterns": [
230
+ "P-NPRS-001"
231
+ ],
232
+ "size_bytes": 1898,
233
+ "size_tokens_est": 475,
234
+ "agent_relevance": {
235
+ "planner": "high",
236
+ "executor": "medium",
237
+ "verifier": "low",
238
+ "reviewer": "medium"
239
+ }
240
+ },
241
+ {
242
+ "name": "error-handling",
243
+ "scope": "universal",
244
+ "file": "pan-wizard-core/learnings/universal/error-handling.md",
245
+ "patterns": [
246
+ "P-1209"
247
+ ],
248
+ "size_bytes": 1726,
249
+ "size_tokens_est": 432,
250
+ "agent_relevance": {
251
+ "planner": "medium",
252
+ "executor": "high",
253
+ "verifier": "high",
254
+ "reviewer": "high"
255
+ }
256
+ },
257
+ {
258
+ "name": "error-paths",
259
+ "scope": "universal",
260
+ "file": "pan-wizard-core/learnings/universal/error-paths.md",
261
+ "patterns": [
262
+ "P-1205"
263
+ ],
264
+ "size_bytes": 1676,
265
+ "size_tokens_est": 419,
266
+ "agent_relevance": {
267
+ "planner": "low",
268
+ "executor": "high",
269
+ "verifier": "high",
270
+ "reviewer": "high"
271
+ }
272
+ },
273
+ {
274
+ "name": "glob-semantics",
275
+ "scope": "universal",
276
+ "file": "pan-wizard-core/learnings/universal/glob-semantics.md",
277
+ "patterns": [
278
+ "P-205"
279
+ ],
280
+ "size_bytes": 1309,
281
+ "size_tokens_est": 328,
282
+ "agent_relevance": {
283
+ "planner": "low",
284
+ "executor": "medium",
285
+ "verifier": "medium",
286
+ "reviewer": "low"
287
+ }
288
+ },
289
+ {
290
+ "name": "idempotency",
291
+ "scope": "universal",
292
+ "file": "pan-wizard-core/learnings/universal/idempotency.md",
293
+ "patterns": [
294
+ "P-IDEM-001"
295
+ ],
296
+ "size_bytes": 2445,
297
+ "size_tokens_est": 612,
298
+ "agent_relevance": {
299
+ "planner": "high",
300
+ "executor": "high",
301
+ "verifier": "high",
302
+ "reviewer": "high"
303
+ }
304
+ },
305
+ {
306
+ "name": "invariants",
307
+ "scope": "universal",
308
+ "file": "pan-wizard-core/learnings/universal/invariants.md",
309
+ "patterns": [
310
+ "P-901"
311
+ ],
312
+ "size_bytes": 1118,
313
+ "size_tokens_est": 280,
314
+ "agent_relevance": {
315
+ "planner": "medium",
316
+ "executor": "high",
317
+ "verifier": "high",
318
+ "reviewer": "high"
319
+ }
320
+ },
321
+ {
322
+ "name": "io-patterns",
323
+ "scope": "universal",
324
+ "file": "pan-wizard-core/learnings/universal/io-patterns.md",
325
+ "patterns": [
326
+ "P-401"
327
+ ],
328
+ "size_bytes": 1225,
329
+ "size_tokens_est": 307,
330
+ "agent_relevance": {
331
+ "planner": "low",
332
+ "executor": "high",
333
+ "verifier": "medium",
334
+ "reviewer": "low"
335
+ }
336
+ },
337
+ {
338
+ "name": "numeric-edge-cases",
339
+ "scope": "universal",
340
+ "file": "pan-wizard-core/learnings/universal/numeric-edge-cases.md",
341
+ "patterns": [
342
+ "P-601"
343
+ ],
344
+ "size_bytes": 1392,
345
+ "size_tokens_est": 348,
346
+ "agent_relevance": {
347
+ "planner": "low",
348
+ "executor": "high",
349
+ "verifier": "high",
350
+ "reviewer": "medium"
351
+ }
352
+ },
353
+ {
354
+ "name": "output-conventions",
355
+ "scope": "universal",
356
+ "file": "pan-wizard-core/learnings/universal/output-conventions.md",
357
+ "patterns": [
358
+ "P-402"
359
+ ],
360
+ "size_bytes": 1076,
361
+ "size_tokens_est": 269,
362
+ "agent_relevance": {
363
+ "planner": "low",
364
+ "executor": "high",
365
+ "verifier": "medium",
366
+ "reviewer": "low"
367
+ }
368
+ },
369
+ {
370
+ "name": "parser-design",
371
+ "scope": "universal",
372
+ "file": "pan-wizard-core/learnings/universal/parser-design.md",
373
+ "patterns": [
374
+ "P-1203"
375
+ ],
376
+ "size_bytes": 1742,
377
+ "size_tokens_est": 436,
378
+ "agent_relevance": {
379
+ "planner": "medium",
380
+ "executor": "high",
381
+ "verifier": "medium",
382
+ "reviewer": "medium"
383
+ }
384
+ },
385
+ {
386
+ "name": "phase-locking",
387
+ "scope": "universal",
388
+ "file": "pan-wizard-core/learnings/universal/phase-locking.md",
389
+ "patterns": [
390
+ "P-1208"
391
+ ],
392
+ "size_bytes": 1922,
393
+ "size_tokens_est": 481,
394
+ "agent_relevance": {
395
+ "planner": "high",
396
+ "executor": "low",
397
+ "verifier": "low",
398
+ "reviewer": "low"
399
+ }
400
+ },
401
+ {
402
+ "name": "pipe-friendly-cli",
403
+ "scope": "universal",
404
+ "file": "pan-wizard-core/learnings/universal/pipe-friendly-cli.md",
405
+ "patterns": [
406
+ "P-1207"
407
+ ],
408
+ "size_bytes": 1608,
409
+ "size_tokens_est": 402,
410
+ "agent_relevance": {
411
+ "planner": "medium",
412
+ "executor": "high",
413
+ "verifier": "low",
414
+ "reviewer": "low"
415
+ }
416
+ },
417
+ {
418
+ "name": "schema-design",
419
+ "scope": "universal",
420
+ "file": "pan-wizard-core/learnings/universal/schema-design.md",
421
+ "patterns": [
422
+ "P-202"
423
+ ],
424
+ "size_bytes": 1273,
425
+ "size_tokens_est": 319,
426
+ "agent_relevance": {
427
+ "planner": "high",
428
+ "executor": "medium",
429
+ "verifier": "medium",
430
+ "reviewer": "medium"
431
+ }
432
+ },
433
+ {
434
+ "name": "secret-handling",
435
+ "scope": "universal",
436
+ "file": "pan-wizard-core/learnings/universal/secret-handling.md",
437
+ "patterns": [
438
+ "P-SEC-001"
439
+ ],
440
+ "size_bytes": 2856,
441
+ "size_tokens_est": 714,
442
+ "agent_relevance": {
443
+ "planner": "medium",
444
+ "executor": "high",
445
+ "verifier": "high",
446
+ "reviewer": "high"
447
+ }
448
+ },
449
+ {
450
+ "name": "streaming-io",
451
+ "scope": "universal",
452
+ "file": "pan-wizard-core/learnings/universal/streaming-io.md",
453
+ "patterns": [
454
+ "P-1202"
455
+ ],
456
+ "size_bytes": 1480,
457
+ "size_tokens_est": 370,
458
+ "agent_relevance": {
459
+ "planner": "low",
460
+ "executor": "high",
461
+ "verifier": "medium",
462
+ "reviewer": "low"
463
+ }
464
+ },
465
+ {
466
+ "name": "test-patterns",
467
+ "scope": "universal",
468
+ "file": "pan-wizard-core/learnings/universal/test-patterns.md",
469
+ "patterns": [
470
+ "P-001",
471
+ "P-002",
472
+ "P-204",
473
+ "P-NPRS-004"
474
+ ],
475
+ "size_bytes": 4512,
476
+ "size_tokens_est": 1128,
477
+ "agent_relevance": {
478
+ "planner": "medium",
479
+ "executor": "high",
480
+ "verifier": "high",
481
+ "reviewer": "high"
482
+ }
483
+ },
484
+ {
485
+ "name": "test-strategy",
486
+ "scope": "universal",
487
+ "file": "pan-wizard-core/learnings/universal/test-strategy.md",
488
+ "patterns": [
489
+ "P-201",
490
+ "P-701"
491
+ ],
492
+ "size_bytes": 2648,
493
+ "size_tokens_est": 662,
494
+ "agent_relevance": {
495
+ "planner": "high",
496
+ "executor": "medium",
497
+ "verifier": "high",
498
+ "reviewer": "high"
499
+ }
500
+ },
501
+ {
502
+ "name": "unicode",
503
+ "scope": "universal",
504
+ "file": "pan-wizard-core/learnings/universal/unicode.md",
505
+ "patterns": [
506
+ "P-1001"
507
+ ],
508
+ "size_bytes": 1376,
509
+ "size_tokens_est": 344,
510
+ "agent_relevance": {
511
+ "planner": "low",
512
+ "executor": "high",
513
+ "verifier": "medium",
514
+ "reviewer": "low"
515
+ }
516
+ },
517
+ {
518
+ "name": "vendor-pattern",
519
+ "scope": "universal",
520
+ "file": "pan-wizard-core/learnings/universal/vendor-pattern.md",
521
+ "patterns": [
522
+ "P-801"
523
+ ],
524
+ "size_bytes": 1796,
525
+ "size_tokens_est": 449,
526
+ "agent_relevance": {
527
+ "planner": "medium",
528
+ "executor": "low",
529
+ "verifier": "low",
530
+ "reviewer": "medium"
531
+ }
532
+ }
533
+ ],
534
+ "totals": {
535
+ "topics": 31,
536
+ "patterns": 63,
537
+ "size_bytes": 90658,
538
+ "size_tokens_est": 22674
539
+ }
540
+ }
@@ -0,0 +1,2 @@
1
+ # Placeholder so git tracks the empty directory.
2
+ # This tier is NOT shipped to user installs — see ../README.md.
@@ -0,0 +1,81 @@
1
+ ---
2
+ topic: experiment-runner
3
+ last_updated: 2026-05-03T03:30:13.038Z
4
+ patterns:
5
+ - id: P-EXP-001
6
+ summary: new-project --auto can finish all artifacts but never commit if the run ends before the workflow's commit step (1 of 5 experiments hit this)
7
+ promoted_at: 2026-05-02T14:35:52.700Z
8
+ source_experiments: [whoocache]
9
+ - id: P-EXP-002
10
+ summary: claude -p exits at phase boundaries despite --auto and prose-based DO NOT exit (v3.7.6 cross-phase YOLO continuation fix), so multi-phase autonomous runs need one invocation per phase
11
+ promoted_at: 2026-05-02T14:35:59.399Z
12
+ source_experiments: [whoolog, whoocache, whooflow, whooschema, whoodb]
13
+ - id: P-EXP-003
14
+ summary: state.md YAML frontmatter is the authoritative truth; body prose may lag after phase completion
15
+ promoted_at: 2026-05-02T14:36:04.863Z
16
+ source_experiments: [whooschema, whoolog, whoocache]
17
+ - id: P-EXP-004
18
+ summary: 30-min DEFAULT_TIMEOUT_MS is too short for typical 3-plan phases; recommend 60+ min default
19
+ promoted_at: 2026-05-02T14:36:15.357Z
20
+ source_experiments: [whoolog]
21
+ - id: P-EXP-005
22
+ summary: 4 concurrent claude -p experiment sessions run cleanly on a single machine; no TTY contention or rate-limit issues
23
+ promoted_at: 2026-05-02T14:36:22.170Z
24
+ source_experiments: [whoolog, whoocache, whooflow, whooschema, whoodb]
25
+ - id: P-NPRS-005
26
+ summary: Single experiment can ship a 24-plan / 5-phase / 346-test / 1.46MB binary milestone in ~6h cumulative agent runtime when the planner emits decision-trace + the executor honors per-plan file ownership
27
+ promoted_at: 2026-05-03T03:30:13.038Z
28
+ source_experiments: [notepadrs]
29
+ ---
30
+
31
+ # Experiment Runner (AI-derived)
32
+
33
+ > Auto-maintained by `pan-tools learn promote`. Each pattern was extracted from one or more experiment runs (see source_experiments). Patterns are **advisory** — orchestrators should weight them against current context.
34
+
35
+ ## P-EXP-001 — Missing git identity in fresh experiment folder causes silent commit failures (whoocache root cause)
36
+
37
+ **Evidence:** whoocache: 24 min of work produced project.md, requirements.md, roadmap.md, src/{cache,atomic-write,lock,...}.js — but git log empty. **Root cause** found in summary.md: "Git identity was not configured in this environment; per environment_notes the commits returned `committed: false` with `reason: 'commit_failed'`. File outputs landed on disk (the contract). Commits can be re-run later by the user once `git config user.email / user.name` are set." `pan-tools commit` returns exit-0 with `{committed: false, reason: 'commit_failed'}` — the autonomous loop sees no error and keeps going. State.md showed Phase 1 ready. Resumed phase commands committed normally from then on, after identity was set.
38
+
39
+ **Rule:** experiment scaffolding (`pan-tools experiment new`) MUST `git init` the folder AND configure `user.email` / `user.name` (inherited from PAN source repo, falling back to placeholders) so the autonomous loop's commits don't silently fail. Fixed in `experiment.cjs initExperimentGit()` v3.7.9. As a defensive layer, `new-project.md` section 8.9 also adds an end-of-workflow safety-net commit. As a hardening item, consider making `pan-tools commit` exit non-zero on `commit_failed` so callers detect the failure mode.
40
+
41
+ **Applies in:** experiment.cjs scaffolder, new-project workflow, any tooling that wraps `pan-tools commit` in a fresh git environment
42
+
43
+ ## P-EXP-002 — claude -p exits at phase boundaries despite --auto and prose-based DO NOT exit (v3.7.6 cross-phase YOLO continuation fix), so multi-phase autonomous runs need one invocation per phase
44
+
45
+ **Evidence:** All 5 experiments (whoolog, whoocache, whooflow, whooschema, whoodb) exited cleanly with exit_code=0 status=incomplete at every Phase N -> Phase N+1 boundary. Each phase needed a separate experiment run --prompt invocation. Even though state.md shows current_phase advanced and last_activity says transitioned to Phase N+1, the spawned claude session ends.
46
+
47
+ **Rule:** Treat the autonomous cross-phase chain as best-effort, not guaranteed. Scripts/CI/runners should plan for one /pan:plan-phase N --auto invocation per phase. Single-invocation multi-phase runs are a stretch goal, not the contract.
48
+
49
+ **Applies in:** any autonomous multi-phase run via claude -p, codex exec, gemini -p, opencode
50
+
51
+ ## P-EXP-003 — state.md YAML frontmatter is the authoritative truth; body prose may lag after phase completion
52
+
53
+ **Evidence:** whooschema after Phase 3 completion: frontmatter showed completed_phases=3 status=completed, but body still showed Current phase 1 - Foundation, Phase 1 Executed. Same pattern observed in whoolog and whoocache to lesser degree.
54
+
55
+ **Rule:** When reading state.md programmatically (from runner.cjs, status checks, harvest scripts), parse the YAML frontmatter fields (completed_phases, current_phase, status). The body's Current Position / Phase Status sections sometimes do not re-render after phase completion. Prefer frontmatter parsers over markdown text scans.
56
+
57
+ **Applies in:** runner.cjs status checks, state.md consumers, anything reading state programmatically
58
+
59
+ ## P-EXP-004 — 30-min DEFAULT_TIMEOUT_MS is too short for typical 3-plan phases; recommend 60+ min default
60
+
61
+ **Evidence:** whoolog Phase 1 first run: timed out at 30:00 after Phase 1 research only (9 commits). Resumed with 90-min timeout and finished Phase 1 fully in 26 minutes. Same pattern would have killed whooflow new-project (~60 min) if that timeout had been the default.
62
+
63
+ **Rule:** DEFAULT_TIMEOUT_MS in runner.cjs should be raised from 30 min to 60 min, OR the experiment new command should set a per-experiment timeout based on roadmap.phase_count * 8 min after the new-project run. Phase 1 of whoolog (3 plans) took 26 min; whooflow (5 plans per phase) was at 35 min when killed by 30-min cap on first run. The default cuts off real work mid-phase.
64
+
65
+ **Applies in:** runner.cjs DEFAULT_TIMEOUT_MS, experiment run --timeout default
66
+
67
+ ## P-EXP-005 — 4 concurrent claude -p experiment sessions run cleanly on a single machine; no TTY contention or rate-limit issues
68
+
69
+ **Evidence:** Ran whoolog Phase 2 + whoocache Phase 1 + whooflow new-project + whooschema new-project + whoodb new-project all in parallel for ~60 minutes. All 4 concurrent sessions made independent progress, no failures, no missed commits attributable to concurrency. Wall-clock time for full 5-experiment run: ~3 hours (vs ~9 hours sequential).
70
+
71
+ **Rule:** The experiment runner can safely fan out to N=4 concurrent autonomous experiments on a single workstation. The runner's stdio ['inherit', 'pipe', 'pipe'] design holds up because claude -p does not actually CONSUME stdin (only probes for TTY). API rate limits at this concurrency are not hit on Anthropic Claude Opus 4.7. Beyond N=4, untested.
72
+
73
+ **Applies in:** experiment runner, automated multi-experiment campaigns, CI
74
+
75
+ ## P-NPRS-005 — Single experiment can ship a 24-plan / 5-phase / 346-test / 1.46MB binary milestone in ~6h cumulative agent runtime when the planner emits decision-trace + the executor honors per-plan file ownership
76
+
77
+ **Evidence:** notepadrs experiment 2026-05-02→03: Phase 1 (4 plans, 18 tests) ran clean; Phase 2 (4 plans, 109 tests cumulative) ran clean; Phase 3 (5 plans, multi-tab + find/replace + worker thread + epoch cancellation) timed out at 90 min on first attempt at 77% — resumed cleanly with /pan:exec-phase 3 --auto and finished in 45 min; Phase 4 (5 plans split mid-run from 4 to handle wave-2 collision) took 50 min; Phase 5 (5 plans + dogfood + ship gate) took 55 min plan + 7 min finish wrap. Total cumulative: ~6h agent time including 1 timeout. Final binary: 1.46 MB (6.86× under the 10MB ship gate); 346 tests (11.5× the 30-test floor). Plan-checker iteration revisions caught wave-2 file collisions BEFORE execution; reasoning-trace handoff via Plan Decisions / Implementation Decisions sections kept context coherent across plan-checker → executor → verifier.
78
+
79
+ **Rule:** Auto-mode multi-phase experiments DO complete v1-shippable software in roughly 1 hour per phase IF: (a) phase plan-phase produces explicit per-plan files_modified ownership AND a decisions buckets section; (b) plan-checker is allowed to iterate (split plans, revise files_modified) BEFORE execution starts; (c) timeouts are 90 min per command, not 60 min; (d) when a phase times out at >70% complete, resume with /pan:exec-phase N --auto rather than restarting plan-phase; (e) final phase wrap (write missing summary.md + verification.md, advance state) sometimes needs a separate short prompt because the auto-runner exits when state.md says 'verifying'. The 'incomplete' status with exit_code 0 means the agent left work mid-state, not that anything failed.
80
+
81
+ **Applies in:** PAN experiment-runner orchestration; the experiment.cjs runner; auto-mode workflow guidance; planner/executor handoff design