@rulemetric/cli 0.14.0 → 0.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/dist/base-command.js +1 -1
  2. package/dist/{chunk-S5U76YUI.js → chunk-3NWJ7CZ2.js} +1 -1
  3. package/dist/{chunk-OLJF4K7L.js → chunk-5PMTNNA6.js} +1 -1
  4. package/dist/{chunk-ZA6NXNPR.js → chunk-5TM7AOH2.js} +1 -1
  5. package/dist/chunk-5VNEHPGC.js +1 -0
  6. package/dist/{chunk-JKWB6UXA.js → chunk-6AAAHV2B.js} +1 -1
  7. package/dist/{chunk-J7UZXRTH.js → chunk-6T6YFPBW.js} +1 -1
  8. package/dist/{chunk-VLWNSTYW.js → chunk-6TGFU6RU.js} +1 -1
  9. package/dist/chunk-77FH6UZP.js +111 -0
  10. package/dist/{chunk-GN46S7T4.js → chunk-7BCZDVIU.js} +1 -1
  11. package/dist/{chunk-IOX4VJPR.js → chunk-7MTYUTUN.js} +1 -1
  12. package/dist/{chunk-S5CQSP35.js → chunk-BDQTVYYF.js} +1 -1
  13. package/dist/chunk-CQD2R3BA.js +3 -0
  14. package/dist/{chunk-FJX7WDPG.js → chunk-CVPAKEEZ.js} +1 -1
  15. package/dist/{chunk-EXVXKJ7Y.js → chunk-CYCH2EQC.js} +1 -1
  16. package/dist/{chunk-JLBQKV4V.js → chunk-CZBO3A6B.js} +1 -1
  17. package/dist/{chunk-N7SZWKCU.js → chunk-DANMUHNW.js} +1 -1
  18. package/dist/chunk-DQYYHX6K.js +1 -0
  19. package/dist/{chunk-OO2ZRKZY.js → chunk-DVU5PHPM.js} +1 -1
  20. package/dist/{chunk-HAYO6JYI.js → chunk-DX6IPDED.js} +1 -1
  21. package/dist/{chunk-E7RH43OS.js → chunk-DXNUCWUX.js} +1 -1
  22. package/dist/{chunk-2WQUOC6S.js → chunk-EBWV4SUS.js} +1 -1
  23. package/dist/{chunk-JRAXWASH.js → chunk-F5PJN2EY.js} +1 -1
  24. package/dist/chunk-FBSZ6KCM.js +1 -0
  25. package/dist/{chunk-JRWQJZYQ.js → chunk-FS3TAQAE.js} +1 -1
  26. package/dist/{chunk-O62OLKQL.js → chunk-FXQS7AEZ.js} +1 -1
  27. package/dist/chunk-FZMO7XSN.js +4 -0
  28. package/dist/{chunk-H4LUPIHJ.js → chunk-GDLQNY4V.js} +1 -1
  29. package/dist/{chunk-ZZHIBOMT.js → chunk-GIXHG5FK.js} +1 -1
  30. package/dist/{chunk-NSPDDSRR.js → chunk-GLBWNB2N.js} +1 -1
  31. package/dist/chunk-GPBN4ROE.js +2 -0
  32. package/dist/{chunk-AT2MMCOJ.js → chunk-H2FMAJUJ.js} +1 -1
  33. package/dist/chunk-H33XYL7O.js +1 -0
  34. package/dist/{chunk-EWGE7YTQ.js → chunk-H4QPAEEA.js} +1 -1
  35. package/dist/{chunk-YP2CBUXH.js → chunk-HM63AB2C.js} +1 -1
  36. package/dist/{chunk-DDYGA2DS.js → chunk-ISFPPDDB.js} +1 -1
  37. package/dist/{chunk-BVOXWAJO.js → chunk-ISYU5BMU.js} +1 -1
  38. package/dist/{chunk-XAOLOR4Q.js → chunk-J6RQ5AH2.js} +1 -1
  39. package/dist/chunk-JP6ULOEX.js +2 -0
  40. package/dist/{chunk-ET7753IY.js → chunk-KE5K3F7J.js} +1 -1
  41. package/dist/{chunk-YUIRDBQQ.js → chunk-KEVDLLHT.js} +1 -1
  42. package/dist/{chunk-GQGGFHX7.js → chunk-KOYHJFB3.js} +1 -1
  43. package/dist/{chunk-OMRH4JXS.js → chunk-L562Y4RN.js} +1 -1
  44. package/dist/chunk-MOJY6S5J.js +1 -0
  45. package/dist/chunk-MYGVN6X4.js +1 -0
  46. package/dist/{chunk-MX34N7Y5.js → chunk-NWV66NMA.js} +1 -1
  47. package/dist/{chunk-SV73ASP2.js → chunk-O4K4M5G6.js} +1 -1
  48. package/dist/{chunk-YNLHJHUP.js → chunk-PIVEJTNF.js} +1 -1
  49. package/dist/{chunk-N26UEHI3.js → chunk-PJ4RIUI3.js} +1 -1
  50. package/dist/{chunk-PPIZMPNI.js → chunk-PXYK4MBX.js} +1 -1
  51. package/dist/{chunk-UFQ43KXE.js → chunk-Q36QSFSB.js} +1 -1
  52. package/dist/chunk-Q776YUBD.js +1 -0
  53. package/dist/{chunk-XFLKW6SJ.js → chunk-QENSCK77.js} +1 -1
  54. package/dist/{chunk-TTSDPDRH.js → chunk-QNSIBPWG.js} +1 -1
  55. package/dist/{chunk-U7BPWFOP.js → chunk-QPAOX7P2.js} +1 -1
  56. package/dist/{chunk-V4PUYPTU.js → chunk-QPVUGTDP.js} +1 -1
  57. package/dist/{chunk-LMCICVE7.js → chunk-RE7RAZQ5.js} +1 -1
  58. package/dist/{chunk-HFSISGCJ.js → chunk-RR7V5CK5.js} +1 -1
  59. package/dist/{chunk-RRM4HQG4.js → chunk-RSVNQ2XI.js} +1 -1
  60. package/dist/{chunk-FK55FXKQ.js → chunk-RYCVPQYK.js} +1 -1
  61. package/dist/{chunk-XAXEZI6Z.js → chunk-SFZPFNC6.js} +1 -1
  62. package/dist/chunk-T47SFA5X.js +1 -0
  63. package/dist/{chunk-AXJAGWZB.js → chunk-UVCVJKEN.js} +1 -1
  64. package/dist/{chunk-5XEGRU2R.js → chunk-VCUW2NAP.js} +1 -1
  65. package/dist/chunk-VXNICAVG.js +1 -0
  66. package/dist/{chunk-UQDOOQCM.js → chunk-WIKCYUZC.js} +1 -1
  67. package/dist/{chunk-E5YE25QG.js → chunk-WL5ZWQAS.js} +1 -1
  68. package/dist/{chunk-N4RJ6CN7.js → chunk-WUCACPGC.js} +1 -1
  69. package/dist/{chunk-TWPG3TEQ.js → chunk-X6CF5KTW.js} +5 -5
  70. package/dist/{chunk-LDUJWJ6A.js → chunk-XIOYV5A7.js} +1 -1
  71. package/dist/chunk-XQYAVSUQ.js +1 -0
  72. package/dist/{chunk-NRYVMGJN.js → chunk-XXPWPKTD.js} +1 -1
  73. package/dist/chunk-XZW5ZHFC.js +15 -0
  74. package/dist/{chunk-7ML2UCI7.js → chunk-ZK3ACE4T.js} +1 -1
  75. package/dist/{chunk-IC6VZHE6.js → chunk-ZTQUGAZG.js} +1 -1
  76. package/dist/commands/antigravity/backfill.js +1 -1
  77. package/dist/commands/auth/create-key.js +1 -1
  78. package/dist/commands/auth/login.js +1 -1
  79. package/dist/commands/auth/logout.js +1 -1
  80. package/dist/commands/auth/revoke-key.js +1 -1
  81. package/dist/commands/auth/signup.js +1 -1
  82. package/dist/commands/auth/status.js +1 -1
  83. package/dist/commands/capture/scope.js +1 -1
  84. package/dist/commands/catalog/index.js +1 -1
  85. package/dist/commands/catalog/recommend.js +1 -1
  86. package/dist/commands/crons/list.js +1 -1
  87. package/dist/commands/crons/run.js +1 -1
  88. package/dist/commands/dashboard.js +1 -1
  89. package/dist/commands/diagnostics.js +1 -1
  90. package/dist/commands/eval-targets/create.js +1 -1
  91. package/dist/commands/eval-targets/list.js +1 -1
  92. package/dist/commands/evals/agent.js +1 -1
  93. package/dist/commands/evals/auto-run.js +1 -1
  94. package/dist/commands/evals/benchmark.js +1 -1
  95. package/dist/commands/evals/compare.js +1 -1
  96. package/dist/commands/evals/create.js +1 -1
  97. package/dist/commands/evals/optimize-description.js +1 -1
  98. package/dist/commands/evals/optimize.js +1 -1
  99. package/dist/commands/evals/refine-cases.js +1 -1
  100. package/dist/commands/evals/run.js +1 -1
  101. package/dist/commands/evals/validate-judge.js +1 -1
  102. package/dist/commands/experiments/list.js +1 -1
  103. package/dist/commands/gateway/ensure.js +1 -1
  104. package/dist/commands/hooks/install.js +1 -1
  105. package/dist/commands/hooks/run.js +1 -1
  106. package/dist/commands/hooks/uninstall.js +1 -1
  107. package/dist/commands/instructions/create.js +1 -1
  108. package/dist/commands/instructions/dedupe.js +1 -1
  109. package/dist/commands/instructions/delete.js +1 -1
  110. package/dist/commands/instructions/fork.js +1 -1
  111. package/dist/commands/instructions/get.js +1 -1
  112. package/dist/commands/instructions/list.js +1 -1
  113. package/dist/commands/instructions/promote.js +1 -1
  114. package/dist/commands/instructions/pull.js +1 -1
  115. package/dist/commands/instructions/restore.js +1 -1
  116. package/dist/commands/instructions/retract.js +1 -1
  117. package/dist/commands/instructions/upstream.js +1 -1
  118. package/dist/commands/instructions/versions.js +1 -1
  119. package/dist/commands/launcher.js +1 -1
  120. package/dist/commands/local/down.js +1 -1
  121. package/dist/commands/local/up.js +1 -1
  122. package/dist/commands/org/current.js +1 -1
  123. package/dist/commands/org/list.js +1 -1
  124. package/dist/commands/org/switch.js +1 -1
  125. package/dist/commands/packs/add-instruction.js +1 -1
  126. package/dist/commands/packs/apply.js +1 -1
  127. package/dist/commands/packs/create.js +1 -1
  128. package/dist/commands/packs/fork.js +1 -1
  129. package/dist/commands/packs/get.js +1 -1
  130. package/dist/commands/packs/list.js +1 -1
  131. package/dist/commands/packs/remove-instruction.js +1 -1
  132. package/dist/commands/proxy/env.js +1 -1
  133. package/dist/commands/proxy/logs.js +1 -1
  134. package/dist/commands/proxy/restart.js +1 -1
  135. package/dist/commands/proxy/setup.js +1 -1
  136. package/dist/commands/proxy/start.js +1 -1
  137. package/dist/commands/proxy/status.js +1 -1
  138. package/dist/commands/proxy/stop.js +1 -1
  139. package/dist/commands/research/backfill.js +1 -1
  140. package/dist/commands/research/tail-transcript.js +1 -1
  141. package/dist/commands/service/install.js +1 -1
  142. package/dist/commands/service/status.js +1 -1
  143. package/dist/commands/service/uninstall.js +1 -1
  144. package/dist/commands/sessions/analyze.js +1 -1
  145. package/dist/commands/sessions/delete.js +1 -1
  146. package/dist/commands/sessions/end.js +1 -1
  147. package/dist/commands/sessions/import.js +1 -1
  148. package/dist/commands/sessions/list.js +1 -1
  149. package/dist/commands/sessions/start.js +1 -1
  150. package/dist/commands/setup.js +1 -1
  151. package/dist/commands/skills/export-approved.js +1 -1
  152. package/dist/commands/skills/install.js +1 -1
  153. package/dist/commands/skills/list.js +1 -1
  154. package/dist/commands/skills/publish.js +1 -1
  155. package/dist/commands/skills/search.js +1 -1
  156. package/dist/commands/skills/update.js +1 -1
  157. package/dist/commands/suggestions/accept.js +1 -1
  158. package/dist/commands/suggestions/auto.js +1 -1
  159. package/dist/commands/suggestions/dismiss.js +1 -1
  160. package/dist/commands/suggestions/list.js +1 -1
  161. package/dist/commands/suggestions/refresh.js +1 -1
  162. package/dist/commands/suggestions/undo.js +1 -1
  163. package/dist/dashboard/Dashboard.js +1 -1
  164. package/dist/dashboard/data.js +1 -1
  165. package/dist/dashboard/launcher/LauncherOverlay.js +1 -1
  166. package/dist/dashboard/launcher/api.js +1 -1
  167. package/dist/dashboard/launcher/useLaunchJobs.js +1 -1
  168. package/dist/dashboard/panels/measurement.js +1 -0
  169. package/dist/{dist-NHS7HY5Q.js → dist-GSHUC7UU.js} +1 -1
  170. package/dist/lib/active-org-refresh.js +1 -1
  171. package/dist/lib/agent-loop.js +1 -1
  172. package/dist/lib/antigravity-transcript.js +1 -1
  173. package/dist/lib/api-client.js +1 -1
  174. package/dist/lib/autorun-batch.js +1 -0
  175. package/dist/lib/ensure-api-key.js +1 -1
  176. package/dist/lib/ensure-fresh-token.js +1 -1
  177. package/dist/lib/eval-analyzer.js +1 -1
  178. package/dist/lib/eval-benchmark.js +1 -1
  179. package/dist/lib/eval-candidate-run.js +1 -1
  180. package/dist/lib/eval-case-generator.js +1 -1
  181. package/dist/lib/eval-conversation-handler.js +1 -1
  182. package/dist/lib/eval-executor.js +1 -1
  183. package/dist/lib/eval-grader.js +1 -1
  184. package/dist/lib/eval-meta-judge.js +1 -1
  185. package/dist/lib/eval-resume.js +1 -1
  186. package/dist/lib/eval-run-batch.js +1 -1
  187. package/dist/lib/eval-trigger-tester.js +1 -1
  188. package/dist/lib/evolution-enrolment.js +1 -1
  189. package/dist/lib/harbor-readiness.js +1 -1
  190. package/dist/lib/insights/generation/installed-asks.js +1 -1
  191. package/dist/lib/insights/generation/project-evidence.js +1 -0
  192. package/dist/lib/insights/generation/prompts.js +1 -1
  193. package/dist/lib/insights/nomination/nominate.js +1 -1
  194. package/dist/lib/instruction-proposer.js +1 -1
  195. package/dist/lib/instructions/acceptance/accept-events.js +1 -1
  196. package/dist/lib/instructions/acceptance/accept-hook.js +1 -1
  197. package/dist/lib/instructions/acceptance/hook-install.js +1 -1
  198. package/dist/lib/instructions/acceptance/reverse-applications.js +1 -1
  199. package/dist/lib/instructions/acceptance/suggestion-accept.js +1 -1
  200. package/dist/lib/jobs/handlers/cron-auto-accept-suggestions.js +1 -1
  201. package/dist/lib/jobs/handlers/cron-eval-autorun.js +1 -1
  202. package/dist/lib/jobs/handlers/cron-instruction-evolution.js +1 -1
  203. package/dist/lib/jobs/handlers/cron-instruction-training.js +1 -1
  204. package/dist/lib/jobs/handlers/cron-reconcile-attribution.js +1 -1
  205. package/dist/lib/jobs/handlers/cron-refine-cases.js +1 -1
  206. package/dist/lib/jobs/handlers/cron-refresh-pricing.js +1 -1
  207. package/dist/lib/jobs/handlers/cron-retire-unused-skills.js +1 -1
  208. package/dist/lib/jobs/handlers/cron-suggest-instructions.js +1 -1
  209. package/dist/lib/jobs/handlers/distill-memories.js +1 -1
  210. package/dist/lib/jobs/handlers/harbor-ab-verdict.js +1 -1
  211. package/dist/lib/jobs/handlers/harbor-ab.js +1 -1
  212. package/dist/lib/jobs/handlers/process-changelog.js +1 -1
  213. package/dist/lib/jobs/handlers/process-conversation.js +1 -1
  214. package/dist/lib/jobs/handlers/process-eval.js +1 -1
  215. package/dist/lib/jobs/handlers/process-insights.js +1 -1
  216. package/dist/lib/jobs/handlers/process-judge-review.js +1 -1
  217. package/dist/lib/jobs/handlers/process-launch.js +1 -1
  218. package/dist/lib/jobs/handlers/process-memory-ab.js +1 -1
  219. package/dist/lib/jobs/handlers/process-run-cleanup.js +1 -1
  220. package/dist/lib/jobs/handlers/process-session-goal.js +1 -1
  221. package/dist/lib/jobs/shed-retry.js +1 -1
  222. package/dist/lib/judge-review-runner.js +1 -1
  223. package/dist/lib/llm-client.js +1 -1
  224. package/dist/lib/manual-tasks.js +1 -1
  225. package/dist/lib/measurement-llm.js +1 -1
  226. package/dist/lib/pi-exec.js +1 -1
  227. package/dist/lib/projects/workspace/worktree.js +1 -1
  228. package/dist/lib/refine-cases.js +1 -1
  229. package/dist/lib/research-client.js +1 -1
  230. package/dist/lib/retraction.js +1 -1
  231. package/dist/lib/reviewer-detect.js +1 -1
  232. package/dist/lib/setup-steps.js +1 -1
  233. package/dist/lib/telemetry.js +1 -1
  234. package/dist/lib/terminal-target-heartbeat.js +1 -1
  235. package/dist/lib/work-report.js +1 -1
  236. package/oclif.manifest.json +1 -1
  237. package/package.json +4 -4
  238. package/dist/chunk-74QIUVWY.js +0 -1
  239. package/dist/chunk-E7GQJML3.js +0 -1
  240. package/dist/chunk-FCTFHY3X.js +0 -13
  241. package/dist/chunk-HRJDKAJ4.js +0 -1
  242. package/dist/chunk-INAZLRY5.js +0 -1
  243. package/dist/chunk-OUK2AWEI.js +0 -1
  244. package/dist/chunk-OYAOLJUH.js +0 -1
  245. package/dist/chunk-PUX6P5KC.js +0 -2
  246. package/dist/chunk-SBGXIPRN.js +0 -2
  247. package/dist/chunk-SJKS3PYX.js +0 -109
  248. package/dist/chunk-SPJ73X7A.js +0 -4
  249. package/dist/chunk-UJ7EPLKC.js +0 -1
  250. package/dist/chunk-WSWZPNLG.js +0 -1
  251. /package/dist/{chunk-SE3UKA3M.js → chunk-T75KAEJO.js} +0 -0
@@ -1 +1 @@
1
- import{b as m}from"./chunk-UQDOOQCM.js";import{a as g}from"./chunk-ZLLER3HP.js";var p=5;function b(t){let r=g((e,f)=>({retire:[],survivingCases:0,replacementsRequired:!1,refused:e,summary:f}),"none");if(!t||t.cases.length===0&&t.unpairedCases.length===0)return r("no-discrimination-data","No case-discrimination data yet \u2014 the target needs runs in BOTH cohorts before any case can be judged dead.");let c=[...t.cases.filter(e=>!e.discriminating).map(e=>({evalId:e.evalId,name:e.name,feedback:{name:e.name,withPassRate:e.withPassRate,withoutPassRate:e.withoutPassRate,reason:e.note}})),...t.unpairedCases.map(e=>({evalId:e.evalId,name:e.name,feedback:{name:e.name,withPassRate:e.withPassRate??0,withoutPassRate:e.withoutPassRate,reason:"runs in only one cohort (no with-vs-without comparison possible)"}}))];if(c.length===0)return r("all-discriminating","Every case discriminates \u2014 nothing to retire.");let s=new Map(t.cases.map(e=>[e.evalId,e.separation])),o=[...c].sort((e,f)=>(s.get(e.evalId)??-1)-(s.get(f.evalId)??-1)).slice(0,p),u=c.length-o.length,d=t.total+t.unpaired,l=d-o.length,i=l<m,n=`${o.length} of ${d} live case(s) carry no treatment signal`+(u>0?` (${u} more over the ${p}-per-run cap)`:"")+(i?`; retiring them leaves ${l}, below the ${m}-case evolution floor, so replacements must be generated first`:"");return{retire:o,survivingCases:l,replacementsRequired:i,refused:null,summary:n}}g(b,"planCaseRefinement");async function v(t,r){let h=r.log??(()=>{}),c=g((n,e)=>({retired:0,generated:0,skipped:n,summary:e,retiredNames:[],generatedNames:[]}),"empty");if(t.refused)return c(t.refused,t.summary);let s=await r.generate(t.retire.map(n=>n.feedback)),a=[];for(let n of s??[]){let e=await r.createCase(n);a.push(e.name),h(` + ${e.name} (${e.id})`)}let o=t.survivingCases+t.retire.length+a.length,u=Math.max(0,o-m),d=t.retire.slice(0,Math.min(t.retire.length,u)),l=t.retire.length-d.length;if(d.length===0)return{retired:0,generated:a.length,skipped:s===null?"no-llm-backend":"no-replacements-generated",summary:`${t.summary}. `+(s===null?"No local LLM backend available, so nothing was retired":`The generator produced ${a.length} usable replacement(s), not enough to retire anything`)+` \u2014 dropping below the ${m}-case floor would silently disenrol the target from the nightly loop.`,retiredNames:[],generatedNames:a};let i=[];for(let n of d)await r.retireCase(n.evalId,n.feedback.reason),i.push(n.name),h(` retired ${n.name}`);return{retired:i.length,generated:a.length,skipped:null,summary:`Retired ${i.length} non-discriminating case(s), added ${a.length} replacement(s)`+(l>0?`; held ${l} back to stay at the ${m}-case floor (they remain condemned and will be retired once replacements exist)`:"")+". The replacements have no runs yet \u2014 the next autorun batch builds their depth.",retiredNames:i,generatedNames:a}}g(v,"executeCaseRefinement");export{p as a,b,v as c};
1
+ import{b as m}from"./chunk-WIKCYUZC.js";import{a as g}from"./chunk-ZLLER3HP.js";var p=5;function b(t){let r=g((e,f)=>({retire:[],survivingCases:0,replacementsRequired:!1,refused:e,summary:f}),"none");if(!t||t.cases.length===0&&t.unpairedCases.length===0)return r("no-discrimination-data","No case-discrimination data yet \u2014 the target needs runs in BOTH cohorts before any case can be judged dead.");let c=[...t.cases.filter(e=>!e.discriminating).map(e=>({evalId:e.evalId,name:e.name,feedback:{name:e.name,withPassRate:e.withPassRate,withoutPassRate:e.withoutPassRate,reason:e.note}})),...t.unpairedCases.map(e=>({evalId:e.evalId,name:e.name,feedback:{name:e.name,withPassRate:e.withPassRate??0,withoutPassRate:e.withoutPassRate,reason:"runs in only one cohort (no with-vs-without comparison possible)"}}))];if(c.length===0)return r("all-discriminating","Every case discriminates \u2014 nothing to retire.");let s=new Map(t.cases.map(e=>[e.evalId,e.separation])),o=[...c].sort((e,f)=>(s.get(e.evalId)??-1)-(s.get(f.evalId)??-1)).slice(0,p),u=c.length-o.length,d=t.total+t.unpaired,l=d-o.length,i=l<m,n=`${o.length} of ${d} live case(s) carry no treatment signal`+(u>0?` (${u} more over the ${p}-per-run cap)`:"")+(i?`; retiring them leaves ${l}, below the ${m}-case evolution floor, so replacements must be generated first`:"");return{retire:o,survivingCases:l,replacementsRequired:i,refused:null,summary:n}}g(b,"planCaseRefinement");async function v(t,r){let h=r.log??(()=>{}),c=g((n,e)=>({retired:0,generated:0,skipped:n,summary:e,retiredNames:[],generatedNames:[]}),"empty");if(t.refused)return c(t.refused,t.summary);let s=await r.generate(t.retire.map(n=>n.feedback)),a=[];for(let n of s??[]){let e=await r.createCase(n);a.push(e.name),h(` + ${e.name} (${e.id})`)}let o=t.survivingCases+t.retire.length+a.length,u=Math.max(0,o-m),d=t.retire.slice(0,Math.min(t.retire.length,u)),l=t.retire.length-d.length;if(d.length===0)return{retired:0,generated:a.length,skipped:s===null?"no-llm-backend":"no-replacements-generated",summary:`${t.summary}. `+(s===null?"No local LLM backend available, so nothing was retired":`The generator produced ${a.length} usable replacement(s), not enough to retire anything`)+` \u2014 dropping below the ${m}-case floor would silently disenrol the target from the nightly loop.`,retiredNames:[],generatedNames:a};let i=[];for(let n of d)await r.retireCase(n.evalId,n.feedback.reason),i.push(n.name),h(` retired ${n.name}`);return{retired:i.length,generated:a.length,skipped:null,summary:`Retired ${i.length} non-discriminating case(s), added ${a.length} replacement(s)`+(l>0?`; held ${l} back to stay at the ${m}-case floor (they remain condemned and will be retired once replacements exist)`:"")+". The replacements have no runs yet \u2014 the next autorun batch builds their depth.",retiredNames:i,generatedNames:a}}g(v,"executeCaseRefinement");export{p as a,b,v as c};
@@ -1 +1 @@
1
- import{d as E}from"./chunk-OUK2AWEI.js";import{b as F,c as x}from"./chunk-KGURGIZ2.js";import{f as R}from"./chunk-ZZHIBOMT.js";import{a}from"./chunk-ZLLER3HP.js";var _="with_candidate",w="with_prior_version";function S(e){return JSON.stringify([e.outputs.engine??null,e.outputs.model??null,e.outputs.methodology??null,e.outputs.deliveryRegime??null,e.grading.judge_engine??null,e.grading.judge_model??null])}a(S,"observedExecutionKey");function I(e){let r=e.filter(n=>n.status==="completed"),i=new Set(r.map(n=>JSON.stringify([n.outputs.engine??null,n.outputs.model??null,n.outputs.methodology??null,n.outputs.deliveryRegime??null]))),t=new Set(r.filter(n=>n.grading.judge_model!=null).map(n=>JSON.stringify([n.grading.judge_engine??"claude",n.grading.judge_model])));return i.size===1&&t.size<=1?JSON.stringify([[...i][0],[...t][0]??null]):null}a(I,"measurementBatchKey");function A(e){let r=e.filter(t=>t.configuration===_),i=[];for(let t of r){let n=e.find(s=>s.configuration===w&&s.evalId===t.evalId&&s.runNumber===t.runNumber);if(!n||S(n)!==S(t))continue;let l=h(t),m=h(n);l==null||m==null||i.push({withScore:l,withoutScore:m})}return i}a(A,"pairCandidateRuns");function h(e){return e.status!=="completed"?null:e.grading?.summary?.pass_rate??null}a(h,"evidenceOf");function $(e){let r=[],i=0;for(let t of e){if(t.status==="failed"){r.push(t.failure??{kind:"unknown",class:"infrastructure"});continue}h(t)==null&&(i+=1)}return{infrastructureFailed:r.length,ungradeable:i,summary:F(r)}}a($,"accountForFailures");function Q(e){let{pairs:r,minPairs:i,accounting:t}=e;return r>=i?{kind:"proceed"}:t.infrastructureFailed<=0?{kind:"proceed"}:{kind:"infrastructure-incomplete",reason:`${r}/${i} pair(s) \u2014 ${t.infrastructureFailed} run(s) never executed (${t.summary.describe()}). Retry when the environment recovers; this is not a statement about the target.`}}a(Q,"attributeShortfall");function k(e,r,i,t){let n=[];for(let l of e)n.push({eval_:l,configuration:_,targetContent:r,runNumber:t}),n.push({eval_:l,configuration:w,targetContent:i,runNumber:t});return n}a(k,"buildCandidateQueue");async function j(e){let{cases:r,candidateContent:i,priorVersionContent:t,concurrency:n,runNumber:l,opts:m,onLog:s=a(()=>{},"onLog")}=e,g=k(r,i,t,l),o=[],y=Math.max(1,n),p=null;for(let u=0;u<g.length;u+=y){let d=g.slice(u,u+y);o.push(...await Promise.all(d.map(c=>E(c,m,s))));let C=o.find(c=>c.failure&&x(c.failure.kind));if(C?.failure){p=C.failure.kind;let c=g.length-o.length;s(` \u26D4 aborting batch \u2014 ${p}: the account is out of quota. Skipped ${c} remaining run(s) that would certainly have failed.`);break}}for(let u of o)try{await R("/api/eval-runs",u)}catch(d){s(` \u26A0 failed to post a run result: ${d instanceof Error?d.message:String(d)}`)}let b=A(o),f=$(o),v=r.length-b.length;if(v>0){let u=f.infrastructureFailed?` \u2014 ${f.infrastructureFailed} run(s) never executed (${f.summary.describe()})`:"";s(` \u26A0 ${v}/${r.length} case(s) produced no usable pair (failed or ungradeable arm)${u}`)}return{completed:o.filter(u=>u.status==="completed").length,failed:o.filter(u=>u.status==="failed").length,results:o,pairs:b,accounting:f,abortedForQuota:p}}a(j,"runCandidateBatchAndPost");export{_ as a,w as b,S as c,I as d,A as e,$ as f,Q as g,k as h,j as i};
1
+ import{d as E}from"./chunk-T47SFA5X.js";import{b as F,c as x}from"./chunk-KGURGIZ2.js";import{f as R}from"./chunk-GIXHG5FK.js";import{a}from"./chunk-ZLLER3HP.js";var _="with_candidate",w="with_prior_version";function S(e){return JSON.stringify([e.outputs.engine??null,e.outputs.model??null,e.outputs.methodology??null,e.outputs.deliveryRegime??null,e.grading.judge_engine??null,e.grading.judge_model??null])}a(S,"observedExecutionKey");function I(e){let r=e.filter(n=>n.status==="completed"),i=new Set(r.map(n=>JSON.stringify([n.outputs.engine??null,n.outputs.model??null,n.outputs.methodology??null,n.outputs.deliveryRegime??null]))),t=new Set(r.filter(n=>n.grading.judge_model!=null).map(n=>JSON.stringify([n.grading.judge_engine??"claude",n.grading.judge_model])));return i.size===1&&t.size<=1?JSON.stringify([[...i][0],[...t][0]??null]):null}a(I,"measurementBatchKey");function A(e){let r=e.filter(t=>t.configuration===_),i=[];for(let t of r){let n=e.find(s=>s.configuration===w&&s.evalId===t.evalId&&s.runNumber===t.runNumber);if(!n||S(n)!==S(t))continue;let l=h(t),m=h(n);l==null||m==null||i.push({withScore:l,withoutScore:m})}return i}a(A,"pairCandidateRuns");function h(e){return e.status!=="completed"?null:e.grading?.summary?.pass_rate??null}a(h,"evidenceOf");function $(e){let r=[],i=0;for(let t of e){if(t.status==="failed"){r.push(t.failure??{kind:"unknown",class:"infrastructure"});continue}h(t)==null&&(i+=1)}return{infrastructureFailed:r.length,ungradeable:i,summary:F(r)}}a($,"accountForFailures");function Q(e){let{pairs:r,minPairs:i,accounting:t}=e;return r>=i?{kind:"proceed"}:t.infrastructureFailed<=0?{kind:"proceed"}:{kind:"infrastructure-incomplete",reason:`${r}/${i} pair(s) \u2014 ${t.infrastructureFailed} run(s) never executed (${t.summary.describe()}). Retry when the environment recovers; this is not a statement about the target.`}}a(Q,"attributeShortfall");function k(e,r,i,t){let n=[];for(let l of e)n.push({eval_:l,configuration:_,targetContent:r,runNumber:t}),n.push({eval_:l,configuration:w,targetContent:i,runNumber:t});return n}a(k,"buildCandidateQueue");async function j(e){let{cases:r,candidateContent:i,priorVersionContent:t,concurrency:n,runNumber:l,opts:m,onLog:s=a(()=>{},"onLog")}=e,g=k(r,i,t,l),o=[],y=Math.max(1,n),p=null;for(let u=0;u<g.length;u+=y){let d=g.slice(u,u+y);o.push(...await Promise.all(d.map(c=>E(c,m,s))));let C=o.find(c=>c.failure&&x(c.failure.kind));if(C?.failure){p=C.failure.kind;let c=g.length-o.length;s(` \u26D4 aborting batch \u2014 ${p}: the account is out of quota. Skipped ${c} remaining run(s) that would certainly have failed.`);break}}for(let u of o)try{await R("/api/eval-runs",u)}catch(d){s(` \u26A0 failed to post a run result: ${d instanceof Error?d.message:String(d)}`)}let b=A(o),f=$(o),v=r.length-b.length;if(v>0){let u=f.infrastructureFailed?` \u2014 ${f.infrastructureFailed} run(s) never executed (${f.summary.describe()})`:"";s(` \u26A0 ${v}/${r.length} case(s) produced no usable pair (failed or ungradeable arm)${u}`)}return{completed:o.filter(u=>u.status==="completed").length,failed:o.filter(u=>u.status==="failed").length,results:o,pairs:b,accounting:f,abortedForQuota:p}}a(j,"runCandidateBatchAndPost");export{_ as a,w as b,S as c,I as d,A as e,$ as f,Q as g,k as h,j as i};
@@ -1,2 +1,2 @@
1
- import{c as E,n as m}from"./chunk-SE3UKA3M.js";import{a as d}from"./chunk-ZZHIBOMT.js";import{a as c}from"./chunk-ZLLER3HP.js";import*as p from"node:fs";import*as u from"node:path";import*as _ from"node:os";function T(){if(process.env.RULEMETRIC_API_KEY||process.env.RULEMETRIC_ACCESS_TOKEN)return;let s=u.join(_.homedir(),".config","rulemetric","env");C(s)||C(u.join(process.cwd(),".env.local"))}c(T,"ensureEnv");function C(s){try{let t=p.readFileSync(s,"utf-8");for(let n of t.split(`
1
+ import{c as E,n as m}from"./chunk-T75KAEJO.js";import{a as d}from"./chunk-GIXHG5FK.js";import{a as c}from"./chunk-ZLLER3HP.js";import*as p from"node:fs";import*as u from"node:path";import*as _ from"node:os";function T(){if(process.env.RULEMETRIC_API_KEY||process.env.RULEMETRIC_ACCESS_TOKEN)return;let s=u.join(_.homedir(),".config","rulemetric","env");C(s)||C(u.join(process.cwd(),".env.local"))}c(T,"ensureEnv");function C(s){try{let t=p.readFileSync(s,"utf-8");for(let n of t.split(`
2
2
  `)){let e=n.trim();if(!e||e.startsWith("#"))continue;let o=e.indexOf("=");if(o<0)continue;let r=e.slice(0,o).trim(),i=e.slice(o+1).trim();process.env[r]||(process.env[r]=i)}return!!(process.env.RULEMETRIC_API_KEY||process.env.RULEMETRIC_ACCESS_TOKEN)}catch{return!1}}c(C,"loadEnvFile");T();async function I(s){let t={totalSessions:0,totalCalls:0,totalInputTokens:0,totalOutputTokens:0,totalCacheReadTokens:0,totalCacheWriteTokens:0,totalCostUSD:0,providers:{}},n=await m(s);t.providers={};for(let a of n)t.providers[a.provider]=(t.providers[a.provider]||0)+1;let e=new E,o=n.filter(a=>a.provider==="claude");for(let a of o)try{let h=p.readdirSync(a.path).filter(f=>f.endsWith(".jsonl"));t.totalSessions+=h.length;for(let f of h){let v=p.readFileSync(u.join(a.path,f),"utf-8"),R=e.parse(v);for(let l of R.events)l.tokenUsage&&(t.totalCalls++,t.totalInputTokens+=l.tokenUsage.input,t.totalOutputTokens+=l.tokenUsage.output,t.totalCacheReadTokens+=l.tokenUsage.cacheRead??0,t.totalCacheWriteTokens+=l.tokenUsage.cacheWrite??0)}}catch{}let r=15,i=75;return t.totalCostUSD=Math.round((t.totalInputTokens/1e6*r+t.totalOutputTokens/1e6*i+t.totalCacheReadTokens/1e6*(r*.1)+t.totalCacheWriteTokens/1e6*(r*1.25))*100)/100,t}c(I,"loadLocalStats");async function U(s){let t=process.env.RULEMETRIC_API_URL??d,n=process.env.RULEMETRIC_API_KEY,e=process.env.RULEMETRIC_ACCESS_TOKEN,o=n??e;if(!o)return null;let r=new URLSearchParams;s&&r.set("projectPath",s);try{let i=await fetch(`${t}/api/insights/compute?${r}`,{headers:{Authorization:`Bearer ${o}`},signal:AbortSignal.timeout(5e3)});return i.ok?await i.json():null}catch{return null}}c(U,"loadApiInsights");async function g(s){let t=process.env.RULEMETRIC_API_URL??d,n=process.env.RULEMETRIC_API_KEY??process.env.RULEMETRIC_ACCESS_TOKEN;if(!n)return null;let e=new URLSearchParams;s&&e.set("projectPath",s);try{let o=await fetch(`${t}/api/insights/linked-instructions?${e}`,{headers:{Authorization:`Bearer ${n}`},signal:AbortSignal.timeout(5e3)});return o.ok?await o.json():null}catch{return null}}c(g,"loadLinkedInstructions");export{I as a,U as b,g as c};
@@ -1 +1 @@
1
- import{c as g}from"./chunk-N7SZWKCU.js";import{e as h,f}from"./chunk-ZZHIBOMT.js";import{q as u,r as m}from"./chunk-TWPG3TEQ.js";import{a as c}from"./chunk-ZLLER3HP.js";import*as i from"node:fs";import*as d from"node:path";var v=new Set(u);async function w(r){let{applications:l}=await h(`/api/recommendation-applications?instructionId=${encodeURIComponent(r.instructionId)}&projectPath=${encodeURIComponent(r.projectPath)}&limit=200`),t=l.filter(e=>v.has(e.status)&&e.inverse),s=[];for(let e of m(t.map(n=>({...n,appliedAt:n.appliedAt})))){let n=e.inverse;if(n.kind==="delete-paths"){let p=y(r.dir,n.paths);s.push({applicationId:e.id,target:e.targetPath,reversed:p.removed,drifted:!1,reason:p.reason}),(p.removed||p.alreadyGone)&&await f(`/api/recommendation-applications/${encodeURIComponent(e.id)}/transition`,{status:"reverted"});continue}if(n.kind!=="remove-hook-entry"){s.push({applicationId:e.id,target:e.targetPath,reversed:!1,drifted:!1,reason:`no reverser for inverse kind '${n.kind}' \u2014 recorded, not reversed`});continue}let o=g({dir:r.dir,inverse:n});s.push({applicationId:e.id,target:e.targetPath,reversed:o.removed,drifted:o.drifted,reason:o.reason}),(o.removed||o.code==="not-present")&&await f(`/api/recommendation-applications/${encodeURIComponent(e.id)}/transition`,{status:"reverted"})}return s}c(w,"reverseApplications");function y(r,l){let t=d.resolve(r),s=!1,e=0;for(let n of l){let o=d.resolve(t,n);if(o===t||!o.startsWith(t+d.sep))return{removed:!1,alreadyGone:!1,reason:`refused: ${n} does not resolve to a path inside the project`};if(!i.existsSync(o)&&!I(o)){e+=1;continue}try{i.rmSync(o,{recursive:!0,force:!0}),s=!0;let a=d.dirname(o);a.startsWith(t+d.sep)&&i.readdirSync(a).length===0&&i.rmdirSync(a)}catch(a){return{removed:!1,alreadyGone:!1,reason:`could not remove ${n}: ${a instanceof Error?a.message:String(a)}`}}}return!s&&e===l.length?{removed:!1,alreadyGone:!0,reason:"already removed"}:{removed:s,alreadyGone:!1}}c(y,"deletePaths");function I(r){try{return i.lstatSync(r).isSymbolicLink()}catch{return!1}}c(I,"isSymlink");function b(r){let l=r.name??r.instructionId,t=[],s=r.reversals.filter(e=>e.reversed);if(r.stripped.length>0)t.push(`Removed ${l} from ${r.stripped.join(", ")}.`);else if(s.length>0)for(let e of s)t.push(`Removed ${l} from ${e.target}.`),e.drifted&&t.push(" (that file had changed since it was installed; only the recorded entry was removed)");else{let e=r.searched.length>0?` (searched ${r.searched.join(", ")})`:"";t.push(`No rulemetric-managed block for ${r.instructionId} was found in this directory${e}.`)}for(let e of r.reversals.filter(n=>!n.reversed))t.push(`Still installed in ${e.target}: ${e.reason??"the recorded inverse did not apply"}`);return r.dismissalError?(t.push(`Could not record the dismissal: ${r.dismissalError}`),t.push(r.stripped.length>0||s.length>0?' What was removed above stays removed \u2014 only the "stop proposing this" record failed.':" Nothing was removed, and the dismissal was not recorded either."),t.push(" This proposal may be suggested again. Re-run this command to retry."),t):(t.push("It will not be proposed again for 30 days."),t.push("Turn auto-adoption off entirely: rulemetric suggestions auto --off"),t)}c(b,"describeUndo");export{w as a,y as b,b as c};
1
+ import{c as g}from"./chunk-DANMUHNW.js";import{e as h,f}from"./chunk-GIXHG5FK.js";import{q as u,r as m}from"./chunk-X6CF5KTW.js";import{a as c}from"./chunk-ZLLER3HP.js";import*as i from"node:fs";import*as d from"node:path";var v=new Set(u);async function w(r){let{applications:l}=await h(`/api/recommendation-applications?instructionId=${encodeURIComponent(r.instructionId)}&projectPath=${encodeURIComponent(r.projectPath)}&limit=200`),t=l.filter(e=>v.has(e.status)&&e.inverse),s=[];for(let e of m(t.map(n=>({...n,appliedAt:n.appliedAt})))){let n=e.inverse;if(n.kind==="delete-paths"){let p=y(r.dir,n.paths);s.push({applicationId:e.id,target:e.targetPath,reversed:p.removed,drifted:!1,reason:p.reason}),(p.removed||p.alreadyGone)&&await f(`/api/recommendation-applications/${encodeURIComponent(e.id)}/transition`,{status:"reverted"});continue}if(n.kind!=="remove-hook-entry"){s.push({applicationId:e.id,target:e.targetPath,reversed:!1,drifted:!1,reason:`no reverser for inverse kind '${n.kind}' \u2014 recorded, not reversed`});continue}let o=g({dir:r.dir,inverse:n});s.push({applicationId:e.id,target:e.targetPath,reversed:o.removed,drifted:o.drifted,reason:o.reason}),(o.removed||o.code==="not-present")&&await f(`/api/recommendation-applications/${encodeURIComponent(e.id)}/transition`,{status:"reverted"})}return s}c(w,"reverseApplications");function y(r,l){let t=d.resolve(r),s=!1,e=0;for(let n of l){let o=d.resolve(t,n);if(o===t||!o.startsWith(t+d.sep))return{removed:!1,alreadyGone:!1,reason:`refused: ${n} does not resolve to a path inside the project`};if(!i.existsSync(o)&&!I(o)){e+=1;continue}try{i.rmSync(o,{recursive:!0,force:!0}),s=!0;let a=d.dirname(o);a.startsWith(t+d.sep)&&i.readdirSync(a).length===0&&i.rmdirSync(a)}catch(a){return{removed:!1,alreadyGone:!1,reason:`could not remove ${n}: ${a instanceof Error?a.message:String(a)}`}}}return!s&&e===l.length?{removed:!1,alreadyGone:!0,reason:"already removed"}:{removed:s,alreadyGone:!1}}c(y,"deletePaths");function I(r){try{return i.lstatSync(r).isSymbolicLink()}catch{return!1}}c(I,"isSymlink");function b(r){let l=r.name??r.instructionId,t=[],s=r.reversals.filter(e=>e.reversed);if(r.stripped.length>0)t.push(`Removed ${l} from ${r.stripped.join(", ")}.`);else if(s.length>0)for(let e of s)t.push(`Removed ${l} from ${e.target}.`),e.drifted&&t.push(" (that file had changed since it was installed; only the recorded entry was removed)");else{let e=r.searched.length>0?` (searched ${r.searched.join(", ")})`:"";t.push(`No rulemetric-managed block for ${r.instructionId} was found in this directory${e}.`)}for(let e of r.reversals.filter(n=>!n.reversed))t.push(`Still installed in ${e.target}: ${e.reason??"the recorded inverse did not apply"}`);return r.dismissalError?(t.push(`Could not record the dismissal: ${r.dismissalError}`),t.push(r.stripped.length>0||s.length>0?' What was removed above stays removed \u2014 only the "stop proposing this" record failed.':" Nothing was removed, and the dismissal was not recorded either."),t.push(" This proposal may be suggested again. Re-run this command to retry."),t):(t.push("It will not be proposed again for 30 days."),t.push("Turn auto-adoption off entirely: rulemetric suggestions auto --off"),t)}c(b,"describeUndo");export{w as a,y as b,b as c};
@@ -0,0 +1 @@
1
+ import{f as w}from"./chunk-SWSOEYC7.js";import{a as C}from"./chunk-KGURGIZ2.js";import{a as M}from"./chunk-DVU5PHPM.js";import{a as x,f as b}from"./chunk-FBSZ6KCM.js";import{d as k}from"./chunk-GPBN4ROE.js";import{f as v}from"./chunk-GIXHG5FK.js";import{f as y}from"./chunk-XQYAVSUQ.js";import{a as m}from"./chunk-ZLLER3HP.js";function $(t,e={}){let i=e.engine??(e.model||t.engine==="pi"?"claude":t.engine);return{engine:i,model:e.model??(i===t.engine?t.model:void 0)}}m($,"selectEvalJudge");function _(t){let e=$(t.actor,t.pin??{});if(!t.available.includes(e.engine))throw new Error(`configured grader unavailable: ${e.engine}`);if(e.engine==="codex"&&!e.model?.trim())throw new Error("Codex grader requires a model pin");return e}m(_,"resolveMeasurementJudge");function A(t,e){let i=t.measurement?y.parse(t.measurement):void 0,r=i?.engine??x(t.engine),o=i?i.model??void 0:t.model;if(!e){let s=k();e=[...s.claudeBin?["claude"]:[],...s.codexBin?["codex"]:[],...s.piBin?["pi"]:[]]}if(!e.includes(r))throw new Error(`configured actor unavailable: ${r}`);let u=t.skipGrading?$({engine:r,model:o}):_({actor:{engine:r,model:o},pin:t.graderEngine||t.graderModel?{engine:t.graderEngine,model:t.graderModel}:null,available:e});return{engine:r,model:o,graderEngine:u.engine,graderModel:u.model,...i?{measurement:i}:{}}}m(A,"resolveMeasurementJob");async function R(t,e,i=()=>{}){let{eval_:r,configuration:o,targetContent:u,runNumber:s}=t;i(`[${o}] ${r.name} run#${s} \u2014 executing...`);let l=x(e.engine),g=w({targetType:e.targetType,targetContent:u,targetName:e.targetName,engine:l}),c={...e.executionKey?{executionKey:e.executionKey}:{},deliveryRegime:`${e.targetType??"prompt"}:${l}:${g.methodology}`,...e.measurement?{measurement:e.measurement}:{},methodology:g.methodology,delivery:g.delivery,isolated:g.isWorktree,...e.candidateContentHash?{candidateContentHash:e.candidateContentHash}:{},...g.leakedFiles.length?{leakedFiles:g.leakedFiles}:{}};g.isWorktree||i(`[${o}] ${r.name} run#${s} \u2014 \u26A0 no git worktree; running without repo context`),g.leakedFiles.length&&i(`[${o}] ${r.name} run#${s} \u2014 \u26A0 CONTAMINATED: ${g.leakedFiles.join(", ")} survived the strip`);try{let n=await b({prompt:r.prompt,targetContent:g.systemPrompt,workDir:g.workDir,timeout:e.timeout,model:e.model,engine:l});if(n.error){let d=C(n.error);return i(`[${o}] ${r.name} run#${s} \u2014 FAILED (${d.kind}): ${n.error}`),{evalId:r.id,evalTargetId:e.targetId,evalTargetVersion:e.targetVersion,configuration:o,runNumber:s,iteration:e.iteration,status:"failed",outputs:{error:n.error,failureKind:d.kind,failureClass:d.class,...c,engine:n.engine??l,model:n.model??null,...n.provider?{provider:n.provider}:{},...n.costUsd!=null?{costUsd:n.costUsd}:{}},timing:{duration_ms:n.durationMs,total_tokens:n.totalTokens},grading:{},failure:d}}i(`[${o}] ${r.name} run#${s} \u2014 completed in ${(n.durationMs/1e3).toFixed(1)}s`);let a={};if(!e.skipGrading&&r.expectations.length>0){i(`[${o}] ${r.name} run#${s} \u2014 grading...`);let d=await M({prompt:r.prompt,output:n.output,expectations:r.expectations,...$({engine:l,model:e.model},{engine:e.graderEngine,model:e.graderModel}),timeout:e.timeout});a=d,i(`[${o}] ${r.name} run#${s} \u2014 grading done: pass_rate=${d.summary.pass_rate==null?"n/a (all assertions errored)":`${(d.summary.pass_rate*100).toFixed(0)}%`}`)}return{evalId:r.id,evalTargetId:e.targetId,evalTargetVersion:e.targetVersion,configuration:o,runNumber:s,iteration:e.iteration,status:"completed",outputs:{transcript:n.output,...c,engine:n.engine??l,...n.provider?{provider:n.provider}:{},model:n.model??null,...n.costUsd!=null?{costUsd:n.costUsd}:{}},timing:{duration_ms:n.durationMs,total_tokens:n.totalTokens,total_duration_seconds:n.durationMs/1e3},grading:a}}finally{g.cleanup()}}m(R,"executeAndGradeCase");async function B(t){let{cases:e,targetContent:i,concurrency:r,runNumber:o,opts:u,skipBaseline:s,onLog:l=m(()=>{},"onLog")}=t,g=s?["with_target"]:["with_target","without_target"],c=[];for(let a of e)for(let d of g)c.push({eval_:a,configuration:d,targetContent:d==="with_target"?i:void 0,runNumber:o});let n=[];for(let a=0;a<c.length;a+=Math.max(1,r)){let d=c.slice(a,a+Math.max(1,r)),h=await Promise.all(d.map(f=>R(f,u,l)));n.push(...h);let p=[];for(let f of h)try{await v("/api/eval-runs",f)}catch(E){p.push(E instanceof Error?E.message:String(E))}if(p.length)throw new Error(`Could not persist ${p.length} eval run(s); stopped further execution: ${p.join("; ")}`)}try{await v(`/api/eval-targets/${u.targetId}/label-state`,{})}catch(a){l(` \u26A0 label-state notification skipped: ${a instanceof Error?a.message:String(a)}`)}return{completed:n.filter(a=>a.status==="completed").length,failed:n.filter(a=>a.status==="failed").length,results:n}}m(B,"runBatchAndPost");export{$ as a,_ as b,A as c,R as d,B as e};
@@ -1 +1 @@
1
- import{b as o,f as a}from"./chunk-ZZHIBOMT.js";import{a as n}from"./chunk-ZLLER3HP.js";function c(e){return e==null?e??null:e instanceof Date?e.toISOString():e}n(c,"serializeDate");async function d(e){let r={provider:e.provider,plan:e.plan,limitType:e.limitType,value:e.value,unit:e.unit,comparator:e.comparator,resetsAt:c(e.resetsAt),sourceType:e.sourceType,sourceUrl:e.sourceUrl,sourceEvidence:e.sourceEvidence,confidence:e.confidence,observedAt:c(e.observedAt)};return a("/api/internal/research/observe",r)}n(d,"postObservation");async function f(e){let r=0,i=0,s=[];for(let u of e)try{await d(u),r++}catch(t){i++;let p=t instanceof o?`HTTP ${t.statusCode}: ${t.message}`:String(t);s.length<5&&s.push(p)}return{posted:r,failed:i,errors:s}}n(f,"postObservations");export{d as a,f as b};
1
+ import{b as o,f as a}from"./chunk-GIXHG5FK.js";import{a as n}from"./chunk-ZLLER3HP.js";function c(e){return e==null?e??null:e instanceof Date?e.toISOString():e}n(c,"serializeDate");async function d(e){let r={provider:e.provider,plan:e.plan,limitType:e.limitType,value:e.value,unit:e.unit,comparator:e.comparator,resetsAt:c(e.resetsAt),sourceType:e.sourceType,sourceUrl:e.sourceUrl,sourceEvidence:e.sourceEvidence,confidence:e.confidence,observedAt:c(e.observedAt)};return a("/api/internal/research/observe",r)}n(d,"postObservation");async function f(e){let r=0,i=0,s=[];for(let u of e)try{await d(u),r++}catch(t){i++;let p=t instanceof o?`HTTP ${t.statusCode}: ${t.message}`:String(t);s.length<5&&s.push(p)}return{posted:r,failed:i,errors:s}}n(f,"postObservations");export{d as a,f as b};
@@ -1,4 +1,4 @@
1
- import{g as E}from"./chunk-GN46S7T4.js";import{b,e as y,f as k,h as M}from"./chunk-ZZHIBOMT.js";import{a as u}from"./chunk-ZLLER3HP.js";var v=50,I=24e3,P=3,R=3,C=40,N=4e3,x=new Set(["fact","decision","correction","convention"]),L=`You are distilling DURABLE, PROJECT-SPECIFIC knowledge from an AI coding session so a future agent working on the SAME project starts smarter.
1
+ import{g as E}from"./chunk-7BCZDVIU.js";import{b,e as y,f as k,h as M}from"./chunk-GIXHG5FK.js";import{a as u}from"./chunk-ZLLER3HP.js";var v=50,I=24e3,P=3,R=3,C=40,N=4e3,x=new Set(["fact","decision","correction","convention"]),L=`You are distilling DURABLE, PROJECT-SPECIFIC knowledge from an AI coding session so a future agent working on the SAME project starts smarter.
2
2
 
3
3
  Extract ONLY facts / decisions / corrections / conventions that will STILL be true and useful in FUTURE sessions \u2014 architecture facts, deliberate design decisions, corrections of a wrong approach, or project conventions.
4
4
 
@@ -0,0 +1 @@
1
+ import{a as E}from"./chunk-DQYYHX6K.js";import{a as I}from"./chunk-RBSEE2Z6.js";import{a as w}from"./chunk-M7QSC64D.js";import{c as v,e as h}from"./chunk-T47SFA5X.js";import{b as R}from"./chunk-SWSOEYC7.js";import{e as m}from"./chunk-GIXHG5FK.js";import{a as d}from"./chunk-ZLLER3HP.js";var T=6e5;async function P(e,$){let i=d(n=>$?.logger?.info?.(n)??console.log(n),"log"),{evalTargetId:r}=e,k=e.measurement?v(e):{},o=await m(`/api/eval-targets/${r}/judge-calibration`),l=!e.measurement||o.methodology?.measurement?.engine===e.measurement.engine&&o.methodology.measurement.model===e.measurement.model&&o.methodology.current===R(e.measurement.engine),a=I({powered:l&&o.powerCheck.powered,mde:l?o.powerCheck.mde??Number.POSITIVE_INFINITY:Number.POSITIVE_INFINITY},(l?o.caseDiscrimination:void 0)??{total:0,discriminating:0,nonDiscriminating:0,unpaired:0},{runsCompleted:0,maxRuns:e.maxRuns??24,batchesRun:0,maxBatches:1});if(a.action==="stop")return i(`[cron_eval_autorun] ${r}: ${a.reason}`),{skipped:a.code,reason:a.reason};let t=await m(`/api/eval-targets/${r}`);if(t.metadata?.autoRunEnabled===!1)return{skipped:"paused",reason:"Nightly measurement is off for this target."};let c=w(t);if(c)return i(`[cron_eval_autorun] ${r}: ${c.reason}`),c;let p=(await m(`/api/eval-targets/${r}/evals`)).filter(n=>!n.retiredAt);if(p.length===0)return{skipped:"no-live-cases"};let{completed:f,failed:b,results:N}=await h({cases:E(p,e.maxRuns??12),targetContent:t.content,concurrency:2,runNumber:Math.floor(Date.now()/1e3),opts:{targetId:r,targetVersion:t.version??1,iteration:1,timeout:e.timeout??T,model:e.model,graderModel:e.graderModel,graderEngine:e.graderEngine,...k,skipGrading:!1,targetType:t.type,targetName:t.name},onLog:i}),g={};for(let n of N){if(n.status!=="failed")continue;let s=n.failure?.kind??"unknown";g[s]=(g[s]??0)+1}let u=Object.entries(g).sort(([,n],[,s])=>s-n).map(([n,s])=>`${n}x${s}`).join(", ");return i(`[cron_eval_autorun] ${t.name}: ${f} completed, ${b} failed`+(u===""?"":` (${u})`)),{ranRuns:f,failedRuns:b,...u===""?{}:{failures:u},reason:a.reason}}d(P,"cronEvalAutorun");export{P as a};
@@ -1 +1 @@
1
- import{b as t,e as E}from"./chunk-S5U76YUI.js";import{a as r}from"./chunk-ZLLER3HP.js";function s(o=10,_=t){for(let e=1;e<=o;e++)if(E(e,o,_).feasible)return e;return o}r(s,"minFeasibleLiveCases");var S=s(),A=3;export{s as a,S as b,A as c};
1
+ import{b as t,e as E}from"./chunk-3NWJ7CZ2.js";import{a as r}from"./chunk-ZLLER3HP.js";function s(o=10,_=t){for(let e=1;e<=o;e++)if(E(e,o,_).feasible)return e;return o}r(s,"minFeasibleLiveCases");var S=s(),A=3;export{s as a,S as b,A as c};
@@ -1 +1 @@
1
- import{a as d,d as m}from"./chunk-ZZHIBOMT.js";import{a as c,l as a}from"./chunk-PZNWH4VQ.js";import{a as o}from"./chunk-ZLLER3HP.js";import{createHash as g,randomUUID as v}from"node:crypto";import{hostname as y,platform as p}from"node:os";import{existsSync as P,mkdirSync as _,readFileSync as h,writeFileSync as R}from"node:fs";import{join as E}from"node:path";var O="device-id";function u(){let e=o(t=>t==="1"||t==="true","off");return e(process.env.RULEMETRIC_NO_TELEMETRY)||e(process.env.DO_NOT_TRACK)}o(u,"telemetryDisabled");function l(){let e=a(),t=E(e,O);try{if(P(t)){let r=h(t,"utf-8").trim();if(r)return r}}catch{}let n=g("sha256").update(`${v()}:${y()}`).digest("hex").slice(0,32);try{_(e,{recursive:!0}),R(t,n,{mode:384})}catch{}return n}o(l,"getDeviceId");async function U(e,t={},n){if(!u())try{await m("/api/telemetry/cli-events",{method:"POST",body:{event:e,deviceId:l(),cliVersion:n,os:p(),props:t},timeoutMs:5e3})}catch{}}o(U,"emitSetupEvent");async function w(e){if(u())return;let n=`${process.env.RULEMETRIC_API_URL??c().apiUrl??d}/api/telemetry/cli-error`,r=process.env.HTTPS_PROXY,s=process.env.HTTP_PROXY,T=r!==void 0||s!==void 0;delete process.env.HTTPS_PROXY,delete process.env.HTTP_PROXY;let i=new AbortController,f=setTimeout(()=>i.abort(),4e3);try{await globalThis.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":`rulemetric-cli/${e.cliVersion??"unknown"}`},body:JSON.stringify({event:e.event??"onboarding_error",deviceId:l(),command:e.command,statusCode:e.statusCode,message:e.message?e.message.slice(0,500):void 0,cliVersion:e.cliVersion,os:p(),nodeVersion:process.version,proxied:T,props:e.props}),signal:i.signal})}catch{}finally{clearTimeout(f),r!==void 0&&(process.env.HTTPS_PROXY=r),s!==void 0&&(process.env.HTTP_PROXY=s)}}o(w,"emitErrorBeacon");export{u as a,l as b,U as c,w as d};
1
+ import{a as d,d as m}from"./chunk-GIXHG5FK.js";import{a as c,l as a}from"./chunk-PZNWH4VQ.js";import{a as o}from"./chunk-ZLLER3HP.js";import{createHash as g,randomUUID as v}from"node:crypto";import{hostname as y,platform as p}from"node:os";import{existsSync as P,mkdirSync as _,readFileSync as h,writeFileSync as R}from"node:fs";import{join as E}from"node:path";var O="device-id";function u(){let e=o(t=>t==="1"||t==="true","off");return e(process.env.RULEMETRIC_NO_TELEMETRY)||e(process.env.DO_NOT_TRACK)}o(u,"telemetryDisabled");function l(){let e=a(),t=E(e,O);try{if(P(t)){let r=h(t,"utf-8").trim();if(r)return r}}catch{}let n=g("sha256").update(`${v()}:${y()}`).digest("hex").slice(0,32);try{_(e,{recursive:!0}),R(t,n,{mode:384})}catch{}return n}o(l,"getDeviceId");async function U(e,t={},n){if(!u())try{await m("/api/telemetry/cli-events",{method:"POST",body:{event:e,deviceId:l(),cliVersion:n,os:p(),props:t},timeoutMs:5e3})}catch{}}o(U,"emitSetupEvent");async function w(e){if(u())return;let n=`${process.env.RULEMETRIC_API_URL??c().apiUrl??d}/api/telemetry/cli-error`,r=process.env.HTTPS_PROXY,s=process.env.HTTP_PROXY,T=r!==void 0||s!==void 0;delete process.env.HTTPS_PROXY,delete process.env.HTTP_PROXY;let i=new AbortController,f=setTimeout(()=>i.abort(),4e3);try{await globalThis.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":`rulemetric-cli/${e.cliVersion??"unknown"}`},body:JSON.stringify({event:e.event??"onboarding_error",deviceId:l(),command:e.command,statusCode:e.statusCode,message:e.message?e.message.slice(0,500):void 0,cliVersion:e.cliVersion,os:p(),nodeVersion:process.version,proxied:T,props:e.props}),signal:i.signal})}catch{}finally{clearTimeout(f),r!==void 0&&(process.env.HTTPS_PROXY=r),s!==void 0&&(process.env.HTTP_PROXY=s)}}o(w,"emitErrorBeacon");export{u as a,l as b,U as c,w as d};
@@ -1,4 +1,4 @@
1
- import{a as c,c as d}from"./chunk-IZTIYR5Q.js";import{d as u}from"./chunk-E5YE25QG.js";import{a}from"./chunk-YUIRDBQQ.js";import{a as n}from"./chunk-HAYO6JYI.js";import{b as i}from"./chunk-ZZHIBOMT.js";import{g as r}from"./chunk-PZNWH4VQ.js";import{a as s}from"./chunk-ZLLER3HP.js";import{Command as f,Flags as h}from"@oclif/core";function p(t){return t instanceof i?t.statusCode>=500||t.statusCode===408||t.statusCode===0:/fetch failed|ECONNREFUSED|ECONNRESET|ETIMEDOUT|EAI_AGAIN|bad gateway|timed out/i.test(t.message??"")}s(p,"isAvailabilityError");var m=class extends f{static{s(this,"BaseCommand")}static baseFlags={"api-url":h.string({description:"Override API base URL",env:"RULEMETRIC_API_URL",hidden:!0})};async init(){await super.init();let{flags:e}=await this.parse(this.constructor);e["api-url"]&&(process.env.RULEMETRIC_API_URL=e["api-url"]);let o=d(this.config.version);o&&!this.argv.includes("--quiet")&&!process.env.RULEMETRIC_QUIET&&process.stderr.write(`
1
+ import{a as c,c as d}from"./chunk-IZTIYR5Q.js";import{d as u}from"./chunk-WL5ZWQAS.js";import{a}from"./chunk-KEVDLLHT.js";import{a as n}from"./chunk-DX6IPDED.js";import{b as i}from"./chunk-GIXHG5FK.js";import{g as r}from"./chunk-PZNWH4VQ.js";import{a as s}from"./chunk-ZLLER3HP.js";import{Command as f,Flags as h}from"@oclif/core";function p(t){return t instanceof i?t.statusCode>=500||t.statusCode===408||t.statusCode===0:/fetch failed|ECONNREFUSED|ECONNRESET|ETIMEDOUT|EAI_AGAIN|bad gateway|timed out/i.test(t.message??"")}s(p,"isAvailabilityError");var m=class extends f{static{s(this,"BaseCommand")}static baseFlags={"api-url":h.string({description:"Override API base URL",env:"RULEMETRIC_API_URL",hidden:!0})};async init(){await super.init();let{flags:e}=await this.parse(this.constructor);e["api-url"]&&(process.env.RULEMETRIC_API_URL=e["api-url"]);let o=d(this.config.version);o&&!this.argv.includes("--quiet")&&!process.env.RULEMETRIC_QUIET&&process.stderr.write(`
2
2
  ${o}
3
3
 
4
4
  `),c();try{await a()}catch{}}requireAuth(){r()||this.error("Not logged in. Run `rulemetric auth login` to authenticate."),n()}async catch(e){throw p(e)&&await u({command:this.id,statusCode:e instanceof i?e.statusCode:void 0,message:e.message,cliVersion:this.config.version}),e instanceof i&&(e.statusCode===401&&this.error("Session expired. Run `rulemetric auth login` to re-authenticate."),this.error(e.message)),(e.message?.includes("fetch failed")||e.message?.includes("ECONNREFUSED"))&&this.error("Could not connect to the API server. Is it running?"),e}};export{m as a};
@@ -1,4 +1,4 @@
1
- import{a as I,b as N}from"./chunk-74QIUVWY.js";import{a as i}from"./chunk-ZLLER3HP.js";function ne(e){return(e.trim().split(`
1
+ import{f as I,g as N}from"./chunk-XQYAVSUQ.js";import{a as i}from"./chunk-ZLLER3HP.js";function ne(e){return(e.trim().split(`
2
2
  `)[0]?.replace(/^#+\s*/,"").trim()||"Suggested instruction").slice(0,120)}i(ne,"recommendationTitle");function oe(e){if(!e||typeof e!="object")return e;let t=e;if(Array.isArray(t.recommendation_candidates))return e;let n=t.suggestions;if(!n||typeof n!="object")return e;let o=n.claude_md_additions;return Array.isArray(o)&&(t.recommendation_candidates=o.flatMap(r=>{if(!r||typeof r!="object")return[];let s=r;if(typeof s.addition!="string"||s.addition.trim()==="")return[];let a=s.addition.trim();return[{title:ne(a),artifact:"instruction",canonicalBody:a,rationale:typeof s.why=="string"?s.why:"",evidence:[],outcomeMetric:"session_outcome",renderings:[{harness:"claude_code",target:"CLAUDE.md",body:a},{harness:"codex",target:"AGENTS.md",body:a}]}]})),e}i(oe,"normalizeRecommendationCandidates");var re=new Set(["instruction"]);function se(e){if(!e||typeof e!="object")return e;let t=e,n=t.recommendation_candidates;if(!Array.isArray(n)||n.length===0)return e;let o=n.filter(s=>!!s&&typeof s=="object"&&typeof s.canonicalBody=="string"&&s.canonicalBody.trim().length>0);for(let s of o){if(Array.isArray(s.renderings)&&s.renderings.length>0)continue;let a=s.canonicalBody.trim(),c=re.has(String(s.artifact));s.renderings=c?[{harness:"claude_code",target:"CLAUDE.md",body:a},{harness:"codex",target:"AGENTS.md",body:a}]:[{harness:"claude_code",target:"manual",body:a},{harness:"codex",target:"manual",body:a}]}let r=t.suggestions&&typeof t.suggestions=="object"?t.suggestions:{};return(!Array.isArray(r.claude_md_additions)||r.claude_md_additions.length===0)&&(r.claude_md_additions=o.filter(s=>s.artifact==="instruction").map(s=>({addition:s.canonicalBody.trim(),why:typeof s.rationale=="string"?s.rationale:"",prompt_scaffold:"Add to CLAUDE.md (and AGENTS.md for Codex)."}))),(!Array.isArray(r.features_to_try)||r.features_to_try.length===0)&&(r.features_to_try=o.filter(s=>s.artifact!=="instruction").map(s=>({feature:typeof s.title=="string"?s.title:"Proposed change",one_liner:typeof s.rationale=="string"?s.rationale:"",why_for_you:typeof s.outcomeMetric=="string"?`Aimed at ${s.outcomeMetric}.`:"",example_code:s.canonicalBody.trim()}))),Array.isArray(r.usage_patterns)||(r.usage_patterns=[]),t.suggestions=r,e}i(se,"deriveLegacyPresentation");function ie(e){if(!e||typeof e!="object")return e;let t=e,n=t.project_areas;if(n!==void 0&&!Array.isArray(n)){let o=n&&typeof n=="object"?n.areas:void 0;t.project_areas=Array.isArray(o)?o:void 0}return ae(e),oe(e),e}i(ie,"normalizeRecommendations");function ae(e){if(!e||typeof e!="object")return;let t=e;if(Array.isArray(t.recommendation_candidates)&&t.recommendation_candidates.length>0)return;let n=t.suggestions;if(!n||typeof n!="object")return;let o=n.recommendation_candidates;!Array.isArray(o)||o.length===0||(t.recommendation_candidates=o)}i(ae,"liftNestedCandidates");import{z as d}from"zod";var P=["org","team","project","personal"],D=d.object({name:d.string().min(1),description:d.string().min(1),type:d.literal("instruction").default("instruction"),scope:d.enum(P),version:d.string().min(1),tags:d.array(d.string()).optional(),compatibility:d.array(d.string()).optional(),slots:d.record(d.string(),d.string()).optional(),metadata:d.record(d.string(),d.unknown()).optional()});import{z as p}from"zod";var j=p.object({name:p.string().min(1),description:p.string().min(1),type:p.literal("prompt"),version:p.string().min(1),tags:p.array(p.string()).optional(),variables:p.array(p.string()).optional(),metadata:p.record(p.string(),p.unknown()).optional()});function _(e,t){let n=t.map(o=>`- ID: ${o.id}
3
3
  Name: ${o.name}
4
4
  Description: ${o.description}
@@ -36,13 +36,13 @@ Only include instructions with a relevance score >= ${.5}. Order by score descen
36
36
  Name: ${e.name}
37
37
  Description: ${e.description}
38
38
  Tags: ${e.tags.join(", ")}
39
- Preview: ${e.contentPreview}`.length+2}i(le,"renderedSize");var H=["Added","Changed","Fixed","Removed","Deprecated","Security"],ue=/^##\s+\[([^\]]+)\](?:\s*[-–]\s*(\d{4}-\d{2}-\d{2}))?\s*$/,me=/^###\s+(.+?)\s*$/,de=/^[-*]\s+(.*\S)\s*$/,pe=/^ {2,}(\S.*)$/;function fe(e){let t=e.split(/\r?\n/),n=[],o=null,r=null,s=null;for(let a of t){let c=a.match(ue);if(c){o&&n.push(o);let m=c[1].trim();o={version:m,date:c[2]??null,unreleased:m.toLowerCase()==="unreleased",sections:{}},r=null,s=null;continue}if(!o)continue;let l=a.match(me);if(l){let m=l[1].trim();H.includes(m)?(r=m,o.sections[r]||(o.sections[r]=[]),s=o.sections[r]):(r=null,s=null);continue}if(!r||!s)continue;let u=a.match(de);if(u){s.push(u[1]);continue}let f=a.match(pe);if(f&&s.length>0){s[s.length-1]+=" "+f[1].trim();continue}}return o&&n.push(o),{entries:n}}i(fe,"parseChangelog");function he(e){return e.entries.filter(t=>t.unreleased?!1:Object.values(t.sections).some(n=>n&&n.length>0))}i(he,"announceableEntries");function S(e){let t=/^(#{1,6})\s+/.exec(e);return t?t[1].length:0}i(S,"headingLevel");function B(e){return e.replace(/^#{1,6}\s+/,"").replace(/[`*_~]/g,"").trim().toLowerCase()}i(B,"normaliseHeading");function ge(e,t){let n=B(t);if(n.length===0)return{content:e,removed:!1,removedText:null,reason:"not-found"};let o=e.split(`
40
- `),r=[];for(let m=0;m<o.length;m+=1)S(o[m])>0&&B(o[m])===n&&r.push(m);if(r.length===0)return{content:e,removed:!1,removedText:null,reason:"not-found"};if(r.length>1)return{content:e,removed:!1,removedText:null,reason:"ambiguous"};let s=r[0],a=S(o[s]),c=o.length;for(let m=s+1;m<o.length;m+=1){let E=S(o[m]);if(E>0&&E<=a){c=m;break}}let l=o.slice(s,c).join(`
39
+ Preview: ${e.contentPreview}`.length+2}i(le,"renderedSize");var H=["Added","Changed","Fixed","Removed","Deprecated","Security"],ue=/^##\s+\[([^\]]+)\](?:\s*[-–]\s*(\d{4}-\d{2}-\d{2}))?\s*$/,me=/^###\s+(.+?)\s*$/,de=/^[-*]\s+(.*\S)\s*$/,pe=/^ {2,}(\S.*)$/;function fe(e){let t=e.split(/\r?\n/),n=[],o=null,r=null,s=null;for(let a of t){let c=a.match(ue);if(c){o&&n.push(o);let m=c[1].trim();o={version:m,date:c[2]??null,unreleased:m.toLowerCase()==="unreleased",sections:{}},r=null,s=null;continue}if(!o)continue;let l=a.match(me);if(l){let m=l[1].trim();H.includes(m)?(r=m,o.sections[r]||(o.sections[r]=[]),s=o.sections[r]):(r=null,s=null);continue}if(!r||!s)continue;let u=a.match(de);if(u){s.push(u[1]);continue}let f=a.match(pe);if(f&&s.length>0){s[s.length-1]+=" "+f[1].trim();continue}}return o&&n.push(o),{entries:n}}i(fe,"parseChangelog");function he(e){return e.entries.filter(t=>t.unreleased?!1:Object.values(t.sections).some(n=>n&&n.length>0))}i(he,"announceableEntries");function E(e){let t=/^(#{1,6})\s+/.exec(e);return t?t[1].length:0}i(E,"headingLevel");function B(e){return e.replace(/^#{1,6}\s+/,"").replace(/[`*_~]/g,"").trim().toLowerCase()}i(B,"normaliseHeading");function ge(e,t){let n=B(t);if(n.length===0)return{content:e,removed:!1,removedText:null,reason:"not-found"};let o=e.split(`
40
+ `),r=[];for(let m=0;m<o.length;m+=1)E(o[m])>0&&B(o[m])===n&&r.push(m);if(r.length===0)return{content:e,removed:!1,removedText:null,reason:"not-found"};if(r.length>1)return{content:e,removed:!1,removedText:null,reason:"ambiguous"};let s=r[0],a=E(o[s]),c=o.length;for(let m=s+1;m<o.length;m+=1){let v=E(o[m]);if(v>0&&v<=a){c=m;break}}let l=o.slice(s,c).join(`
41
41
  `),u=[...o.slice(0,s),...o.slice(c)];return u.join("").trim().length===0?{content:e,removed:!1,removedText:null,reason:"would-empty-file"}:{content:u.join(`
42
42
  `).replace(/\n{3,}/g,`
43
43
 
44
44
  `),removed:!0,removedText:l}}i(ge,"removeMarkdownSection");function ye(e,t){let n=t.trim();if(n.length===0)return{content:e,removed:!1,removedText:null,reason:"not-found"};let o=e.indexOf(n);if(o===-1)return{content:e,removed:!1,removedText:null,reason:"not-found"};if(e.indexOf(n,o+1)!==-1)return{content:e,removed:!1,removedText:null,reason:"ambiguous"};let r=(e.slice(0,o)+e.slice(o+n.length)).replace(/\n{3,}/g,`
45
45
 
46
- `);return r.trim().length===0?{content:e,removed:!1,removedText:null,reason:"would-empty-file"}:{content:r,removed:!0,removedText:n}}i(ye,"removeExactBlock");var U=["HTTPS_PROXY","HTTP_PROXY","NODE_EXTRA_CA_CERTS"];function xe(e,t){if(!e||typeof e!="object")return{value:e,removed:!1,removedDescriptions:[],reason:"not-found"};let n=structuredClone(e);if(!n.hooks)return{value:n,removed:!1,removedDescriptions:[],reason:"not-found"};let o=[];for(let[r,s]of Object.entries(n.hooks)){if(!Array.isArray(s))continue;let a=s.filter(c=>{let l=(c.hooks??[]).some(u=>typeof u.command=="string"&&u.command.includes(t));return l&&o.push(`${r}: ${c.matcher??"*"} \u2192 ${(c.hooks??[]).map(u=>u.command).join(", ")}`),!l});a.length===0?delete n.hooks[r]:n.hooks[r]=a}return Object.keys(n.hooks).length===0&&delete n.hooks,{value:n,removed:o.length>0,removedDescriptions:o,...o.length===0?{reason:"not-found"}:{}}}i(xe,"removeHookByCommand");function _e(e,t){if(!e||typeof e!="object")return{value:e,removed:!1,removedDescriptions:[],reason:"not-found"};let n=structuredClone(e);return!n.mcpServers||!(t in n.mcpServers)?{value:n,removed:!1,removedDescriptions:[],reason:"not-found"}:(delete n.mcpServers[t],Object.keys(n.mcpServers).length===0&&delete n.mcpServers,{value:n,removed:!0,removedDescriptions:[`mcpServers.${t}`]})}i(_e,"removeMcpServer");function v(e){if(!e||typeof e!="object")return[];let t=e.env;return t?U.filter(n=>n in t):[]}i(v,"protectedEnvKeysPresent");function Ee(e,t){let n=v(e),o=new Set(v(t));return n.filter(r=>!o.has(r))}i(Ee,"lostProtectedEnvKeys");function Se(e,t){let n=`HTTP ${e}`;if(!t||typeof t!="object")return{message:n};let o=t,r=typeof o.error=="string"&&o.error?o.error:o.error?JSON.stringify(o.error):n,s=typeof o.code=="string"&&o.code?o.code:void 0;return s?{message:r,code:s}:{message:r}}i(Se,"parseApiError");var T=["inside","outside"];function y(e){return e.trim().toLowerCase()}i(y,"normalizeDependencyKey");function ve(e){let t=[];if(T.includes(e.boundaryClass)||t.push({field:"boundaryClass",message:`must be one of ${T.join(" | ")}`}),!Array.isArray(e.targets)||e.targets.length===0)t.push({field:"targets",message:"a proposal that cannot name the paths it writes cannot be applied"});else{for(let r of e.targets)if(typeof r!="string"||r.trim().length===0){t.push({field:"targets",message:"target paths must be non-empty"});break}let n=e.targets.filter(r=>typeof r=="string"&&(r.startsWith("/")||/^[A-Za-z]:[\\/]/.test(r)));n.length>0&&t.push({field:"targets",message:`targets must be project-relative (absolute: ${n.join(", ")})`});let o=e.targets.filter(r=>typeof r=="string"&&r.split(/[\\/]/).includes(".."));o.length>0&&t.push({field:"targets",message:`targets must not traverse outside the project (${o.join(", ")})`})}for(let n of["requires","provides"]){let o=e[n];if(!Array.isArray(o)){t.push({field:n,message:"must be an array of dependency keys"});continue}o.some(r=>typeof r!="string"||r.trim().length===0)&&t.push({field:n,message:"dependency keys must be non-empty strings"})}return t}i(ve,"validateArtifactSpec");function Ae(e,t){let n=[],o=new Set(e.targets??[]);if(t.kind==="delete-paths"){e.boundaryClass!=="inside"&&n.push({field:"inverse",message:"deleting paths is only an inverse for `inside` artifacts; an `outside` path may hold text we did not write"}),t.paths.length===0&&n.push({field:"inverse.paths",message:"nothing to delete \u2014 this is not an inverse"});let r=t.paths.filter(s=>!o.has(s));return r.length>0&&n.push({field:"inverse.paths",message:`would delete paths the spec never declared: ${r.join(", ")}`}),n}return e.boundaryClass!=="outside"&&n.push({field:"inverse",message:"a compensation is only an inverse for `outside` artifacts; an `inside` path owes an exact undo"}),(!t.backupPath||t.backupPath.trim().length===0)&&n.push({field:"inverse.backupPath",message:"an `outside` write owes a backup"}),(!t.hashAtWrite||t.hashAtWrite.trim().length===0)&&n.push({field:"inverse.hashAtWrite",message:"without the post-write hash the undo cannot tell a drifted file from an untouched one"}),o.has(t.file)||n.push({field:"inverse.file",message:`wrote ${t.file}, which the spec did not declare as a target`}),t.kind==="remove-marked-region"?(!t.startMarker||!t.endMarker)&&n.push({field:"inverse",message:"an `outside` region needs both markers, or the undo cannot tell where our text ends"}):t.command.trim().length===0&&n.push({field:"inverse.command",message:"the exact command written is the identity of the entry; without it the undo is a search"}),n}i(Ae,"validateArtifactInverse");var z="artifact";function A(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim().length>0):[]}i(A,"stringArray");function Te(e){if(!e||typeof e!="object")return null;let t=e[z];if(!t||typeof t!="object")return null;let n=t;return{boundaryClass:n.boundaryClass,targets:A(n.targets),requires:A(n.requires),provides:A(n.provides)}}i(Te,"parseArtifactSpec");var be=["applied","measuring","improved","inconclusive","harmful","rollback_ready"];function K(e){return e.appliedAt?e.appliedAt instanceof Date?e.appliedAt.getTime():new Date(e.appliedAt).getTime():0}i(K,"appliedAtMs");function ke(e){return[...e].sort((t,n)=>{let o=K(n)-K(t);return o!==0?o:(n.applySeq??0)-(t.applySeq??0)})}i(ke,"orderForReversal");var Y=["SessionStart","SessionEnd","UserPromptSubmit","PreToolUse","PostToolUse","PreCompact","Notification","Stop","SubagentStop"],b=".claude/settings.local.json";function G(e){return`# rm-artifact:${e}`}i(G,"hookTag");function Ce(e,t){return`${e.trim()} ${G(t)}`}i(Ce,"taggedHookCommand");var Oe=new Set(["if","then","else","elif","fi","for","while","until","do","done","case","esac","function","return","exit","cd","echo","test","true","false"]);function k(e){let t=e.trim().split(/\s+/)[0]??"";return!/^[a-z][a-z0-9_-]*$/.test(t)||Oe.has(t)?null:y(`cmd:${t}`)}i(k,"inferredCommandRequirement");function we(e,t){let n=new Set((t?.requires??[]).map(y).filter(Boolean)),o=k(e.command);return o&&n.add(o),{boundaryClass:"outside",targets:[b],requires:[...n],provides:(t?.provides??[]).map(y).filter(Boolean)}}i(we,"hookArtifactSpec");function x(e){let t=[];Y.includes(e.event)||t.push({field:"event",message:`unknown hook event ${JSON.stringify(e.event)} \u2014 a hook on an event that never fires is indistinguishable from one that was never installed`});let n=(e.command??"").trim();return n.length===0?t.push({field:"command",message:"a hook with no command installs nothing"}):(/[\r\n]/.test(n)&&t.push({field:"command",message:"multi-line commands are refused: the identity tag is a trailing shell comment, which would silence only the final line, and a human reviewing an install should read one line"}),n.includes("\0")&&t.push({field:"command",message:"command contains a NUL byte"}),n.includes("rulemetric")&&t.push({field:"command",message:'refused: `rulemetric hooks uninstall` deletes every hook whose command contains "rulemetric", so installing one here would make this hook collateral damage of an unrelated command'}),n.includes("rm-artifact:")&&t.push({field:"command",message:"command already carries an artifact tag \u2014 installing it would produce two identities for one entry"})),e.matcher!==void 0&&(typeof e.matcher!="string"||e.matcher.trim().length===0)&&t.push({field:"matcher",message:"matcher must be a non-empty string when present"}),t}i(x,"validateHookSpec");function Re(e){let t=[`runs on: ${e.event}${e.matcher?` (tools matching ${e.matcher})`:""}`,`spawns: ${e.command.trim()}`,`writes: ${b} (one entry, tagged with this artifact's id)`],n=k(e.command);return n&&t.push(`needs: ${n} on PATH`),t}i(Re,"describeHookCapability");var q="hook";function h(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}i(h,"asRecord");function F(e){let t=e.event,n=e.command;if(typeof t!="string"||typeof n!="string")return null;let o=typeof e.matcher=="string"?e.matcher:void 0;return{event:t,matcher:o,command:n}}i(F,"readBareSpec");function W(e){let t=h(e.hooks)??e,n=[];for(let[o,r]of Object.entries(t))if(Array.isArray(r))for(let s of r){let a=h(s);if(!a)continue;let c=typeof a.matcher=="string"&&a.matcher.length>0?a.matcher:void 0,l=Array.isArray(a.hooks)?a.hooks:[];for(let u of l){let f=h(u)?.command;typeof f=="string"&&n.push({event:o,matcher:c,command:f})}}return n.length===0?{spec:null,problems:[]}:n.length>1?{spec:null,problems:[{field:"hook",message:`proposal describes ${n.length} hook entries; one proposal installs exactly one hook, so its inverse stays exact and its review stays readable`}]}:{spec:n[0],problems:[]}}i(W,"readSettingsFragment");function Le(e){let t=[],n=/```[a-zA-Z]*\n([\s\S]*?)```/g,o;for(;(o=n.exec(e))!==null;)t.push(o[1]);return t}i(Le,"fencedBlocks");function Ie(e){let t=h(h(e.frontmatter)?.artifact),n=t?h(t[q]):null;if(n){let o=F(n);if(o)return{spec:o,problems:x(o),source:"envelope"};let r=W(n);if(r.spec)return{spec:r.spec,problems:x(r.spec),source:"envelope"};if(r.problems.length>0)return{spec:null,problems:r.problems,source:"envelope"}}for(let o of Le(e.content??"")){let r;try{r=JSON.parse(o)}catch{continue}let s=h(r);if(!s)continue;let a=F(s);if(a)return{spec:a,problems:x(a),source:"content-fragment"};let c=W(s);if(c.spec)return{spec:c.spec,problems:x(c.spec),source:"content-fragment"};if(c.problems.length>0)return{spec:null,problems:c.problems,source:"content-fragment"}}return{spec:null,problems:[{field:"hook",message:"no hook spec found \u2014 a hook proposal must carry {event, command} in its artifact envelope or a JSON settings fragment in its body"}],source:"none"}}i(Ie,"parseHookSpec");var V=25,C=N,X=[{task:"rm-batch-task",instructions:"rm-batch-task/inject.md",class:"proven",axis:"reward",measured:"2026-09-02 n=25/arm Haiku 4.5: 0/25 \u2192 25/25, delta +1.000, 95% CI [+0.734, +1.000]"},{task:"rm-locality-task",instructions:"rm-locality-task/inject.md",class:"proven",axis:"cost",measured:"2026-09-02 n=25/arm Haiku 4.5: 25/25 both arms, cost \u221225.6%/trial, 95% CI [\u22120.0171, \u22120.0107]"},{task:"rm-migrations-task",instructions:"rm-migrations-task/inject.md",class:"negative",axis:"reward",measured:"2026-08-31 Haiku 4.5: flat after two reworks \u2014 redundant with the model's priors on this shape"},{task:"rm-pagination-task",instructions:"rm-pagination-task/inject.md",class:"negative",axis:"reward",measured:"2026-09-02 n=25/arm Haiku 4.5: 25/25 baseline under --allowedTools Bash; the rule costs +8.0%/trial and buys nothing"}];function Ne(e){return X.filter(t=>t.class===e)}i(Ne,"harborTasksOfClass");function J(e,t){return t?.engine==="codex"&&e.axis==="cost"?`${e.task}: dollar-cost telemetry is unavailable for Codex; reward calibration remains supported`:null}i(J,"harborTaskSupport");function Pe(e,t,n=null){let o=n?I.parse(n):null,r=J(e,o);if(r)throw new Error(r);let s=!o||o.engine==="claude"&&o.model===C;return{task:e.task,instructions:e.instructions,class:s?e.class:"unvalidated",axis:e.axis,model:o?.model??C,...o?{measurement:o}:{},nTrials:V,lane:t}}i(Pe,"harborPayloadFor");var De=/[\p{L}\p{N}]+/gu;function O(e){let t=new Set;for(let n of e.toLowerCase().matchAll(De)){let o=` ${n[0]} `;for(let r=0;r+3<=o.length;r+=1)t.add(o.slice(r,r+3))}return t}i(O,"trigrams");function g(e,t){let n=O(e),o=O(t);if(n.size===0||o.size===0)return 0;let r=0,[s,a]=n.size<=o.size?[n,o]:[o,n];for(let l of s)a.has(l)&&(r+=1);let c=n.size+o.size-r;return c===0?0:r/c}i(g,"trigramSimilarity");var R=.3,je=15;function w(e){let n=e.replace(/<!--[\s\S]*?-->/g," ").replace(/```[\s\S]*?```/g," "),o=[];for(let r of n.split(`
46
+ `);return r.trim().length===0?{content:e,removed:!1,removedText:null,reason:"would-empty-file"}:{content:r,removed:!0,removedText:n}}i(ye,"removeExactBlock");var U=["HTTPS_PROXY","HTTP_PROXY","NODE_EXTRA_CA_CERTS"];function xe(e,t){if(!e||typeof e!="object")return{value:e,removed:!1,removedDescriptions:[],reason:"not-found"};let n=structuredClone(e);if(!n.hooks)return{value:n,removed:!1,removedDescriptions:[],reason:"not-found"};let o=[];for(let[r,s]of Object.entries(n.hooks)){if(!Array.isArray(s))continue;let a=s.filter(c=>{let l=(c.hooks??[]).some(u=>typeof u.command=="string"&&u.command.includes(t));return l&&o.push(`${r}: ${c.matcher??"*"} \u2192 ${(c.hooks??[]).map(u=>u.command).join(", ")}`),!l});a.length===0?delete n.hooks[r]:n.hooks[r]=a}return Object.keys(n.hooks).length===0&&delete n.hooks,{value:n,removed:o.length>0,removedDescriptions:o,...o.length===0?{reason:"not-found"}:{}}}i(xe,"removeHookByCommand");function _e(e,t){if(!e||typeof e!="object")return{value:e,removed:!1,removedDescriptions:[],reason:"not-found"};let n=structuredClone(e);return!n.mcpServers||!(t in n.mcpServers)?{value:n,removed:!1,removedDescriptions:[],reason:"not-found"}:(delete n.mcpServers[t],Object.keys(n.mcpServers).length===0&&delete n.mcpServers,{value:n,removed:!0,removedDescriptions:[`mcpServers.${t}`]})}i(_e,"removeMcpServer");function S(e){if(!e||typeof e!="object")return[];let t=e.env;return t?U.filter(n=>n in t):[]}i(S,"protectedEnvKeysPresent");function ve(e,t){let n=S(e),o=new Set(S(t));return n.filter(r=>!o.has(r))}i(ve,"lostProtectedEnvKeys");function Ee(e,t){let n=`HTTP ${e}`;if(!t||typeof t!="object")return{message:n};let o=t,r=typeof o.error=="string"&&o.error?o.error:o.error?JSON.stringify(o.error):n,s=typeof o.code=="string"&&o.code?o.code:void 0;return s?{message:r,code:s}:{message:r}}i(Ee,"parseApiError");var T=["inside","outside"];function y(e){return e.trim().toLowerCase()}i(y,"normalizeDependencyKey");function Se(e){let t=[];if(T.includes(e.boundaryClass)||t.push({field:"boundaryClass",message:`must be one of ${T.join(" | ")}`}),!Array.isArray(e.targets)||e.targets.length===0)t.push({field:"targets",message:"a proposal that cannot name the paths it writes cannot be applied"});else{for(let r of e.targets)if(typeof r!="string"||r.trim().length===0){t.push({field:"targets",message:"target paths must be non-empty"});break}let n=e.targets.filter(r=>typeof r=="string"&&(r.startsWith("/")||/^[A-Za-z]:[\\/]/.test(r)));n.length>0&&t.push({field:"targets",message:`targets must be project-relative (absolute: ${n.join(", ")})`});let o=e.targets.filter(r=>typeof r=="string"&&r.split(/[\\/]/).includes(".."));o.length>0&&t.push({field:"targets",message:`targets must not traverse outside the project (${o.join(", ")})`})}for(let n of["requires","provides"]){let o=e[n];if(!Array.isArray(o)){t.push({field:n,message:"must be an array of dependency keys"});continue}o.some(r=>typeof r!="string"||r.trim().length===0)&&t.push({field:n,message:"dependency keys must be non-empty strings"})}return t}i(Se,"validateArtifactSpec");function Ae(e,t){let n=[],o=new Set(e.targets??[]);if(t.kind==="delete-paths"){e.boundaryClass!=="inside"&&n.push({field:"inverse",message:"deleting paths is only an inverse for `inside` artifacts; an `outside` path may hold text we did not write"}),t.paths.length===0&&n.push({field:"inverse.paths",message:"nothing to delete \u2014 this is not an inverse"});let r=t.paths.filter(s=>!o.has(s));return r.length>0&&n.push({field:"inverse.paths",message:`would delete paths the spec never declared: ${r.join(", ")}`}),n}return e.boundaryClass!=="outside"&&n.push({field:"inverse",message:"a compensation is only an inverse for `outside` artifacts; an `inside` path owes an exact undo"}),(!t.backupPath||t.backupPath.trim().length===0)&&n.push({field:"inverse.backupPath",message:"an `outside` write owes a backup"}),(!t.hashAtWrite||t.hashAtWrite.trim().length===0)&&n.push({field:"inverse.hashAtWrite",message:"without the post-write hash the undo cannot tell a drifted file from an untouched one"}),o.has(t.file)||n.push({field:"inverse.file",message:`wrote ${t.file}, which the spec did not declare as a target`}),t.kind==="remove-marked-region"?(!t.startMarker||!t.endMarker)&&n.push({field:"inverse",message:"an `outside` region needs both markers, or the undo cannot tell where our text ends"}):t.command.trim().length===0&&n.push({field:"inverse.command",message:"the exact command written is the identity of the entry; without it the undo is a search"}),n}i(Ae,"validateArtifactInverse");var z="artifact";function A(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim().length>0):[]}i(A,"stringArray");function Te(e){if(!e||typeof e!="object")return null;let t=e[z];if(!t||typeof t!="object")return null;let n=t;return{boundaryClass:n.boundaryClass,targets:A(n.targets),requires:A(n.requires),provides:A(n.provides)}}i(Te,"parseArtifactSpec");var be=["applied","measuring","improved","inconclusive","harmful","rollback_ready"];function K(e){return e.appliedAt?e.appliedAt instanceof Date?e.appliedAt.getTime():new Date(e.appliedAt).getTime():0}i(K,"appliedAtMs");function ke(e){return[...e].sort((t,n)=>{let o=K(n)-K(t);return o!==0?o:(n.applySeq??0)-(t.applySeq??0)})}i(ke,"orderForReversal");var Y=["SessionStart","SessionEnd","UserPromptSubmit","PreToolUse","PostToolUse","PreCompact","Notification","Stop","SubagentStop"],b=".claude/settings.local.json";function G(e){return`# rm-artifact:${e}`}i(G,"hookTag");function Ce(e,t){return`${e.trim()} ${G(t)}`}i(Ce,"taggedHookCommand");var Oe=new Set(["if","then","else","elif","fi","for","while","until","do","done","case","esac","function","return","exit","cd","echo","test","true","false"]);function k(e){let t=e.trim().split(/\s+/)[0]??"";return!/^[a-z][a-z0-9_-]*$/.test(t)||Oe.has(t)?null:y(`cmd:${t}`)}i(k,"inferredCommandRequirement");function we(e,t){let n=new Set((t?.requires??[]).map(y).filter(Boolean)),o=k(e.command);return o&&n.add(o),{boundaryClass:"outside",targets:[b],requires:[...n],provides:(t?.provides??[]).map(y).filter(Boolean)}}i(we,"hookArtifactSpec");function x(e){let t=[];Y.includes(e.event)||t.push({field:"event",message:`unknown hook event ${JSON.stringify(e.event)} \u2014 a hook on an event that never fires is indistinguishable from one that was never installed`});let n=(e.command??"").trim();return n.length===0?t.push({field:"command",message:"a hook with no command installs nothing"}):(/[\r\n]/.test(n)&&t.push({field:"command",message:"multi-line commands are refused: the identity tag is a trailing shell comment, which would silence only the final line, and a human reviewing an install should read one line"}),n.includes("\0")&&t.push({field:"command",message:"command contains a NUL byte"}),n.includes("rulemetric")&&t.push({field:"command",message:'refused: `rulemetric hooks uninstall` deletes every hook whose command contains "rulemetric", so installing one here would make this hook collateral damage of an unrelated command'}),n.includes("rm-artifact:")&&t.push({field:"command",message:"command already carries an artifact tag \u2014 installing it would produce two identities for one entry"})),e.matcher!==void 0&&(typeof e.matcher!="string"||e.matcher.trim().length===0)&&t.push({field:"matcher",message:"matcher must be a non-empty string when present"}),t}i(x,"validateHookSpec");function Re(e){let t=[`runs on: ${e.event}${e.matcher?` (tools matching ${e.matcher})`:""}`,`spawns: ${e.command.trim()}`,`writes: ${b} (one entry, tagged with this artifact's id)`],n=k(e.command);return n&&t.push(`needs: ${n} on PATH`),t}i(Re,"describeHookCapability");var q="hook";function h(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}i(h,"asRecord");function F(e){let t=e.event,n=e.command;if(typeof t!="string"||typeof n!="string")return null;let o=typeof e.matcher=="string"?e.matcher:void 0;return{event:t,matcher:o,command:n}}i(F,"readBareSpec");function W(e){let t=h(e.hooks)??e,n=[];for(let[o,r]of Object.entries(t))if(Array.isArray(r))for(let s of r){let a=h(s);if(!a)continue;let c=typeof a.matcher=="string"&&a.matcher.length>0?a.matcher:void 0,l=Array.isArray(a.hooks)?a.hooks:[];for(let u of l){let f=h(u)?.command;typeof f=="string"&&n.push({event:o,matcher:c,command:f})}}return n.length===0?{spec:null,problems:[]}:n.length>1?{spec:null,problems:[{field:"hook",message:`proposal describes ${n.length} hook entries; one proposal installs exactly one hook, so its inverse stays exact and its review stays readable`}]}:{spec:n[0],problems:[]}}i(W,"readSettingsFragment");function Le(e){let t=[],n=/```[a-zA-Z]*\n([\s\S]*?)```/g,o;for(;(o=n.exec(e))!==null;)t.push(o[1]);return t}i(Le,"fencedBlocks");function Ie(e){let t=h(h(e.frontmatter)?.artifact),n=t?h(t[q]):null;if(n){let o=F(n);if(o)return{spec:o,problems:x(o),source:"envelope"};let r=W(n);if(r.spec)return{spec:r.spec,problems:x(r.spec),source:"envelope"};if(r.problems.length>0)return{spec:null,problems:r.problems,source:"envelope"}}for(let o of Le(e.content??"")){let r;try{r=JSON.parse(o)}catch{continue}let s=h(r);if(!s)continue;let a=F(s);if(a)return{spec:a,problems:x(a),source:"content-fragment"};let c=W(s);if(c.spec)return{spec:c.spec,problems:x(c.spec),source:"content-fragment"};if(c.problems.length>0)return{spec:null,problems:c.problems,source:"content-fragment"}}return{spec:null,problems:[{field:"hook",message:"no hook spec found \u2014 a hook proposal must carry {event, command} in its artifact envelope or a JSON settings fragment in its body"}],source:"none"}}i(Ie,"parseHookSpec");var V=25,C=N,X=[{task:"rm-batch-task",instructions:"rm-batch-task/inject.md",class:"proven",axis:"reward",measured:"2026-09-02 n=25/arm Haiku 4.5: 0/25 \u2192 25/25, delta +1.000, 95% CI [+0.734, +1.000]"},{task:"rm-locality-task",instructions:"rm-locality-task/inject.md",class:"proven",axis:"cost",measured:"2026-09-02 n=25/arm Haiku 4.5: 25/25 both arms, cost \u221225.6%/trial, 95% CI [\u22120.0171, \u22120.0107]"},{task:"rm-migrations-task",instructions:"rm-migrations-task/inject.md",class:"negative",axis:"reward",measured:"2026-08-31 Haiku 4.5: inconclusive after two exploratory reworks; redundancy unestablished"},{task:"rm-pagination-task",instructions:"rm-pagination-task/inject.md",class:"negative",axis:"reward",measured:"2026-09-02 n=25/arm Haiku 4.5: 25/25 baseline under --allowedTools Bash; observed cost +8.0%/trial; reward equivalence unestablished"}];function Ne(e){return X.filter(t=>t.class===e)}i(Ne,"harborTasksOfClass");function J(e,t){return t?.engine==="pi"?"Pi is supported for eval trials, not Harbor tasks":t?.engine==="codex"&&e.axis==="cost"?`${e.task}: dollar-cost telemetry is unavailable for Codex; reward calibration remains supported`:null}i(J,"harborTaskSupport");function Pe(e,t,n=null){let o=n?I.parse(n):null,r=J(e,o);if(r)throw new Error(r);let s=!o||o.engine==="claude"&&o.model===C;return{task:e.task,instructions:e.instructions,class:s?e.class:"unvalidated",axis:e.axis,model:o?.model??C,...o?{measurement:o}:{},nTrials:V,lane:t}}i(Pe,"harborPayloadFor");var De=/[\p{L}\p{N}]+/gu;function O(e){let t=new Set;for(let n of e.toLowerCase().matchAll(De)){let o=` ${n[0]} `;for(let r=0;r+3<=o.length;r+=1)t.add(o.slice(r,r+3))}return t}i(O,"trigrams");function g(e,t){let n=O(e),o=O(t);if(n.size===0||o.size===0)return 0;let r=0,[s,a]=n.size<=o.size?[n,o]:[o,n];for(let l of s)a.has(l)&&(r+=1);let c=n.size+o.size-r;return c===0?0:r/c}i(g,"trigramSimilarity");var R=.3,je=15;function w(e){let n=e.replace(/<!--[\s\S]*?-->/g," ").replace(/```[\s\S]*?```/g," "),o=[];for(let r of n.split(`
47
47
  `)){let s=r.trim();if(s.length===0||s.startsWith("#"))continue;let a=s.replace(/^(?:[-*+]|\d+[.)])\s+/,"").trim();if(a.length!==0)for(let c of a.split(/(?<=[.!?])\s+(?=[A-Z(`"'*])/)){let l=c.trim();l.length>=je&&o.push(l)}}return o}i(w,"splitDirectives");function Z(e,t,n=R){let o=w(e);if(o.length===0)return{redundant:!1,coverage:0,matches:[],novel:[]};let r=t.flatMap(c=>w(c.content).map(l=>({text:l,id:c.id,source:c.source}))),s=[],a=[];for(let c of o){let l=null;for(let u of r){let f=g(c,u.text);f<n||(l===null||f>l.similarity)&&(l={directive:c,matchedDirective:u.text,matchedId:u.id,matchedSource:u.source,similarity:f})}l?s.push(l):a.push(c)}return{redundant:a.length===0,coverage:s.length/o.length,matches:s,novel:a}}i(Z,"assessRedundancy");function $e(e,t=R){let n=[];for(let o=0;o<e.length;o+=1){let r=Z(e[o].content,e.slice(0,o),t);r.matches.length>0&&n.push({instruction:e[o],verdict:r})}return n}i($e,"findInternalRedundancy");var Q=.5,Me=/-(?=[0-9a-f]{6}$)[0-9a-f]*[0-9][0-9a-f]*$/;function L(e){return e.trim().toLowerCase().replace(/^skills--/,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(Me,"").replace(/-+$/,"")}i(L,"skillNameStem");function He(e,t,n=Q){let o=L(e.name);for(let s of t)if(o.length>0&&L(s.name)===o)return{name:s.name,similarity:g(e.content,s.content),reason:"name-stem"};let r=null;for(let s of t){let a=g(e.content,s.content);a<n||(r===null||a>r.similarity)&&(r={name:s.name,similarity:a,reason:"body"})}return r}i(He,"assessSkillDuplication");var Be=new Set(["sh","bash","zsh","fish"]),Ue=new Set(["mjs","cjs","js","ts","py","rb","pl"]),Ke=/(?:^|[\s(`'"])(?:sudo\s+)?(?:node|npx|pnpm|npm|yarn|bun|deno|tsx|ts-node|vitest|jest|python3?|python|ruby|perl|bash|sh|zsh|exec|run|dlx)\s+(?:[-\w=@./]+\s+)*$/,ze=/(?:\.\/)?(?:[\w.@-]+\/)+[\w.@-]+\.\w+/g;function Fe(e){return e.replace(/```[\w-]*\n?/g," ").replace(/`/g," ")}i(Fe,"stripCodeMarkers");function We(e){let t=e.trim();return t=t.replace(/[.,;:)\]]+$/,""),t.startsWith("./")&&(t=t.slice(2)),t.length===0||t.startsWith("/")||t.startsWith("~")||t.startsWith("..")||/[<>{}*?]/.test(t)?null:t}i(We,"normalise");function ee(e){let t=Fe(e),n=new Set,o=[];for(let r of t.matchAll(ze)){let s=r[0],a=r.index??0,c=t.slice(Math.max(0,a-1),a);if(c.length>0&&!/[\s(['"=]/.test(c))continue;let l=We(s);if(!l)continue;let u=l.slice(l.lastIndexOf(".")+1).toLowerCase();(Be.has(u)||Ue.has(u)&&(s.startsWith("./")||Ke.test(t.slice(t.lastIndexOf(`
48
- `,Math.max(0,a-1))+1,a))))&&(n.has(l)||(n.add(l),o.push({reference:s,path:l})))}return o}i(ee,"extractCommandReferences");function Ye(e,t){return ee(e).filter(n=>!t(n.path))}i(Ye,"findUnresolvableReferences");import Yt from"gray-matter";import{z as te}from"zod";var Xt=te.object({type:te.enum(["instruction","prompt"])});export{se as a,ie as b,_ as c,M as d,fe as e,he as f,ge as g,ye as h,xe as i,_e as j,Ee as k,Se as l,y as m,ve as n,Ae as o,Te as p,be as q,ke as r,b as s,G as t,Ce as u,we as v,Re as w,Ie as x,C as y,Ne as z,J as A,Pe as B,w as C,Z as D,$e as E,He as F,Ye as G};
48
+ `,Math.max(0,a-1))+1,a))))&&(n.has(l)||(n.add(l),o.push({reference:s,path:l})))}return o}i(ee,"extractCommandReferences");function Ye(e,t){return ee(e).filter(n=>!t(n.path))}i(Ye,"findUnresolvableReferences");import Yt from"gray-matter";import{z as te}from"zod";var Xt=te.object({type:te.enum(["instruction","prompt"])});export{se as a,ie as b,_ as c,M as d,fe as e,he as f,ge as g,ye as h,xe as i,_e as j,ve as k,Ee as l,y as m,Se as n,Ae as o,Te as p,be as q,ke as r,b as s,G as t,Ce as u,we as v,Re as w,Ie as x,C as y,Ne as z,J as A,Pe as B,w as C,Z as D,$e as E,He as F,Ye as G};
@@ -1 +1 @@
1
- import{b as l}from"./chunk-DDYGA2DS.js";import{a as p}from"./chunk-5RBLIVBF.js";import{h}from"./chunk-ZZHIBOMT.js";import{a as c}from"./chunk-ZLLER3HP.js";async function g(t){if(!t.worktree?.create)return t;let{branch:e,baseRef:s}=t.worktree,n=await l({repoRoot:t.projectPath,branch:e,baseRef:s});return{...t,projectPath:n.path,gitBranch:n.branch}}c(g,"resolveWorktreeForLaunch");async function L(t,e){let{mirrorId:s,tool:n}=t,{config:r}=t,a=c(o=>e.logger.info(o),"log");if(e.job.attempts>1)throw new p(`process_launch is not safe to retry (attempt ${e.job.attempts}). Re-launch manually.`);r=await g(r),r.worktree?.create&&a(`Worktree resolved: ${r.projectPath} (branch ${r.gitBranch})`),a(`Launching ${n}...`);let{getLauncher:f}=await import("./dist-NHS7HY5Q.js"),i=await f(n).launch(r);a(`Launch completed: sessionId=${i.sessionId}`);let u={...i,worktreePath:r.worktree?.create?r.projectPath:void 0,runId:r.runId};return await h(`/api/launch-jobs/${s}/state`,{result:u}).catch(o=>{a(`result persist failed: ${o instanceof Error?o.message:String(o)}`)}),u}c(L,"processLaunch");export{g as a,L as b};
1
+ import{b as l}from"./chunk-ISFPPDDB.js";import{a as p}from"./chunk-5RBLIVBF.js";import{h}from"./chunk-GIXHG5FK.js";import{a as c}from"./chunk-ZLLER3HP.js";async function g(t){if(!t.worktree?.create)return t;let{branch:e,baseRef:s}=t.worktree,n=await l({repoRoot:t.projectPath,branch:e,baseRef:s});return{...t,projectPath:n.path,gitBranch:n.branch}}c(g,"resolveWorktreeForLaunch");async function L(t,e){let{mirrorId:s,tool:n}=t,{config:r}=t,a=c(o=>e.logger.info(o),"log");if(e.job.attempts>1)throw new p(`process_launch is not safe to retry (attempt ${e.job.attempts}). Re-launch manually.`);r=await g(r),r.worktree?.create&&a(`Worktree resolved: ${r.projectPath} (branch ${r.gitBranch})`),a(`Launching ${n}...`);let{getLauncher:f}=await import("./dist-GSHUC7UU.js"),i=await f(n).launch(r);a(`Launch completed: sessionId=${i.sessionId}`);let u={...i,worktreePath:r.worktree?.create?r.projectPath:void 0,runId:r.runId};return await h(`/api/launch-jobs/${s}/state`,{result:u}).catch(o=>{a(`result persist failed: ${o instanceof Error?o.message:String(o)}`)}),u}c(L,"processLaunch");export{g as a,L as b};
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-ZLLER3HP.js";import{z as e}from"zod";var l=e.enum(["claude","codex","pi"]),d=e.string().trim().min(1).max(200).nullable(),c=o((n,r)=>{n.engine==="codex"&&!n.model&&r.addIssue({code:"custom",path:["model"],message:"Codex requires a model pin"}),n.engine==="pi"&&!/^[^\s/:]+\/[^\s/]+$/.test(n.model??"")&&r.addIssue({code:"custom",path:["model"],message:"Pi requires a provider/model pin (for example openai-codex/gpt-5.4-mini)"}),n.engine===null&&n.model!==null&&r.addIssue({code:"custom",path:["model"],message:"Choose an engine before a model"})},"requirePin"),u=e.object({engine:l.nullable(),model:d}).strict().superRefine(c),p=e.object({preference:u,workers:e.array(e.object({lastSeen:e.string(),protocol:e.number().nullable(),engines:e.array(e.string())})).optional(),graderBlockers:e.array(e.object({targetId:e.string(),name:e.string(),engine:e.string(),model:e.string()})).optional()}),g=e.object({cadence:e.string(),summary:e.string(),readiness:e.object({ready:e.boolean(),reported:e.boolean(),missing:e.array(e.string())}),sweeps:e.array(e.object({task:e.string(),last:e.object({status:e.string(),decision:e.string().nullable(),reason:e.string().nullable()}).nullable()}))});function b(n){let{preference:r,workers:t,graderBlockers:a}=n,s=[{id:"actor",label:"Measurement actor",detail:r.engine?`${r.engine} \xB7 ${r.model??"CLI default"}`:"Unset \u2014 existing worker defaults"},{id:"workers",label:"Worker reports",detail:t===void 0?"Unavailable":t.length===0?"No recent worker report \u2014 start or upgrade your worker":t.map(i=>`${i.engines.join(", ")||"no engines"} (protocol ${i.protocol??"unknown"})`).join("; ")},{id:"readiness",label:"Trial readiness",detail:"Check each eval target for nightly readiness, schedule and latest batch. Engine detection does not guarantee credits."},{id:"grader",label:"Independent graders",detail:a===void 0?"Readiness unavailable":a.length?`${a.length} target(s) lack a compatible actor/grader worker`:"No reported grader blockers; pins are configured per target"}];return r.engine==="pi"&&s.push({id:"limit",label:"Pi",detail:"Uses the selected provider/model. Harbor is unsupported."}),r.engine==="codex"&&s.push({id:"limit",label:"Codex",detail:"Reports tokens, not measured dollars. Harbor dollar-cost-only tasks are unsupported."}),s}o(b,"measurementRows");function h(n){return[{id:"harbor",label:"Harbor schedule",detail:n.summary},{id:"harbor-worker",label:"Harbor worker",detail:n.readiness.reported?n.readiness.ready?"Dependencies reported ready; local worker and Docker must remain available":`Not ready: ${n.readiness.missing.join(", ")}`:"No recent readiness report"},...n.sweeps.map(r=>({id:`harbor-${r.task}`,label:r.task,detail:r.last?`${r.last.decision??r.last.status} \u2014 ${r.last.reason??"No result detail"}`:"Not run yet"}))]}o(h,"harborRows");var f=e.object({version:e.literal(1),engine:l,model:d,source:e.enum(["account","explicit"])}).strict().superRefine(c),k="claude-haiku-4-5";export{u as a,p as b,g as c,b as d,h as e,f,k as g};
@@ -1 +1 @@
1
- import{b as c,f as m}from"./chunk-ZZHIBOMT.js";import{a as s}from"./chunk-ZLLER3HP.js";var R=new Set([408,429,502,503,504]),_=12e4,T=2e4,b=1e3,l=15e3;function p(t,e){try{t(JSON.stringify({ts:new Date().toISOString(),...e}))}catch{t(`[agent-loop] log_error event=${e.event}`)}}s(p,"structuredLog");function f(t,e){return e.aborted?Promise.resolve(!1):t<=0?Promise.resolve(!0):new Promise(r=>{let a=setTimeout(()=>{e.removeEventListener("abort",o),r(!0)},t),o=s(()=>{clearTimeout(a),e.removeEventListener("abort",o),r(!1)},"onAbort");e.addEventListener("abort",o,{once:!0})})}s(f,"abortableSleep");function g(t){return t instanceof c?R.has(t.statusCode):!0}s(g,"isRetryableReportError");async function S(t,e,r){let a=Date.now()+r.budgetMs,o=b;for(let i=1;;i++)try{return await m(t,e),{ok:!0,attempts:i}}catch(n){let u=a-Date.now();if(!g(n)||u<=0||r.signal.aborted)return{ok:!1,attempts:i,error:n};if(p(r.log,{event:`${r.event}_retry`,jobId:r.jobId,attempt:i,status:n instanceof c?n.statusCode:void 0,error:n instanceof Error?n.message:String(n),retryInMs:Math.min(o,u)}),!await f(Math.min(o,u),r.signal))return{ok:!1,attempts:i,error:n};o=Math.min(o*2,l)}}s(S,"postReportWithRetry");export{R as a,_ as b,T as c,b as d,l as e,p as f,f as g,g as h,S as i};
1
+ import{b as c,f as m}from"./chunk-GIXHG5FK.js";import{a as s}from"./chunk-ZLLER3HP.js";var R=new Set([408,429,502,503,504]),_=12e4,T=2e4,b=1e3,l=15e3;function p(t,e){try{t(JSON.stringify({ts:new Date().toISOString(),...e}))}catch{t(`[agent-loop] log_error event=${e.event}`)}}s(p,"structuredLog");function f(t,e){return e.aborted?Promise.resolve(!1):t<=0?Promise.resolve(!0):new Promise(r=>{let a=setTimeout(()=>{e.removeEventListener("abort",o),r(!0)},t),o=s(()=>{clearTimeout(a),e.removeEventListener("abort",o),r(!1)},"onAbort");e.addEventListener("abort",o,{once:!0})})}s(f,"abortableSleep");function g(t){return t instanceof c?R.has(t.statusCode):!0}s(g,"isRetryableReportError");async function S(t,e,r){let a=Date.now()+r.budgetMs,o=b;for(let i=1;;i++)try{return await m(t,e),{ok:!0,attempts:i}}catch(n){let u=a-Date.now();if(!g(n)||u<=0||r.signal.aborted)return{ok:!1,attempts:i,error:n};if(p(r.log,{event:`${r.event}_retry`,jobId:r.jobId,attempt:i,status:n instanceof c?n.statusCode:void 0,error:n instanceof Error?n.message:String(n),retryInMs:Math.min(o,u)}),!await f(Math.min(o,u),r.signal))return{ok:!1,attempts:i,error:n};o=Math.min(o*2,l)}}s(S,"postReportWithRetry");export{R as a,_ as b,T as c,b as d,l as e,p as f,f as g,g as h,S as i};
@@ -0,0 +1,15 @@
1
+ import{a as M}from"./chunk-5RBLIVBF.js";import{c as q}from"./chunk-GLBWNB2N.js";import{a as K,b as Y}from"./chunk-CQD2R3BA.js";import{a as A,d as N}from"./chunk-3UKZJAFS.js";import{a as j,b as k,c as V,d as D}from"./chunk-77FH6UZP.js";import{a as Z}from"./chunk-KE5K3F7J.js";import{b as W,e as B,g as T}from"./chunk-7BCZDVIU.js";import{e as h,f as U,h as m}from"./chunk-GIXHG5FK.js";import{a as L,b as H}from"./chunk-X6CF5KTW.js";import{a as f}from"./chunk-ZLLER3HP.js";var Q=f((l,{limit:a,sort:n,eventTypes:s})=>h(`/api/sessions/${l}/events?limit=${a}&sort=${n}&eventType=${encodeURIComponent(s.join(","))}&hasContent=true`),"fetchTranscriptTurns");async function ms(l,a){let{mirrorId:n,projectPath:s,projectId:r,config:u}=l,e=f(t=>a.logger.info(t),"log");if(u?.sessionId)return es({mirrorId:n,sessionId:u.sessionId},e);e(`Processing insights job ${n}...`),await m(`/api/insights-jobs/${n}/progress`,{status:"running",progress:{step:"reading_data"}});try{let{repaired:t}=await U("/api/sessions/repair-analyzed-at",{});t>0&&e(` Repaired analyzed_at on ${t} orphan session(s).`)}catch(t){e(` Warning: analyzed_at repair failed: ${t instanceof Error?t.message:String(t)}`)}let p=20,C=200,z=15*6e4,F=3,E=Date.now()+z,I=B()==="none"?"no-llm-backend":null;if(I&&a.logger.warn?.("[process-insights] no LLM backend (no claude/codex CLI and no ANTHROPIC_API_KEY) \u2014 facet grading SKIPPED for this run; the summary below is computed from already-graded sessions only"),!I){let t=0,i=0;try{for(;t<C&&Date.now()<E;){let c=await h(`/api/sessions?needsFacets=true&graderVersion=${2}&limit=${p}&offset=${i}`);if(c.length===0)break;e(` Generating facets for ${c.length} un-analyzed sessions (drained ${t} so far)...`);for(let b=0;b<c.length&&!(t>=C||Date.now()>=E);b+=F){let R=c.slice(b,b+F);await Promise.all(R.map(async g=>{if(!(t>=C||Date.now()>=E))try{let d=await N(ss=>Q(g.id,ss));if(d.turnCount<2){t++,i++;return}let O=await T(D,d.text,4096);O&&typeof O.outcome=="string"?(await m(`/api/sessions/${g.id}/enrich`,{analysis:{source:"generated_facets",...O,graderVersion:2},...g.eventCount!=null?{analyzedEventCount:g.eventCount}:{},analyzedTurnCount:d.turnCount}),e(` Generated facets for session ${g.id} (${g.tool}, ${d.turnCount} turns)`)):i++,t++}catch(d){e(` Failed to generate facets for session ${g.id}: ${d instanceof Error?d.message:String(d)}`),t++,i++}}))}if(c.length<p)break}}catch(c){e(` Warning: facet generation failed after ${t} sessions: ${c instanceof Error?c.message:String(c)}`)}if(t>0){let c=Date.now()>=E?`time budget (${Math.round(z/6e4)}m)`:t>=C?`hard cap (${C})`:"queue empty";e(` Facet drain stopped on ${c} after ${t} session(s); the rest resume next run.`)}}let _=await ns(s,r);if(!_)throw new M("No session data found \u2014 ensure sessions are captured and enriched.");e(` Found ${_.stats.sessions} sessions, generating recommendations...`);let y=await Y({projectId:r,projectPath:s},h);_.summary+=`
2
+
3
+ ${y.text}`,e(` Session evidence: ${y.sessionIds.length} usable, ${y.failedSessionIds.length} unavailable`);let S=await ts(s,e);S&&e(` Generator memory: ${S.split(`
4
+ `).length} lines of prior-advice context`);let o={},$=[],w=k.length+1;for(let t=0;t<k.length;t++){let i=k[t];e(` [${t+1}/${w}] Generating ${i.name}...`);try{await m(`/api/insights-jobs/${n}/progress`,{status:"running",progress:{step:i.name,current:t+1,total:w,partial:{...o}}})}catch(d){e(` Warning: progress update failed for ${i.name}: ${d instanceof Error?d.message:String(d)}`)}e(` Running LLM prompt for ${i.name}...`);let c=i.usesGeneratorMemory&&S?`${_.summary}
5
+ ${S}`:_.summary,b=Date.now(),R=await T(i.prompt,c,i.maxTokens,{timeoutMs:i.timeoutMs}),g=Date.now()-b;R?(o[i.name]=R,e(` Got result for ${i.name} (${Math.round(g/1e3)}s)`)):($.push(i.name),e(` No result for ${i.name} after ${Math.round(g/1e3)}s (budget ${Math.round((i.timeoutMs??12e4)/1e3)}s) \u2014 section DROPPED`))}e(` [${w}/${w}] Generating at_a_glance...`),await m(`/api/insights-jobs/${n}/progress`,{status:"running",progress:{step:"at_a_glance",current:w,total:w,partial:{...o}}});let X=[_.summary,o.what_works?`
6
+ ## What Works
7
+ ${JSON.stringify(o.what_works)}`:"",o.friction_analysis?`
8
+ ## Friction
9
+ ${JSON.stringify(o.friction_analysis)}`:"",o.suggestions?`
10
+ ## Suggestions
11
+ ${JSON.stringify(o.suggestions)}`:"",o.on_the_horizon?`
12
+ ## On the Horizon
13
+ ${JSON.stringify(o.on_the_horizon)}`:""].join(`
14
+ `),x=await T(V,X,8192);x&&(o.at_a_glance=x),e(" Uploading results..."),e(` Done! Recommendations generated for job ${n}`),H(o);let v=K(o.recommendation_candidates,y.sessionIds);o.recommendation_candidates=v.candidates;let P=o.suggestions;if(P&&typeof P=="object"&&!Array.isArray(P)){let t=P;t.recommendation_candidates=v.candidates,t.claude_md_additions=[],t.features_to_try=[]}L(o);let J={recommendations:o,sessionEvidence:{sessionIds:y.sessionIds,failedSessionIds:y.failedSessionIds,emptySessionIds:y.emptySessionIds,selection:"recent-8-head-tail",rejectedCandidateTitles:v.rejected},...$.length>0?{sectionsFailed:$}:{},...I?{facetsSkipped:I}:{}};return $.length>0&&e(` \u26A0 ${$.length} section(s) produced nothing: ${$.join(", ")}`),await m(`/api/insights-jobs/${n}/state`,{result:J}).catch(t=>{e(`result persist failed: ${t instanceof Error?t.message:String(t)}`)}),await Z(o,s,e),J}f(ms,"processInsights");async function es(l,a){let{mirrorId:n,sessionId:s}=l;a(`Analyzing session ${s} via tool CLI...`),await m(`/api/insights-jobs/${n}/progress`,{status:"running",progress:{step:"fetching_session"}});let r=await h(`/api/sessions/${s}`);if(r.analysis&&r.analysis.source==="session_analysis")return a(` Session ${s} already analyzed \u2014 skipping (idempotency guard)`),{sessionId:s,skipped:!0,reason:"already_analyzed"};let u=await N(p=>Q(s,p));if(u.turnCount<2)throw new M("Session has too few conversation turns to analyze");await m(`/api/insights-jobs/${n}/progress`,{status:"running",progress:{step:"running_analysis",tool:r.tool}});let e=await W(r.tool,D,u.text);if(!e.ok)throw new Error(`Analysis failed \u2014 ${e.reason}`);return await m(`/api/sessions/${s}/enrich`,{analysis:{source:"session_analysis",tool:r.tool,...e.value,graderVersion:2},...r.eventCount!=null?{analyzedEventCount:r.eventCount}:{},analyzedTurnCount:u.turnCount}),a(` Session ${s} analyzed via ${r.tool}`),{sessionId:s,tool:r.tool,facets:e.value}}f(es,"processSessionAnalysisInline");async function ts(l,a,n=h,s=q){let{asks:r,omitted:u}=s(l);try{let e=await n(`/api/insights/recommendations/history?projectPath=${encodeURIComponent(l??"")}`);return!e||!Array.isArray(e.dismissed)||!Array.isArray(e.repeated)?j({dismissed:[],repeated:[],installed:r,installedOmitted:u}):j({...e,installed:r,installedOmitted:u})}catch(e){return a(` Warning: generator memory unavailable (${e instanceof Error?e.message:String(e)}) \u2014 generating without it`),j({dismissed:[],repeated:[],installed:r,installedOmitted:u})}}f(ts,"fetchGeneratorMemory");async function ns(l,a){try{let n=new URLSearchParams;a?n.set("projectId",a):l&&n.set("projectPath",l);let s=await h(`/api/insights/compute?${n}`);if(!s||s.total_sessions===0)return null;let r=Object.entries(s.tool_counts??{}).sort((e,p)=>p[1]-e[1]).slice(0,10).map(([e,p])=>`${e}: ${p}`).join(", ");return{summary:[`Sessions: ${s.total_sessions}, Messages: ${s.total_messages}, Session-hours: ${Math.round(s.total_duration_hours)} (sum of per-session spans across ${s.sessions_with_meta} measured sessions; concurrent sessions counted separately, so this exceeds elapsed time)`,`Top tools: ${r}`,s.goal_categories&&Object.keys(s.goal_categories).length>0?`Goals: ${JSON.stringify(s.goal_categories)}`:"",s.friction&&Object.keys(s.friction).length>0?`Friction: ${JSON.stringify(s.friction)}`:"",s.outcomes&&Object.keys(s.outcomes).length>0?`Outcomes: ${JSON.stringify(s.outcomes)}`:"",s.projects&&Object.keys(s.projects).length>0?`Projects: ${JSON.stringify(s.projects)}`:""].filter(Boolean).join(`
15
+ `),stats:{sessions:s.total_sessions,totalMessages:s.total_messages,totalSessionHours:s.total_duration_hours,measuredSessions:s.sessions_with_meta,toolCounts:s.tool_counts,goalCounts:s.goal_categories,frictionCounts:s.friction}}}catch(n){throw new G(n instanceof Error?n.message:String(n))}}f(ns,"buildDataSummaryFromApi");var G=class extends Error{static{f(this,"InsightsSummaryUnavailableError")}constructor(a){super(`Could not read session summary (retryable): ${a}`),this.name="InsightsSummaryUnavailableError"}};export{ms as a,ts as b};
@@ -1 +1 @@
1
- import{b as s,c as a}from"./chunk-5MXZJWQS.js";import{f as c}from"./chunk-UJ7EPLKC.js";import{a as u}from"./chunk-74QIUVWY.js";import{a as m}from"./chunk-ZLLER3HP.js";import{mkdtempSync as p,rmSync as d}from"node:fs";import{join as f}from"node:path";import{tmpdir as l}from"node:os";async function g(n,o,i){let r=u.parse(n),e=p(f(l(),"rulemetric-measurement-generation-"));try{let t=await c({engine:r.engine,model:r.model??void 0,systemPrompt:o,prompt:i,workDir:e,timeout:12e4});if(t.error||t.exitCode!==0||!t.output.trim())throw new Error(`Selected ${r.engine} generator failed: ${t.error??`exit ${t.exitCode}, empty output`}`);return t.output}finally{d(e,{recursive:!0,force:!0})}}m(g,"runMeasurementText");async function S(n,o,i){let r=await g(n,o,i),e=s(a(r)??r);if(!e.ok||!e.value||Array.isArray(e.value)||typeof e.value!="object")throw new Error(`Selected ${n.engine} generator returned invalid JSON`);return e.value}m(S,"runMeasurementJson");export{g as a,S as b};
1
+ import{b as s,c as a}from"./chunk-5MXZJWQS.js";import{f as c}from"./chunk-FBSZ6KCM.js";import{f as u}from"./chunk-XQYAVSUQ.js";import{a as m}from"./chunk-ZLLER3HP.js";import{mkdtempSync as p,rmSync as d}from"node:fs";import{join as f}from"node:path";import{tmpdir as l}from"node:os";async function g(n,o,i){let r=u.parse(n),e=p(f(l(),"rulemetric-measurement-generation-"));try{let t=await c({engine:r.engine,model:r.model??void 0,systemPrompt:o,prompt:i,workDir:e,timeout:12e4});if(t.error||t.exitCode!==0||!t.output.trim())throw new Error(`Selected ${r.engine} generator failed: ${t.error??`exit ${t.exitCode}, empty output`}`);return t.output}finally{d(e,{recursive:!0,force:!0})}}m(g,"runMeasurementText");async function S(n,o,i){let r=await g(n,o,i),e=s(a(r)??r);if(!e.ok||!e.value||Array.isArray(e.value)||typeof e.value!="object")throw new Error(`Selected ${n.engine} generator returned invalid JSON`);return e.value}m(S,"runMeasurementJson");export{g as a,S as b};
@@ -1 +1 @@
1
- import{a as z}from"./chunk-5RBLIVBF.js";import{a as L}from"./chunk-IOX4VJPR.js";import{b as A}from"./chunk-E7RH43OS.js";import{a as j,c as G}from"./chunk-OUK2AWEI.js";import{f as P}from"./chunk-SWSOEYC7.js";import{a as S}from"./chunk-OO2ZRKZY.js";import{a as J,f as T}from"./chunk-UJ7EPLKC.js";import{e as y,f as R,h as f}from"./chunk-ZZHIBOMT.js";import{a as E}from"./chunk-ZLLER3HP.js";async function X(s,v){let{mirrorId:l,evalTargetId:u}=s,o=s.measurement?{...s.config,...G({...s.config,measurement:s.measurement})}:s.config,a=E(e=>v.logger.info(e),"log"),i=await y(`/api/eval-targets/${u}`),b=await y(`/api/eval-targets/${u}/evals`);if(b.length===0&&o.generateIfEmpty){a("No eval cases on target \u2014 generating from content via local LLM...");let e=await A({content:i.content,name:i.name,...s.measurement?{measurement:s.measurement}:{}});if(e===null)throw new Error("Case generation requires a local LLM backend (Claude or Codex CLI) \u2014 none available on this worker.");let r=[];for(let t of e)r.push(await R(`/api/eval-targets/${u}/evals`,t));b=r,a(`Generated ${r.length} eval case(s)`)}if(b.length===0)throw new z("No evals defined for target");let F=o.runsPerEval??1,_=o.timeout??12e4,I=o.iteration??1,k=new Set;if(v.job.attempts>1)for(let r=0;;r+=100){let t=await y(`/api/eval-targets/${u}/runs?jobId=${l}&limit=100&offset=${r}`);for(let n of t)k.add(`${n.evalId}|${n.configuration}|${n.runNumber}|${n.iteration}`);if(t.length<100)break}let M=[{name:"with_target",content:i.content}];o.skipBaseline||M.push({name:"without_target"});let d=[];for(let e of b)for(let r of M)for(let t=1;t<=F;t++)k.has(`${e.id}|${r.name}|${t}|${I}`)||d.push({eval_:e,configuration:r.name,targetContent:r.content,runNumber:t});k.size>0&&a(`Resuming attempt ${v.job.attempts}: ${k.size} run(s) already persisted, ${d.length} remaining`);let g=d.length,c=0,$=J(o.engine),p=Math.min(o.parallel??1,4);await f(`/api/eval-jobs/${l}/progress`,{status:"running",progress:{total:g,completed:0,current:null,message:`Starting ${g} eval runs (concurrency: ${p})...`}});let h=[];async function x(e){let r=`${e.configuration} \xB7 ${e.eval_.name} \xB7 run#${e.runNumber}`;a(`[${c+1}/${g}] ${r}`);let t=P({targetType:i.type,targetContent:e.targetContent,targetName:i.name,engine:$});t.leakedFiles.length&&a(`\u26A0 CONTAMINATED ${r}: ${t.leakedFiles.join(", ")} survived the strip`);try{let n=await T({prompt:e.eval_.prompt,targetContent:t.systemPrompt,workDir:t.workDir,timeout:_,model:o.model,engine:$}),m={};return!o.skipGrading&&e.eval_.expectations.length>0&&!n.error&&(m=await S({...j({engine:$,model:o.model},{engine:o.graderEngine,model:o.graderModel}),prompt:e.eval_.prompt,output:n.output,expectations:e.eval_.expectations,timeout:_})),{jobId:l,evalId:e.eval_.id,evalTargetId:i.id,evalTargetVersion:i.version,configuration:e.configuration,runNumber:e.runNumber,iteration:I,status:n.error?"failed":"completed",outputs:{...n.error?{error:n.error}:{transcript:n.output,...n.model?{model:n.model}:{}},methodology:t.methodology,delivery:t.delivery,isolated:t.isWorktree,engine:n.engine??$,model:n.model??null,deliveryRegime:`${i.type}:${$}:${t.methodology}`,...s.measurement?{measurement:s.measurement}:{},...n.provider?{provider:n.provider}:{},...n.costUsd!=null?{costUsd:n.costUsd}:{},...t.leakedFiles.length?{leakedFiles:t.leakedFiles}:{}},timing:{duration_ms:n.durationMs,total_tokens:n.totalTokens},grading:m,worktree:t.isWorktree?!0:void 0}}finally{t.cleanup()}}if(E(x,"processItem"),p<=1)for(let e of d){let r=`${e.configuration} \xB7 ${e.eval_.name} \xB7 run#${e.runNumber}`;await f(`/api/eval-jobs/${l}/progress`,{status:"running",progress:{total:g,completed:c,current:r,message:`Executing ${r}...`}});let t=await x(e);await R("/api/eval-runs",t),h.push(t),c++,await f(`/api/eval-jobs/${l}/progress`,{status:"running",progress:{total:g,completed:c,current:r,message:`Completed ${r}`}})}else{a(`Running ${g} evals with concurrency=${p} (worktree isolation)`);for(let e=0;e<d.length;e+=p){let r=d.slice(e,e+p),t=`batch ${Math.floor(e/p)+1}/${Math.ceil(d.length/p)}`;await f(`/api/eval-jobs/${l}/progress`,{status:"running",progress:{total:g,completed:c,current:t,message:`Executing ${t} (${r.length} parallel)...`}});let n=await Promise.all(r.map(x));for(let m of n)await R("/api/eval-runs",m),h.push(m),c++;await f(`/api/eval-jobs/${l}/progress`,{status:"running",progress:{total:g,completed:c,current:t,message:`Completed ${t}`}})}}let N=O(h),w;if(!o.skipGrading&&h.some(e=>e.grading&&Object.keys(e.grading).length>0))try{a(`Running meta-judge for job ${l}...`);let e=b.map(r=>{let n=h.filter(m=>m.evalId===r.id&&m.configuration==="with_target")[0];return{evalName:r.name,prompt:r.prompt,expectations:r.expectations,grading:n?.grading?n.grading:null,output:n?.outputs?.transcript?.slice(0,500)}});w=await L({...j({engine:$,model:o.model},{engine:o.graderEngine,model:o.graderModel}),targetName:i.name,evalResults:e,timeout:6e4}),a(`Meta-judge: quality=${w.quality_score}/5, issues=${w.issues.length}`)}catch(e){a(`Meta-judge failed (non-fatal): ${e instanceof Error?e.message:String(e)}`)}let C=w?{...N,meta_judgement:w}:N;return a(`Job ${l} completed: ${c}/${g} runs`),await f(`/api/eval-jobs/${l}/state`,{result:C}).catch(e=>{a(`result persist failed: ${e instanceof Error?e.message:String(e)}`)}),C}E(X,"processEval");function O(s){let v=s.filter(a=>a.status==="completed"),l=s.filter(a=>a.status==="failed"),u=v.filter(a=>{let i=a.grading;return i&&Object.keys(i).length>0}),o=u.length>0?u.reduce((a,i)=>a+(i.grading?.summary?.pass_rate??0),0)/u.length:null;return{total:s.length,completed:v.length,failed:l.length,avgPassRate:o}}E(O,"buildSummary");export{X as a};
1
+ import{a as z}from"./chunk-5RBLIVBF.js";import{a as L}from"./chunk-7MTYUTUN.js";import{b as A}from"./chunk-DXNUCWUX.js";import{a as j,c as G}from"./chunk-T47SFA5X.js";import{f as P}from"./chunk-SWSOEYC7.js";import{a as S}from"./chunk-DVU5PHPM.js";import{a as J,f as T}from"./chunk-FBSZ6KCM.js";import{e as y,f as R,h as f}from"./chunk-GIXHG5FK.js";import{a as E}from"./chunk-ZLLER3HP.js";async function X(s,v){let{mirrorId:l,evalTargetId:u}=s,o=s.measurement?{...s.config,...G({...s.config,measurement:s.measurement})}:s.config,a=E(e=>v.logger.info(e),"log"),i=await y(`/api/eval-targets/${u}`),b=await y(`/api/eval-targets/${u}/evals`);if(b.length===0&&o.generateIfEmpty){a("No eval cases on target \u2014 generating from content via local LLM...");let e=await A({content:i.content,name:i.name,...s.measurement?{measurement:s.measurement}:{}});if(e===null)throw new Error("Case generation requires a local LLM backend (Claude or Codex CLI) \u2014 none available on this worker.");let r=[];for(let t of e)r.push(await R(`/api/eval-targets/${u}/evals`,t));b=r,a(`Generated ${r.length} eval case(s)`)}if(b.length===0)throw new z("No evals defined for target");let F=o.runsPerEval??1,_=o.timeout??12e4,I=o.iteration??1,k=new Set;if(v.job.attempts>1)for(let r=0;;r+=100){let t=await y(`/api/eval-targets/${u}/runs?jobId=${l}&limit=100&offset=${r}`);for(let n of t)k.add(`${n.evalId}|${n.configuration}|${n.runNumber}|${n.iteration}`);if(t.length<100)break}let M=[{name:"with_target",content:i.content}];o.skipBaseline||M.push({name:"without_target"});let d=[];for(let e of b)for(let r of M)for(let t=1;t<=F;t++)k.has(`${e.id}|${r.name}|${t}|${I}`)||d.push({eval_:e,configuration:r.name,targetContent:r.content,runNumber:t});k.size>0&&a(`Resuming attempt ${v.job.attempts}: ${k.size} run(s) already persisted, ${d.length} remaining`);let g=d.length,c=0,$=J(o.engine),p=Math.min(o.parallel??1,4);await f(`/api/eval-jobs/${l}/progress`,{status:"running",progress:{total:g,completed:0,current:null,message:`Starting ${g} eval runs (concurrency: ${p})...`}});let h=[];async function x(e){let r=`${e.configuration} \xB7 ${e.eval_.name} \xB7 run#${e.runNumber}`;a(`[${c+1}/${g}] ${r}`);let t=P({targetType:i.type,targetContent:e.targetContent,targetName:i.name,engine:$});t.leakedFiles.length&&a(`\u26A0 CONTAMINATED ${r}: ${t.leakedFiles.join(", ")} survived the strip`);try{let n=await T({prompt:e.eval_.prompt,targetContent:t.systemPrompt,workDir:t.workDir,timeout:_,model:o.model,engine:$}),m={};return!o.skipGrading&&e.eval_.expectations.length>0&&!n.error&&(m=await S({...j({engine:$,model:o.model},{engine:o.graderEngine,model:o.graderModel}),prompt:e.eval_.prompt,output:n.output,expectations:e.eval_.expectations,timeout:_})),{jobId:l,evalId:e.eval_.id,evalTargetId:i.id,evalTargetVersion:i.version,configuration:e.configuration,runNumber:e.runNumber,iteration:I,status:n.error?"failed":"completed",outputs:{...n.error?{error:n.error}:{transcript:n.output,...n.model?{model:n.model}:{}},methodology:t.methodology,delivery:t.delivery,isolated:t.isWorktree,engine:n.engine??$,model:n.model??null,deliveryRegime:`${i.type}:${$}:${t.methodology}`,...s.measurement?{measurement:s.measurement}:{},...n.provider?{provider:n.provider}:{},...n.costUsd!=null?{costUsd:n.costUsd}:{},...t.leakedFiles.length?{leakedFiles:t.leakedFiles}:{}},timing:{duration_ms:n.durationMs,total_tokens:n.totalTokens},grading:m,worktree:t.isWorktree?!0:void 0}}finally{t.cleanup()}}if(E(x,"processItem"),p<=1)for(let e of d){let r=`${e.configuration} \xB7 ${e.eval_.name} \xB7 run#${e.runNumber}`;await f(`/api/eval-jobs/${l}/progress`,{status:"running",progress:{total:g,completed:c,current:r,message:`Executing ${r}...`}});let t=await x(e);await R("/api/eval-runs",t),h.push(t),c++,await f(`/api/eval-jobs/${l}/progress`,{status:"running",progress:{total:g,completed:c,current:r,message:`Completed ${r}`}})}else{a(`Running ${g} evals with concurrency=${p} (worktree isolation)`);for(let e=0;e<d.length;e+=p){let r=d.slice(e,e+p),t=`batch ${Math.floor(e/p)+1}/${Math.ceil(d.length/p)}`;await f(`/api/eval-jobs/${l}/progress`,{status:"running",progress:{total:g,completed:c,current:t,message:`Executing ${t} (${r.length} parallel)...`}});let n=await Promise.all(r.map(x));for(let m of n)await R("/api/eval-runs",m),h.push(m),c++;await f(`/api/eval-jobs/${l}/progress`,{status:"running",progress:{total:g,completed:c,current:t,message:`Completed ${t}`}})}}let N=O(h),w;if(!o.skipGrading&&h.some(e=>e.grading&&Object.keys(e.grading).length>0))try{a(`Running meta-judge for job ${l}...`);let e=b.map(r=>{let n=h.filter(m=>m.evalId===r.id&&m.configuration==="with_target")[0];return{evalName:r.name,prompt:r.prompt,expectations:r.expectations,grading:n?.grading?n.grading:null,output:n?.outputs?.transcript?.slice(0,500)}});w=await L({...j({engine:$,model:o.model},{engine:o.graderEngine,model:o.graderModel}),targetName:i.name,evalResults:e,timeout:6e4}),a(`Meta-judge: quality=${w.quality_score}/5, issues=${w.issues.length}`)}catch(e){a(`Meta-judge failed (non-fatal): ${e instanceof Error?e.message:String(e)}`)}let C=w?{...N,meta_judgement:w}:N;return a(`Job ${l} completed: ${c}/${g} runs`),await f(`/api/eval-jobs/${l}/state`,{result:C}).catch(e=>{a(`result persist failed: ${e instanceof Error?e.message:String(e)}`)}),C}E(X,"processEval");function O(s){let v=s.filter(a=>a.status==="completed"),l=s.filter(a=>a.status==="failed"),u=v.filter(a=>{let i=a.grading;return i&&Object.keys(i).length>0}),o=u.length>0?u.reduce((a,i)=>a+(i.grading?.summary?.pass_rate??0),0)/u.length:null;return{total:s.length,completed:v.length,failed:l.length,avgPassRate:o}}E(O,"buildSummary");export{X as a};
@@ -1,2 +1,2 @@
1
- import{a as v,b as u,e as y,g as d}from"../../chunk-S5CQSP35.js";import{a as h}from"../../chunk-N4RJ6CN7.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-E5YE25QG.js";import"../../chunk-YUIRDBQQ.js";import"../../chunk-HAYO6JYI.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-ZZHIBOMT.js";import"../../chunk-TWPG3TEQ.js";import"../../chunk-74QIUVWY.js";import"../../chunk-PZNWH4VQ.js";import{a as p}from"../../chunk-ZLLER3HP.js";import{Args as k,Flags as o}from"@oclif/core";import{existsSync as T}from"node:fs";import{homedir as P}from"node:os";import{join as I}from"node:path";var A=I(P(),".gemini","antigravity-ide","brain"),g=class x extends h{static{p(this,"AntigravityBackfill")}static description="Backfill historical events from an Antigravity conversation transcript into a RuleMetric session. Useful for seeding a conversation that existed before hooks were installed \u2014 the live hook intentionally only captures forward.";static examples=["<%= config.bin %> antigravity backfill 26fd215d-f43b-4ea5-b177-dc2c0e696f97 --session 158db9aa-68ee-43fc-961b-f3a180578694","<%= config.bin %> antigravity backfill 26fd215d-f43b-4ea5-b177-dc2c0e696f97 --dry-run"];static args={conversationId:k.string({description:"Antigravity conversationId (UUID) \u2014 the directory name under ~/.gemini/antigravity-ide/brain/",required:!0})};static flags={session:o.string({char:"s",description:"RuleMetric session UUID to POST events into. If omitted, resolved from the hook tmp file ($TMPDIR/rulemetric/<conversationId>) \u2014 fails if neither is present."}),transcript:o.string({description:"Path to the transcript.jsonl file. Defaults to ~/.gemini/antigravity-ide/brain/<conversationId>/.system_generated/logs/transcript.jsonl"}),"after-step":o.integer({description:"Only emit records with step_index > this value. Default: read from existing state file, else -1 (everything)."}),limit:o.integer({description:"Cap on the number of records to process this run."}),"dry-run":o.boolean({default:!1,description:"Classify records without POSTing. Reports counts only."}),"save-state":o.boolean({default:!0,allowNo:!0,description:"After backfill, persist the highest step_index so the live hook resumes from there."})};async run(){let{args:b,flags:e}=await this.parse(x),t=b.conversationId;d.loadEnvFile(),process.env.RULEMETRIC_API_URL||this.error("RULEMETRIC_API_URL is not set. Configure it via env or ~/.config/rulemetric/env.");let l=e.transcript??I(A,t,".system_generated","logs","transcript.jsonl");T(l)||this.error(`Transcript not found: ${l}`);let m=e.session??d.resolveRwSessionId(t);m||this.error(`No RuleMetric session resolved. Pass --session <uuid>, or run the Antigravity hook at least once so $TMPDIR/rulemetric/${t} is populated.`);let n=e["after-step"];n===void 0&&(n=d.load(t)?.lastStepIdx??-1);let i=v(l,n);e.limit!==void 0&&i.length>e.limit&&(i=i.slice(0,e.limit));let R=u(l);if(this.log(`Conversation ${t}: transcript max step = ${R}, after-step = ${n}, records to process = ${i.length}`),i.length===0){this.log("Nothing to backfill.");return}if(e["dry-run"]){let r=0,a=0,c={};for(let S of i){let f=(await import("../../lib/antigravity-transcript.js")).classifyRecord(S,0);f?(r++,c[f.eventType]=(c[f.eventType]??0)+1):a++}this.log(`Dry run: would emit ${r}, skip ${a}. By eventType: ${JSON.stringify(c)}`);return}let w=Date.now(),s=await y(i,m,t,n,{onProgress:p(({attempted:r,total:a})=>{(r%100===0||r===a)&&process.stderr.write(` \u2026${r}/${a}
1
+ import{a as v,b as u,e as y,g as d}from"../../chunk-BDQTVYYF.js";import{a as h}from"../../chunk-WUCACPGC.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-WL5ZWQAS.js";import"../../chunk-KEVDLLHT.js";import"../../chunk-DX6IPDED.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-GIXHG5FK.js";import"../../chunk-X6CF5KTW.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as p}from"../../chunk-ZLLER3HP.js";import{Args as k,Flags as o}from"@oclif/core";import{existsSync as T}from"node:fs";import{homedir as P}from"node:os";import{join as I}from"node:path";var A=I(P(),".gemini","antigravity-ide","brain"),g=class x extends h{static{p(this,"AntigravityBackfill")}static description="Backfill historical events from an Antigravity conversation transcript into a RuleMetric session. Useful for seeding a conversation that existed before hooks were installed \u2014 the live hook intentionally only captures forward.";static examples=["<%= config.bin %> antigravity backfill 26fd215d-f43b-4ea5-b177-dc2c0e696f97 --session 158db9aa-68ee-43fc-961b-f3a180578694","<%= config.bin %> antigravity backfill 26fd215d-f43b-4ea5-b177-dc2c0e696f97 --dry-run"];static args={conversationId:k.string({description:"Antigravity conversationId (UUID) \u2014 the directory name under ~/.gemini/antigravity-ide/brain/",required:!0})};static flags={session:o.string({char:"s",description:"RuleMetric session UUID to POST events into. If omitted, resolved from the hook tmp file ($TMPDIR/rulemetric/<conversationId>) \u2014 fails if neither is present."}),transcript:o.string({description:"Path to the transcript.jsonl file. Defaults to ~/.gemini/antigravity-ide/brain/<conversationId>/.system_generated/logs/transcript.jsonl"}),"after-step":o.integer({description:"Only emit records with step_index > this value. Default: read from existing state file, else -1 (everything)."}),limit:o.integer({description:"Cap on the number of records to process this run."}),"dry-run":o.boolean({default:!1,description:"Classify records without POSTing. Reports counts only."}),"save-state":o.boolean({default:!0,allowNo:!0,description:"After backfill, persist the highest step_index so the live hook resumes from there."})};async run(){let{args:b,flags:e}=await this.parse(x),t=b.conversationId;d.loadEnvFile(),process.env.RULEMETRIC_API_URL||this.error("RULEMETRIC_API_URL is not set. Configure it via env or ~/.config/rulemetric/env.");let l=e.transcript??I(A,t,".system_generated","logs","transcript.jsonl");T(l)||this.error(`Transcript not found: ${l}`);let m=e.session??d.resolveRwSessionId(t);m||this.error(`No RuleMetric session resolved. Pass --session <uuid>, or run the Antigravity hook at least once so $TMPDIR/rulemetric/${t} is populated.`);let n=e["after-step"];n===void 0&&(n=d.load(t)?.lastStepIdx??-1);let i=v(l,n);e.limit!==void 0&&i.length>e.limit&&(i=i.slice(0,e.limit));let R=u(l);if(this.log(`Conversation ${t}: transcript max step = ${R}, after-step = ${n}, records to process = ${i.length}`),i.length===0){this.log("Nothing to backfill.");return}if(e["dry-run"]){let r=0,a=0,c={};for(let S of i){let f=(await import("../../lib/antigravity-transcript.js")).classifyRecord(S,0);f?(r++,c[f.eventType]=(c[f.eventType]??0)+1):a++}this.log(`Dry run: would emit ${r}, skip ${a}. By eventType: ${JSON.stringify(c)}`);return}let w=Date.now(),s=await y(i,m,t,n,{onProgress:p(({attempted:r,total:a})=>{(r%100===0||r===a)&&process.stderr.write(` \u2026${r}/${a}
2
2
  `)},"onProgress")}),$=((Date.now()-w)/1e3).toFixed(1);this.log(`Backfill complete in ${$}s. attempted=${s.attempted} emitted=${s.emitted} skipped=${s.skipped} failed=${s.failed} highestStepIdx=${s.highestStepIdx}`),e["save-state"]?(d.save(t,{lastStepIdx:s.highestStepIdx}),this.log(`State saved \u2192 live hook will resume from step_index > ${s.highestStepIdx}.`)):this.log("State NOT saved (--no-save-state). Live hook will re-emit any new records from after-step.")}};export{g as default};
@@ -1 +1 @@
1
- import{a as n}from"../../chunk-N4RJ6CN7.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-E5YE25QG.js";import"../../chunk-YUIRDBQQ.js";import"../../chunk-HAYO6JYI.js";import"../../chunk-3AV3GTMP.js";import{f as r}from"../../chunk-ZZHIBOMT.js";import"../../chunk-TWPG3TEQ.js";import"../../chunk-74QIUVWY.js";import{i as o,l as s}from"../../chunk-PZNWH4VQ.js";import{a}from"../../chunk-ZLLER3HP.js";import*as c from"node:path";import{Flags as l}from"@oclif/core";var t=class g extends n{static{a(this,"AuthCreateKey")}static description="Create a long-lived API key for CLI and proxy authentication";static examples=['<%= config.bin %> auth create-key --name "laptop"','<%= config.bin %> auth create-key --name "ci token" --no-save'];static flags={name:l.string({char:"n",description:"Name for this key",required:!0}),save:l.boolean({char:"s",description:"Save key to ~/.config/rulemetric/env for hooks/proxy",default:!0,allowNo:!0})};async run(){let{flags:i}=await this.parse(g),e=await r("/api/auth/api-keys",{name:i.name});this.log(""),this.log("API key created successfully:"),this.log(""),this.log(` Name: ${e.name}`),this.log(` Key: ${e.key}`),this.log(` Prefix: ${e.keyPrefix}`),this.log(""),this.warn("Save this key now \u2014 it will not be shown again."),i.save&&(o(e.key,process.env.RULEMETRIC_API_URL),this.log(""),this.log(`Key saved to ${c.join(s(),"env")} (RULEMETRIC_API_KEY)`),this.log("Hooks and proxy will use this key automatically."))}};export{t as default};
1
+ import{a as n}from"../../chunk-WUCACPGC.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-WL5ZWQAS.js";import"../../chunk-KEVDLLHT.js";import"../../chunk-DX6IPDED.js";import"../../chunk-3AV3GTMP.js";import{f as r}from"../../chunk-GIXHG5FK.js";import"../../chunk-X6CF5KTW.js";import"../../chunk-XQYAVSUQ.js";import{i as o,l as s}from"../../chunk-PZNWH4VQ.js";import{a}from"../../chunk-ZLLER3HP.js";import*as c from"node:path";import{Flags as l}from"@oclif/core";var t=class g extends n{static{a(this,"AuthCreateKey")}static description="Create a long-lived API key for CLI and proxy authentication";static examples=['<%= config.bin %> auth create-key --name "laptop"','<%= config.bin %> auth create-key --name "ci token" --no-save'];static flags={name:l.string({char:"n",description:"Name for this key",required:!0}),save:l.boolean({char:"s",description:"Save key to ~/.config/rulemetric/env for hooks/proxy",default:!0,allowNo:!0})};async run(){let{flags:i}=await this.parse(g),e=await r("/api/auth/api-keys",{name:i.name});this.log(""),this.log("API key created successfully:"),this.log(""),this.log(` Name: ${e.name}`),this.log(` Key: ${e.key}`),this.log(` Prefix: ${e.keyPrefix}`),this.log(""),this.warn("Save this key now \u2014 it will not be shown again."),i.save&&(o(e.key,process.env.RULEMETRIC_API_URL),this.log(""),this.log(`Key saved to ${c.join(s(),"env")} (RULEMETRIC_API_KEY)`),this.log("Hooks and proxy will use this key automatically."))}};export{t as default};
@@ -1,4 +1,4 @@
1
- import{a as f}from"../../chunk-V4PUYPTU.js";import{a as w}from"../../chunk-N4RJ6CN7.js";import"../../chunk-IZTIYR5Q.js";import{c}from"../../chunk-E5YE25QG.js";import"../../chunk-YUIRDBQQ.js";import{b as n}from"../../chunk-HAYO6JYI.js";import"../../chunk-3AV3GTMP.js";import{b as r,d as a}from"../../chunk-ZZHIBOMT.js";import"../../chunk-TWPG3TEQ.js";import"../../chunk-74QIUVWY.js";import{b as m,d,h as u,i as g}from"../../chunk-PZNWH4VQ.js";import{a as l}from"../../chunk-ZLLER3HP.js";import{Flags as p}from"@oclif/core";var h=class y extends w{static{l(this,"AuthLogin")}static description="Log in to RuleMetric";static examples=["<%= config.bin %> auth login","<%= config.bin %> auth login -e user@example.com"];static flags={email:p.string({char:"e",description:"Email address"}),password:p.string({char:"p",description:"Password (for non-interactive use)"}),"api-key":p.string({description:"Authenticate with an API key from https://rulemetric.com/connect (required for Google/GitHub sign-ins, which have no password)",exclusive:["password"]})};async run(){let{flags:s}=await this.parse(y);if(s["api-key"]){await this.loginWithApiKey(s["api-key"]);return}let e=s.email,t=s.password;if(!e||!t){process.stdin.isTTY||this.error("Missing credentials in a non-interactive shell. Pass --email/-e and --password/-p, or set RULEMETRIC_API_KEY (create a key at https://rulemetric.com/connect).");let{input:o,password:k}=await import("@inquirer/prompts");this.log("Signed up with Google or GitHub? You have no password \u2014 press Ctrl-C and run:"),this.log(" rulemetric auth login --api-key <key> (create one at https://rulemetric.com/connect)"),this.log(""),e||(e=await o({message:"Email:"})),t||(t=await k({message:"Password:"}))}let i;try{i=await a("/auth/login",{method:"POST",body:{email:e,password:t},timeoutMs:2e4})}catch(o){throw o instanceof r&&o.statusCode===401&&this.error(`Invalid email or password.
1
+ import{a as f}from"../../chunk-QPVUGTDP.js";import{a as w}from"../../chunk-WUCACPGC.js";import"../../chunk-IZTIYR5Q.js";import{c}from"../../chunk-WL5ZWQAS.js";import"../../chunk-KEVDLLHT.js";import{b as n}from"../../chunk-DX6IPDED.js";import"../../chunk-3AV3GTMP.js";import{b as r,d as a}from"../../chunk-GIXHG5FK.js";import"../../chunk-X6CF5KTW.js";import"../../chunk-XQYAVSUQ.js";import{b as m,d,h as u,i as g}from"../../chunk-PZNWH4VQ.js";import{a as l}from"../../chunk-ZLLER3HP.js";import{Flags as p}from"@oclif/core";var h=class y extends w{static{l(this,"AuthLogin")}static description="Log in to RuleMetric";static examples=["<%= config.bin %> auth login","<%= config.bin %> auth login -e user@example.com"];static flags={email:p.string({char:"e",description:"Email address"}),password:p.string({char:"p",description:"Password (for non-interactive use)"}),"api-key":p.string({description:"Authenticate with an API key from https://rulemetric.com/connect (required for Google/GitHub sign-ins, which have no password)",exclusive:["password"]})};async run(){let{flags:s}=await this.parse(y);if(s["api-key"]){await this.loginWithApiKey(s["api-key"]);return}let e=s.email,t=s.password;if(!e||!t){process.stdin.isTTY||this.error("Missing credentials in a non-interactive shell. Pass --email/-e and --password/-p, or set RULEMETRIC_API_KEY (create a key at https://rulemetric.com/connect).");let{input:o,password:k}=await import("@inquirer/prompts");this.log("Signed up with Google or GitHub? You have no password \u2014 press Ctrl-C and run:"),this.log(" rulemetric auth login --api-key <key> (create one at https://rulemetric.com/connect)"),this.log(""),e||(e=await o({message:"Email:"})),t||(t=await k({message:"Password:"}))}let i;try{i=await a("/auth/login",{method:"POST",body:{email:e,password:t},timeoutMs:2e4})}catch(o){throw o instanceof r&&o.statusCode===401&&this.error(`Invalid email or password.
2
2
 
3
3
  If you signed up with Google or GitHub, you have no password \u2014 that is why this cannot work. Create an API key at https://rulemetric.com/connect, then run:
4
4
  rulemetric auth login --api-key <key>`),o}let v=i.expiresAt??new Date(Date.now()+3600*1e3).toISOString();d({accessToken:i.accessToken,refreshToken:i.refreshToken,expiresAt:v,email:i.email}),u(i.accessToken,process.env.RULEMETRIC_API_URL),await n(),await f(this.log.bind(this),this.warn.bind(this),this.config.version),c("auth_login",{},this.config.version),this.log(`Logged in as ${i.email}`)}async loginWithApiKey(s){let e=s.trim();e||this.error("Empty --api-key. Create one at https://rulemetric.com/connect"),process.env.RULEMETRIC_API_KEY=e;try{await a("/api/setup/status",{timeoutMs:2e4})}catch(t){throw delete process.env.RULEMETRIC_API_KEY,t instanceof r&&(t.statusCode===401||t.statusCode===403)&&this.error("That API key was rejected. Check you copied it whole (it is shown only once at creation) or mint a new one at https://rulemetric.com/connect"),t}g(e,process.env.RULEMETRIC_API_URL),m(),await n(),c("auth_login",{method:"api_key"},this.config.version),this.log(`Authenticated with API key ${e.slice(0,11)}...`),this.log("Verify any time with: rulemetric auth status")}};export{h as default};
@@ -1 +1 @@
1
- import{a as s}from"../../chunk-N4RJ6CN7.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-E5YE25QG.js";import"../../chunk-YUIRDBQQ.js";import"../../chunk-HAYO6JYI.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-ZZHIBOMT.js";import"../../chunk-TWPG3TEQ.js";import"../../chunk-74QIUVWY.js";import{f as i,j as r}from"../../chunk-PZNWH4VQ.js";import{a as o}from"../../chunk-ZLLER3HP.js";var e=class t extends s{static{o(this,"AuthLogout")}static description="Log out of RuleMetric";static examples=["<%= config.bin %> auth logout"];async run(){await this.parse(t),i(),r(),this.log("Logged out successfully.")}};export{e as default};
1
+ import{a as s}from"../../chunk-WUCACPGC.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-WL5ZWQAS.js";import"../../chunk-KEVDLLHT.js";import"../../chunk-DX6IPDED.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-GIXHG5FK.js";import"../../chunk-X6CF5KTW.js";import"../../chunk-XQYAVSUQ.js";import{f as i,j as r}from"../../chunk-PZNWH4VQ.js";import{a as o}from"../../chunk-ZLLER3HP.js";var e=class t extends s{static{o(this,"AuthLogout")}static description="Log out of RuleMetric";static examples=["<%= config.bin %> auth logout"];async run(){await this.parse(t),i(),r(),this.log("Logged out successfully.")}};export{e as default};
@@ -1,4 +1,4 @@
1
- import{a as k}from"../../chunk-N4RJ6CN7.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-E5YE25QG.js";import"../../chunk-YUIRDBQQ.js";import"../../chunk-HAYO6JYI.js";import"../../chunk-3AV3GTMP.js";import{e as n,i as c}from"../../chunk-ZZHIBOMT.js";import"../../chunk-TWPG3TEQ.js";import"../../chunk-74QIUVWY.js";import"../../chunk-PZNWH4VQ.js";import{a as s}from"../../chunk-ZLLER3HP.js";import{Args as y}from"@oclif/core";var a=class m extends k{static{s(this,"AuthRevokeKey")}static description="Revoke an API key (run with no argument to list active keys)";static examples=["<%= config.bin %> auth revoke-key","<%= config.bin %> auth revoke-key rm_abc12345",'<%= config.bin %> auth revoke-key "my-laptop (auto)"'];static args={id:y.string({description:"API key ID, prefix (rm_xxxxxxxx), or name"})};async run(){let{args:o}=await this.parse(m),r=(await n("/api/auth/api-keys")).filter(e=>!e.revokedAt);if(!o.id){if(r.length===0){this.log("No active API keys.");return}this.log(`Active API keys \u2014 pass an id, prefix, or name to revoke one:
1
+ import{a as k}from"../../chunk-WUCACPGC.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-WL5ZWQAS.js";import"../../chunk-KEVDLLHT.js";import"../../chunk-DX6IPDED.js";import"../../chunk-3AV3GTMP.js";import{e as n,i as c}from"../../chunk-GIXHG5FK.js";import"../../chunk-X6CF5KTW.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as s}from"../../chunk-ZLLER3HP.js";import{Args as y}from"@oclif/core";var a=class m extends k{static{s(this,"AuthRevokeKey")}static description="Revoke an API key (run with no argument to list active keys)";static examples=["<%= config.bin %> auth revoke-key","<%= config.bin %> auth revoke-key rm_abc12345",'<%= config.bin %> auth revoke-key "my-laptop (auto)"'];static args={id:y.string({description:"API key ID, prefix (rm_xxxxxxxx), or name"})};async run(){let{args:o}=await this.parse(m),r=(await n("/api/auth/api-keys")).filter(e=>!e.revokedAt);if(!o.id){if(r.length===0){this.log("No active API keys.");return}this.log(`Active API keys \u2014 pass an id, prefix, or name to revoke one:
2
2
  `);for(let e of r)this.log(` ${e.id} ${e.keyPrefix}... ${e.name}`);return}let i=o.id,t=r.filter(e=>e.id===i||e.name===i||i.startsWith("rm_")&&i.startsWith(e.keyPrefix));t.length===0&&this.error(`No active API key matches "${i}". Run \`rulemetric auth revoke-key\` with no argument to list keys.`),t.length>1&&this.error(`"${i}" matches ${t.length} keys \u2014 use the exact key ID:
3
3
  `+t.map(e=>` ${e.id} ${e.keyPrefix}... ${e.name}`).join(`
4
4
  `)),await c(`/api/auth/api-keys/${t[0].id}`),this.log(`API key ${t[0].keyPrefix}... ("${t[0].name}") revoked.`)}};export{a as default};
@@ -1 +1 @@
1
- import{a as g}from"../../chunk-V4PUYPTU.js";import{a as h}from"../../chunk-N4RJ6CN7.js";import"../../chunk-IZTIYR5Q.js";import{c as d}from"../../chunk-E5YE25QG.js";import"../../chunk-YUIRDBQQ.js";import{b as l}from"../../chunk-HAYO6JYI.js";import"../../chunk-3AV3GTMP.js";import{b as m,d as p}from"../../chunk-ZZHIBOMT.js";import"../../chunk-TWPG3TEQ.js";import"../../chunk-74QIUVWY.js";import{d as n,h as c}from"../../chunk-PZNWH4VQ.js";import{a as o}from"../../chunk-ZLLER3HP.js";import{Flags as u}from"@oclif/core";var t=class f extends h{static{o(this,"AuthSignup")}static description="Create a RuleMetric account from the CLI";static examples=["<%= config.bin %> auth signup","<%= config.bin %> auth signup -e user@example.com"];static flags={email:u.string({char:"e",description:"Email address"}),password:u.string({char:"p",description:"Password (min 8 chars; for non-interactive use)"})};async run(){let{flags:a}=await this.parse(f),i=a.email,r=a.password;if(!i||!r){process.stdin.isTTY||this.error("Missing credentials in a non-interactive shell. Pass --email/-e and --password/-p.");let{input:s,password:v}=await import("@inquirer/prompts");i||(i=await s({message:"Email:"})),r||(r=await v({message:"Password (min 8 chars):"}))}let e;try{e=await p("/auth/signup",{method:"POST",body:{email:i,password:r},timeoutMs:2e4})}catch(s){throw s instanceof m&&s.statusCode===409&&this.error(`An account with ${i} already exists. Run: rulemetric auth login -e ${i}`),s}if(e.confirmationRequired||!e.accessToken||!e.refreshToken){this.log(`Account created for ${e.email}.`),this.log("Check your email and click the confirmation link, then run:"),this.log(` rulemetric auth login -e ${e.email}`);return}let w=e.expiresAt??new Date(Date.now()+3600*1e3).toISOString();n({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresAt:w,email:e.email}),c(e.accessToken,process.env.RULEMETRIC_API_URL),await l(),await g(this.log.bind(this),this.warn.bind(this),this.config.version),d("auth_signup",{},this.config.version),this.log(`Signed up and logged in as ${e.email}`)}};export{t as default};
1
+ import{a as g}from"../../chunk-QPVUGTDP.js";import{a as h}from"../../chunk-WUCACPGC.js";import"../../chunk-IZTIYR5Q.js";import{c as d}from"../../chunk-WL5ZWQAS.js";import"../../chunk-KEVDLLHT.js";import{b as l}from"../../chunk-DX6IPDED.js";import"../../chunk-3AV3GTMP.js";import{b as m,d as p}from"../../chunk-GIXHG5FK.js";import"../../chunk-X6CF5KTW.js";import"../../chunk-XQYAVSUQ.js";import{d as n,h as c}from"../../chunk-PZNWH4VQ.js";import{a as o}from"../../chunk-ZLLER3HP.js";import{Flags as u}from"@oclif/core";var t=class f extends h{static{o(this,"AuthSignup")}static description="Create a RuleMetric account from the CLI";static examples=["<%= config.bin %> auth signup","<%= config.bin %> auth signup -e user@example.com"];static flags={email:u.string({char:"e",description:"Email address"}),password:u.string({char:"p",description:"Password (min 8 chars; for non-interactive use)"})};async run(){let{flags:a}=await this.parse(f),i=a.email,r=a.password;if(!i||!r){process.stdin.isTTY||this.error("Missing credentials in a non-interactive shell. Pass --email/-e and --password/-p.");let{input:s,password:v}=await import("@inquirer/prompts");i||(i=await s({message:"Email:"})),r||(r=await v({message:"Password (min 8 chars):"}))}let e;try{e=await p("/auth/signup",{method:"POST",body:{email:i,password:r},timeoutMs:2e4})}catch(s){throw s instanceof m&&s.statusCode===409&&this.error(`An account with ${i} already exists. Run: rulemetric auth login -e ${i}`),s}if(e.confirmationRequired||!e.accessToken||!e.refreshToken){this.log(`Account created for ${e.email}.`),this.log("Check your email and click the confirmation link, then run:"),this.log(` rulemetric auth login -e ${e.email}`);return}let w=e.expiresAt??new Date(Date.now()+3600*1e3).toISOString();n({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresAt:w,email:e.email}),c(e.accessToken,process.env.RULEMETRIC_API_URL),await l(),await g(this.log.bind(this),this.warn.bind(this),this.config.version),d("auth_signup",{},this.config.version),this.log(`Signed up and logged in as ${e.email}`)}};export{t as default};
@@ -1 +1 @@
1
- import{a as c}from"../../chunk-W2MV25SB.js";import{a as g}from"../../chunk-N4RJ6CN7.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-E5YE25QG.js";import"../../chunk-YUIRDBQQ.js";import"../../chunk-HAYO6JYI.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-ZZHIBOMT.js";import"../../chunk-TWPG3TEQ.js";import"../../chunk-74QIUVWY.js";import{a,e as l,l as t}from"../../chunk-PZNWH4VQ.js";import{a as r}from"../../chunk-ZLLER3HP.js";import*as u from"node:path";var o=class h extends g{static{r(this,"AuthStatus")}static description="Show current authentication status";static examples=["<%= config.bin %> auth status"];async run(){await this.parse(h);let e=l(),i=process.env.RULEMETRIC_API_KEY,s=a().apiKey;if(i||s){let m=i||s,p=i?"RULEMETRIC_API_KEY env var":u.join(t(),"env");this.log(`Authenticated via API key ${m.slice(0,11)}... (${p})`),e&&this.log(`Logged in as: ${e.email}`),this.log(`Config: ${t()}`);return}if(!e){this.log("Not logged in. Run `rulemetric auth login` to authenticate.");return}let n=new Date(e.expiresAt).getTime();if(Number.isNaN(n)||Date.now()>=n){this.log("Session expired. Run `rulemetric auth login` to re-authenticate.");return}this.log(`Logged in as: ${e.email}`),this.log(`Session expires: ${c(e.expiresAt)}`),this.log(`Config: ${t()}`)}};export{o as default};
1
+ import{a as c}from"../../chunk-W2MV25SB.js";import{a as g}from"../../chunk-WUCACPGC.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-WL5ZWQAS.js";import"../../chunk-KEVDLLHT.js";import"../../chunk-DX6IPDED.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-GIXHG5FK.js";import"../../chunk-X6CF5KTW.js";import"../../chunk-XQYAVSUQ.js";import{a,e as l,l as t}from"../../chunk-PZNWH4VQ.js";import{a as r}from"../../chunk-ZLLER3HP.js";import*as u from"node:path";var o=class h extends g{static{r(this,"AuthStatus")}static description="Show current authentication status";static examples=["<%= config.bin %> auth status"];async run(){await this.parse(h);let e=l(),i=process.env.RULEMETRIC_API_KEY,s=a().apiKey;if(i||s){let m=i||s,p=i?"RULEMETRIC_API_KEY env var":u.join(t(),"env");this.log(`Authenticated via API key ${m.slice(0,11)}... (${p})`),e&&this.log(`Logged in as: ${e.email}`),this.log(`Config: ${t()}`);return}if(!e){this.log("Not logged in. Run `rulemetric auth login` to authenticate.");return}let n=new Date(e.expiresAt).getTime();if(Number.isNaN(n)||Date.now()>=n){this.log("Session expired. Run `rulemetric auth login` to re-authenticate.");return}this.log(`Logged in as: ${e.email}`),this.log(`Session expires: ${c(e.expiresAt)}`),this.log(`Config: ${t()}`)}};export{o as default};
@@ -1,2 +1,2 @@
1
- import{a as f,b as k,c as S,d as x,e as R,f as n,g as y}from"../../chunk-VALRPZXH.js";import{b as C,c as w,g as v,h as b}from"../../chunk-QI3FJKGK.js";import{a as u}from"../../chunk-N4RJ6CN7.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-E5YE25QG.js";import"../../chunk-YUIRDBQQ.js";import"../../chunk-HAYO6JYI.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-ZZHIBOMT.js";import"../../chunk-TWPG3TEQ.js";import"../../chunk-74QIUVWY.js";import{l as m}from"../../chunk-PZNWH4VQ.js";import{a as h}from"../../chunk-ZLLER3HP.js";import{existsSync as O}from"node:fs";import{Flags as c}from"@oclif/core";var g=class E extends u{static{h(this,"CaptureScope")}static description="Show or set which projects RuleMetric captures \u2014 the Codex sweep and hook-driven sessions each have their own scope";static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --add ~/work/client-a --add ~/work/client-b","<%= config.bin %> <%= command.id %> --tool hooks --add ~/work/client-a","<%= config.bin %> <%= command.id %> --tool hooks --off","<%= config.bin %> <%= command.id %> --remove ~/work/client-a","<%= config.bin %> <%= command.id %> --off","<%= config.bin %> <%= command.id %> --all"];static flags={tool:c.string({description:'Which capture path to edit: "codex" (the worker transcript sweep, the default) or "hooks" (Claude Code / Cursor / Copilot / Antigravity hook sessions).',options:["codex","hooks"],default:"codex"}),add:c.string({description:"Capture sessions under this path (repeatable). Implies an allowlist.",multiple:!0}),remove:c.string({description:"Stop capturing under this path (repeatable).",multiple:!0}),off:c.boolean({description:"Turn this capture path off entirely.",exclusive:["all"]}),all:c.boolean({description:"Capture every project (the default).",exclusive:["off"]}),clear:c.boolean({description:"Remove this scope, restoring the default."})};async run(){let{flags:o}=await this.parse(E),s=m(),d=f(s);if(!((o.add?.length??0)>0||(o.remove?.length??0)>0||o.off||o.all||o.clear)){await this.show(s,d);return}for(let t of[...o.add??[],...o.remove??[]])R(t)||this.error(`Not an absolute path: ${t}
1
+ import{a as f,b as k,c as S,d as x,e as R,f as n,g as y}from"../../chunk-VALRPZXH.js";import{b as C,c as w,g as v,h as b}from"../../chunk-QI3FJKGK.js";import{a as u}from"../../chunk-WUCACPGC.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-WL5ZWQAS.js";import"../../chunk-KEVDLLHT.js";import"../../chunk-DX6IPDED.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-GIXHG5FK.js";import"../../chunk-X6CF5KTW.js";import"../../chunk-XQYAVSUQ.js";import{l as m}from"../../chunk-PZNWH4VQ.js";import{a as h}from"../../chunk-ZLLER3HP.js";import{existsSync as O}from"node:fs";import{Flags as c}from"@oclif/core";var g=class E extends u{static{h(this,"CaptureScope")}static description="Show or set which projects RuleMetric captures \u2014 the Codex sweep and hook-driven sessions each have their own scope";static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --add ~/work/client-a --add ~/work/client-b","<%= config.bin %> <%= command.id %> --tool hooks --add ~/work/client-a","<%= config.bin %> <%= command.id %> --tool hooks --off","<%= config.bin %> <%= command.id %> --remove ~/work/client-a","<%= config.bin %> <%= command.id %> --off","<%= config.bin %> <%= command.id %> --all"];static flags={tool:c.string({description:'Which capture path to edit: "codex" (the worker transcript sweep, the default) or "hooks" (Claude Code / Cursor / Copilot / Antigravity hook sessions).',options:["codex","hooks"],default:"codex"}),add:c.string({description:"Capture sessions under this path (repeatable). Implies an allowlist.",multiple:!0}),remove:c.string({description:"Stop capturing under this path (repeatable).",multiple:!0}),off:c.boolean({description:"Turn this capture path off entirely.",exclusive:["all"]}),all:c.boolean({description:"Capture every project (the default).",exclusive:["off"]}),clear:c.boolean({description:"Remove this scope, restoring the default."})};async run(){let{flags:o}=await this.parse(E),s=m(),d=f(s);if(!((o.add?.length??0)>0||(o.remove?.length??0)>0||o.off||o.all||o.clear)){await this.show(s,d);return}for(let t of[...o.add??[],...o.remove??[]])R(t)||this.error(`Not an absolute path: ${t}
2
2
  Use an absolute path or ~/\u2026 \u2014 relative paths cannot be matched against a session's cwd.`);for(let t of o.add??[]){let a=x(t);O(a)||this.warn(`${a} does not exist yet \u2014 added anyway, but nothing will match until it does.`)}let e;try{e=k(s)}catch(t){o.clear||this.error(t instanceof Error?t.message:String(t));let a=y(s);this.warn(`${f(s)} was not valid JSON \u2014 saved it to ${a} and starting fresh.`),e={}}let i=o.tool??"codex",r=void 0,l=!1;if(o.clear&&({config:e}=n(e,{op:"clear"},r,i)),o.off&&({config:e}=n(e,{op:"mode",mode:"off"},r,i)),o.all&&({config:e}=n(e,{op:"mode",mode:"all"},r,i)),o.remove?.length){let t=n(e,{op:"remove",roots:o.remove},r,i);e=t.config,l=t.emptiedToOff}o.add?.length&&({config:e}=n(e,{op:"add",roots:o.add},r,i)),S(s,e),l&&(this.log(`Removed the last root \u2014 ${i==="hooks"?"hook":"Codex"} capture is now OFF rather than silently capturing everything.`),this.log("Use --all to go back to capturing every project.")),await this.show(s,d),this.log(""),this.log(i==="hooks"?"Takes effect on the next hook fire. No restart needed.":"Takes effect on the next sweep (within ~30s). No restart needed.")}async show(o,s){let d=await C({configDir:o}),p=await w({configDir:o}),e=h((i,r,l,t)=>{if(this.log(`${i}: ${l}`),r.roots.length)for(let a of r.roots)this.log(` \u2022 ${a}`);r.error&&(this.log(" This scope is FAILING CLOSED \u2014 nothing is being captured on this path."),this.log(` Fix the file, or run \`rulemetric capture scope ${i==="Hook capture"?"--tool hooks ":""}--clear\` to start over.`)),r.source==="env"&&this.log(` Set by environment variable, which outranks the config file (${t}).`)},"print");e("Codex capture",d,v(d),"RULEMETRIC_CODEX_CAPTURE / RULEMETRIC_CODEX_ROOTS"),e("Hook capture",p,b(p),"RULEMETRIC_HOOKS_CAPTURE / RULEMETRIC_HOOKS_ROOTS"),this.log(`Config: ${s}`)}};export{g as default};
@@ -1,2 +1,2 @@
1
- import{a as g,b as d,c as p}from"../../chunk-W2MV25SB.js";import{a as c}from"../../chunk-N4RJ6CN7.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-E5YE25QG.js";import"../../chunk-YUIRDBQQ.js";import"../../chunk-HAYO6JYI.js";import"../../chunk-3AV3GTMP.js";import{e as n}from"../../chunk-ZZHIBOMT.js";import"../../chunk-TWPG3TEQ.js";import"../../chunk-74QIUVWY.js";import"../../chunk-PZNWH4VQ.js";import{a}from"../../chunk-ZLLER3HP.js";import{Flags as i}from"@oclif/core";var o=class m extends c{static{a(this,"Catalog")}static description="Browse the org instruction catalog";static flags={badge:i.string({description:"Filter by badge",options:["recommended","required"]}),scope:i.string({description:"Filter by scope",options:["org","team"]}),search:i.string({description:"Search by name or description"})};async run(){let{flags:e}=await this.parse(m);this.requireAuth();let s=new URLSearchParams;e.badge&&s.set("badge",e.badge),e.scope&&s.set("scope",e.scope),e.search&&s.set("search",e.search);let r=await n(`/api/catalog?${s.toString()}`);if(r.length===0){this.log("No instructions found in catalog.");return}for(let t of r){let l=t.badge?` [${t.badge}]`:"",f=t.tags?.length?` (${t.tags.join(", ")})`:"";this.log(` ${d(t.name,40)} \u2014 ${p(t.scope)}${l} v${t.version}${f} ${g(t.updatedAt)}`)}this.log(`
1
+ import{a as g,b as d,c as p}from"../../chunk-W2MV25SB.js";import{a as c}from"../../chunk-WUCACPGC.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-WL5ZWQAS.js";import"../../chunk-KEVDLLHT.js";import"../../chunk-DX6IPDED.js";import"../../chunk-3AV3GTMP.js";import{e as n}from"../../chunk-GIXHG5FK.js";import"../../chunk-X6CF5KTW.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a}from"../../chunk-ZLLER3HP.js";import{Flags as i}from"@oclif/core";var o=class m extends c{static{a(this,"Catalog")}static description="Browse the org instruction catalog";static flags={badge:i.string({description:"Filter by badge",options:["recommended","required"]}),scope:i.string({description:"Filter by scope",options:["org","team"]}),search:i.string({description:"Search by name or description"})};async run(){let{flags:e}=await this.parse(m);this.requireAuth();let s=new URLSearchParams;e.badge&&s.set("badge",e.badge),e.scope&&s.set("scope",e.scope),e.search&&s.set("search",e.search);let r=await n(`/api/catalog?${s.toString()}`);if(r.length===0){this.log("No instructions found in catalog.");return}for(let t of r){let l=t.badge?` [${t.badge}]`:"",f=t.tags?.length?` (${t.tags.join(", ")})`:"";this.log(` ${d(t.name,40)} \u2014 ${p(t.scope)}${l} v${t.version}${f} ${g(t.updatedAt)}`)}this.log(`
2
2
  ${r.length} instruction(s) found.`)}};export{o as default};
@@ -1,3 +1,3 @@
1
- import{a as i}from"../../chunk-N4RJ6CN7.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-E5YE25QG.js";import"../../chunk-YUIRDBQQ.js";import"../../chunk-HAYO6JYI.js";import"../../chunk-3AV3GTMP.js";import{f as n}from"../../chunk-ZZHIBOMT.js";import"../../chunk-TWPG3TEQ.js";import"../../chunk-74QIUVWY.js";import"../../chunk-PZNWH4VQ.js";import{a as t}from"../../chunk-ZLLER3HP.js";import{Args as c}from"@oclif/core";var o=class s extends i{static{t(this,"CatalogRecommend")}static description="Get AI-powered instruction recommendations for a project";static args={projectId:c.string({description:"ID of the project",required:!0})};async run(){let{args:a}=await this.parse(s);this.requireAuth(),this.log(`Analyzing project and generating recommendations...
1
+ import{a as i}from"../../chunk-WUCACPGC.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-WL5ZWQAS.js";import"../../chunk-KEVDLLHT.js";import"../../chunk-DX6IPDED.js";import"../../chunk-3AV3GTMP.js";import{f as n}from"../../chunk-GIXHG5FK.js";import"../../chunk-X6CF5KTW.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as t}from"../../chunk-ZLLER3HP.js";import{Args as c}from"@oclif/core";var o=class s extends i{static{t(this,"CatalogRecommend")}static description="Get AI-powered instruction recommendations for a project";static args={projectId:c.string({description:"ID of the project",required:!0})};async run(){let{args:a}=await this.parse(s);this.requireAuth(),this.log(`Analyzing project and generating recommendations...
2
2
  `);let r=await n(`/api/projects/${a.projectId}/recommendations`,{});if(r.error&&this.warn(`Note: ${r.error}`),r.recommendations.length===0){this.log("No recommendations found.");return}for(let e of r.recommendations)this.log(` ${(e.score*100).toFixed(0)}% \u2014 ${e.instructionId}`),this.log(` ${e.reason}
3
3
  `)}};export{o as default};
@@ -1 +1 @@
1
- import{a as o}from"../../chunk-4VN5PG2S.js";import{a as n}from"../../chunk-N4RJ6CN7.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-E5YE25QG.js";import"../../chunk-YUIRDBQQ.js";import"../../chunk-HAYO6JYI.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-ZZHIBOMT.js";import"../../chunk-TWPG3TEQ.js";import"../../chunk-74QIUVWY.js";import"../../chunk-PZNWH4VQ.js";import{a as i}from"../../chunk-ZLLER3HP.js";import{printTable as t}from"@oclif/table";var a=class s extends n{static{i(this,"CronsList")}static description="List manually-runnable maintenance tasks";static examples=["<%= config.bin %> crons list"];async run(){await this.parse(s),t({data:o.map(e=>({Name:e.name,"Scheduled by":e.scheduledBy,Description:e.description})),columns:["Name","Scheduled by","Description"]}),this.log(""),this.log("Scheduled crons run in Supabase pg_cron \u2014 audit them with:"),this.log(` psql "$DATABASE_URL" -c 'select jobname, schedule, active from cron.job;'`),this.log("Run any task above on demand with: rulemetric crons run <name>")}};export{a as default};
1
+ import{a as o}from"../../chunk-4VN5PG2S.js";import{a as n}from"../../chunk-WUCACPGC.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-WL5ZWQAS.js";import"../../chunk-KEVDLLHT.js";import"../../chunk-DX6IPDED.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-GIXHG5FK.js";import"../../chunk-X6CF5KTW.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as i}from"../../chunk-ZLLER3HP.js";import{printTable as t}from"@oclif/table";var a=class s extends n{static{i(this,"CronsList")}static description="List manually-runnable maintenance tasks";static examples=["<%= config.bin %> crons list"];async run(){await this.parse(s),t({data:o.map(e=>({Name:e.name,"Scheduled by":e.scheduledBy,Description:e.description})),columns:["Name","Scheduled by","Description"]}),this.log(""),this.log("Scheduled crons run in Supabase pg_cron \u2014 audit them with:"),this.log(` psql "$DATABASE_URL" -c 'select jobname, schedule, active from cron.job;'`),this.log("Run any task above on demand with: rulemetric crons run <name>")}};export{a as default};
@@ -1,2 +1,2 @@
1
- import{a as $}from"../../chunk-4VN5PG2S.js";import{a as k}from"../../chunk-N4RJ6CN7.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-E5YE25QG.js";import"../../chunk-YUIRDBQQ.js";import"../../chunk-HAYO6JYI.js";import"../../chunk-3AV3GTMP.js";import{e as b}from"../../chunk-ZZHIBOMT.js";import{A as f,B as g,z as h}from"../../chunk-TWPG3TEQ.js";import{a as p}from"../../chunk-74QIUVWY.js";import"../../chunk-PZNWH4VQ.js";import{a as d}from"../../chunk-ZLLER3HP.js";import{Args as _,Flags as y}from"@oclif/core";var l=class w extends k{static{d(this,"CronsRun")}static description="Run a maintenance task synchronously, right now";static examples=["<%= config.bin %> crons run cron_check_changelog","<%= config.bin %> crons run cron_suggest_instructions --quiet"];static args={name:_.string({description:"Task name (run `rulemetric crons list` to see all)",required:!0})};static flags={"dry-run":y.boolean({description:"For Harbor, print the saved engine/model and supported tasks without running them"}),quiet:y.boolean({char:"q",description:"Suppress per-line log output; print summary only"})};async run(){let{args:s,flags:a}=await this.parse(w);this.requireAuth();let o=$.find(e=>e.name===s.name);o||this.error(`Unknown task: ${s.name}
1
+ import{a as $}from"../../chunk-4VN5PG2S.js";import{a as k}from"../../chunk-WUCACPGC.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-WL5ZWQAS.js";import"../../chunk-KEVDLLHT.js";import"../../chunk-DX6IPDED.js";import"../../chunk-3AV3GTMP.js";import{e as b}from"../../chunk-GIXHG5FK.js";import{A as f,B as g,z as h}from"../../chunk-X6CF5KTW.js";import{f as p}from"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as d}from"../../chunk-ZLLER3HP.js";import{Args as _,Flags as y}from"@oclif/core";var l=class w extends k{static{d(this,"CronsRun")}static description="Run a maintenance task synchronously, right now";static examples=["<%= config.bin %> crons run cron_check_changelog","<%= config.bin %> crons run cron_suggest_instructions --quiet"];static args={name:_.string({description:"Task name (run `rulemetric crons list` to see all)",required:!0})};static flags={"dry-run":y.boolean({description:"For Harbor, print the saved engine/model and supported tasks without running them"}),quiet:y.boolean({char:"q",description:"Suppress per-line log output; print summary only"})};async run(){let{args:s,flags:a}=await this.parse(w);this.requireAuth();let o=$.find(e=>e.name===s.name);o||this.error(`Unknown task: ${s.name}
2
2
  Run \`rulemetric crons list\` to see available tasks.`);let t=null;if(s.name==="harbor_ab"){let e=await b("/api/settings/measurement");t=e.execution.harbor?p.parse(e.execution.harbor):null;for(let r of h("proven")){let m=f(r,t);if(m){this.log(`Unsupported: ${m}`);continue}let i=g(r,"manual",t);this.log(`${r.task}: ${t?.engine??"claude"} / ${i.model}, ${i.class}, ${i.nTrials} trials per arm`)}if(a["dry-run"])return}else a["dry-run"]&&this.error("--dry-run is currently supported only for harbor_ab");let u;try{({runManualTask:u}=await import("../../lib/manual-tasks.js"))}catch(e){let r=e?.code;throw(r==="ERR_MODULE_NOT_FOUND"||r==="MODULE_NOT_FOUND")&&this.error("`crons run` needs the worker runtime, which isn't available in this install.\nReinstall the CLI and verify that its runtime dependencies are present. A database credential is not required for end-user maintenance tasks."),e}this.log(`\u25B6 Running ${o.name} \u2026`);let v=Date.now(),n=await u(s.name,{measurement:t});if(!a.quiet)for(let e of n.logs){let r=e.level==="error"||e.level==="warn"?`[${e.level}]`:"";this.log(` ${r} ${e.message}`)}let c=((n.durationMs??Date.now()-v)/1e3).toFixed(1);n.ok?this.log(`\u2713 ${o.name} completed in ${c}s (${n.logs.length} log line${n.logs.length===1?"":"s"})`):this.error(`\u2717 ${o.name} failed after ${c}s: ${n.error}`)}};export{l as default};
@@ -1 +1 @@
1
- import{a as o}from"../chunk-N4RJ6CN7.js";import"../chunk-IZTIYR5Q.js";import"../chunk-E5YE25QG.js";import"../chunk-YUIRDBQQ.js";import"../chunk-HAYO6JYI.js";import"../chunk-3AV3GTMP.js";import"../chunk-ZZHIBOMT.js";import"../chunk-TWPG3TEQ.js";import"../chunk-74QIUVWY.js";import"../chunk-PZNWH4VQ.js";import{a as i}from"../chunk-ZLLER3HP.js";import{Flags as r}from"@oclif/core";var a=class s extends o{static{i(this,"Dashboard")}static description="Interactive TUI dashboard showing session analytics, outcomes, friction, and insights";static examples=["<%= config.bin %> dashboard","<%= config.bin %> dashboard --period 30days","<%= config.bin %> dashboard --launcher"];static flags={period:r.string({char:"p",default:"week",options:["today","week","30days","month","all"],description:"Initial time period"}),launcher:r.boolean({char:"l",default:!1,description:"Open the launcher overlay immediately"})};async run(){let{flags:e}=await this.parse(s),{renderDashboard:t}=await import("../dashboard/Dashboard.js");await t(e.period,{openLauncher:e.launcher})}};export{a as default};
1
+ import{a as o}from"../chunk-WUCACPGC.js";import"../chunk-IZTIYR5Q.js";import"../chunk-WL5ZWQAS.js";import"../chunk-KEVDLLHT.js";import"../chunk-DX6IPDED.js";import"../chunk-3AV3GTMP.js";import"../chunk-GIXHG5FK.js";import"../chunk-X6CF5KTW.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import{a as i}from"../chunk-ZLLER3HP.js";import{Flags as r}from"@oclif/core";var a=class s extends o{static{i(this,"Dashboard")}static description="Interactive TUI dashboard showing session analytics, outcomes, friction, and insights";static examples=["<%= config.bin %> dashboard","<%= config.bin %> dashboard --period 30days","<%= config.bin %> dashboard --launcher"];static flags={period:r.string({char:"p",default:"week",options:["today","week","30days","month","all"],description:"Initial time period"}),launcher:r.boolean({char:"l",default:!1,description:"Open the launcher overlay immediately"})};async run(){let{flags:e}=await this.parse(s),{renderDashboard:t}=await import("../dashboard/Dashboard.js");await t(e.period,{openLauncher:e.launcher})}};export{a as default};