plumbbob 0.9.3 → 0.10.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 (320) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +92 -89
  3. package/dist/cli-core.js +25 -8
  4. package/dist/cli.js +1 -1
  5. package/dist/lib/agents.js +26 -26
  6. package/dist/lib/buildlog.js +11 -11
  7. package/dist/lib/buildlogsync.js +8 -8
  8. package/dist/lib/check.js +55 -22
  9. package/dist/lib/commitbody.js +72 -0
  10. package/dist/lib/commitmsg.js +7 -7
  11. package/dist/lib/git.js +44 -15
  12. package/dist/lib/intent.js +21 -20
  13. package/dist/lib/latch.js +19 -19
  14. package/dist/lib/orient.js +36 -17
  15. package/dist/lib/reentry.js +70 -0
  16. package/dist/lib/settings.js +16 -16
  17. package/dist/lib/sidecar.js +54 -54
  18. package/dist/lib/templates.js +1 -1
  19. package/dist/verbs/agent.js +27 -27
  20. package/dist/verbs/build.js +9 -9
  21. package/dist/verbs/check.js +6 -6
  22. package/dist/verbs/checkpoint.js +48 -47
  23. package/dist/verbs/doctor.js +31 -30
  24. package/dist/verbs/finish.js +28 -41
  25. package/dist/verbs/handoff.js +9 -8
  26. package/dist/verbs/init.js +9 -9
  27. package/dist/verbs/park.js +3 -3
  28. package/dist/verbs/recover.js +297 -0
  29. package/dist/verbs/revert.js +13 -13
  30. package/dist/verbs/spike.js +25 -19
  31. package/dist/verbs/start.js +49 -19
  32. package/dist/verbs/status.js +8 -8
  33. package/dist/verbs/turn.js +16 -16
  34. package/dist/verbs/use.js +4 -4
  35. package/hooks/post-edit.sh +4 -4
  36. package/hooks/pre-bash-commit.sh +3 -3
  37. package/node_modules/checkride/.claude-plugin/plugin.json +11 -0
  38. package/node_modules/checkride/CHANGELOG.md +1404 -0
  39. package/node_modules/checkride/LICENSE +201 -21
  40. package/node_modules/checkride/README.md +197 -38
  41. package/node_modules/checkride/dist/__tests__/fixtures/released-stanzas.d.ts +15 -0
  42. package/node_modules/checkride/dist/__tests__/fixtures/released-stanzas.d.ts.map +1 -0
  43. package/node_modules/checkride/dist/__tests__/fixtures/released-stanzas.js +17 -0
  44. package/node_modules/checkride/dist/__tests__/fixtures/released-stanzas.js.map +1 -0
  45. package/node_modules/checkride/dist/adapters.d.ts +30 -10
  46. package/node_modules/checkride/dist/adapters.d.ts.map +1 -1
  47. package/node_modules/checkride/dist/adapters.js +62 -23
  48. package/node_modules/checkride/dist/adapters.js.map +1 -1
  49. package/node_modules/checkride/dist/agent-setup/claude.d.ts +88 -0
  50. package/node_modules/checkride/dist/agent-setup/claude.d.ts.map +1 -0
  51. package/node_modules/checkride/dist/agent-setup/claude.js +305 -0
  52. package/node_modules/checkride/dist/agent-setup/claude.js.map +1 -0
  53. package/node_modules/checkride/dist/agent-setup/command.d.ts +43 -0
  54. package/node_modules/checkride/dist/agent-setup/command.d.ts.map +1 -0
  55. package/node_modules/checkride/dist/agent-setup/command.js +77 -0
  56. package/node_modules/checkride/dist/agent-setup/command.js.map +1 -0
  57. package/node_modules/checkride/dist/agent-setup/cursor.d.ts +69 -0
  58. package/node_modules/checkride/dist/agent-setup/cursor.d.ts.map +1 -0
  59. package/node_modules/checkride/dist/agent-setup/cursor.js +247 -0
  60. package/node_modules/checkride/dist/agent-setup/cursor.js.map +1 -0
  61. package/node_modules/checkride/dist/agent-setup/files.d.ts +50 -0
  62. package/node_modules/checkride/dist/agent-setup/files.d.ts.map +1 -0
  63. package/node_modules/checkride/dist/agent-setup/files.js +80 -0
  64. package/node_modules/checkride/dist/agent-setup/files.js.map +1 -0
  65. package/node_modules/checkride/dist/agent-setup/harness.d.ts +101 -0
  66. package/node_modules/checkride/dist/agent-setup/harness.d.ts.map +1 -0
  67. package/node_modules/checkride/dist/agent-setup/harness.js +93 -0
  68. package/node_modules/checkride/dist/agent-setup/harness.js.map +1 -0
  69. package/node_modules/checkride/dist/agent-setup/hook.d.ts +45 -52
  70. package/node_modules/checkride/dist/agent-setup/hook.d.ts.map +1 -1
  71. package/node_modules/checkride/dist/agent-setup/hook.js +64 -95
  72. package/node_modules/checkride/dist/agent-setup/hook.js.map +1 -1
  73. package/node_modules/checkride/dist/agent-setup/index.d.ts +10 -4
  74. package/node_modules/checkride/dist/agent-setup/index.d.ts.map +1 -1
  75. package/node_modules/checkride/dist/agent-setup/index.js +9 -4
  76. package/node_modules/checkride/dist/agent-setup/index.js.map +1 -1
  77. package/node_modules/checkride/dist/agent-setup/scripts.d.ts +81 -0
  78. package/node_modules/checkride/dist/agent-setup/scripts.d.ts.map +1 -0
  79. package/node_modules/checkride/dist/agent-setup/scripts.js +604 -0
  80. package/node_modules/checkride/dist/agent-setup/scripts.js.map +1 -0
  81. package/node_modules/checkride/dist/agent-setup/skills.d.ts +31 -0
  82. package/node_modules/checkride/dist/agent-setup/skills.d.ts.map +1 -0
  83. package/node_modules/checkride/dist/agent-setup/skills.js +56 -0
  84. package/node_modules/checkride/dist/agent-setup/skills.js.map +1 -0
  85. package/node_modules/checkride/dist/artifacts/configured.d.ts +30 -0
  86. package/node_modules/checkride/dist/artifacts/configured.d.ts.map +1 -0
  87. package/node_modules/checkride/dist/artifacts/configured.js +45 -0
  88. package/node_modules/checkride/dist/artifacts/configured.js.map +1 -0
  89. package/node_modules/checkride/dist/artifacts/format.d.ts +33 -0
  90. package/node_modules/checkride/dist/artifacts/format.d.ts.map +1 -0
  91. package/node_modules/checkride/dist/artifacts/format.js +56 -0
  92. package/node_modules/checkride/dist/artifacts/format.js.map +1 -0
  93. package/node_modules/checkride/dist/artifacts/freshness.d.ts +32 -0
  94. package/node_modules/checkride/dist/artifacts/freshness.d.ts.map +1 -0
  95. package/node_modules/checkride/dist/artifacts/freshness.js +37 -0
  96. package/node_modules/checkride/dist/artifacts/freshness.js.map +1 -0
  97. package/node_modules/checkride/dist/artifacts/index.d.ts +22 -0
  98. package/node_modules/checkride/dist/artifacts/index.d.ts.map +1 -0
  99. package/node_modules/checkride/dist/artifacts/index.js +19 -0
  100. package/node_modules/checkride/dist/artifacts/index.js.map +1 -0
  101. package/node_modules/checkride/dist/artifacts/json.d.ts +31 -0
  102. package/node_modules/checkride/dist/artifacts/json.d.ts.map +1 -0
  103. package/node_modules/checkride/dist/artifacts/json.js +47 -0
  104. package/node_modules/checkride/dist/artifacts/json.js.map +1 -0
  105. package/node_modules/checkride/dist/artifacts/raw.d.ts +60 -0
  106. package/node_modules/checkride/dist/artifacts/raw.d.ts.map +1 -0
  107. package/node_modules/checkride/dist/artifacts/raw.js +91 -0
  108. package/node_modules/checkride/dist/artifacts/raw.js.map +1 -0
  109. package/node_modules/checkride/dist/artifacts/summary.d.ts +69 -0
  110. package/node_modules/checkride/dist/artifacts/summary.d.ts.map +1 -0
  111. package/node_modules/checkride/dist/artifacts/summary.js +108 -0
  112. package/node_modules/checkride/dist/artifacts/summary.js.map +1 -0
  113. package/node_modules/checkride/dist/atomic.d.ts +16 -1
  114. package/node_modules/checkride/dist/atomic.d.ts.map +1 -1
  115. package/node_modules/checkride/dist/atomic.js +25 -3
  116. package/node_modules/checkride/dist/atomic.js.map +1 -1
  117. package/node_modules/checkride/dist/baseline/fallow.d.ts +9 -5
  118. package/node_modules/checkride/dist/baseline/fallow.d.ts.map +1 -1
  119. package/node_modules/checkride/dist/baseline/fallow.js +163 -60
  120. package/node_modules/checkride/dist/baseline/fallow.js.map +1 -1
  121. package/node_modules/checkride/dist/baseline/fingerprint.d.ts +20 -11
  122. package/node_modules/checkride/dist/baseline/fingerprint.d.ts.map +1 -1
  123. package/node_modules/checkride/dist/baseline/fingerprint.js +73 -23
  124. package/node_modules/checkride/dist/baseline/fingerprint.js.map +1 -1
  125. package/node_modules/checkride/dist/baseline/history.d.ts +98 -0
  126. package/node_modules/checkride/dist/baseline/history.d.ts.map +1 -0
  127. package/node_modules/checkride/dist/baseline/history.js +232 -0
  128. package/node_modules/checkride/dist/baseline/history.js.map +1 -0
  129. package/node_modules/checkride/dist/baseline/index.d.ts +7 -5
  130. package/node_modules/checkride/dist/baseline/index.d.ts.map +1 -1
  131. package/node_modules/checkride/dist/baseline/index.js +5 -4
  132. package/node_modules/checkride/dist/baseline/index.js.map +1 -1
  133. package/node_modules/checkride/dist/baseline/store.d.ts +41 -10
  134. package/node_modules/checkride/dist/baseline/store.d.ts.map +1 -1
  135. package/node_modules/checkride/dist/baseline/store.js +65 -24
  136. package/node_modules/checkride/dist/baseline/store.js.map +1 -1
  137. package/node_modules/checkride/dist/baseline-command.d.ts +5 -5
  138. package/node_modules/checkride/dist/baseline-command.js +7 -7
  139. package/node_modules/checkride/dist/baseline-command.js.map +1 -1
  140. package/node_modules/checkride/dist/cli.d.ts +21 -4
  141. package/node_modules/checkride/dist/cli.d.ts.map +1 -1
  142. package/node_modules/checkride/dist/cli.js +350 -36
  143. package/node_modules/checkride/dist/cli.js.map +1 -1
  144. package/node_modules/checkride/dist/config.d.ts +114 -9
  145. package/node_modules/checkride/dist/config.d.ts.map +1 -1
  146. package/node_modules/checkride/dist/config.js +142 -23
  147. package/node_modules/checkride/dist/config.js.map +1 -1
  148. package/node_modules/checkride/dist/digest/digest.d.ts +5 -5
  149. package/node_modules/checkride/dist/digest/digest.js +6 -6
  150. package/node_modules/checkride/dist/digest/index.d.ts +2 -2
  151. package/node_modules/checkride/dist/digest/index.js +2 -2
  152. package/node_modules/checkride/dist/doctor.d.ts +27 -6
  153. package/node_modules/checkride/dist/doctor.d.ts.map +1 -1
  154. package/node_modules/checkride/dist/doctor.js +231 -27
  155. package/node_modules/checkride/dist/doctor.js.map +1 -1
  156. package/node_modules/checkride/dist/gate.d.ts +180 -0
  157. package/node_modules/checkride/dist/gate.d.ts.map +1 -0
  158. package/node_modules/checkride/dist/gate.js +617 -0
  159. package/node_modules/checkride/dist/gate.js.map +1 -0
  160. package/node_modules/checkride/dist/init.d.ts +79 -12
  161. package/node_modules/checkride/dist/init.d.ts.map +1 -1
  162. package/node_modules/checkride/dist/init.js +385 -81
  163. package/node_modules/checkride/dist/init.js.map +1 -1
  164. package/node_modules/checkride/dist/json.d.ts +21 -0
  165. package/node_modules/checkride/dist/json.d.ts.map +1 -0
  166. package/node_modules/checkride/dist/json.js +21 -0
  167. package/node_modules/checkride/dist/json.js.map +1 -0
  168. package/node_modules/checkride/dist/links.d.ts +31 -5
  169. package/node_modules/checkride/dist/links.d.ts.map +1 -1
  170. package/node_modules/checkride/dist/links.js +141 -32
  171. package/node_modules/checkride/dist/links.js.map +1 -1
  172. package/node_modules/checkride/dist/node-pin.d.ts +129 -0
  173. package/node_modules/checkride/dist/node-pin.d.ts.map +1 -0
  174. package/node_modules/checkride/dist/node-pin.js +211 -0
  175. package/node_modules/checkride/dist/node-pin.js.map +1 -0
  176. package/node_modules/checkride/dist/orchestrator.d.ts +53 -10
  177. package/node_modules/checkride/dist/orchestrator.d.ts.map +1 -1
  178. package/node_modules/checkride/dist/orchestrator.js +312 -113
  179. package/node_modules/checkride/dist/orchestrator.js.map +1 -1
  180. package/node_modules/checkride/dist/pack.d.ts +8 -9
  181. package/node_modules/checkride/dist/pack.d.ts.map +1 -1
  182. package/node_modules/checkride/dist/pack.js +53 -17
  183. package/node_modules/checkride/dist/pack.js.map +1 -1
  184. package/node_modules/checkride/dist/pm/detect.d.ts +6 -1
  185. package/node_modules/checkride/dist/pm/detect.d.ts.map +1 -1
  186. package/node_modules/checkride/dist/pm/detect.js +6 -1
  187. package/node_modules/checkride/dist/pm/detect.js.map +1 -1
  188. package/node_modules/checkride/dist/pm/index.d.ts +7 -2
  189. package/node_modules/checkride/dist/pm/index.d.ts.map +1 -1
  190. package/node_modules/checkride/dist/pm/index.js +6 -2
  191. package/node_modules/checkride/dist/pm/index.js.map +1 -1
  192. package/node_modules/checkride/dist/pm/launch.d.ts +72 -0
  193. package/node_modules/checkride/dist/pm/launch.d.ts.map +1 -0
  194. package/node_modules/checkride/dist/pm/launch.js +108 -0
  195. package/node_modules/checkride/dist/pm/launch.js.map +1 -0
  196. package/node_modules/checkride/dist/pm/tools.d.ts +73 -0
  197. package/node_modules/checkride/dist/pm/tools.d.ts.map +1 -0
  198. package/node_modules/checkride/dist/pm/tools.js +124 -0
  199. package/node_modules/checkride/dist/pm/tools.js.map +1 -0
  200. package/node_modules/checkride/dist/pm/translate.d.ts +35 -9
  201. package/node_modules/checkride/dist/pm/translate.d.ts.map +1 -1
  202. package/node_modules/checkride/dist/pm/translate.js +78 -18
  203. package/node_modules/checkride/dist/pm/translate.js.map +1 -1
  204. package/node_modules/checkride/dist/proc.d.ts +30 -0
  205. package/node_modules/checkride/dist/proc.d.ts.map +1 -0
  206. package/node_modules/checkride/dist/proc.js +42 -0
  207. package/node_modules/checkride/dist/proc.js.map +1 -0
  208. package/node_modules/checkride/dist/qa/cli.d.ts +20 -0
  209. package/node_modules/checkride/dist/qa/cli.d.ts.map +1 -0
  210. package/node_modules/checkride/dist/qa/cli.js +24 -0
  211. package/node_modules/checkride/dist/qa/cli.js.map +1 -0
  212. package/node_modules/checkride/dist/qa/dead.d.ts +39 -0
  213. package/node_modules/checkride/dist/qa/dead.d.ts.map +1 -0
  214. package/node_modules/checkride/dist/qa/dead.js +88 -0
  215. package/node_modules/checkride/dist/qa/dead.js.map +1 -0
  216. package/node_modules/checkride/dist/qa/dupes.d.ts +45 -0
  217. package/node_modules/checkride/dist/qa/dupes.d.ts.map +1 -0
  218. package/node_modules/checkride/dist/qa/dupes.js +62 -0
  219. package/node_modules/checkride/dist/qa/dupes.js.map +1 -0
  220. package/node_modules/checkride/dist/qa/health.d.ts +85 -0
  221. package/node_modules/checkride/dist/qa/health.d.ts.map +1 -0
  222. package/node_modules/checkride/dist/qa/health.js +109 -0
  223. package/node_modules/checkride/dist/qa/health.js.map +1 -0
  224. package/node_modules/checkride/dist/qa/index.d.ts +23 -0
  225. package/node_modules/checkride/dist/qa/index.d.ts.map +1 -0
  226. package/node_modules/checkride/dist/qa/index.js +22 -0
  227. package/node_modules/checkride/dist/qa/index.js.map +1 -0
  228. package/node_modules/checkride/dist/qa/mutation.d.ts +80 -0
  229. package/node_modules/checkride/dist/qa/mutation.d.ts.map +1 -0
  230. package/node_modules/checkride/dist/qa/mutation.js +195 -0
  231. package/node_modules/checkride/dist/qa/mutation.js.map +1 -0
  232. package/node_modules/checkride/dist/qa/qa.d.ts +71 -0
  233. package/node_modules/checkride/dist/qa/qa.d.ts.map +1 -0
  234. package/node_modules/checkride/dist/qa/qa.js +158 -0
  235. package/node_modules/checkride/dist/qa/qa.js.map +1 -0
  236. package/node_modules/checkride/dist/qa/read.d.ts +40 -0
  237. package/node_modules/checkride/dist/qa/read.d.ts.map +1 -0
  238. package/node_modules/checkride/dist/qa/read.js +47 -0
  239. package/node_modules/checkride/dist/qa/read.js.map +1 -0
  240. package/node_modules/checkride/dist/qa/render.d.ts +26 -0
  241. package/node_modules/checkride/dist/qa/render.d.ts.map +1 -0
  242. package/node_modules/checkride/dist/qa/render.js +310 -0
  243. package/node_modules/checkride/dist/qa/render.js.map +1 -0
  244. package/node_modules/checkride/dist/recover.d.ts +48 -0
  245. package/node_modules/checkride/dist/recover.d.ts.map +1 -0
  246. package/node_modules/checkride/dist/recover.js +220 -0
  247. package/node_modules/checkride/dist/recover.js.map +1 -0
  248. package/node_modules/checkride/dist/security.d.ts +45 -0
  249. package/node_modules/checkride/dist/security.d.ts.map +1 -0
  250. package/node_modules/checkride/dist/security.js +86 -0
  251. package/node_modules/checkride/dist/security.js.map +1 -0
  252. package/node_modules/checkride/dist/smoke.d.ts +6 -6
  253. package/node_modules/checkride/dist/smoke.js +6 -6
  254. package/node_modules/checkride/dist/snippets.d.ts +27 -30
  255. package/node_modules/checkride/dist/snippets.d.ts.map +1 -1
  256. package/node_modules/checkride/dist/snippets.js +26 -30
  257. package/node_modules/checkride/dist/snippets.js.map +1 -1
  258. package/node_modules/checkride/dist/tool-json.d.ts +33 -0
  259. package/node_modules/checkride/dist/tool-json.d.ts.map +1 -0
  260. package/node_modules/checkride/dist/tool-json.js +58 -0
  261. package/node_modules/checkride/dist/tool-json.js.map +1 -0
  262. package/node_modules/checkride/dist/triage/cli.d.ts +21 -0
  263. package/node_modules/checkride/dist/triage/cli.d.ts.map +1 -0
  264. package/node_modules/checkride/dist/triage/cli.js +26 -0
  265. package/node_modules/checkride/dist/triage/cli.js.map +1 -0
  266. package/node_modules/checkride/dist/triage/doctor-fold.d.ts +51 -0
  267. package/node_modules/checkride/dist/triage/doctor-fold.d.ts.map +1 -0
  268. package/node_modules/checkride/dist/triage/doctor-fold.js +88 -0
  269. package/node_modules/checkride/dist/triage/doctor-fold.js.map +1 -0
  270. package/node_modules/checkride/dist/triage/env.d.ts +54 -0
  271. package/node_modules/checkride/dist/triage/env.d.ts.map +1 -0
  272. package/node_modules/checkride/dist/triage/env.js +81 -0
  273. package/node_modules/checkride/dist/triage/env.js.map +1 -0
  274. package/node_modules/checkride/dist/triage/gate.d.ts +61 -0
  275. package/node_modules/checkride/dist/triage/gate.d.ts.map +1 -0
  276. package/node_modules/checkride/dist/triage/gate.js +121 -0
  277. package/node_modules/checkride/dist/triage/gate.js.map +1 -0
  278. package/node_modules/checkride/dist/triage/index.d.ts +22 -0
  279. package/node_modules/checkride/dist/triage/index.d.ts.map +1 -0
  280. package/node_modules/checkride/dist/triage/index.js +20 -0
  281. package/node_modules/checkride/dist/triage/index.js.map +1 -0
  282. package/node_modules/checkride/dist/triage/render.d.ts +19 -0
  283. package/node_modules/checkride/dist/triage/render.d.ts.map +1 -0
  284. package/node_modules/checkride/dist/triage/render.js +419 -0
  285. package/node_modules/checkride/dist/triage/render.js.map +1 -0
  286. package/node_modules/checkride/dist/triage/triage.d.ts +83 -0
  287. package/node_modules/checkride/dist/triage/triage.d.ts.map +1 -0
  288. package/node_modules/checkride/dist/triage/triage.js +131 -0
  289. package/node_modules/checkride/dist/triage/triage.js.map +1 -0
  290. package/node_modules/checkride/package.json +18 -15
  291. package/node_modules/checkride/schema/checkride.config.schema.json +70 -5
  292. package/node_modules/checkride/schema/checkride.summary.schema.json +1 -1
  293. package/node_modules/checkride/skills/check/SKILL.md +265 -0
  294. package/node_modules/checkride/skills/qa/SKILL.md +231 -0
  295. package/node_modules/checkride/templates/shared/cspell.json +1 -0
  296. package/node_modules/checkride/templates/shared/oxlintrc.json +1 -1
  297. package/node_modules/checkride/templates/shared/styles/Repo/Drift.yml +41 -0
  298. package/node_modules/checkride/templates/shared/styles/Repo/Latin.yml +14 -0
  299. package/node_modules/checkride/templates/shared/styles/Repo/LyHyphen.yml +28 -0
  300. package/node_modules/checkride/templates/shared/styles/Repo/Minted.yml +33 -0
  301. package/node_modules/checkride/templates/shared/styles/Repo/ThereIs.yml +16 -0
  302. package/node_modules/checkride/templates/shared/styles/Repo/Weasel.yml +26 -0
  303. package/node_modules/checkride/templates/shared/vale.ini +34 -0
  304. package/package.json +10 -9
  305. package/skills/build/SKILL.md +85 -76
  306. package/skills/doctor/SKILL.md +11 -11
  307. package/skills/finish/SKILL.md +21 -18
  308. package/skills/harvest/SKILL.md +13 -11
  309. package/skills/park/SKILL.md +10 -10
  310. package/skills/plan/SKILL.md +69 -59
  311. package/skills/recover/SKILL.md +28 -0
  312. package/skills/refine/SKILL.md +21 -18
  313. package/skills/revert/SKILL.md +6 -6
  314. package/skills/spike/SKILL.md +9 -9
  315. package/skills/status/SKILL.md +5 -5
  316. package/skills/step/SKILL.md +20 -15
  317. package/skills/verify/SKILL.md +56 -46
  318. package/templates/build-log.md +7 -7
  319. package/templates/intent.md +52 -41
  320. package/templates/spike-report.md +10 -10
@@ -0,0 +1,310 @@
1
+ /**
2
+ * Rendering a {@link QaReport} as Markdown, under the same 8 KB ceiling
3
+ * `--digest` uses.
4
+ *
5
+ * The ledger is the head and never drops: which artifacts are evidence, which
6
+ * are days old, and which were never produced is the answer, not the preamble
7
+ * (D14). Each ledger row carries its own headline number, so even if the byte
8
+ * ceiling trims a detail section the score behind it survives.
9
+ *
10
+ * Detail sections follow in the order the skill reasons about them — surviving
11
+ * mutants, then dead code, then duplication, then complexity — and each is
12
+ * internally capped by its extractor, so the ceiling is a backstop rather than
13
+ * the usual path. When it does bind, whole sections drop from the end and are
14
+ * named; nothing is silently truncated mid-thought.
15
+ *
16
+ * No artifact's *contents* appear here beyond located samples and file names.
17
+ * The one place source text surfaces at all is a clipped mutant replacement,
18
+ * which is the only way a line number becomes actionable without opening a
19
+ * 2.3 MB file.
20
+ */
21
+ import { formatBytes, formatDuration } from '../artifacts/index.js';
22
+ /** Matches `--digest`'s ceiling: a report that reads in one gulp. */
23
+ export const QA_MAX_BYTES = 8000;
24
+ const NOT_READ_NOTE = 'Not read: the full contents of any `.check/` artifact. Every list above is capped and every ' +
25
+ 'count is from a full pass, so a short list is a *ranked* list, never a complete one — open the ' +
26
+ 'named artifact when a specific finding is the one you are working on.';
27
+ const NOTHING_RUN_NOTE = 'This reader ran nothing. Every number above is whatever the last run left in `.check/`, which ' +
28
+ 'may be a narrow run — check `covered` above before treating a clean artifact as a clean repo.';
29
+ function bullets(items) {
30
+ return items.map((item) => `- ${item}`).join('\n');
31
+ }
32
+ function table(head, rows) {
33
+ return [`| ${head.join(' | ')} |`, `| ${head.map(() => '---').join(' | ')} |`, ...rows].join('\n');
34
+ }
35
+ /** `70.96%`, or `—` when nothing was measurable. `places` matches the tool's. */
36
+ function pct(value, places = 1) {
37
+ return value === null ? '—' : `${value.toFixed(places)}%`;
38
+ }
39
+ function count(value) {
40
+ return value === null ? '—' : String(value);
41
+ }
42
+ /**
43
+ * A code span whose fence outgrows any backtick run inside `text`. Mutant
44
+ * replacements are source, and stryker's `StringLiteral` mutator turns a
45
+ * template literal into one made of backticks — a fixed single-backtick span
46
+ * would break and swallow the rest of the line.
47
+ */
48
+ function code(text) {
49
+ const runs = [...text.matchAll(/`+/g)].map((match) => match[0].length);
50
+ const fence = '`'.repeat(Math.max(0, ...runs) + 1);
51
+ const pad = text.startsWith('`') || text.endsWith('`') ? ' ' : '';
52
+ return `${fence}${pad}${text}${pad}${fence}`;
53
+ }
54
+ /* -------------------------------------------------------------- the ledger */
55
+ /** The four-state answer, plus the two ways a file can be unusable. */
56
+ function stateOf(entry) {
57
+ if (entry.problem === 'absent')
58
+ return entry.optedIn === false ? 'not opted in' : 'absent';
59
+ if (entry.problem !== null)
60
+ return entry.problem;
61
+ return entry.file?.freshness.state === 'stale' ? 'STALE' : 'read';
62
+ }
63
+ function ageOf(entry) {
64
+ const freshness = entry.file?.freshness;
65
+ if (freshness === undefined)
66
+ return '—';
67
+ if (freshness.state === 'stale')
68
+ return formatDuration(freshness.ageMs ?? 0);
69
+ return freshness.state === 'fresh' ? 'fresh' : '?';
70
+ }
71
+ function mutationHeadline(extract) {
72
+ return `score ${pct(extract.score, 2)} · ${extract.survived} survived · ${extract.noCoverage} no-coverage`;
73
+ }
74
+ function deadHeadline(extract) {
75
+ return `${count(extract.totalIssues)} issue(s) · ${extract.buckets.length} non-empty bucket(s)`;
76
+ }
77
+ function dupesHeadline(extract) {
78
+ return `${pct(extract.duplicationPercentage)} duplicated · ${extract.cloneGroups} clone group(s)`;
79
+ }
80
+ function healthHeadline(extract) {
81
+ const over = extract.totalFindings;
82
+ return `${extract.score === null ? '—' : extract.score.toFixed(1)}/${extract.grade} · ${over} function(s) over threshold`;
83
+ }
84
+ function headlineFor(report, slot) {
85
+ if (slot === 'mutation')
86
+ return report.mutation === null ? '—' : mutationHeadline(report.mutation);
87
+ if (slot === 'dead')
88
+ return report.dead === null ? '—' : deadHeadline(report.dead);
89
+ if (slot === 'dupes')
90
+ return report.dupes === null ? '—' : dupesHeadline(report.dupes);
91
+ return report.health === null ? '—' : healthHeadline(report.health);
92
+ }
93
+ function ledgerRow(report, entry) {
94
+ const size = entry.file === null ? '—' : formatBytes(entry.file.bytes);
95
+ return `| \`.check/${entry.artifact}\` | ${stateOf(entry)} | ${size} | ${ageOf(entry)} | ${headlineFor(report, entry.slot)} |`;
96
+ }
97
+ /** Where this artifact came from, when that is not "the run described above". */
98
+ function provenanceReason(entry) {
99
+ if (entry.optedIn === false) {
100
+ return `\`${entry.slot}\` is not named in \`checkride.config.json\`, so no \`checkride\` run produces it`;
101
+ }
102
+ if (!entry.ranThisRun) {
103
+ return `\`${entry.slot}\` has no entry in the summary on disk, so nothing here is from that run`;
104
+ }
105
+ return null;
106
+ }
107
+ function stalenessReason(entry) {
108
+ const freshness = entry.file?.freshness;
109
+ if (freshness?.state !== 'stale')
110
+ return null;
111
+ return `the file is ${formatDuration(freshness.ageMs ?? 0)} older than that run's start`;
112
+ }
113
+ /** Why the fold produced nothing. Every problem state names itself. */
114
+ const PROBLEM_REASON = {
115
+ absent: () => 'nothing is on disk',
116
+ 'too-large': () => "the file is past this reader's parse ceiling",
117
+ unreadable: (entry) => `the file is ${entry.detail ?? 'unparseable'}`,
118
+ unrecognized: () => 'the file parsed but is not the report this slot writes',
119
+ };
120
+ function problemReason(entry) {
121
+ return entry.problem === null ? null : (PROBLEM_REASON[entry.problem]?.(entry) ?? null);
122
+ }
123
+ /**
124
+ * The prose beside a row that is not plain evidence — provenance first, then
125
+ * age, then why nothing was folded, then the remedy. A row with nothing to say
126
+ * produces no note at all, so a clean ledger is a bare table.
127
+ */
128
+ function ledgerNote(entry) {
129
+ const why = [provenanceReason(entry), stalenessReason(entry), problemReason(entry)].filter((reason) => reason !== null);
130
+ return why.length === 0 ? null : `**${entry.slot}** — ${why.join('; ')}. ${entry.remedy}`;
131
+ }
132
+ function renderLedger(report) {
133
+ const rows = report.ledger.map((entry) => ledgerRow(report, entry));
134
+ const notes = report.ledger.map(ledgerNote).filter((note) => note !== null);
135
+ const body = table(['artifact', 'state', 'size', 'age', 'headline'], rows);
136
+ return notes.length === 0 ? body : `${body}\n\n${bullets(notes)}`;
137
+ }
138
+ /* --------------------------------------------------------------- the head */
139
+ /**
140
+ * How long ago the run finished. A summary stamped in the *future* is a real
141
+ * condition — a skewed clock on the machine that wrote it — and saying so beats
142
+ * printing a negative duration, because the same skew is what will have made
143
+ * every artifact beside it look stale.
144
+ */
145
+ function ageClause(ageMs) {
146
+ if (ageMs === null)
147
+ return 'age unknown';
148
+ if (ageMs < 0)
149
+ return `stamped ${formatDuration(-ageMs)} IN THE FUTURE — the writing clock is ahead`;
150
+ return `${formatDuration(ageMs)} ago`;
151
+ }
152
+ /**
153
+ * Why the summary is unusable, in the words that distinguish the cases. An
154
+ * absent `schema_version` means a stranger wrote this file, which is a
155
+ * different report from a checkride that is simply newer than this reader.
156
+ */
157
+ function summaryProblem(summary) {
158
+ if (summary.state === 'foreign')
159
+ return 'no `schema_version` field — NOT written by checkride';
160
+ if (summary.state === 'schema-mismatch')
161
+ return `\`schema_version\` is ${JSON.stringify(summary.found)}, not 1; STOP`;
162
+ return summary.state;
163
+ }
164
+ /** Provenance first: what wrote these artifacts, when, and over which slots. */
165
+ function renderHead(report) {
166
+ const { summary } = report;
167
+ const at = '`.check/summary.json`';
168
+ const provenance = summary.state === 'ok'
169
+ ? `${at} — \`schema_version\` 1, ${ageClause(report.summaryAgeMs)}, ${formatDuration(summary.summary.total_duration_ms)}`
170
+ : `${at} — ${summaryProblem(summary)}`;
171
+ const covered = report.covered.length === 0
172
+ ? 'covered: nothing — no readable summary, so the artifacts below belong to no known run'
173
+ : `covered: ${report.covered.length} slot(s) ran — ${report.covered.join(', ')}`;
174
+ const lines = [`summary: ${provenance}`, covered];
175
+ if (report.skipped.length > 0)
176
+ lines.push(`skipped: ${report.skipped.join(', ')}`);
177
+ return `# checkride qa\n\n${bullets(lines)}\n\n## artifacts\n\n${renderLedger(report)}\n`;
178
+ }
179
+ /* ----------------------------------------------------------- the sections */
180
+ function mutationRow(file) {
181
+ const mutators = file.mutators.map((m) => `${m.mutator} ${m.count}`).join(', ');
182
+ return `| \`${file.path}\` | ${pct(file.score, 1)} | ${file.survived} | ${file.noCoverage} | ${file.tested} | ${mutators} |`;
183
+ }
184
+ function sampleLine(sample) {
185
+ const where = `\`${sample.path}\`${sample.line === null ? '' : `:${sample.line}`}`;
186
+ return `${where} — ${sample.mutator} → ${code(sample.replacement)} (${sample.status})`;
187
+ }
188
+ function renderMutation(report) {
189
+ const m = report.mutation;
190
+ if (m === null)
191
+ return '';
192
+ const counts = `Score **${pct(m.score, 2)}** (detected ÷ tested — stryker's own headline), ${pct(m.scoreCovered, 2)} ` +
193
+ `counting only mutants a test reaches.\n\n` +
194
+ `${m.killed} killed · ${m.timeout} timeout · **${m.survived} survived** · **${m.noCoverage} no-coverage** · ` +
195
+ `${m.ignored} ignored${m.other > 0 ? ` · ${m.other} errored` : ''} — ${m.total} mutant(s) over ${m.totalFiles} file(s).\n\n` +
196
+ 'No-coverage means no test reaches the line at all; survived means a test reaches it and asserts ' +
197
+ 'nothing that would notice the change. They want different fixes.';
198
+ const rows = m.files.map(mutationRow);
199
+ const ranking = `\nRanked by undetected (survived + no-coverage) count${m.omittedFiles > 0 ? `; ${m.omittedFiles} more file(s) not shown` : ''}.`;
200
+ const mutators = `\nUndetected by mutator: ${m.mutators.map((x) => `${x.mutator} ${x.count}`).join(', ')}.`;
201
+ const samples = m.samples.length === 0 ? '' : `\n\nLocated samples (worst files only):\n\n${bullets(m.samples.map(sampleLine))}`;
202
+ return `${counts}\n\n${table(['file', 'score', 'survived', 'no-cov', 'tested', 'top undetected mutators'], rows)}\n${ranking}\n${mutators}${samples}`;
203
+ }
204
+ function renderDead(report) {
205
+ const d = report.dead;
206
+ if (d === null)
207
+ return '';
208
+ const head = `${count(d.totalIssues)} issue(s) across ${count(d.entryPoints)} entry point(s).`;
209
+ if (d.buckets.length === 0)
210
+ return `${head} No finding bucket is non-empty.`;
211
+ const rows = d.buckets.map((b) => `| ${b.name} | ${b.count} | ${b.samples.map((s) => `\`${s}\``).join(', ')} |`);
212
+ const omitted = d.omittedBuckets > 0 ? `\n\n${d.omittedBuckets} more non-empty bucket(s) not shown.` : '';
213
+ return `${head}\n\n${table(['bucket', 'count', 'first few'], rows)}${omitted}`;
214
+ }
215
+ function renderDupes(report) {
216
+ const d = report.dupes;
217
+ if (d === null)
218
+ return '';
219
+ const head = `${pct(d.duplicationPercentage)} duplicated — ${count(d.duplicatedLines)} of ${count(d.totalLines)} line(s) ` +
220
+ `across ${count(d.totalFiles)} file(s); ${d.cloneGroups} clone group(s) in ${d.totalFamilies} families.`;
221
+ if (d.families.length === 0)
222
+ return head;
223
+ const rows = d.families.map((f) => {
224
+ const files = [...f.files, ...(f.omittedFiles > 0 ? [`+${f.omittedFiles} more`] : [])];
225
+ return `| ${files.map((x) => `\`${x}\``).join(', ')} | ${f.groups} | ${count(f.lines)} | ${count(f.tokens)} |`;
226
+ });
227
+ const omitted = d.omittedFamilies > 0 ? `\n\n${d.omittedFamilies} more families not shown.` : '';
228
+ return `${head}\n\n${table(['files', 'groups', 'lines', 'tokens'], rows)}${omitted}`;
229
+ }
230
+ function healthFindingRow(finding) {
231
+ return `| \`${finding.path}\`:${count(finding.line)} | ${finding.name} | ${finding.exceeded} | ${finding.severity} | ${count(finding.cyclomatic)} | ${count(finding.cognitive)} | ${count(finding.lineCount)} |`;
232
+ }
233
+ function hotspotRow(hotspot) {
234
+ return `| \`${hotspot.path}\` | ${count(hotspot.score)} | ${count(hotspot.commits)} | ${count(hotspot.complexityDensity)} | ${hotspot.trend} |`;
235
+ }
236
+ function healthFindings(h) {
237
+ const { cyclomatic, cognitive, crap, unitSize } = h.thresholds;
238
+ const thresholds = `Thresholds — cyclomatic ${count(cyclomatic)}, cognitive ${count(cognitive)}, CRAP ${count(crap)}, unit size ${count(unitSize)}.`;
239
+ if (h.totalFindings === 0)
240
+ return `${thresholds} No function is over any of them.`;
241
+ const grouped = h.byThreshold.map((g) => `${g.exceeded} ${g.count}`).join(', ');
242
+ const omitted = h.omittedFindings > 0 ? `\n\n${h.omittedFindings} more finding(s) not shown.` : '';
243
+ return (`${thresholds} ${h.totalFindings} function(s) over — by threshold: ${grouped}.\n\n` +
244
+ `${table(['function', 'name', 'exceeded', 'severity', 'cyc', 'cog', 'lines'], h.findings.map(healthFindingRow))}${omitted}`);
245
+ }
246
+ function renderHealth(report) {
247
+ const h = report.health;
248
+ if (h === null)
249
+ return '';
250
+ const penalties = h.penalties.length === 0
251
+ ? 'No penalty is non-zero.'
252
+ : `Penalties: ${h.penalties.map((p) => `**${p.name} ${p.points}**`).join(', ')}${h.zeroPenalties > 0 ? ` (${h.zeroPenalties} more at zero)` : ''}.`;
253
+ const head = `Score **${h.score === null ? '—' : h.score.toFixed(1)}** (grade ${h.grade}, formula v${count(h.formulaVersion)}) ` +
254
+ `over ${count(h.filesAnalyzed)} file(s) and ${count(h.functionsAnalyzed)} function(s); ` +
255
+ `average maintainability ${count(h.averageMaintainability)}.\n\n${penalties} ` +
256
+ 'The score is 100 minus these, so the non-zero ones are the whole explanation of the grade.';
257
+ const hotspots = h.hotspots.length === 0
258
+ ? ''
259
+ : `\n\nHotspots — complex *and* frequently changed (${h.hotspots.length} of ${h.totalHotspots}):\n\n${table(['file', 'score', 'commits', 'complexity density', 'trend'], h.hotspots.map(hotspotRow))}`;
260
+ return `${head}\n\n${healthFindings(h)}${hotspots}`;
261
+ }
262
+ function assemble(head, all, kept, maxBytes) {
263
+ const keeping = new Set(kept);
264
+ const dropped = all.filter((section) => !keeping.has(section)).map((section) => section.title);
265
+ const body = kept.map((section) => `\n## ${section.title}\n\n${section.body}\n`).join('');
266
+ const note = dropped.length === 0
267
+ ? ''
268
+ : `\n_Trimmed to fit ${maxBytes} bytes; section(s) omitted: ${dropped.join(', ')}. ` +
269
+ 'Their headline numbers are in the ledger above; read the named artifact for the rest._\n';
270
+ return `${head}${body}${note}\n## reading this\n\n${bullets([NOTHING_RUN_NOTE, NOT_READ_NOTE])}\n`;
271
+ }
272
+ /**
273
+ * Fill the budget in priority order: take each section that still fits, skip
274
+ * the ones that do not, and name what was skipped.
275
+ *
276
+ * Greedy rather than dropping from the end, because the sections are wildly
277
+ * uneven — `mutation` is most of the bytes and `dupes` is a line or two — so
278
+ * trimming the tail frees nothing until it reaches the one section worth
279
+ * keeping, and then overshoots the budget by half. Skipping only what does not
280
+ * fit keeps the most important section *and* whatever small ones fit around it.
281
+ *
282
+ * The ledger in `head` is never at risk, so every headline number survives any
283
+ * amount of trimming. The second pass exists because the "omitted" note is
284
+ * itself bytes: a section admitted before the note existed can stop fitting
285
+ * once it does, and dropping from the end there converges (the note stops
286
+ * growing once everything is dropped).
287
+ */
288
+ function fit(head, sections, maxBytes) {
289
+ const over = (kept) => Buffer.byteLength(assemble(head, sections, kept, maxBytes), 'utf8') > maxBytes;
290
+ const kept = [];
291
+ for (const section of sections) {
292
+ kept.push(section);
293
+ if (over(kept))
294
+ kept.pop();
295
+ }
296
+ while (kept.length > 0 && over(kept))
297
+ kept.pop();
298
+ return assemble(head, sections, kept, maxBytes);
299
+ }
300
+ /** Render the whole report. Deterministic: same report in, same bytes out. */
301
+ export function renderQa(report, maxBytes = QA_MAX_BYTES) {
302
+ const sections = [
303
+ { title: 'mutation', body: renderMutation(report) },
304
+ { title: 'dead', body: renderDead(report) },
305
+ { title: 'dupes', body: renderDupes(report) },
306
+ { title: 'health', body: renderHealth(report) },
307
+ ].filter((section) => section.body !== '');
308
+ return fit(renderHead(report), sections, maxBytes);
309
+ }
310
+ //# sourceMappingURL=render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/qa/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAQpE,qEAAqE;AACrE,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AAEjC,MAAM,aAAa,GACjB,8FAA8F;IAC9F,iGAAiG;IACjG,uEAAuE,CAAC;AAE1E,MAAM,gBAAgB,GACpB,gGAAgG;IAChG,+FAA+F,CAAC;AAElG,SAAS,OAAO,CAAC,KAAwB;IACvC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,KAAK,CAAC,IAAuB,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AAI,CAAC,OAAO,CAAC,CAAC;QACnB,IAAI,IAAI,CAAC,IAAI,CAAC;YAAE,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC;QAAE,IAAI,CAAC,GAAG,EAAE,CAAC;IACjD,OAAO,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAClD,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,QAAQ,CAAC,MAAgB,EAAE,WAAmB,YAAY;IACxE,MAAM,QAAQ,GAAc;QAC1B,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE;QACnD,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE;QAC3C,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE;QAC7C,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,EAAE;KAChD,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IAC3C,OAAO,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACrD,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * `checkride recover` — rebuild `checkride.baseline.json` from git history.
3
+ *
4
+ * The incident this exists for: a merge (often an agent resolving a conflict by
5
+ * deleting the "problem" lines) silently drops baseline entries. Missing
6
+ * entries fail closed, so the next run is a wall of red with no explanation and
7
+ * the remedy used to be manual git archaeology. `recover` does the dig: it
8
+ * walks the file's recent commits, dedupes the distinct states, and presents a
9
+ * small candidate set with deltas; `--pick` applies one.
10
+ *
11
+ * Applying writes the file through `writeBaseline` — never `git checkout` — so
12
+ * a restore lands as an ordinary working-tree edit the author reviews and
13
+ * commits. The default write is the UNION of the candidate and the current
14
+ * file: nothing is removed, and a resurrected key that is stale gets pruned by
15
+ * the ratchet on the next full green run. That generosity is also why a bare
16
+ * `checkride baseline` is the wrong remedy here — a re-capture would
17
+ * grandfather genuinely new debt introduced since the damage.
18
+ *
19
+ * Exit codes: 0 listed or applied, 2 usage or environment error — never 1;
20
+ * nothing here is a check failure. Stream discipline: the listing (Markdown or
21
+ * `--json`) is the machine output on stdout; apply confirmations are human
22
+ * prose on stderr.
23
+ */
24
+ import type { GitRunner } from './baseline/index.js';
25
+ import type { Out } from './orchestrator.js';
26
+ export type RecoverOptions = {
27
+ cwd?: string;
28
+ /** `union`, a listing number, or a sha prefix (≥ 4 hex chars). Absent → list. */
29
+ pick?: string;
30
+ /** Write the picked snapshot verbatim instead of the union with current. */
31
+ exact?: boolean;
32
+ /** Preview what `--pick` would change; write nothing. */
33
+ dryRun?: boolean;
34
+ /** Commits of file history to walk (default {@link DEFAULT_DEPTH}). */
35
+ depth?: number;
36
+ /** Emit the listing / apply result as JSON on stdout. */
37
+ json?: boolean;
38
+ stdout?: Out;
39
+ stderr?: Out;
40
+ /** Injectable for tests. */
41
+ git?: GitRunner;
42
+ };
43
+ export type RecoverResult = {
44
+ ok: boolean;
45
+ exitCode: number;
46
+ };
47
+ export declare function runRecover(options: RecoverOptions): Promise<RecoverResult>;
48
+ //# sourceMappingURL=recover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recover.d.ts","sourceRoot":"","sources":["../src/recover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAoD,SAAS,EAAe,MAAM,qBAAqB,CAAC;AAcpH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yDAAyD;IACzD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,4BAA4B;IAC5B,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAkB9D,wBAAsB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAkBhF"}
@@ -0,0 +1,220 @@
1
+ /**
2
+ * `checkride recover` — rebuild `checkride.baseline.json` from git history.
3
+ *
4
+ * The incident this exists for: a merge (often an agent resolving a conflict by
5
+ * deleting the "problem" lines) silently drops baseline entries. Missing
6
+ * entries fail closed, so the next run is a wall of red with no explanation and
7
+ * the remedy used to be manual git archaeology. `recover` does the dig: it
8
+ * walks the file's recent commits, dedupes the distinct states, and presents a
9
+ * small candidate set with deltas; `--pick` applies one.
10
+ *
11
+ * Applying writes the file through `writeBaseline` — never `git checkout` — so
12
+ * a restore lands as an ordinary working-tree edit the author reviews and
13
+ * commits. The default write is the UNION of the candidate and the current
14
+ * file: nothing is removed, and a resurrected key that is stale gets pruned by
15
+ * the ratchet on the next full green run. That generosity is also why a bare
16
+ * `checkride baseline` is the wrong remedy here — a re-capture would
17
+ * grandfather genuinely new debt introduced since the damage.
18
+ *
19
+ * Exit codes: 0 listed or applied, 2 usage or environment error — never 1;
20
+ * nothing here is a check failure. Stream discipline: the listing (Markdown or
21
+ * `--json`) is the machine output on stdout; apply confirmations are human
22
+ * prose on stderr.
23
+ */
24
+ import { BASELINE_FILE, baselineDirty, baselinesEqual, collectCandidates, countBaselineKeys, DEFAULT_DEPTH, diffBaselines, readBaselineStatus, realGit, unionBaselines, writeBaseline, } from './baseline/index.js';
25
+ const EMPTY_BASELINE = { schema_version: 1, slots: {} };
26
+ /** Keys shown per slot in a `--dry-run` preview before eliding the rest. */
27
+ const PREVIEW_KEYS_PER_SLOT = 20;
28
+ export async function runRecover(options) {
29
+ const cwd = options.cwd ?? process.cwd();
30
+ const stdout = options.stdout ?? process.stdout;
31
+ const stderr = options.stderr ?? process.stderr;
32
+ if (options.exact && options.pick === undefined) {
33
+ throw new Error('recover: --exact requires --pick (it says how to write the picked candidate)');
34
+ }
35
+ const git = options.git ?? realGit(cwd);
36
+ const read = readBaselineStatus(cwd);
37
+ const scan = await collectCandidates(git, read.baseline, options.depth ?? DEFAULT_DEPTH);
38
+ const dirty = await baselineDirty(git);
39
+ const ctx = { cwd, read, scan, dirty, json: options.json ?? false, stdout, stderr };
40
+ if (options.pick === undefined) {
41
+ ctx.stdout.write(ctx.json ? `${JSON.stringify(listingJson(ctx), null, 2)}\n` : renderListing(ctx));
42
+ return { ok: true, exitCode: 0 };
43
+ }
44
+ return apply(ctx, options.pick, options.exact ?? false, options.dryRun ?? false);
45
+ }
46
+ /** Resolve a sha-prefix `--pick` against the listed snapshots. */
47
+ function resolveShaPick(scan, pick) {
48
+ if (!/^[0-9a-f]{4,40}$/i.test(pick)) {
49
+ throw new Error(`recover: --pick expects \`union\`, a listing number, or a sha prefix of at least 4 hex characters, got '${pick}'`);
50
+ }
51
+ const matches = scan.candidates.filter((c) => c.kind === 'snapshot' && c.rev.sha.startsWith(pick.toLowerCase()));
52
+ const first = matches[0];
53
+ if (first && matches.length === 1)
54
+ return first;
55
+ if (matches.length > 1)
56
+ throw new Error(`recover: --pick ${pick} is ambiguous (${matches.length} listed candidates match)`);
57
+ throw new Error(`recover: --pick ${pick} matches none of the listed candidates (run \`checkride recover\` to list them)`);
58
+ }
59
+ /** Resolve `--pick` against the scan: `union`, a 1-based index, or a sha prefix. */
60
+ function resolvePick(scan, pick) {
61
+ if (scan.candidates.length === 0) {
62
+ throw new Error(`recover: no committed history of ${BASELINE_FILE} differs from the current file — nothing to pick`);
63
+ }
64
+ if (pick === 'union') {
65
+ const union = scan.candidates.find((c) => c.kind === 'union');
66
+ if (!union)
67
+ throw new Error('recover: the union of recent history adds nothing to the current baseline');
68
+ return union;
69
+ }
70
+ if (/^\d+$/.test(pick)) {
71
+ const candidate = scan.candidates[Number(pick) - 1];
72
+ if (!candidate)
73
+ throw new Error(`recover: --pick ${pick} is out of range (1..${scan.candidates.length})`);
74
+ return candidate;
75
+ }
76
+ return resolveShaPick(scan, pick);
77
+ }
78
+ /** The human name of a pick, for confirmations: `union of N snapshot(s)` or `snapshot <sha>`. */
79
+ function describe(candidate) {
80
+ return candidate.kind === 'union' ? `union of ${candidate.folded} snapshot(s)` : `snapshot ${candidate.rev.shortSha}`;
81
+ }
82
+ /**
83
+ * Turn `--pick` into an {@link Apply}. The union write is dirty-safe by
84
+ * construction (current keys survive), so only `--exact` — which discards
85
+ * keys, unrecoverable once overwritten — is gated on a clean file.
86
+ */
87
+ function resolveApply(ctx, pick, exact, dryRun) {
88
+ const candidate = resolvePick(ctx.scan, pick);
89
+ const current = ctx.read.baseline;
90
+ if (exact && ctx.dirty && !dryRun) {
91
+ throw new Error(`recover: ${BASELINE_FILE} has uncommitted changes and --exact would discard them — commit or stash first, or drop --exact (the default union keeps them)`);
92
+ }
93
+ const target = exact ? candidate.baseline : unionBaselines(current === null ? [candidate.baseline] : [current, candidate.baseline]);
94
+ return { candidate, exact, target, delta: diffBaselines(current, target) };
95
+ }
96
+ /** Emit an apply outcome: the machine shape on stdout when `--json`, else nothing. */
97
+ function emitApply(ctx, action, a) {
98
+ if (ctx.json)
99
+ ctx.stdout.write(`${JSON.stringify(applyJson(action, a), null, 2)}\n`);
100
+ return { ok: true, exitCode: 0 };
101
+ }
102
+ async function apply(ctx, pick, exact, dryRun) {
103
+ const a = resolveApply(ctx, pick, exact, dryRun);
104
+ if (dryRun) {
105
+ if (!ctx.json)
106
+ ctx.stdout.write(renderPreview(a));
107
+ return emitApply(ctx, 'dry-run', a);
108
+ }
109
+ if (baselinesEqual(a.target, ctx.read.baseline ?? EMPTY_BASELINE)) {
110
+ writeLine(ctx.stderr, `recover: nothing to write — ${describe(a.candidate)} changes nothing against the current file`);
111
+ return emitApply(ctx, 'noop', a);
112
+ }
113
+ await writeBaseline(ctx.cwd, a.target);
114
+ const dropped = a.delta.absentCount > 0 ? `, −${a.delta.absentCount} dropped (--exact)` : '';
115
+ writeLine(ctx.stderr, `recover: wrote ${BASELINE_FILE} — +${a.delta.restoredCount} key(s) restored${dropped} (${a.exact ? 'exact copy of' : 'union with'} ${describe(a.candidate)}); review with \`git diff\` and commit`);
116
+ return emitApply(ctx, 'written', a);
117
+ }
118
+ function writeLine(out, line) {
119
+ out.write(`${line}\n`);
120
+ }
121
+ /** The `- file:` line — the reader's first question is what state the file is in. */
122
+ function fileLine(read, dirty) {
123
+ if (read.state === 'absent')
124
+ return `- file: \`${BASELINE_FILE}\` — ABSENT`;
125
+ if (read.state === 'unparseable')
126
+ return `- file: \`${BASELINE_FILE}\` — present but unparseable (treated as no baseline)`;
127
+ const baseline = read.baseline ?? EMPTY_BASELINE;
128
+ const keys = countBaselineKeys(baseline);
129
+ const slots = Object.keys(baseline.slots).length;
130
+ return `- file: \`${BASELINE_FILE}\` — present, ${keys} key(s) across ${slots} slot(s)${dirty ? ', with uncommitted changes' : ''}`;
131
+ }
132
+ function candidateRow(candidate, index, current) {
133
+ const delta = diffBaselines(current, candidate.baseline);
134
+ const keys = countBaselineKeys(candidate.baseline);
135
+ const vs = `+${delta.restoredCount} / −${delta.absentCount}`;
136
+ if (candidate.kind === 'union') {
137
+ return `| ${index} | union (${candidate.folded} snapshot(s) + current) | — | — | — | ${keys} | ${vs} |`;
138
+ }
139
+ const { rev } = candidate;
140
+ return `| ${index} | snapshot | ${rev.shortSha} | ${rev.date.slice(0, 10)} | ${rev.author} | ${keys} | ${vs} |`;
141
+ }
142
+ function renderListing(ctx) {
143
+ const { read, scan, dirty } = ctx;
144
+ const lines = ['# checkride recover — baseline candidates from git history', ''];
145
+ lines.push(fileLine(read, dirty));
146
+ const skipped = scan.skipped.length > 0 ? `; skipped ${scan.skipped.length} unreadable snapshot(s): ${scan.skipped.join(', ')}` : '';
147
+ lines.push(`- walked: ${scan.walked} commit(s)${skipped}`);
148
+ if (scan.shallow)
149
+ lines.push('- note: history is shallow (truncated); `git fetch --unshallow` reveals more');
150
+ lines.push('');
151
+ if (scan.walked === 0) {
152
+ lines.push(`No committed history of ${BASELINE_FILE} — nothing to recover.`, '');
153
+ return lines.join('\n');
154
+ }
155
+ if (scan.candidates.length === 0) {
156
+ lines.push('The current file matches every recent committed state — nothing to recover.', '');
157
+ return lines.join('\n');
158
+ }
159
+ lines.push('| # | candidate | commit | date | author | keys | vs current |');
160
+ lines.push('| - | --------- | ------ | ---- | ------ | ---- | ---------- |');
161
+ scan.candidates.forEach((candidate, i) => lines.push(candidateRow(candidate, i + 1, read.baseline)));
162
+ lines.push('', '`vs current` is +keys an apply restores / −keys only `--exact` would drop.', '', 'Apply: `checkride recover --pick <#>` by number, or `--pick <sha>` by commit', '(stable across invocations — prefer it in scripts). Preview with `--dry-run`.', '', 'The default write is the union of the candidate and the current file: nothing', 'is removed, and a stale resurrected key is pruned by the ratchet on the next', 'full green run. `--exact` writes the snapshot verbatim instead.', '');
163
+ return lines.join('\n');
164
+ }
165
+ /** One preview section: a slot's changed keys, elided past the cap. */
166
+ function pushKeySection(lines, slot, keys, verb) {
167
+ lines.push(`## ${slot} — ${keys.length} ${verb}`, '');
168
+ for (const key of keys.slice(0, PREVIEW_KEYS_PER_SLOT))
169
+ lines.push(`- ${key}`);
170
+ if (keys.length > PREVIEW_KEYS_PER_SLOT)
171
+ lines.push(`- … and ${keys.length - PREVIEW_KEYS_PER_SLOT} more`);
172
+ lines.push('');
173
+ }
174
+ /** The `--dry-run` preview: the per-slot keys an apply would restore (and drop, under `--exact`). */
175
+ function renderPreview(a) {
176
+ const lines = [`# checkride recover — dry run: ${describe(a.candidate)}${a.exact ? ' (--exact)' : ''}`, ''];
177
+ lines.push(`Would write ${BASELINE_FILE} with ${countBaselineKeys(a.target)} key(s): +${a.delta.restoredCount} restored, −${a.delta.absentCount} dropped.`, '');
178
+ for (const [slot, keys] of Object.entries(a.delta.restored))
179
+ pushKeySection(lines, slot, keys, 'restored');
180
+ for (const [slot, keys] of Object.entries(a.delta.absent))
181
+ pushKeySection(lines, slot, keys, 'dropped under --exact');
182
+ if (a.delta.restoredCount === 0 && a.delta.absentCount === 0)
183
+ lines.push('No changes against the current file.', '');
184
+ return lines.join('\n');
185
+ }
186
+ /** The machine listing. Documented in help/README; not part of the artifact contract. */
187
+ function listingJson(ctx) {
188
+ const { read, scan, dirty } = ctx;
189
+ return {
190
+ schema_version: 1,
191
+ file: {
192
+ state: read.state,
193
+ keys: read.baseline === null ? 0 : countBaselineKeys(read.baseline),
194
+ dirty,
195
+ },
196
+ walked: scan.walked,
197
+ shallow: scan.shallow,
198
+ skipped: scan.skipped,
199
+ candidates: scan.candidates.map((candidate, i) => {
200
+ const delta = diffBaselines(read.baseline, candidate.baseline);
201
+ const common = { index: i + 1, keys: countBaselineKeys(candidate.baseline), restored: delta.restoredCount, absent: delta.absentCount };
202
+ return candidate.kind === 'union'
203
+ ? { kind: 'union', folded: candidate.folded, ...common }
204
+ : { kind: 'snapshot', sha: candidate.rev.sha, short_sha: candidate.rev.shortSha, date: candidate.rev.date, author: candidate.rev.author, subject: candidate.rev.subject, ...common };
205
+ }),
206
+ };
207
+ }
208
+ function applyJson(action, a) {
209
+ return {
210
+ schema_version: 1,
211
+ action,
212
+ file: BASELINE_FILE,
213
+ pick: a.candidate.kind === 'union' ? 'union' : a.candidate.rev.sha,
214
+ mode: a.exact ? 'exact' : 'union',
215
+ keys: countBaselineKeys(a.target),
216
+ restored: a.delta.restoredCount,
217
+ dropped: a.delta.absentCount,
218
+ };
219
+ }
220
+ //# sourceMappingURL=recover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recover.js","sourceRoot":"","sources":["../src/recover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,OAAO,EACP,cAAc,EACd,aAAa,GACd,MAAM,qBAAqB,CAAC;AAkC7B,MAAM,cAAc,GAAa,EAAE,cAAc,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AAElE,4EAA4E;AAC5E,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAuB;IACtD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACzC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAChD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAChD,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAC;IAClG,CAAC;IACD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,KAAK,IAAI,aAAa,CAAC,CAAC;IACzF,MAAM,KAAK,GAAG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