@justjoshn/pi-pstack-v2 0.0.0-stage → 0.1.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.
Files changed (576) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +66 -2
  3. package/agents/ci-watcher.md +26 -0
  4. package/agents/comment-sicko.md +32 -0
  5. package/agents/poteto-agent.md +8 -0
  6. package/agents/thermo-nuclear-code-quality-review.md +23 -0
  7. package/docs/guide/01-setup.md +81 -0
  8. package/docs/guide/02-poteto-mode.md +137 -0
  9. package/docs/guide/03-understand.md +79 -0
  10. package/docs/guide/04-design.md +133 -0
  11. package/docs/guide/05-build-and-clean.md +83 -0
  12. package/docs/guide/06-verify-and-ship.md +162 -0
  13. package/docs/guide/07-overnight.md +121 -0
  14. package/docs/guide/08-principles.md +72 -0
  15. package/docs/guide/09-make-it-yours.md +100 -0
  16. package/docs/guide/10-recipes-and-pitfalls.md +182 -0
  17. package/docs/guide/README.md +38 -0
  18. package/docs/guide/images/design.jpg +0 -0
  19. package/docs/guide/images/overnight.jpg +0 -0
  20. package/docs/guide/images/recipes.jpg +0 -0
  21. package/docs/guide/images/router.jpg +0 -0
  22. package/docs/guide/images/understanding.jpg +0 -0
  23. package/docs/guide/images/verification.jpg +0 -0
  24. package/docs/pi-mechanisms.md +101 -0
  25. package/package.json +49 -4
  26. package/rules/no-inline-imports.md +8 -0
  27. package/rules/typescript-exhaustive-switch.md +6 -0
  28. package/skills/architect/SKILL.md +81 -0
  29. package/skills/architect/references/design-red-flags.md +57 -0
  30. package/skills/architect/references/rationale-template.md +35 -0
  31. package/skills/architect/references/runner-prompt.md +20 -0
  32. package/skills/arena/SKILL.md +48 -0
  33. package/skills/automate-me/SKILL.md +104 -0
  34. package/skills/benchmark-checklist/SKILL.md +39 -0
  35. package/skills/blast-radius/SKILL.md +50 -0
  36. package/skills/bro/SKILL.md +7 -0
  37. package/skills/check-compiler-errors/SKILL.md +23 -0
  38. package/skills/control-cli/SKILL.md +110 -0
  39. package/skills/control-ui/SKILL.md +109 -0
  40. package/skills/correct/SKILL.md +32 -0
  41. package/skills/create-formal-verification-skill/SKILL.md +43 -0
  42. package/skills/create-verification-skill/SKILL.md +44 -0
  43. package/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
  44. package/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
  45. package/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
  46. package/skills/deslop/SKILL.md +22 -0
  47. package/skills/figure-it-out/SKILL.md +54 -0
  48. package/skills/fix-ci/SKILL.md +29 -0
  49. package/skills/fix-merge-conflicts/SKILL.md +32 -0
  50. package/skills/get-pr-comments/SKILL.md +23 -0
  51. package/skills/how/SKILL.md +21 -0
  52. package/skills/in-your-own-words/SKILL.md +7 -0
  53. package/skills/interrogate/SKILL.md +35 -0
  54. package/skills/ketchup/SKILL.md +43 -0
  55. package/skills/ketchup-video/SKILL.md +29 -0
  56. package/skills/loop-on-ci/SKILL.md +50 -0
  57. package/skills/maintain-formal-verification-skill/SKILL.md +58 -0
  58. package/skills/maintain-verification-skill/SKILL.md +39 -0
  59. package/skills/make-bot-ui/SKILL.md +98 -0
  60. package/skills/make-pr-easy-to-review/SKILL.md +59 -0
  61. package/skills/new-branch-and-pr/SKILL.md +29 -0
  62. package/skills/no-comments/SKILL.md +26 -0
  63. package/skills/poteto-help/SKILL.md +159 -0
  64. package/skills/poteto-help/references/prompting.md +51 -0
  65. package/skills/poteto-help/references/recipes.md +51 -0
  66. package/skills/poteto-mode/SKILL.md +151 -0
  67. package/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
  68. package/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
  69. package/skills/poteto-mode/playbooks/autopilot-full.md +25 -0
  70. package/skills/poteto-mode/playbooks/autopilot-stack.md +8 -0
  71. package/skills/poteto-mode/playbooks/babysit.md +23 -0
  72. package/skills/poteto-mode/playbooks/bug-fix.md +15 -0
  73. package/skills/poteto-mode/playbooks/eval.md +25 -0
  74. package/skills/poteto-mode/playbooks/feature.md +21 -0
  75. package/skills/poteto-mode/playbooks/hillclimb.md +21 -0
  76. package/skills/poteto-mode/playbooks/investigation.md +14 -0
  77. package/skills/poteto-mode/playbooks/multi-phase-plan.md +155 -0
  78. package/skills/poteto-mode/playbooks/opening-a-pr.md +32 -0
  79. package/skills/poteto-mode/playbooks/orchestrate.md +25 -0
  80. package/skills/poteto-mode/playbooks/pause-safely.md +10 -0
  81. package/skills/poteto-mode/playbooks/perf-issue.md +25 -0
  82. package/skills/poteto-mode/playbooks/prototype.md +14 -0
  83. package/skills/poteto-mode/playbooks/refactoring.md +16 -0
  84. package/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
  85. package/skills/poteto-mode/playbooks/session-pickup.md +11 -0
  86. package/skills/poteto-mode/playbooks/shipping.md +12 -0
  87. package/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
  88. package/skills/poteto-mode/playbooks/visual-parity.md +11 -0
  89. package/skills/poteto-mode/playbooks/worktree-cleanup.md +12 -0
  90. package/skills/poteto-mode/references/bugbot-triage.md +142 -0
  91. package/skills/poteto-mode/scripts/bootstrap.ts +62 -0
  92. package/skills/poteto-mode/scripts/bun.lock +67 -0
  93. package/skills/poteto-mode/scripts/check-plan.mjs +205 -0
  94. package/skills/poteto-mode/scripts/check-plan.test.ts +110 -0
  95. package/skills/poteto-mode/scripts/package.json +16 -0
  96. package/skills/poteto-mode/scripts/watch-pr/cli.test.ts +224 -0
  97. package/skills/poteto-mode/scripts/watch-pr/cli.ts +223 -0
  98. package/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +129 -0
  99. package/skills/poteto-mode/scripts/watch-pr/github.test.ts +498 -0
  100. package/skills/poteto-mode/scripts/watch-pr/github.ts +726 -0
  101. package/skills/poteto-mode/scripts/watch-pr/policy.test.ts +482 -0
  102. package/skills/poteto-mode/scripts/watch-pr/policy.ts +842 -0
  103. package/skills/poteto-mode/scripts/watch-pr/render.ts +169 -0
  104. package/skills/poteto-mode/scripts/watch-pr/tsconfig.json +13 -0
  105. package/skills/poteto-mode/scripts/watch-pr/types.compile.ts +93 -0
  106. package/skills/poteto-mode/scripts/watch-pr/types.ts +414 -0
  107. package/skills/poteto-mode/scripts/watch-pr/watch-pr +6 -0
  108. package/skills/poteto-mode/scripts/worktree-audit.sh +146 -0
  109. package/skills/pr-review-canvas/SKILL.md +170 -0
  110. package/skills/pr-review-canvas/renderer.js +170 -0
  111. package/skills/pr-review-canvas/styles.css +96 -0
  112. package/skills/pr-review-canvas/template.html +18 -0
  113. package/skills/principle-attack-the-premise/SKILL.md +21 -0
  114. package/skills/principle-boundary-discipline/SKILL.md +34 -0
  115. package/skills/principle-build-the-lever/SKILL.md +23 -0
  116. package/skills/principle-encode-lessons-in-structure/SKILL.md +11 -0
  117. package/skills/principle-exhaust-the-design-space/SKILL.md +9 -0
  118. package/skills/principle-experience-first/SKILL.md +19 -0
  119. package/skills/principle-explain-the-number/SKILL.md +18 -0
  120. package/skills/principle-fix-root-causes/SKILL.md +21 -0
  121. package/skills/principle-foundational-thinking/SKILL.md +21 -0
  122. package/skills/principle-guard-the-context-window/SKILL.md +12 -0
  123. package/skills/principle-laziness-protocol/SKILL.md +10 -0
  124. package/skills/principle-make-operations-idempotent/SKILL.md +22 -0
  125. package/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +14 -0
  126. package/skills/principle-minimize-reader-load/SKILL.md +18 -0
  127. package/skills/principle-model-the-domain/SKILL.md +24 -0
  128. package/skills/principle-never-block-on-the-human/SKILL.md +15 -0
  129. package/skills/principle-outcome-oriented-execution/SKILL.md +21 -0
  130. package/skills/principle-prove-it-works/SKILL.md +22 -0
  131. package/skills/principle-redesign-from-first-principles/SKILL.md +16 -0
  132. package/skills/principle-separate-before-serializing-shared-state/SKILL.md +16 -0
  133. package/skills/principle-sequence-verifiable-units/SKILL.md +17 -0
  134. package/skills/principle-subtract-before-you-add/SKILL.md +18 -0
  135. package/skills/principle-test-behavior-not-implementation/SKILL.md +20 -0
  136. package/skills/principle-type-system-discipline/SKILL.md +13 -0
  137. package/skills/recall/SKILL.md +37 -0
  138. package/skills/reflect/SKILL.md +69 -0
  139. package/skills/reflect/references/divergent-reviewer.md +38 -0
  140. package/skills/reflect/references/judgment-reviewer.md +37 -0
  141. package/skills/reflect/references/synthesizer.md +56 -0
  142. package/skills/reflect/references/tooling-reviewer.md +48 -0
  143. package/skills/review-and-ship/SKILL.md +41 -0
  144. package/skills/run-smoke-tests/SKILL.md +42 -0
  145. package/skills/setup-pstack/SKILL.md +79 -0
  146. package/skills/sharpen/SKILL.md +16 -0
  147. package/skills/show-me-your-work/SKILL.md +82 -0
  148. package/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
  149. package/skills/show-me-your-work/scripts/log.sh +42 -0
  150. package/skills/statechart/SKILL.md +82 -0
  151. package/skills/statechart/references/render.md +93 -0
  152. package/skills/statechart/scripts/backends/cfg.ts +33 -0
  153. package/skills/statechart/scripts/backends/mermaid.ts +249 -0
  154. package/skills/statechart/scripts/backends/plain-text.ts +72 -0
  155. package/skills/statechart/scripts/backends/report.ts +177 -0
  156. package/skills/statechart/scripts/frontends/config.ts +276 -0
  157. package/skills/statechart/scripts/frontends/dot.ts +74 -0
  158. package/skills/statechart/scripts/frontends/marks.ts +93 -0
  159. package/skills/statechart/scripts/frontends/messages.ts +52 -0
  160. package/skills/statechart/scripts/frontends/spec.ts +114 -0
  161. package/skills/statechart/scripts/frontends/trace.ts +24 -0
  162. package/skills/statechart/scripts/frontends/value.ts +166 -0
  163. package/skills/statechart/scripts/frontends/verdict.ts +40 -0
  164. package/skills/statechart/scripts/frontends/view.ts +119 -0
  165. package/skills/statechart/scripts/ir.ts +547 -0
  166. package/skills/statechart/scripts/package.json +11 -0
  167. package/skills/statechart/scripts/passes/annotate.ts +128 -0
  168. package/skills/statechart/scripts/passes/label.ts +269 -0
  169. package/skills/statechart/scripts/passes/lift.ts +85 -0
  170. package/skills/statechart/scripts/passes/loop-check.ts +68 -0
  171. package/skills/statechart/scripts/passes/paths.ts +60 -0
  172. package/skills/statechart/scripts/passes/reach.ts +135 -0
  173. package/skills/statechart/scripts/passes/region-check.ts +97 -0
  174. package/skills/statechart/scripts/passes/regions.ts +295 -0
  175. package/skills/statechart/scripts/pipeline.ts +76 -0
  176. package/skills/statechart/scripts/run.ts +506 -0
  177. package/skills/statechart/scripts/statechart +29 -0
  178. package/skills/statechart/scripts/statechart.ts +164 -0
  179. package/skills/statechart/scripts/test/ConfigOracle.java +63 -0
  180. package/skills/statechart/scripts/test/chart.test.ts +1253 -0
  181. package/skills/statechart/scripts/test/charts/Braces.mmd +7 -0
  182. package/skills/statechart/scripts/test/charts/Escapes.mmd +11 -0
  183. package/skills/statechart/scripts/test/charts/Phases.mmd +29 -0
  184. package/skills/statechart/scripts/test/cli.test.ts +1315 -0
  185. package/skills/statechart/scripts/test/config-fuzz.test.ts +263 -0
  186. package/skills/statechart/scripts/test/corpus/Counter/ChartRun.out +57 -0
  187. package/skills/statechart/scripts/test/corpus/Counter/Counter.cfg +3 -0
  188. package/skills/statechart/scripts/test/corpus/Counter/Counter.tla +10 -0
  189. package/skills/statechart/scripts/test/corpus/Counter/chart.mmd +9 -0
  190. package/skills/statechart/scripts/test/corpus/Counter/graph.dot +16 -0
  191. package/skills/statechart/scripts/test/corpus/Counter/report.md +7 -0
  192. package/skills/statechart/scripts/test/corpus/Counter/sany.out +2 -0
  193. package/skills/statechart/scripts/test/corpus/Counter/verdict-1.out +49 -0
  194. package/skills/statechart/scripts/test/corpus/CounterAction/ChartRun.out +60 -0
  195. package/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.cfg +4 -0
  196. package/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.tla +22 -0
  197. package/skills/statechart/scripts/test/corpus/CounterAction/chart.mmd +26 -0
  198. package/skills/statechart/scripts/test/corpus/CounterAction/graph.dot +19 -0
  199. package/skills/statechart/scripts/test/corpus/CounterAction/report.md +20 -0
  200. package/skills/statechart/scripts/test/corpus/CounterAction/sany.out +2 -0
  201. package/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.exit +1 -0
  202. package/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.out +56 -0
  203. package/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.exit +1 -0
  204. package/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.out +82 -0
  205. package/skills/statechart/scripts/test/corpus/CounterAction/verdict-3.out +57 -0
  206. package/skills/statechart/scripts/test/corpus/CounterDeadlock/ChartRun.out +59 -0
  207. package/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.cfg +3 -0
  208. package/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.tla +11 -0
  209. package/skills/statechart/scripts/test/corpus/CounterDeadlock/chart.mmd +22 -0
  210. package/skills/statechart/scripts/test/corpus/CounterDeadlock/graph.dot +16 -0
  211. package/skills/statechart/scripts/test/corpus/CounterDeadlock/report.md +17 -0
  212. package/skills/statechart/scripts/test/corpus/CounterDeadlock/sany.out +2 -0
  213. package/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.exit +1 -0
  214. package/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.out +56 -0
  215. package/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.exit +1 -0
  216. package/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.out +77 -0
  217. package/skills/statechart/scripts/test/corpus/CounterFan/ChartRun.out +69 -0
  218. package/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.cfg +2 -0
  219. package/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.tla +11 -0
  220. package/skills/statechart/scripts/test/corpus/CounterFan/chart.mmd +85 -0
  221. package/skills/statechart/scripts/test/corpus/CounterFan/graph.dot +70 -0
  222. package/skills/statechart/scripts/test/corpus/CounterFan/report.md +12 -0
  223. package/skills/statechart/scripts/test/corpus/CounterFan/sany.out +2 -0
  224. package/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.exit +1 -0
  225. package/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.out +67 -0
  226. package/skills/statechart/scripts/test/corpus/CounterFan/verdict-2.out +57 -0
  227. package/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.exit +1 -0
  228. package/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.out +85 -0
  229. package/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.cfg +6 -0
  230. package/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.tla +13 -0
  231. package/skills/statechart/scripts/test/corpus/CounterGuard/chart.mmd +5 -0
  232. package/skills/statechart/scripts/test/corpus/CounterGuard/graph.dot +10 -0
  233. package/skills/statechart/scripts/test/corpus/CounterGuard/report.md +31 -0
  234. package/skills/statechart/scripts/test/corpus/CounterGuard/sany.out +2 -0
  235. package/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.exit +1 -0
  236. package/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.out +64 -0
  237. package/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.exit +1 -0
  238. package/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.out +77 -0
  239. package/skills/statechart/scripts/test/corpus/CounterInitPast/ChartRun.out +55 -0
  240. package/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.cfg +3 -0
  241. package/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.tla +10 -0
  242. package/skills/statechart/scripts/test/corpus/CounterInitPast/chart.mmd +12 -0
  243. package/skills/statechart/scripts/test/corpus/CounterInitPast/graph.dot +6 -0
  244. package/skills/statechart/scripts/test/corpus/CounterInitPast/report.md +12 -0
  245. package/skills/statechart/scripts/test/corpus/CounterInitPast/sany.out +2 -0
  246. package/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.exit +1 -0
  247. package/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.out +33 -0
  248. package/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-2.out +54 -0
  249. package/skills/statechart/scripts/test/corpus/CounterInitPastHolds/ChartRun.out +54 -0
  250. package/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.cfg +3 -0
  251. package/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.tla +10 -0
  252. package/skills/statechart/scripts/test/corpus/CounterInitPastHolds/chart.mmd +1 -0
  253. package/skills/statechart/scripts/test/corpus/CounterInitPastHolds/graph.dot +6 -0
  254. package/skills/statechart/scripts/test/corpus/CounterInitPastHolds/report.md +7 -0
  255. package/skills/statechart/scripts/test/corpus/CounterInitPastHolds/sany.out +2 -0
  256. package/skills/statechart/scripts/test/corpus/CounterInitPastHolds/verdict-1.out +46 -0
  257. package/skills/statechart/scripts/test/corpus/CounterInstance/ChartRun.out +59 -0
  258. package/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.cfg +2 -0
  259. package/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.tla +10 -0
  260. package/skills/statechart/scripts/test/corpus/CounterInstance/CounterSteps.tla +6 -0
  261. package/skills/statechart/scripts/test/corpus/CounterInstance/chart.mmd +17 -0
  262. package/skills/statechart/scripts/test/corpus/CounterInstance/graph.dot +15 -0
  263. package/skills/statechart/scripts/test/corpus/CounterInstance/report.md +14 -0
  264. package/skills/statechart/scripts/test/corpus/CounterInstance/sany.out +3 -0
  265. package/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.exit +1 -0
  266. package/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.out +78 -0
  267. package/skills/statechart/scripts/test/corpus/CounterJump/ChartRun.out +59 -0
  268. package/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.cfg +3 -0
  269. package/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.tla +19 -0
  270. package/skills/statechart/scripts/test/corpus/CounterJump/chart.mmd +26 -0
  271. package/skills/statechart/scripts/test/corpus/CounterJump/graph.dot +22 -0
  272. package/skills/statechart/scripts/test/corpus/CounterJump/report.md +12 -0
  273. package/skills/statechart/scripts/test/corpus/CounterJump/sany.out +2 -0
  274. package/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.exit +1 -0
  275. package/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.out +58 -0
  276. package/skills/statechart/scripts/test/corpus/CounterJump/verdict-2.out +57 -0
  277. package/skills/statechart/scripts/test/corpus/CounterLoop/ChartRun.out +57 -0
  278. package/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.cfg +2 -0
  279. package/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.tla +11 -0
  280. package/skills/statechart/scripts/test/corpus/CounterLoop/chart.mmd +17 -0
  281. package/skills/statechart/scripts/test/corpus/CounterLoop/graph.dot +15 -0
  282. package/skills/statechart/scripts/test/corpus/CounterLoop/report.md +14 -0
  283. package/skills/statechart/scripts/test/corpus/CounterLoop/sany.out +2 -0
  284. package/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.exit +1 -0
  285. package/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.out +76 -0
  286. package/skills/statechart/scripts/test/corpus/CounterOrder/ChartRun.out +59 -0
  287. package/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.cfg +3 -0
  288. package/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.tla +11 -0
  289. package/skills/statechart/scripts/test/corpus/CounterOrder/chart.mmd +19 -0
  290. package/skills/statechart/scripts/test/corpus/CounterOrder/graph.dot +10 -0
  291. package/skills/statechart/scripts/test/corpus/CounterOrder/report.md +15 -0
  292. package/skills/statechart/scripts/test/corpus/CounterOrder/sany.out +2 -0
  293. package/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.exit +1 -0
  294. package/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.out +56 -0
  295. package/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.exit +1 -0
  296. package/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.out +67 -0
  297. package/skills/statechart/scripts/test/corpus/CounterRules/ChartRun.out +62 -0
  298. package/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.cfg +6 -0
  299. package/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.tla +24 -0
  300. package/skills/statechart/scripts/test/corpus/CounterRules/Moves.tla +5 -0
  301. package/skills/statechart/scripts/test/corpus/CounterRules/chart.mmd +22 -0
  302. package/skills/statechart/scripts/test/corpus/CounterRules/graph.dot +10 -0
  303. package/skills/statechart/scripts/test/corpus/CounterRules/report.md +23 -0
  304. package/skills/statechart/scripts/test/corpus/CounterRules/sany.out +3 -0
  305. package/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.exit +1 -0
  306. package/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.out +58 -0
  307. package/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.exit +1 -0
  308. package/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.out +66 -0
  309. package/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.exit +1 -0
  310. package/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.out +74 -0
  311. package/skills/statechart/scripts/test/corpus/CounterRules/verdict-4.out +59 -0
  312. package/skills/statechart/scripts/test/corpus/CounterStart/ChartRun.out +58 -0
  313. package/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.cfg +3 -0
  314. package/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.tla +15 -0
  315. package/skills/statechart/scripts/test/corpus/CounterStart/chart.mmd +18 -0
  316. package/skills/statechart/scripts/test/corpus/CounterStart/graph.dot +13 -0
  317. package/skills/statechart/scripts/test/corpus/CounterStart/report.md +11 -0
  318. package/skills/statechart/scripts/test/corpus/CounterStart/sany.out +2 -0
  319. package/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.exit +1 -0
  320. package/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.out +33 -0
  321. package/skills/statechart/scripts/test/corpus/CounterStart/verdict-2.out +57 -0
  322. package/skills/statechart/scripts/test/corpus/CounterStop/ChartRun.out +57 -0
  323. package/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.cfg +3 -0
  324. package/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.tla +15 -0
  325. package/skills/statechart/scripts/test/corpus/CounterStop/chart.mmd +7 -0
  326. package/skills/statechart/scripts/test/corpus/CounterStop/graph.dot +13 -0
  327. package/skills/statechart/scripts/test/corpus/CounterStop/report.md +6 -0
  328. package/skills/statechart/scripts/test/corpus/CounterStop/sany.out +2 -0
  329. package/skills/statechart/scripts/test/corpus/CounterStop/verdict-1.out +49 -0
  330. package/skills/statechart/scripts/test/corpus/CounterTie/ChartRun.out +61 -0
  331. package/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.cfg +4 -0
  332. package/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.tla +14 -0
  333. package/skills/statechart/scripts/test/corpus/CounterTie/chart.mmd +30 -0
  334. package/skills/statechart/scripts/test/corpus/CounterTie/graph.dot +19 -0
  335. package/skills/statechart/scripts/test/corpus/CounterTie/report.md +27 -0
  336. package/skills/statechart/scripts/test/corpus/CounterTie/sany.out +2 -0
  337. package/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.exit +1 -0
  338. package/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.out +56 -0
  339. package/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.exit +1 -0
  340. package/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.out +64 -0
  341. package/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.exit +1 -0
  342. package/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.out +87 -0
  343. package/skills/statechart/scripts/test/corpus/CounterTie/verdict-4.out +57 -0
  344. package/skills/statechart/scripts/test/corpus/CounterTieInGraph/ChartRun.out +60 -0
  345. package/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.cfg +3 -0
  346. package/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.tla +12 -0
  347. package/skills/statechart/scripts/test/corpus/CounterTieInGraph/chart.mmd +23 -0
  348. package/skills/statechart/scripts/test/corpus/CounterTieInGraph/graph.dot +19 -0
  349. package/skills/statechart/scripts/test/corpus/CounterTieInGraph/report.md +11 -0
  350. package/skills/statechart/scripts/test/corpus/CounterTieInGraph/sany.out +2 -0
  351. package/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.exit +1 -0
  352. package/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.out +56 -0
  353. package/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-2.out +57 -0
  354. package/skills/statechart/scripts/test/corpus/CounterView/ChartRun.out +61 -0
  355. package/skills/statechart/scripts/test/corpus/CounterView/CounterView.cfg +4 -0
  356. package/skills/statechart/scripts/test/corpus/CounterView/CounterView.tla +14 -0
  357. package/skills/statechart/scripts/test/corpus/CounterView/chart.mmd +23 -0
  358. package/skills/statechart/scripts/test/corpus/CounterView/graph.dot +19 -0
  359. package/skills/statechart/scripts/test/corpus/CounterView/report.md +27 -0
  360. package/skills/statechart/scripts/test/corpus/CounterView/sany.out +2 -0
  361. package/skills/statechart/scripts/test/corpus/CounterView/verdict-1.exit +1 -0
  362. package/skills/statechart/scripts/test/corpus/CounterView/verdict-1.out +56 -0
  363. package/skills/statechart/scripts/test/corpus/CounterView/verdict-2.exit +1 -0
  364. package/skills/statechart/scripts/test/corpus/CounterView/verdict-2.out +64 -0
  365. package/skills/statechart/scripts/test/corpus/CounterView/verdict-3.exit +1 -0
  366. package/skills/statechart/scripts/test/corpus/CounterView/verdict-3.out +87 -0
  367. package/skills/statechart/scripts/test/corpus/CounterView/verdict-4.out +57 -0
  368. package/skills/statechart/scripts/test/corpus/CounterView/view.mjs +1 -0
  369. package/skills/statechart/scripts/test/corpus/DieHard/ChartRun.out +59 -0
  370. package/skills/statechart/scripts/test/corpus/DieHard/DieHard.cfg +4 -0
  371. package/skills/statechart/scripts/test/corpus/DieHard/DieHard.tla +38 -0
  372. package/skills/statechart/scripts/test/corpus/DieHard/chart.mmd +92 -0
  373. package/skills/statechart/scripts/test/corpus/DieHard/graph.dot +126 -0
  374. package/skills/statechart/scripts/test/corpus/DieHard/report.md +17 -0
  375. package/skills/statechart/scripts/test/corpus/DieHard/sany.out +2 -0
  376. package/skills/statechart/scripts/test/corpus/DieHard/verdict-1.exit +1 -0
  377. package/skills/statechart/scripts/test/corpus/DieHard/verdict-1.out +91 -0
  378. package/skills/statechart/scripts/test/corpus/DieHard/verdict-2.out +57 -0
  379. package/skills/statechart/scripts/test/corpus/FirstRule/ChartRun.out +61 -0
  380. package/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.cfg +6 -0
  381. package/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.tla +11 -0
  382. package/skills/statechart/scripts/test/corpus/FirstRule/chart.mmd +22 -0
  383. package/skills/statechart/scripts/test/corpus/FirstRule/graph.dot +16 -0
  384. package/skills/statechart/scripts/test/corpus/FirstRule/report.md +25 -0
  385. package/skills/statechart/scripts/test/corpus/FirstRule/sany.out +2 -0
  386. package/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.exit +1 -0
  387. package/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.out +56 -0
  388. package/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.exit +1 -0
  389. package/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.out +64 -0
  390. package/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.exit +1 -0
  391. package/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.out +64 -0
  392. package/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.exit +1 -0
  393. package/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.out +77 -0
  394. package/skills/statechart/scripts/test/corpus/HiddenClock/ChartRun.out +57 -0
  395. package/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.cfg +4 -0
  396. package/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.tla +11 -0
  397. package/skills/statechart/scripts/test/corpus/HiddenClock/chart.mmd +13 -0
  398. package/skills/statechart/scripts/test/corpus/HiddenClock/graph.dot +12 -0
  399. package/skills/statechart/scripts/test/corpus/HiddenClock/report.md +11 -0
  400. package/skills/statechart/scripts/test/corpus/HiddenClock/sany.out +2 -0
  401. package/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.exit +1 -0
  402. package/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.out +72 -0
  403. package/skills/statechart/scripts/test/corpus/Login/ChartRun.out +57 -0
  404. package/skills/statechart/scripts/test/corpus/Login/Login.cfg +3 -0
  405. package/skills/statechart/scripts/test/corpus/Login/Login.tla +62 -0
  406. package/skills/statechart/scripts/test/corpus/Login/chart.mmd +28 -0
  407. package/skills/statechart/scripts/test/corpus/Login/graph.dot +40 -0
  408. package/skills/statechart/scripts/test/corpus/Login/report.md +7 -0
  409. package/skills/statechart/scripts/test/corpus/Login/sany.out +1 -0
  410. package/skills/statechart/scripts/test/corpus/Login/verdict-1.out +47 -0
  411. package/skills/statechart/scripts/test/corpus/Login/view.mjs +1 -0
  412. package/skills/statechart/scripts/test/corpus/LoginGuarded/ChartRun.out +57 -0
  413. package/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.cfg +2 -0
  414. package/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.tla +64 -0
  415. package/skills/statechart/scripts/test/corpus/LoginGuarded/chart.mmd +28 -0
  416. package/skills/statechart/scripts/test/corpus/LoginGuarded/graph.dot +37 -0
  417. package/skills/statechart/scripts/test/corpus/LoginGuarded/report.md +8 -0
  418. package/skills/statechart/scripts/test/corpus/LoginGuarded/sany.out +1 -0
  419. package/skills/statechart/scripts/test/corpus/LoginGuarded/verdict-1.out +47 -0
  420. package/skills/statechart/scripts/test/corpus/LoginGuarded/view.mjs +1 -0
  421. package/skills/statechart/scripts/test/corpus/LoginParallel/ChartRun.out +60 -0
  422. package/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.cfg +3 -0
  423. package/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.tla +64 -0
  424. package/skills/statechart/scripts/test/corpus/LoginParallel/chart.mmd +44 -0
  425. package/skills/statechart/scripts/test/corpus/LoginParallel/graph.dot +58 -0
  426. package/skills/statechart/scripts/test/corpus/LoginParallel/report.md +17 -0
  427. package/skills/statechart/scripts/test/corpus/LoginParallel/sany.out +1 -0
  428. package/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.exit +1 -0
  429. package/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.out +83 -0
  430. package/skills/statechart/scripts/test/corpus/LoginParallel/verdict-2.out +57 -0
  431. package/skills/statechart/scripts/test/corpus/LoginParallel/view.mjs +1 -0
  432. package/skills/statechart/scripts/test/corpus/MediaPlayer/ChartRun.out +60 -0
  433. package/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.cfg +3 -0
  434. package/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.tla +103 -0
  435. package/skills/statechart/scripts/test/corpus/MediaPlayer/chart.mmd +43 -0
  436. package/skills/statechart/scripts/test/corpus/MediaPlayer/graph.dot +93 -0
  437. package/skills/statechart/scripts/test/corpus/MediaPlayer/report.md +14 -0
  438. package/skills/statechart/scripts/test/corpus/MediaPlayer/sany.out +1 -0
  439. package/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.exit +1 -0
  440. package/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.out +59 -0
  441. package/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-2.out +72 -0
  442. package/skills/statechart/scripts/test/corpus/MediaPlayer/view.mjs +3 -0
  443. package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/ChartRun.out +57 -0
  444. package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.cfg +2 -0
  445. package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.tla +100 -0
  446. package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/chart.mmd +31 -0
  447. package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/graph.dot +85 -0
  448. package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/report.md +9 -0
  449. package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/sany.out +1 -0
  450. package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/verdict-1.out +47 -0
  451. package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/view.mjs +3 -0
  452. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/ChartRun.out +59 -0
  453. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayer.tla +103 -0
  454. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.cfg +3 -0
  455. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.tla +6 -0
  456. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/chart.mmd +42 -0
  457. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/graph.dot +93 -0
  458. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/report.md +19 -0
  459. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/sany.out +2 -0
  460. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.exit +1 -0
  461. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.out +61 -0
  462. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-2.out +59 -0
  463. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-3.out +61 -0
  464. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.exit +1 -0
  465. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.out +66 -0
  466. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.exit +1 -0
  467. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.out +58 -0
  468. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-6.out +49 -0
  469. package/skills/statechart/scripts/test/corpus/MediaPlayerProps/view.mjs +3 -0
  470. package/skills/statechart/scripts/test/corpus/PickWorker/ChartRun.out +57 -0
  471. package/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.cfg +6 -0
  472. package/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.tla +11 -0
  473. package/skills/statechart/scripts/test/corpus/PickWorker/chart.mmd +5 -0
  474. package/skills/statechart/scripts/test/corpus/PickWorker/graph.dot +11 -0
  475. package/skills/statechart/scripts/test/corpus/PickWorker/report.md +7 -0
  476. package/skills/statechart/scripts/test/corpus/PickWorker/sany.out +5 -0
  477. package/skills/statechart/scripts/test/corpus/PickWorker/verdict-1.out +70 -0
  478. package/skills/statechart/scripts/test/corpus/Shadow/ChartRun.out +61 -0
  479. package/skills/statechart/scripts/test/corpus/Shadow/Shadow.cfg +4 -0
  480. package/skills/statechart/scripts/test/corpus/Shadow/Shadow.tla +11 -0
  481. package/skills/statechart/scripts/test/corpus/Shadow/ShadowLib.tla +6 -0
  482. package/skills/statechart/scripts/test/corpus/Shadow/ShadowSub.tla +3 -0
  483. package/skills/statechart/scripts/test/corpus/Shadow/chart.mmd +9 -0
  484. package/skills/statechart/scripts/test/corpus/Shadow/graph.dot +16 -0
  485. package/skills/statechart/scripts/test/corpus/Shadow/report.md +8 -0
  486. package/skills/statechart/scripts/test/corpus/Shadow/sany.out +4 -0
  487. package/skills/statechart/scripts/test/corpus/Shadow/verdict-1.out +65 -0
  488. package/skills/statechart/scripts/test/corpus/SpacedNames/ChartRun.out +59 -0
  489. package/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.cfg +2 -0
  490. package/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.tla +9 -0
  491. package/skills/statechart/scripts/test/corpus/SpacedNames/chart.mmd +23 -0
  492. package/skills/statechart/scripts/test/corpus/SpacedNames/graph.dot +17 -0
  493. package/skills/statechart/scripts/test/corpus/SpacedNames/report.md +15 -0
  494. package/skills/statechart/scripts/test/corpus/SpacedNames/sany.out +1 -0
  495. package/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.exit +1 -0
  496. package/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.out +65 -0
  497. package/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.exit +1 -0
  498. package/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.out +75 -0
  499. package/skills/statechart/scripts/test/corpus/TwoPhase/ChartRun.out +69 -0
  500. package/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.cfg +3 -0
  501. package/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.tla +75 -0
  502. package/skills/statechart/scripts/test/corpus/TwoPhase/chart.mmd +60 -0
  503. package/skills/statechart/scripts/test/corpus/TwoPhase/graph.dot +297 -0
  504. package/skills/statechart/scripts/test/corpus/TwoPhase/report.md +20 -0
  505. package/skills/statechart/scripts/test/corpus/TwoPhase/sany.out +1 -0
  506. package/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.exit +1 -0
  507. package/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.out +95 -0
  508. package/skills/statechart/scripts/test/corpus/TwoPhase/verdict-2.out +57 -0
  509. package/skills/statechart/scripts/test/corpus/TwoPhase/view.mjs +1 -0
  510. package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/ChartRun.out +57 -0
  511. package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.cfg +3 -0
  512. package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.tla +75 -0
  513. package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/chart.mmd +37 -0
  514. package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/graph.dot +223 -0
  515. package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/report.md +11 -0
  516. package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/sany.out +1 -0
  517. package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/verdict-1.out +47 -0
  518. package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/view.mjs +1 -0
  519. package/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.exit +1 -0
  520. package/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.out +75 -0
  521. package/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.cfg +5 -0
  522. package/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.tla +11 -0
  523. package/skills/statechart/scripts/test/corpus/TypeGuard/chart.mmd +18 -0
  524. package/skills/statechart/scripts/test/corpus/TypeGuard/graph.dot +14 -0
  525. package/skills/statechart/scripts/test/corpus/TypeGuard/report.md +29 -0
  526. package/skills/statechart/scripts/test/corpus/TypeGuard/sany.out +2 -0
  527. package/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.exit +1 -0
  528. package/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.out +64 -0
  529. package/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.exit +1 -0
  530. package/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.out +75 -0
  531. package/skills/statechart/scripts/test/corpus/UserNoDeadlock/ChartRun.out +58 -0
  532. package/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.cfg +2 -0
  533. package/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.tla +8 -0
  534. package/skills/statechart/scripts/test/corpus/UserNoDeadlock/chart.mmd +22 -0
  535. package/skills/statechart/scripts/test/corpus/UserNoDeadlock/graph.dot +16 -0
  536. package/skills/statechart/scripts/test/corpus/UserNoDeadlock/report.md +15 -0
  537. package/skills/statechart/scripts/test/corpus/UserNoDeadlock/sany.out +2 -0
  538. package/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.exit +1 -0
  539. package/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.out +56 -0
  540. package/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.exit +1 -0
  541. package/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.out +77 -0
  542. package/skills/statechart/scripts/test/corpus.test.ts +441 -0
  543. package/skills/statechart/scripts/test/differential.test.ts +565 -0
  544. package/skills/statechart/scripts/test/drawn.ts +20 -0
  545. package/skills/statechart/scripts/test/grid/Grid.cfg +2 -0
  546. package/skills/statechart/scripts/test/grid/Grid.tla +9 -0
  547. package/skills/statechart/scripts/test/grid/sany.out +2 -0
  548. package/skills/statechart/scripts/test/java.ts +63 -0
  549. package/skills/statechart/scripts/test/labels.ts +648 -0
  550. package/skills/statechart/scripts/test/messages.test.ts +212 -0
  551. package/skills/statechart/scripts/test/pipeline.test.ts +270 -0
  552. package/skills/statechart/scripts/test/plain-tlc.test.ts +255 -0
  553. package/skills/statechart/scripts/test/render.test.ts +145 -0
  554. package/skills/statechart/scripts/test/tlc-out.test.ts +90 -0
  555. package/skills/statechart/scripts/test/tlc.ts +158 -0
  556. package/skills/statechart/scripts/tsconfig.json +11 -0
  557. package/skills/statechart/scripts/worker.ts +35 -0
  558. package/skills/swarm/SKILL.md +41 -0
  559. package/skills/tdd/SKILL.md +42 -0
  560. package/skills/teach/SKILL.md +23 -0
  561. package/skills/technical-writing/SKILL.md +106 -0
  562. package/skills/thermo-nuclear-code-quality-review/SKILL.md +192 -0
  563. package/skills/typescript-best-practices/SKILL.md +32 -0
  564. package/skills/typescript-best-practices/references/patterns.md +328 -0
  565. package/skills/unslop/SKILL.md +62 -0
  566. package/skills/verify-this/SKILL.md +74 -0
  567. package/skills/weekly-review/SKILL.md +32 -0
  568. package/skills/what-did-i-get-done/SKILL.md +31 -0
  569. package/skills/why/SKILL.md +9 -0
  570. package/skills/workflow-from-chats/SKILL.md +50 -0
  571. package/src/credentials.ts +156 -0
  572. package/src/index.ts +663 -0
  573. package/src/jobs.ts +436 -0
  574. package/src/sandbox.ts +232 -0
  575. package/src/sweep.ts +132 -0
  576. package/src/transcript.ts +66 -0
@@ -0,0 +1,146 @@
1
+ #!/usr/bin/env bash
2
+ # Read-only worktree prune audit. Classifies every git worktree by size, merge
3
+ # state, uncommitted work, remote/PR state, and the most recent chat that
4
+ # operated in it. Emits a table sorted by size with a suggested bucket. Never
5
+ # deletes anything; deletion stays a human-gated step in the playbook.
6
+ #
7
+ # Usage: worktree-audit.sh [-b|--base <ref>] [repo-path]
8
+ # repo-path defaults to the current repo.
9
+ # -b sets the ref the MERGED column checks against (e.g. origin/integration).
10
+ # Without it the base is origin/HEAD, then origin/main, then origin/master.
11
+ # origin/HEAD is the remote's default branch, not necessarily the branch PRs
12
+ # merge into; pass -b when they differ.
13
+ set -u
14
+
15
+ base=""
16
+ while [ $# -gt 0 ]; do
17
+ case "$1" in
18
+ -b|--base) [ $# -ge 2 ] || { echo "error: $1 needs a ref" >&2; exit 2; }; base="$2"; shift 2 ;;
19
+ -h|--help) sed -n '2,/^set -u/p' "$0" | sed '$d; s/^# \{0,1\}//'; exit 0 ;;
20
+ -*) echo "error: unknown option: $1" >&2; exit 2 ;;
21
+ *) break ;;
22
+ esac
23
+ done
24
+
25
+ repo="${1:-$(git rev-parse --show-toplevel 2>/dev/null)}"
26
+ [ -z "$repo" ] && { echo "not in a git repo; pass a repo path" >&2; exit 1; }
27
+ cd "$repo" || exit 1
28
+ git rev-parse --git-dir >/dev/null 2>&1 || { echo "error: not a git repo: $repo" >&2; exit 1; }
29
+
30
+ # Main worktree is the first entry; everything else is a candidate.
31
+ main_wt=$(git worktree list --porcelain | awk '/^worktree /{print $2; exit}')
32
+
33
+ if [ -z "$base" ]; then
34
+ for cand in "$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null)" origin/main origin/master; do
35
+ [ -n "$cand" ] && git rev-parse --verify --quiet "$cand^{commit}" >/dev/null && { base="$cand"; break; }
36
+ done
37
+ [ -z "$base" ] && { echo "error: no base ref (origin/HEAD, origin/main, origin/master all missing); pass -b <ref>" >&2; exit 1; }
38
+ echo "warn: no -b given; MERGED checks against $base" >&2
39
+ fi
40
+
41
+ # The base drives the merge check. The fetch is best-effort (stale is fine for
42
+ # a first pass) and runs before the check, since -b may name a branch not
43
+ # fetched yet. The explicit refspec creates it even in a single-branch clone.
44
+ case "$base" in
45
+ origin/*) git fetch origin "+refs/heads/${base#origin/}:refs/remotes/$base" --quiet 2>/dev/null \
46
+ || echo "warn: could not fetch $base; merged column may be stale" >&2 ;;
47
+ esac
48
+ git rev-parse --verify --quiet "$base^{commit}" >/dev/null 2>&1 || { echo "error: base ref not found: $base" >&2; exit 1; }
49
+
50
+ # GNU coreutils (Linux, Homebrew gnubin) reads `stat -f` as file system status
51
+ # and `date -r` as a file, so pick the stat and date flags once.
52
+ if stat -c %Y / >/dev/null 2>&1; then
53
+ stat_fmt=(-c '%Y %n'); fmt_day() { date -d "@$1" '+%Y-%m-%d'; }
54
+ else
55
+ stat_fmt=(-f '%m %N'); fmt_day() { date -r "$1" '+%Y-%m-%d'; }
56
+ fi
57
+
58
+ # PR state by branch, fetched once as [{number, state, head}] with a lowercase
59
+ # state. Origin when its CLI can read this repo's PRs, otherwise gh. Empty when
60
+ # neither can.
61
+ prs=$(mktemp)
62
+ if command -v origin >/dev/null 2>&1 \
63
+ && raw=$(origin pr list --author "@me" --state all --limit 1000 \
64
+ --json number,status,headRef 2>/dev/null); then
65
+ printf '%s' "$raw" | jq '[.[] | {number, state: .status, head: .headRef}]' > "$prs" 2>/dev/null
66
+ elif raw=$(gh pr list --author "@me" --state all --limit 1000 \
67
+ --json number,state,headRefName 2>/dev/null); then
68
+ printf '%s' "$raw" | jq '[.[] | {number, state: (.state | ascii_downcase), head: .headRefName}]' > "$prs" 2>/dev/null
69
+ fi
70
+ [ -s "$prs" ] || echo "[]" > "$prs"
71
+
72
+ # Pi session transcripts, scoped to this repository: its own session directories, plus the job
73
+ # session of each audited job worktree. Other projects' sessions are never read.
74
+ agent_dir="${PI_CODING_AGENT_DIR:-$HOME/.pi/agent}"
75
+ sessions_root="${PI_CODING_AGENT_SESSION_DIR:-$agent_dir/sessions}"
76
+ [ -d "$sessions_root" ] || sessions_root="$HOME/.pi/agent/sessions"
77
+ jobs_root="$agent_dir/pstack-v2/jobs"
78
+ [ -d "$jobs_root" ] || jobs_root="$HOME/.pi/agent/pstack-v2/jobs"
79
+ repo_slug="--$(printf '%s' "${main_wt#/}" | tr '/' '-')"
80
+ repo_sessions=()
81
+ for d in "$sessions_root/$repo_slug"*; do [ -d "$d" ] && repo_sessions+=("$d"); done
82
+ now=$(date +%s)
83
+
84
+ echo "# base: $base"
85
+ printf "SIZE\tAGE\tMERGED\tDIRTY\tREMOTE\tPR\tLAST_CHAT\tBUCKET\tWORKTREE\n"
86
+
87
+ git worktree list --porcelain | awk '/^worktree /{print $2}' | while read -r wt; do
88
+ [ "$wt" = "$main_wt" ] && continue
89
+
90
+ size=$(du -sh "$wt" 2>/dev/null | awk '{print $1}')
91
+ head=$(git -C "$wt" rev-parse HEAD 2>/dev/null)
92
+ head_ts=$(git -C "$wt" log -1 --format='%ct' HEAD 2>/dev/null || echo 0)
93
+ age=$([ "$head_ts" -gt 0 ] 2>/dev/null && echo "$(( (now - head_ts) / 86400 ))d" || echo "?")
94
+
95
+ # Squash-merged branches are not ancestors of the base, so PR state is the
96
+ # real signal; merge-base only catches fast-forward/rebase merges.
97
+ git merge-base --is-ancestor "$head" "$base" 2>/dev/null && merged=YES || merged=no
98
+
99
+ # Distinguish real WIP (tracked edits) from disposable untracked scratch.
100
+ porcelain=$(git -C "$wt" status --porcelain 2>/dev/null)
101
+ if [ -z "$porcelain" ]; then dirty=clean
102
+ elif printf '%s\n' "$porcelain" | grep -qv '^??'; then
103
+ dirty="wip:$(printf '%s\n' "$porcelain" | grep -cv '^??')"
104
+ else dirty="scratch:$(printf '%s\n' "$porcelain" | grep -c '^??')"; fi
105
+
106
+ branch=$(git -C "$wt" symbolic-ref --quiet --short HEAD 2>/dev/null || echo "")
107
+ if [ -z "$branch" ]; then remote=detached
108
+ elif git -C "$wt" show-ref --verify --quiet "refs/remotes/origin/$branch"; then
109
+ [ "$(git -C "$wt" rev-parse "origin/$branch" 2>/dev/null)" = "$head" ] \
110
+ && remote=pushed \
111
+ || remote="ahead$(git -C "$wt" rev-list --count "origin/$branch..HEAD" 2>/dev/null)"
112
+ else remote=no-remote; fi
113
+
114
+ pr=$([ -n "$branch" ] && jq -r --arg b "$branch" \
115
+ '.[] | select(.head==$b) | "#\(.number)/\(.state)"' "$prs" 2>/dev/null | head -1)
116
+ [ -z "$pr" ] && pr="-"
117
+
118
+ # Most recent chat whose transcript operated in this worktree. Match path
119
+ # followed by "/" or a quote so glint-482 does not match glint-482-r37.
120
+ last="-"; last_ts=0
121
+ transcripts=()
122
+ [ "${#repo_sessions[@]}" -gt 0 ] && transcripts=("${repo_sessions[@]}")
123
+ case "$wt" in "$jobs_root"/*/worktree)
124
+ job_session="${wt%/worktree}/session"; [ -d "$job_session" ] && transcripts+=("$job_session") ;;
125
+ esac
126
+ if [ "${#transcripts[@]}" -gt 0 ]; then
127
+ f=$(rg -l -g '*.jsonl' -e "${wt}/" -e "${wt}\"" "${transcripts[@]}" 2>/dev/null \
128
+ | xargs stat "${stat_fmt[@]}" 2>/dev/null | sort -rn | head -1)
129
+ if [ -n "$f" ]; then last_ts=$(echo "$f" | awk '{print $1}')
130
+ last=$(fmt_day "$last_ts" 2>/dev/null); fi
131
+ fi
132
+ recent=$([ "$last_ts" -gt 0 ] 2>/dev/null && [ $(( (now - last_ts) / 86400 )) -le 4 ] && echo yes || echo no)
133
+
134
+ case "$dirty" in wip:*) bucket=hold-wip ;; *)
135
+ case "$pr" in */open|*/draft) bucket=hold-open-pr ;; *)
136
+ if [ "$recent" = yes ]; then bucket=verify-recent-chat
137
+ elif [ "$merged" = YES ] || [ "$pr" != "-" ]; then bucket=safe
138
+ else bucket=review; fi ;;
139
+ esac ;;
140
+ esac
141
+
142
+ printf "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" \
143
+ "$size" "$age" "$merged" "$dirty" "$remote" "$pr" "$last" "$bucket" "$wt"
144
+ done | sort -t$'\t' -k1,1 -rh
145
+
146
+ rm -f "$prs"
@@ -0,0 +1,170 @@
1
+ ---
2
+ name: pr-review-canvas
3
+ disable-model-invocation: true
4
+ description: Generate an interactive PR review walkthrough as an HTML page. Fetches PR data via gh API, categorizes files into core vs mechanical changes, adds reviewer annotations, and renders diffs with moved-code detection. Use when the user pastes a GitHub PR URL and asks for a review, walkthrough, or summary, or says "review this PR".
5
+ ---
6
+
7
+ # PR Review Canvas
8
+
9
+ Generate an interactive HTML review of a GitHub PR that reads like a peer walking you through what matters.
10
+
11
+ ## Workflow
12
+
13
+ ### 1. Fetch PR data
14
+
15
+ Run these `gh api` calls in parallel:
16
+
17
+ ```bash
18
+ gh api repos/{owner}/{repo}/pulls/{number} --jq '{title, body, user: .user.login, state, additions, deletions, changed_files, base: .base.ref, head: .head.ref}'
19
+ gh api repos/{owner}/{repo}/pulls/{number}/files --paginate --jq '.[] | {filename, status, additions, deletions, patch}'
20
+ gh api repos/{owner}/{repo}/pulls/{number}/comments --jq '.[] | {user: .user.login, body, path, line}'
21
+ ```
22
+
23
+ ### 2. Analyze the PR and write the body HTML
24
+
25
+ Read the diffs, understand the PR, and write the `<body>` content directly as HTML. You have full creative freedom -- the goal is to explain the PR clearly to a reviewer. Use whatever structure best fits the PR.
26
+
27
+ **Typical structure** (adapt as needed):
28
+ - Header with title, PR number, author, stats
29
+ - Summary box explaining what the PR does in plain English
30
+ - Core file sections with annotations and diffs
31
+ - Mechanical/boilerplate files collapsed by default
32
+ - Review checklist at the bottom
33
+
34
+ **But you can also add:**
35
+ - **Pseudocode summaries** for verbose code -- show the algorithm in plain English or short pseudocode, with the real diff collapsed below (use a `.bp-section` card labeled "Show full implementation"). Great when 150 lines of retry/backoff/error-handling code is really just "fetch with exponential backoff and circuit breaker."
36
+ - Diagrams (inline SVG, mermaid via CDN, ASCII art in `<pre>`)
37
+ - Flowcharts showing before/after control flow
38
+ - Tables comparing old vs new behavior
39
+ - Callout boxes for warnings, questions, or gotchas
40
+ - Interactive widgets if they help
41
+ - Anything else that makes the review clearer
42
+
43
+ **Pseudocode pattern example:**
44
+ ```html
45
+ <div class="file-card">
46
+ <div class="file-hdr" onclick="toggle(this)">
47
+ <span class="fname">retryClient.ts</span>
48
+ <div class="fstats"><span class="pill add">+173</span><span class="pill del">&minus;11</span><span class="chev open">&#9654;</span></div>
49
+ </div>
50
+ <div class="file-body open">
51
+ <div class="file-note">
52
+ <strong>What this does in plain English:</strong>
53
+ <pre style="margin-top:8px;color:var(--text);font-size:12px;line-height:1.6;">
54
+ fetch(url):
55
+ if circuit breaker is open → fail fast
56
+ retry up to N times:
57
+ try fetch with timeout
58
+ on success → close circuit breaker, return
59
+ on retryable error → wait (exponential backoff + jitter)
60
+ on non-retryable error → throw
61
+ circuit breaker records failure</pre>
62
+ </div>
63
+ <div class="bp-section" style="margin:0;border:0;border-radius:0;">
64
+ <div class="bp-hdr" onclick="toggleBP(this)">
65
+ <span>Show full implementation (+173 lines)</span><span class="chev">&#9654;</span>
66
+ </div>
67
+ <div class="bp-body"><div data-diff="retryClient"></div></div>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ ```
72
+
73
+ ### 3. Available CSS classes and JS utilities
74
+
75
+ Read [styles.css](styles.css) and [renderer.js](renderer.js) from this skill directory. These give you a prebuilt dark-themed toolkit. Inject them into [template.html](template.html) verbatim.
76
+
77
+ **CSS classes you can use:**
78
+
79
+ | Class | Purpose |
80
+ |-------|---------|
81
+ | `.header`, `.header h1`, `.header-meta` | Page header |
82
+ | `.pill.add`, `.pill.del`, `.pill.files` | Stat badges (+N, -N, N files) |
83
+ | `.content` | Centered content wrapper (max 900px) |
84
+ | `.summary` | Summary/TL;DR box |
85
+ | `.section-title` | Section heading with bottom border |
86
+ | `.ic` | Inline code reference (mono, blue, dark bg) |
87
+ | `.file-card`, `.file-hdr`, `.file-body` | Collapsible file card (use `onclick="toggle(this)"` on `.file-hdr`) |
88
+ | `.file-note` | Sticky reviewer annotation inside a file card |
89
+ | `.bp-section`, `.bp-hdr`, `.bp-body` | Collapsed boilerplate card (use `onclick="toggleBP(this)"`) |
90
+ | `.bp-note` | Note inside a boilerplate card |
91
+ | `.verdict` | Review checklist box |
92
+
93
+ **JS functions available:**
94
+
95
+ | Function | Usage |
96
+ |----------|-------|
97
+ | `toggle(hdrElement)` | Toggle a `.file-body` open/closed |
98
+ | `toggleBP(hdrElement)` | Toggle a `.bp-body` open/closed |
99
+ | `renderDiff(target, diffInput)` | Render a unified diff. `target` can be a DOM element, string ID, or CSS selector. `diffInput` can be a raw patch string OR an array of lines -- both work. Automatically filters imports, collapses whitespace-only changes, detects moved code (blue/purple tint). |
100
+ | `esc(string)` | HTML-escape a string |
101
+
102
+ **Rendering diffs -- use `data-diff` attributes with auto-discovery.**
103
+ Put `<div data-diff="KEY"></div>` placeholders in your body HTML wherever you want a diff rendered. The renderer finds them automatically after DOM load and fills them from the `<script id="pr-diffs-json" type="application/json">` element in `template.html`.
104
+
105
+ **CRITICAL: Patch strings can contain `</script>` in addition to newlines, backslashes, and quotes.** Even `json.dumps(...)` is not enough if you paste raw output into executable `<script>` because HTML parsing can terminate the tag early. Never manually embed patch strings in JS/JSON. Instead, use this safe approach:
106
+
107
+ 1. During the fetch step, save patches to a JSON file using `jq` (which handles escaping correctly):
108
+ ```bash
109
+ gh api repos/{owner}/{repo}/pulls/{number}/files --paginate \
110
+ --jq '[.[] | {key: (.filename | gsub("[^a-zA-Z0-9]"; "_")), value: (.patch // "")}] | from_entries' \
111
+ > /tmp/pr-patches-{number}.json
112
+ ```
113
+
114
+ 2. During assembly, use Python to safely inject the JSON into `template.html`:
115
+ ```bash
116
+ python3 <<'PY'
117
+ import json
118
+ from pathlib import Path
119
+
120
+ patches = json.loads(Path('/tmp/pr-patches-{number}.json').read_text())
121
+ html = Path('/tmp/pr-review-{number}-body.html').read_text()
122
+ css = Path('styles.css').read_text()
123
+ js = Path('renderer.js').read_text()
124
+ tmpl = Path('template.html').read_text()
125
+
126
+ # Prevent literal </script> from terminating HTML script tags early.
127
+ safe_json = json.dumps(patches).replace('<', '\\u003c').replace('>', '\\u003e').replace('&', '\\u0026')
128
+
129
+ out = (
130
+ tmpl.replace('/* INJECT_CSS */', css)
131
+ .replace('/* INJECT_JS */', js)
132
+ .replace('<!-- INJECT_BODY -->', html)
133
+ .replace('{"__PR_DIFFS_PLACEHOLDER__":true}', safe_json)
134
+ )
135
+
136
+ Path('/tmp/pr-review-{number}.html').write_text(out)
137
+ PY
138
+ ```
139
+
140
+ This guarantees valid JSON and script-safe HTML embedding. The agent writes body HTML to a temp file, then Python assembles everything safely.
141
+
142
+ The diff data keys should match the `data-diff` attribute values in the HTML:
143
+ ```html
144
+ <div data-diff="path_to_file_ts"></div>
145
+ ```
146
+
147
+ Since renderer.js loads in `<head>`, you can also call `renderDiff(target, lines)` directly from inline `<script>` tags if needed for custom use cases. The function accepts a DOM element, ID string, or CSS selector as `target`, and a string or array as `lines`.
148
+
149
+ **You're not limited to these.** Add your own inline `<style>` blocks, `<script>` blocks, SVGs, diagrams, or anything else. The prebuilt pieces save time but don't constrain you.
150
+
151
+ ### 4. Assemble and open
152
+
153
+ 1. Write your body HTML (everything that goes inside `<body>`) to `/tmp/pr-review-{number}-body.html`
154
+ 2. Save patches to `/tmp/pr-patches-{number}.json` using the `jq` command from step 3 above
155
+ 3. Run the Python assembly script from step 3 above (reads styles.css, renderer.js, template.html from this skill directory, injects body + patches safely, writes final HTML)
156
+ 4. Open `/tmp/pr-review-{number}.html` in the browser and tell the user the path. The page is one self-contained HTML file, so no server is needed. A `tmux_run` server would not see the file on Linux, where each job gets its own private `/tmp`.
157
+
158
+ ### Diff features (handled automatically by renderer.js)
159
+
160
+ - Filters out import-only lines
161
+ - Collapses whitespace-only changes into context lines
162
+ - Detects moved code blocks (3+ consecutive lines deleted in one place and added identically elsewhere) -- renders in blue/purple instead of red/green
163
+ - Near-matches (moved + small edit) get a different purple tint
164
+
165
+ ### Style notes
166
+
167
+ - Dark theme: `#1a1a1a` background, Inter body font, IBM Plex Mono for code
168
+ - Use `var(--warning)` for orange, `var(--success)` for green, `var(--danger)` for red, `var(--accent)` for blue
169
+ - Sticky file headers (`position: sticky; top: 0`) and notes (`top: 35px`) pin while scrolling
170
+ - Core files expanded by default (`.file-body.open`), mechanical files collapsed
@@ -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>
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: principle-attack-the-premise
3
+ description: "Apply when two or more fixes that share one premise have failed the same gate. Write the premise down and test it directly before you write another fix that assumes it."
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Attack the Premise
8
+
9
+ When two or more fixes that share one premise have failed the same gate, suspect the premise, not the fixes.
10
+
11
+ **Why:** Each failed fix is evidence against the belief it assumed. A third fix on the same premise spends effort where the evidence already says the cause is not.
12
+
13
+ **Pattern:**
14
+ - **Write the premise down.** The premise is the one sentence that every failed fix assumed.
15
+ - **Test the premise before the next fix.** Find an observation that would come out differently if the premise were false, and make it. Look at how the failures are distributed, not only at how large they are. Make the check rerunnable per [Build the Lever](../principle-build-the-lever/SKILL.md).
16
+ - **Follow the evidence.** If it contradicts the premise, the cause is elsewhere. Look for what the failures have in common that the premise did not predict. If it confirms the premise, ask the next "why" per [Fix Root Causes](../principle-fix-root-causes/SKILL.md). The earlier fixes may have treated a consequence instead of the cause.
17
+ - **Remove the condition instead of compensating for it**, per the [Laziness Protocol](../principle-laziness-protocol/SKILL.md). If the evidence shows that one part always lands on the losing side, change what puts it there. A mechanism that cleans up after it leaves the cause in place and adds work on every run.
18
+
19
+ **Stop:** Do not start the next fix before the premise is written down and tested.
20
+
21
+ This principle is distinct from [Redesign from First Principles](../principle-redesign-from-first-principles/SKILL.md), which rebuilds a design around a new requirement. It questions a fact the current design assumes.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: principle-boundary-discipline
3
+ description: "Apply when wiring validation, error handling, or framework adapters. Concentrate guards at system boundaries (CLI, config, network, external APIs); trust internal types and keep business logic in pure functions."
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Boundary Discipline
8
+
9
+ Place validation, type narrowing, and error handling at system boundaries. Trust internal code unconditionally. Business logic lives in pure functions. The shell is thin and mechanical.
10
+
11
+ **Why:** Scattered validation is noisy, redundant, and gives a false sense of safety. Keep logic out of framework wiring so it can be tested without the framework.
12
+
13
+ **The pattern:**
14
+ - **At boundaries** (CLI args, config files, external APIs, network protocols): validate, return errors, handle defensively.
15
+ - **Inside the system:** typed data, error propagation, no re-validation. Trust the types.
16
+ - **Across the boundary.** Expose domain concepts, not the boundary's private representation. Keep general-purpose mechanism inside and special-purpose policy at the edge.
17
+
18
+ **Applications:**
19
+
20
+ Validation and error handling:
21
+ - Validate config at parse time (the boundary), not inside business logic
22
+ - Parse raw data into domain types at the boundary
23
+ - Do not re-export transport, storage, framework, or wire types through the public surface
24
+ - No redundant nil checks deep in call chains if the boundary already validated
25
+
26
+ Code organization:
27
+ - Business logic in pure functions with no framework dependencies
28
+ - Parse functions: pure transforms from raw bytes to typed state
29
+ - Prompt construction: structured state in, string out
30
+ - Scoring and assessment: pure transforms from state to results
31
+
32
+ **The tests:**
33
+ - "Is this data crossing a system boundary right now?" If not, validation is redundant.
34
+ - "Can this be a pure function that the shell just calls?" If yes, extract it.