@lannguyensi/harness 0.63.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (702) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/README.md +46 -42
  3. package/dist/cli/add/index.js +17 -21
  4. package/dist/cli/add/index.js.map +1 -1
  5. package/dist/cli/adopt/derive.d.ts +2 -2
  6. package/dist/cli/adopt/derive.js +2 -19
  7. package/dist/cli/adopt/derive.js.map +1 -1
  8. package/dist/cli/adopt/index.d.ts +1 -1
  9. package/dist/cli/adopt/index.js +1 -12
  10. package/dist/cli/adopt/index.js.map +1 -1
  11. package/dist/cli/apply/apply.d.ts +20 -35
  12. package/dist/cli/apply/apply.js +61 -136
  13. package/dist/cli/apply/apply.js.map +1 -1
  14. package/dist/cli/apply/generate-codex-config.js +10 -58
  15. package/dist/cli/apply/generate-codex-config.js.map +1 -1
  16. package/dist/cli/apply/generate-memory-index.js +1 -2
  17. package/dist/cli/apply/generate-memory-index.js.map +1 -1
  18. package/dist/cli/apply/generate-opencode-config.d.ts +2 -10
  19. package/dist/cli/apply/generate-opencode-config.js +74 -113
  20. package/dist/cli/apply/generate-opencode-config.js.map +1 -1
  21. package/dist/cli/apply/generate-settings.d.ts +11 -64
  22. package/dist/cli/apply/generate-settings.js +27 -132
  23. package/dist/cli/apply/generate-settings.js.map +1 -1
  24. package/dist/cli/apply/index.d.ts +1 -1
  25. package/dist/cli/apply/index.js +1 -1
  26. package/dist/cli/apply/index.js.map +1 -1
  27. package/dist/cli/apply/install-codex-config.d.ts +153 -1
  28. package/dist/cli/apply/install-codex-config.js +445 -70
  29. package/dist/cli/apply/install-codex-config.js.map +1 -1
  30. package/dist/cli/apply/next-steps.d.ts +7 -0
  31. package/dist/cli/apply/next-steps.js +13 -1
  32. package/dist/cli/apply/next-steps.js.map +1 -1
  33. package/dist/cli/bounded-stdin.d.ts +0 -23
  34. package/dist/cli/bounded-stdin.js +2 -49
  35. package/dist/cli/bounded-stdin.js.map +1 -1
  36. package/dist/cli/describe.d.ts +1 -1
  37. package/dist/cli/describe.js +0 -3
  38. package/dist/cli/describe.js.map +1 -1
  39. package/dist/cli/diff/engine.d.ts +0 -11
  40. package/dist/cli/diff/engine.js +1 -17
  41. package/dist/cli/diff/engine.js.map +1 -1
  42. package/dist/cli/diff/index.js +14 -25
  43. package/dist/cli/diff/index.js.map +1 -1
  44. package/dist/cli/doctor/claude-mcp.d.ts +4 -19
  45. package/dist/cli/doctor/claude-mcp.js +11 -22
  46. package/dist/cli/doctor/claude-mcp.js.map +1 -1
  47. package/dist/cli/doctor/codex.d.ts +12 -14
  48. package/dist/cli/doctor/codex.js +31 -144
  49. package/dist/cli/doctor/codex.js.map +1 -1
  50. package/dist/cli/doctor/format.js +23 -338
  51. package/dist/cli/doctor/format.js.map +1 -1
  52. package/dist/cli/doctor/hook-liveness.d.ts +56 -0
  53. package/dist/cli/doctor/hook-liveness.js +455 -0
  54. package/dist/cli/doctor/hook-liveness.js.map +1 -0
  55. package/dist/cli/doctor/index.d.ts +13 -87
  56. package/dist/cli/doctor/index.js +57 -705
  57. package/dist/cli/doctor/index.js.map +1 -1
  58. package/dist/cli/doctor/opencode.d.ts +2 -1
  59. package/dist/cli/doctor/opencode.js.map +1 -1
  60. package/dist/cli/doctor/types.d.ts +21 -378
  61. package/dist/cli/doctor/types.js.map +1 -1
  62. package/dist/cli/drain-stdio.d.ts +31 -0
  63. package/dist/cli/drain-stdio.js +76 -0
  64. package/dist/cli/drain-stdio.js.map +1 -0
  65. package/dist/cli/export.d.ts +3 -1
  66. package/dist/cli/export.js +7 -16
  67. package/dist/cli/export.js.map +1 -1
  68. package/dist/cli/gate/codex-disable.d.ts +29 -0
  69. package/dist/cli/gate/codex-disable.js +195 -0
  70. package/dist/cli/gate/codex-disable.js.map +1 -0
  71. package/dist/cli/gate/codex-enable.d.ts +41 -0
  72. package/dist/cli/gate/codex-enable.js +127 -0
  73. package/dist/cli/gate/codex-enable.js.map +1 -0
  74. package/dist/cli/gate/codex-snapshot.d.ts +208 -0
  75. package/dist/cli/gate/codex-snapshot.js +402 -0
  76. package/dist/cli/gate/codex-snapshot.js.map +1 -0
  77. package/dist/cli/gate/disable.d.ts +9 -0
  78. package/dist/cli/gate/disable.js +263 -28
  79. package/dist/cli/gate/disable.js.map +1 -1
  80. package/dist/cli/gate/enable.d.ts +26 -6
  81. package/dist/cli/gate/enable.js +152 -80
  82. package/dist/cli/gate/enable.js.map +1 -1
  83. package/dist/cli/gate/link-chain.d.ts +53 -0
  84. package/dist/cli/gate/link-chain.js +122 -0
  85. package/dist/cli/gate/link-chain.js.map +1 -0
  86. package/dist/cli/gate/snapshot.d.ts +289 -12
  87. package/dist/cli/gate/snapshot.js +481 -22
  88. package/dist/cli/gate/snapshot.js.map +1 -1
  89. package/dist/cli/index.d.ts +0 -9
  90. package/dist/cli/index.js +15 -2607
  91. package/dist/cli/index.js.map +1 -1
  92. package/dist/cli/init/composer.d.ts +3 -6
  93. package/dist/cli/init/composer.js +6 -370
  94. package/dist/cli/init/composer.js.map +1 -1
  95. package/dist/cli/init/dependencies.d.ts +1 -2
  96. package/dist/cli/init/dependencies.js +4 -80
  97. package/dist/cli/init/dependencies.js.map +1 -1
  98. package/dist/cli/init/detect.js +5 -4
  99. package/dist/cli/init/detect.js.map +1 -1
  100. package/dist/cli/init/interactive.d.ts +1 -23
  101. package/dist/cli/init/interactive.js +33 -247
  102. package/dist/cli/init/interactive.js.map +1 -1
  103. package/dist/cli/init/profiles.d.ts +2 -2
  104. package/dist/cli/init/profiles.js +51 -243
  105. package/dist/cli/init/profiles.js.map +1 -1
  106. package/dist/cli/init/templates.d.ts +2 -37
  107. package/dist/cli/init/templates.js +25 -1237
  108. package/dist/cli/init/templates.js.map +1 -1
  109. package/dist/cli/list.d.ts +1 -1
  110. package/dist/cli/list.js +1 -38
  111. package/dist/cli/list.js.map +1 -1
  112. package/dist/cli/loader.d.ts +15 -1
  113. package/dist/cli/loader.js +56 -39
  114. package/dist/cli/loader.js.map +1 -1
  115. package/dist/cli/main.js +7 -2
  116. package/dist/cli/main.js.map +1 -1
  117. package/dist/cli/migrate-home/index.js +2 -2
  118. package/dist/cli/migrate-home/index.js.map +1 -1
  119. package/dist/cli/pack/add.js +1 -1
  120. package/dist/cli/pack/add.js.map +1 -1
  121. package/dist/cli/pack/hook-bootstrap.d.ts +5 -164
  122. package/dist/cli/pack/hook-bootstrap.js +15 -291
  123. package/dist/cli/pack/hook-bootstrap.js.map +1 -1
  124. package/dist/cli/pack/hook-branch-protection.d.ts +28 -21
  125. package/dist/cli/pack/hook-branch-protection.js +365 -340
  126. package/dist/cli/pack/hook-branch-protection.js.map +1 -1
  127. package/dist/cli/pack/index.d.ts +0 -1
  128. package/dist/cli/pack/index.js +0 -1
  129. package/dist/cli/pack/index.js.map +1 -1
  130. package/dist/cli/pack/list.js +1 -6
  131. package/dist/cli/pack/list.js.map +1 -1
  132. package/dist/cli/pack/mutate.d.ts +7 -9
  133. package/dist/cli/pack/mutate.js +6 -9
  134. package/dist/cli/pack/mutate.js.map +1 -1
  135. package/dist/cli/pack/reseed.d.ts +2 -2
  136. package/dist/cli/pack/reseed.js +16 -22
  137. package/dist/cli/pack/reseed.js.map +1 -1
  138. package/dist/cli/register-gate-group.d.ts +5 -0
  139. package/dist/cli/register-gate-group.js +348 -0
  140. package/dist/cli/register-gate-group.js.map +1 -0
  141. package/dist/cli/register-inspect-group.d.ts +6 -0
  142. package/dist/cli/register-inspect-group.js +189 -0
  143. package/dist/cli/register-inspect-group.js.map +1 -0
  144. package/dist/cli/register-operator-lifecycle.d.ts +5 -0
  145. package/dist/cli/register-operator-lifecycle.js +20 -0
  146. package/dist/cli/register-operator-lifecycle.js.map +1 -0
  147. package/dist/cli/register-pack-group.d.ts +5 -0
  148. package/dist/cli/register-pack-group.js +134 -0
  149. package/dist/cli/register-pack-group.js.map +1 -0
  150. package/dist/cli/register-setup-group.d.ts +5 -0
  151. package/dist/cli/register-setup-group.js +495 -0
  152. package/dist/cli/register-setup-group.js.map +1 -0
  153. package/dist/cli/remove/index.d.ts +0 -14
  154. package/dist/cli/remove/index.js +2 -115
  155. package/dist/cli/remove/index.js.map +1 -1
  156. package/dist/cli/remove/mutate.d.ts +0 -2
  157. package/dist/cli/remove/mutate.js +1 -19
  158. package/dist/cli/remove/mutate.js.map +1 -1
  159. package/dist/cli/remove/register.d.ts +5 -0
  160. package/dist/cli/remove/register.js +25 -0
  161. package/dist/cli/remove/register.js.map +1 -0
  162. package/dist/cli/shell-quote.d.ts +7 -0
  163. package/dist/cli/shell-quote.js +17 -0
  164. package/dist/cli/shell-quote.js.map +1 -0
  165. package/dist/cli/uninstall/index.d.ts +4 -2
  166. package/dist/cli/uninstall/index.js +15 -7
  167. package/dist/cli/uninstall/index.js.map +1 -1
  168. package/dist/cli/uninstall/register.d.ts +5 -0
  169. package/dist/cli/uninstall/register.js +171 -0
  170. package/dist/cli/uninstall/register.js.map +1 -0
  171. package/dist/cli/uninstall/snapshot.d.ts +15 -0
  172. package/dist/cli/uninstall/snapshot.js +38 -0
  173. package/dist/cli/uninstall/snapshot.js.map +1 -1
  174. package/dist/cli/validate/checks.d.ts +0 -77
  175. package/dist/cli/validate/checks.js +3 -1049
  176. package/dist/cli/validate/checks.js.map +1 -1
  177. package/dist/cli/validate/index.js +19 -15
  178. package/dist/cli/validate/index.js.map +1 -1
  179. package/dist/index.d.ts +0 -3
  180. package/dist/index.js +0 -3
  181. package/dist/index.js.map +1 -1
  182. package/dist/io/claude-mcp.d.ts +1 -1
  183. package/dist/io/claude-mcp.js +27 -14
  184. package/dist/io/claude-mcp.js.map +1 -1
  185. package/dist/io/harness-lock.js +2 -2
  186. package/dist/io/harness-lock.js.map +1 -1
  187. package/dist/io/lock.d.ts +0 -26
  188. package/dist/io/lock.js +10 -27
  189. package/dist/io/lock.js.map +1 -1
  190. package/dist/io/merge-settings.js +6 -4
  191. package/dist/io/merge-settings.js.map +1 -1
  192. package/dist/io/project-name.d.ts +22 -39
  193. package/dist/io/project-name.js +25 -42
  194. package/dist/io/project-name.js.map +1 -1
  195. package/dist/io/read-regular-file.d.ts +103 -40
  196. package/dist/io/read-regular-file.js +196 -35
  197. package/dist/io/read-regular-file.js.map +1 -1
  198. package/dist/io/restart-hints.js +3 -6
  199. package/dist/io/restart-hints.js.map +1 -1
  200. package/dist/io/version-compare.d.ts +1 -3
  201. package/dist/io/version-compare.js +1 -3
  202. package/dist/io/version-compare.js.map +1 -1
  203. package/dist/io/write-regular-file.d.ts +30 -0
  204. package/dist/io/write-regular-file.js +85 -0
  205. package/dist/io/write-regular-file.js.map +1 -0
  206. package/dist/overrides/index.d.ts +1 -0
  207. package/dist/overrides/index.js +1 -0
  208. package/dist/overrides/index.js.map +1 -1
  209. package/dist/overrides/merge-layers.d.ts +43 -0
  210. package/dist/overrides/merge-layers.js +76 -0
  211. package/dist/overrides/merge-layers.js.map +1 -0
  212. package/dist/overrides/merge.d.ts +16 -0
  213. package/dist/overrides/merge.js +21 -8
  214. package/dist/overrides/merge.js.map +1 -1
  215. package/dist/policy-packs/builtin/branch-protection-runtime.d.ts +4 -69
  216. package/dist/policy-packs/builtin/branch-protection-runtime.js +12 -84
  217. package/dist/policy-packs/builtin/branch-protection-runtime.js.map +1 -1
  218. package/dist/policy-packs/builtin/branch-protection.d.ts +7 -30
  219. package/dist/policy-packs/builtin/branch-protection.js +56 -89
  220. package/dist/policy-packs/builtin/branch-protection.js.map +1 -1
  221. package/dist/policy-packs/config-check.d.ts +7 -5
  222. package/dist/policy-packs/config-check.js +2 -2
  223. package/dist/policy-packs/config-check.js.map +1 -1
  224. package/dist/policy-packs/expand.d.ts +1 -3
  225. package/dist/policy-packs/expand.js +5 -42
  226. package/dist/policy-packs/expand.js.map +1 -1
  227. package/dist/policy-packs/index.d.ts +3 -3
  228. package/dist/policy-packs/index.js +2 -2
  229. package/dist/policy-packs/index.js.map +1 -1
  230. package/dist/policy-packs/registry.d.ts +9 -38
  231. package/dist/policy-packs/registry.js +5 -65
  232. package/dist/policy-packs/registry.js.map +1 -1
  233. package/dist/policy-packs/runtime.d.ts +0 -4
  234. package/dist/policy-packs/runtime.js +9 -22
  235. package/dist/policy-packs/runtime.js.map +1 -1
  236. package/dist/policy-packs/types.d.ts +0 -19
  237. package/dist/policy-packs/ux-compare.d.ts +1 -11
  238. package/dist/policy-packs/ux-compare.js +6 -42
  239. package/dist/policy-packs/ux-compare.js.map +1 -1
  240. package/dist/policy-packs/ux-drift-check.d.ts +5 -5
  241. package/dist/policy-packs/ux-drift-check.js +17 -22
  242. package/dist/policy-packs/ux-drift-check.js.map +1 -1
  243. package/dist/policy-packs/version-check.d.ts +5 -26
  244. package/dist/policy-packs/version-check.js +19 -74
  245. package/dist/policy-packs/version-check.js.map +1 -1
  246. package/dist/probes/memory.d.ts +1 -1
  247. package/dist/probes/memory.js +1 -1
  248. package/dist/probes/memory.js.map +1 -1
  249. package/dist/runtime/agent-facing.d.ts +9 -0
  250. package/dist/runtime/agent-facing.js +28 -14
  251. package/dist/runtime/agent-facing.js.map +1 -1
  252. package/dist/runtime/bounded-text.d.ts +15 -0
  253. package/dist/runtime/bounded-text.js +27 -0
  254. package/dist/runtime/bounded-text.js.map +1 -0
  255. package/dist/runtime/git-branch.d.ts +125 -0
  256. package/dist/runtime/git-branch.js +381 -0
  257. package/dist/runtime/git-branch.js.map +1 -0
  258. package/dist/runtime/hermetic-spawn-guard.d.ts +2 -2
  259. package/dist/runtime/hermetic-spawn-guard.js +24 -34
  260. package/dist/runtime/hermetic-spawn-guard.js.map +1 -1
  261. package/dist/runtime/home-dir.js +3 -2
  262. package/dist/runtime/home-dir.js.map +1 -1
  263. package/dist/runtime/tool-name-aliases.d.ts +0 -6
  264. package/dist/runtime/tool-name-aliases.js +5 -18
  265. package/dist/runtime/tool-name-aliases.js.map +1 -1
  266. package/dist/schema/grounding.d.ts +7 -54
  267. package/dist/schema/grounding.js +10 -12
  268. package/dist/schema/grounding.js.map +1 -1
  269. package/dist/schema/hooks.d.ts +39 -136
  270. package/dist/schema/hooks.js +3 -6
  271. package/dist/schema/hooks.js.map +1 -1
  272. package/dist/schema/index.d.ts +114 -3828
  273. package/dist/schema/index.js +41 -80
  274. package/dist/schema/index.js.map +1 -1
  275. package/dist/schema/memory.d.ts +54 -131
  276. package/dist/schema/memory.js +2 -2
  277. package/dist/schema/memory.js.map +1 -1
  278. package/dist/schema/policy-packs.d.ts +3 -45
  279. package/dist/schema/policy-packs.js +7 -13
  280. package/dist/schema/policy-packs.js.map +1 -1
  281. package/dist/schema/policy-ux.d.ts +7 -0
  282. package/dist/schema/policy-ux.js +18 -0
  283. package/dist/schema/policy-ux.js.map +1 -0
  284. package/dist/schema/removed-keys.d.ts +185 -0
  285. package/dist/schema/removed-keys.js +531 -0
  286. package/dist/schema/removed-keys.js.map +1 -0
  287. package/dist/schema/tools.d.ts +30 -268
  288. package/dist/schema/tools.js +4 -4
  289. package/dist/schema/tools.js.map +1 -1
  290. package/package.json +5 -16
  291. package/dist/cli/approve/branch-protection.d.ts +0 -69
  292. package/dist/cli/approve/branch-protection.js +0 -144
  293. package/dist/cli/approve/branch-protection.js.map +0 -1
  294. package/dist/cli/approve/risk.d.ts +0 -112
  295. package/dist/cli/approve/risk.js +0 -197
  296. package/dist/cli/approve/risk.js.map +0 -1
  297. package/dist/cli/approve/stdin-report.d.ts +0 -57
  298. package/dist/cli/approve/stdin-report.js +0 -145
  299. package/dist/cli/approve/stdin-report.js.map +0 -1
  300. package/dist/cli/approve/understanding.d.ts +0 -410
  301. package/dist/cli/approve/understanding.js +0 -996
  302. package/dist/cli/approve/understanding.js.map +0 -1
  303. package/dist/cli/audit.d.ts +0 -80
  304. package/dist/cli/audit.js +0 -252
  305. package/dist/cli/audit.js.map +0 -1
  306. package/dist/cli/delegate/index.d.ts +0 -76
  307. package/dist/cli/delegate/index.js +0 -443
  308. package/dist/cli/delegate/index.js.map +0 -1
  309. package/dist/cli/doctor/auto-approve-mode.d.ts +0 -37
  310. package/dist/cli/doctor/auto-approve-mode.js +0 -80
  311. package/dist/cli/doctor/auto-approve-mode.js.map +0 -1
  312. package/dist/cli/doctor/bypass-without-auto-approve.d.ts +0 -38
  313. package/dist/cli/doctor/bypass-without-auto-approve.js +0 -95
  314. package/dist/cli/doctor/bypass-without-auto-approve.js.map +0 -1
  315. package/dist/cli/doctor/codex-config-drift.d.ts +0 -28
  316. package/dist/cli/doctor/codex-config-drift.js +0 -240
  317. package/dist/cli/doctor/codex-config-drift.js.map +0 -1
  318. package/dist/cli/doctor/rogue-ledger.d.ts +0 -53
  319. package/dist/cli/doctor/rogue-ledger.js +0 -153
  320. package/dist/cli/doctor/rogue-ledger.js.map +0 -1
  321. package/dist/cli/doctor/session-start-preflight-setup-version.d.ts +0 -83
  322. package/dist/cli/doctor/session-start-preflight-setup-version.js +0 -114
  323. package/dist/cli/doctor/session-start-preflight-setup-version.js.map +0 -1
  324. package/dist/cli/doctor/settings-drift.d.ts +0 -25
  325. package/dist/cli/doctor/settings-drift.js +0 -213
  326. package/dist/cli/doctor/settings-drift.js.map +0 -1
  327. package/dist/cli/doctor/toolchain-parity.d.ts +0 -63
  328. package/dist/cli/doctor/toolchain-parity.js +0 -154
  329. package/dist/cli/doctor/toolchain-parity.js.map +0 -1
  330. package/dist/cli/doctor/ug-auto-approvals.d.ts +0 -40
  331. package/dist/cli/doctor/ug-auto-approvals.js +0 -91
  332. package/dist/cli/doctor/ug-auto-approvals.js.map +0 -1
  333. package/dist/cli/doctor/ug-delegations.d.ts +0 -26
  334. package/dist/cli/doctor/ug-delegations.js +0 -121
  335. package/dist/cli/doctor/ug-delegations.js.map +0 -1
  336. package/dist/cli/doctor/ug-inflight.d.ts +0 -35
  337. package/dist/cli/doctor/ug-inflight.js +0 -57
  338. package/dist/cli/doctor/ug-inflight.js.map +0 -1
  339. package/dist/cli/doctor/understanding-mode-env.d.ts +0 -51
  340. package/dist/cli/doctor/understanding-mode-env.js +0 -98
  341. package/dist/cli/doctor/understanding-mode-env.js.map +0 -1
  342. package/dist/cli/dry-run.d.ts +0 -46
  343. package/dist/cli/dry-run.js +0 -250
  344. package/dist/cli/dry-run.js.map +0 -1
  345. package/dist/cli/event-input.d.ts +0 -28
  346. package/dist/cli/event-input.js +0 -73
  347. package/dist/cli/event-input.js.map +0 -1
  348. package/dist/cli/explain-action.d.ts +0 -20
  349. package/dist/cli/explain-action.js +0 -27
  350. package/dist/cli/explain-action.js.map +0 -1
  351. package/dist/cli/explain-policy.d.ts +0 -135
  352. package/dist/cli/explain-policy.js +0 -266
  353. package/dist/cli/explain-policy.js.map +0 -1
  354. package/dist/cli/explain.d.ts +0 -31
  355. package/dist/cli/explain.js +0 -159
  356. package/dist/cli/explain.js.map +0 -1
  357. package/dist/cli/gc/index.d.ts +0 -63
  358. package/dist/cli/gc/index.js +0 -566
  359. package/dist/cli/gc/index.js.map +0 -1
  360. package/dist/cli/pack/approve-escape.d.ts +0 -19
  361. package/dist/cli/pack/approve-escape.js +0 -190
  362. package/dist/cli/pack/approve-escape.js.map +0 -1
  363. package/dist/cli/pack/auto-approve-path.d.ts +0 -146
  364. package/dist/cli/pack/auto-approve-path.js +0 -462
  365. package/dist/cli/pack/auto-approve-path.js.map +0 -1
  366. package/dist/cli/pack/hook-codex-post-tool-use.d.ts +0 -25
  367. package/dist/cli/pack/hook-codex-post-tool-use.js +0 -160
  368. package/dist/cli/pack/hook-codex-post-tool-use.js.map +0 -1
  369. package/dist/cli/pack/hook-codex-pre-tool-use.d.ts +0 -48
  370. package/dist/cli/pack/hook-codex-pre-tool-use.js +0 -474
  371. package/dist/cli/pack/hook-codex-pre-tool-use.js.map +0 -1
  372. package/dist/cli/pack/hook-codex-stop.d.ts +0 -35
  373. package/dist/cli/pack/hook-codex-stop.js +0 -329
  374. package/dist/cli/pack/hook-codex-stop.js.map +0 -1
  375. package/dist/cli/pack/hook-codex-user-prompt-submit.d.ts +0 -24
  376. package/dist/cli/pack/hook-codex-user-prompt-submit.js +0 -93
  377. package/dist/cli/pack/hook-codex-user-prompt-submit.js.map +0 -1
  378. package/dist/cli/pack/hook-post-merge-gate-record.d.ts +0 -37
  379. package/dist/cli/pack/hook-post-merge-gate-record.js +0 -190
  380. package/dist/cli/pack/hook-post-merge-gate-record.js.map +0 -1
  381. package/dist/cli/pack/hook-post-merge-gate.d.ts +0 -34
  382. package/dist/cli/pack/hook-post-merge-gate.js +0 -277
  383. package/dist/cli/pack/hook-post-merge-gate.js.map +0 -1
  384. package/dist/cli/pack/hook-post-tool-use.d.ts +0 -45
  385. package/dist/cli/pack/hook-post-tool-use.js +0 -137
  386. package/dist/cli/pack/hook-post-tool-use.js.map +0 -1
  387. package/dist/cli/pack/hook-pre-tool-use.d.ts +0 -92
  388. package/dist/cli/pack/hook-pre-tool-use.js +0 -1328
  389. package/dist/cli/pack/hook-pre-tool-use.js.map +0 -1
  390. package/dist/cli/pack/hook-runtime-reality.d.ts +0 -63
  391. package/dist/cli/pack/hook-runtime-reality.js +0 -210
  392. package/dist/cli/pack/hook-runtime-reality.js.map +0 -1
  393. package/dist/cli/pack/hook-solution-acceptance-writeguard.d.ts +0 -32
  394. package/dist/cli/pack/hook-solution-acceptance-writeguard.js +0 -337
  395. package/dist/cli/pack/hook-solution-acceptance-writeguard.js.map +0 -1
  396. package/dist/cli/pack/hook-solution-acceptance.d.ts +0 -157
  397. package/dist/cli/pack/hook-solution-acceptance.js +0 -530
  398. package/dist/cli/pack/hook-solution-acceptance.js.map +0 -1
  399. package/dist/cli/pack/hook-stay-in-scope.d.ts +0 -37
  400. package/dist/cli/pack/hook-stay-in-scope.js +0 -128
  401. package/dist/cli/pack/hook-stay-in-scope.js.map +0 -1
  402. package/dist/cli/pack/hook-subagent-start.d.ts +0 -23
  403. package/dist/cli/pack/hook-subagent-start.js +0 -88
  404. package/dist/cli/pack/hook-subagent-start.js.map +0 -1
  405. package/dist/cli/pack/hook-subagent-stop.d.ts +0 -19
  406. package/dist/cli/pack/hook-subagent-stop.js +0 -41
  407. package/dist/cli/pack/hook-subagent-stop.js.map +0 -1
  408. package/dist/cli/pack/hook-track-active-claim.d.ts +0 -27
  409. package/dist/cli/pack/hook-track-active-claim.js +0 -275
  410. package/dist/cli/pack/hook-track-active-claim.js.map +0 -1
  411. package/dist/cli/pack/transcript-report-scan.d.ts +0 -71
  412. package/dist/cli/pack/transcript-report-scan.js +0 -359
  413. package/dist/cli/pack/transcript-report-scan.js.map +0 -1
  414. package/dist/cli/pack/understanding-report-schema-hint.d.ts +0 -26
  415. package/dist/cli/pack/understanding-report-schema-hint.js +0 -120
  416. package/dist/cli/pack/understanding-report-schema-hint.js.map +0 -1
  417. package/dist/cli/pack/upgrade.d.ts +0 -32
  418. package/dist/cli/pack/upgrade.js +0 -273
  419. package/dist/cli/pack/upgrade.js.map +0 -1
  420. package/dist/cli/pause/index.d.ts +0 -113
  421. package/dist/cli/pause/index.js +0 -251
  422. package/dist/cli/pause/index.js.map +0 -1
  423. package/dist/cli/pause-check.d.ts +0 -22
  424. package/dist/cli/pause-check.js +0 -54
  425. package/dist/cli/pause-check.js.map +0 -1
  426. package/dist/cli/policy/intercept.d.ts +0 -233
  427. package/dist/cli/policy/intercept.js +0 -1020
  428. package/dist/cli/policy/intercept.js.map +0 -1
  429. package/dist/cli/policy/risk-envelope-enrichment.d.ts +0 -40
  430. package/dist/cli/policy/risk-envelope-enrichment.js +0 -108
  431. package/dist/cli/policy/risk-envelope-enrichment.js.map +0 -1
  432. package/dist/cli/record/index.d.ts +0 -81
  433. package/dist/cli/record/index.js +0 -348
  434. package/dist/cli/record/index.js.map +0 -1
  435. package/dist/cli/resolve-env.d.ts +0 -32
  436. package/dist/cli/resolve-env.js +0 -47
  437. package/dist/cli/resolve-env.js.map +0 -1
  438. package/dist/cli/session-export/index.d.ts +0 -46
  439. package/dist/cli/session-export/index.js +0 -169
  440. package/dist/cli/session-export/index.js.map +0 -1
  441. package/dist/cli/session-export/redact.d.ts +0 -22
  442. package/dist/cli/session-export/redact.js +0 -47
  443. package/dist/cli/session-export/redact.js.map +0 -1
  444. package/dist/cli/session-export/transcript.d.ts +0 -24
  445. package/dist/cli/session-export/transcript.js +0 -164
  446. package/dist/cli/session-export/transcript.js.map +0 -1
  447. package/dist/cli/session-start/branch-check.d.ts +0 -18
  448. package/dist/cli/session-start/branch-check.js +0 -140
  449. package/dist/cli/session-start/branch-check.js.map +0 -1
  450. package/dist/cli/session-start/index.d.ts +0 -121
  451. package/dist/cli/session-start/index.js +0 -591
  452. package/dist/cli/session-start/index.js.map +0 -1
  453. package/dist/cli/session-start/shared-options.d.ts +0 -103
  454. package/dist/cli/session-start/shared-options.js +0 -107
  455. package/dist/cli/session-start/shared-options.js.map +0 -1
  456. package/dist/cli/session-start/stale-base-check.d.ts +0 -46
  457. package/dist/cli/session-start/stale-base-check.js +0 -352
  458. package/dist/cli/session-start/stale-base-check.js.map +0 -1
  459. package/dist/cli/session-start/toolchain-parity.d.ts +0 -267
  460. package/dist/cli/session-start/toolchain-parity.js +0 -797
  461. package/dist/cli/session-start/toolchain-parity.js.map +0 -1
  462. package/dist/cli/smoke/assertions.d.ts +0 -46
  463. package/dist/cli/smoke/assertions.js +0 -170
  464. package/dist/cli/smoke/assertions.js.map +0 -1
  465. package/dist/cli/smoke/index.d.ts +0 -76
  466. package/dist/cli/smoke/index.js +0 -245
  467. package/dist/cli/smoke/index.js.map +0 -1
  468. package/dist/cli/smoke/runner.d.ts +0 -55
  469. package/dist/cli/smoke/runner.js +0 -134
  470. package/dist/cli/smoke/runner.js.map +0 -1
  471. package/dist/cli/smoke/stream-parser.d.ts +0 -65
  472. package/dist/cli/smoke/stream-parser.js +0 -115
  473. package/dist/cli/smoke/stream-parser.js.map +0 -1
  474. package/dist/cli/test-risk.d.ts +0 -26
  475. package/dist/cli/test-risk.js +0 -34
  476. package/dist/cli/test-risk.js.map +0 -1
  477. package/dist/io/display-path.d.ts +0 -11
  478. package/dist/io/display-path.js +0 -29
  479. package/dist/io/display-path.js.map +0 -1
  480. package/dist/io/duration.d.ts +0 -5
  481. package/dist/io/duration.js +0 -50
  482. package/dist/io/duration.js.map +0 -1
  483. package/dist/io/extract.d.ts +0 -79
  484. package/dist/io/extract.js +0 -226
  485. package/dist/io/extract.js.map +0 -1
  486. package/dist/io/ledger-record.d.ts +0 -83
  487. package/dist/io/ledger-record.js +0 -301
  488. package/dist/io/ledger-record.js.map +0 -1
  489. package/dist/io/read-json-dir-entries.d.ts +0 -36
  490. package/dist/io/read-json-dir-entries.js +0 -48
  491. package/dist/io/read-json-dir-entries.js.map +0 -1
  492. package/dist/io/safe-json-parse.d.ts +0 -5
  493. package/dist/io/safe-json-parse.js +0 -21
  494. package/dist/io/safe-json-parse.js.map +0 -1
  495. package/dist/policies/index.d.ts +0 -5
  496. package/dist/policies/index.js +0 -6
  497. package/dist/policies/index.js.map +0 -1
  498. package/dist/policies/ledger-client.d.ts +0 -113
  499. package/dist/policies/ledger-client.js +0 -500
  500. package/dist/policies/ledger-client.js.map +0 -1
  501. package/dist/policies/producers.d.ts +0 -12
  502. package/dist/policies/producers.js +0 -61
  503. package/dist/policies/producers.js.map +0 -1
  504. package/dist/policies/requires.d.ts +0 -75
  505. package/dist/policies/requires.js +0 -240
  506. package/dist/policies/requires.js.map +0 -1
  507. package/dist/policies/timestamp.d.ts +0 -14
  508. package/dist/policies/timestamp.js +0 -36
  509. package/dist/policies/timestamp.js.map +0 -1
  510. package/dist/policy-packs/builtin/permission-profiles.d.ts +0 -11
  511. package/dist/policy-packs/builtin/permission-profiles.js +0 -74
  512. package/dist/policy-packs/builtin/permission-profiles.js.map +0 -1
  513. package/dist/policy-packs/builtin/post-merge-gate-runtime.d.ts +0 -286
  514. package/dist/policy-packs/builtin/post-merge-gate-runtime.js +0 -397
  515. package/dist/policy-packs/builtin/post-merge-gate-runtime.js.map +0 -1
  516. package/dist/policy-packs/builtin/post-merge-gate.d.ts +0 -56
  517. package/dist/policy-packs/builtin/post-merge-gate.js +0 -347
  518. package/dist/policy-packs/builtin/post-merge-gate.js.map +0 -1
  519. package/dist/policy-packs/builtin/solution-acceptance-reconnect.d.ts +0 -50
  520. package/dist/policy-packs/builtin/solution-acceptance-reconnect.js +0 -151
  521. package/dist/policy-packs/builtin/solution-acceptance-reconnect.js.map +0 -1
  522. package/dist/policy-packs/builtin/solution-acceptance-runtime.d.ts +0 -323
  523. package/dist/policy-packs/builtin/solution-acceptance-runtime.js +0 -672
  524. package/dist/policy-packs/builtin/solution-acceptance-runtime.js.map +0 -1
  525. package/dist/policy-packs/builtin/solution-acceptance.d.ts +0 -45
  526. package/dist/policy-packs/builtin/solution-acceptance.js +0 -226
  527. package/dist/policy-packs/builtin/solution-acceptance.js.map +0 -1
  528. package/dist/policy-packs/builtin/understanding-before-execution/active-claim.d.ts +0 -25
  529. package/dist/policy-packs/builtin/understanding-before-execution/active-claim.js +0 -94
  530. package/dist/policy-packs/builtin/understanding-before-execution/active-claim.js.map +0 -1
  531. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.d.ts +0 -35
  532. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.js +0 -86
  533. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.js.map +0 -1
  534. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.d.ts +0 -210
  535. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.js +0 -361
  536. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.js.map +0 -1
  537. package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.d.ts +0 -304
  538. package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.js +0 -734
  539. package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.js.map +0 -1
  540. package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.d.ts +0 -36
  541. package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.js +0 -73
  542. package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.js.map +0 -1
  543. package/dist/policy-packs/builtin/understanding-before-execution/index.d.ts +0 -19
  544. package/dist/policy-packs/builtin/understanding-before-execution/index.js +0 -83
  545. package/dist/policy-packs/builtin/understanding-before-execution/index.js.map +0 -1
  546. package/dist/policy-packs/builtin/understanding-before-execution/inflight-records.d.ts +0 -135
  547. package/dist/policy-packs/builtin/understanding-before-execution/inflight-records.js +0 -618
  548. package/dist/policy-packs/builtin/understanding-before-execution/inflight-records.js.map +0 -1
  549. package/dist/policy-packs/builtin/understanding-before-execution/ledger.d.ts +0 -25
  550. package/dist/policy-packs/builtin/understanding-before-execution/ledger.js +0 -56
  551. package/dist/policy-packs/builtin/understanding-before-execution/ledger.js.map +0 -1
  552. package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.d.ts +0 -20
  553. package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.js +0 -93
  554. package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.js.map +0 -1
  555. package/dist/policy-packs/builtin/understanding-before-execution/markers.d.ts +0 -126
  556. package/dist/policy-packs/builtin/understanding-before-execution/markers.js +0 -245
  557. package/dist/policy-packs/builtin/understanding-before-execution/markers.js.map +0 -1
  558. package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.d.ts +0 -29
  559. package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.js +0 -82
  560. package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.js.map +0 -1
  561. package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.d.ts +0 -71
  562. package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.js +0 -175
  563. package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.js.map +0 -1
  564. package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.d.ts +0 -620
  565. package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.js +0 -1047
  566. package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.js.map +0 -1
  567. package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.d.ts +0 -128
  568. package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.js +0 -213
  569. package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.js.map +0 -1
  570. package/dist/policy-packs/builtin/understanding-before-execution/stay-in-scope-config.d.ts +0 -129
  571. package/dist/policy-packs/builtin/understanding-before-execution/stay-in-scope-config.js +0 -166
  572. package/dist/policy-packs/builtin/understanding-before-execution/stay-in-scope-config.js.map +0 -1
  573. package/dist/policy-packs/builtin/understanding-before-execution/task-markers.d.ts +0 -164
  574. package/dist/policy-packs/builtin/understanding-before-execution/task-markers.js +0 -275
  575. package/dist/policy-packs/builtin/understanding-before-execution/task-markers.js.map +0 -1
  576. package/dist/policy-packs/builtin/understanding-before-execution-runtime.d.ts +0 -1
  577. package/dist/policy-packs/builtin/understanding-before-execution-runtime.js +0 -10
  578. package/dist/policy-packs/builtin/understanding-before-execution-runtime.js.map +0 -1
  579. package/dist/policy-packs/builtin/understanding-before-execution.d.ts +0 -526
  580. package/dist/policy-packs/builtin/understanding-before-execution.js +0 -1074
  581. package/dist/policy-packs/builtin/understanding-before-execution.js.map +0 -1
  582. package/dist/policy-packs/permission-translator.d.ts +0 -9
  583. package/dist/policy-packs/permission-translator.js +0 -76
  584. package/dist/policy-packs/permission-translator.js.map +0 -1
  585. package/dist/runtime/action-envelope.d.ts +0 -64
  586. package/dist/runtime/action-envelope.js +0 -46
  587. package/dist/runtime/action-envelope.js.map +0 -1
  588. package/dist/runtime/approval-signing.d.ts +0 -111
  589. package/dist/runtime/approval-signing.js +0 -384
  590. package/dist/runtime/approval-signing.js.map +0 -1
  591. package/dist/runtime/bash-match-facts.d.ts +0 -60
  592. package/dist/runtime/bash-match-facts.js +0 -196
  593. package/dist/runtime/bash-match-facts.js.map +0 -1
  594. package/dist/runtime/bash-match-registry.d.ts +0 -112
  595. package/dist/runtime/bash-match-registry.js +0 -406
  596. package/dist/runtime/bash-match-registry.js.map +0 -1
  597. package/dist/runtime/bash-prefix-parse.d.ts +0 -31
  598. package/dist/runtime/bash-prefix-parse.js +0 -576
  599. package/dist/runtime/bash-prefix-parse.js.map +0 -1
  600. package/dist/runtime/command-normalize.d.ts +0 -658
  601. package/dist/runtime/command-normalize.js +0 -2410
  602. package/dist/runtime/command-normalize.js.map +0 -1
  603. package/dist/runtime/deletion-target-resolve.d.ts +0 -28
  604. package/dist/runtime/deletion-target-resolve.js +0 -1078
  605. package/dist/runtime/deletion-target-resolve.js.map +0 -1
  606. package/dist/runtime/destructive-shell-floor.d.ts +0 -19
  607. package/dist/runtime/destructive-shell-floor.js +0 -611
  608. package/dist/runtime/destructive-shell-floor.js.map +0 -1
  609. package/dist/runtime/environment-resolver.d.ts +0 -36
  610. package/dist/runtime/environment-resolver.js +0 -138
  611. package/dist/runtime/environment-resolver.js.map +0 -1
  612. package/dist/runtime/git-context.d.ts +0 -201
  613. package/dist/runtime/git-context.js +0 -422
  614. package/dist/runtime/git-context.js.map +0 -1
  615. package/dist/runtime/index.d.ts +0 -12
  616. package/dist/runtime/index.js +0 -13
  617. package/dist/runtime/index.js.map +0 -1
  618. package/dist/runtime/intercept.d.ts +0 -494
  619. package/dist/runtime/intercept.js +0 -1313
  620. package/dist/runtime/intercept.js.map +0 -1
  621. package/dist/runtime/kube-context.d.ts +0 -16
  622. package/dist/runtime/kube-context.js +0 -63
  623. package/dist/runtime/kube-context.js.map +0 -1
  624. package/dist/runtime/kubectl-target-parse.d.ts +0 -31
  625. package/dist/runtime/kubectl-target-parse.js +0 -249
  626. package/dist/runtime/kubectl-target-parse.js.map +0 -1
  627. package/dist/runtime/ledger-add.d.ts +0 -16
  628. package/dist/runtime/ledger-add.js +0 -150
  629. package/dist/runtime/ledger-add.js.map +0 -1
  630. package/dist/runtime/ledger-writer.d.ts +0 -27
  631. package/dist/runtime/ledger-writer.js +0 -46
  632. package/dist/runtime/ledger-writer.js.map +0 -1
  633. package/dist/runtime/pause-sentinel.d.ts +0 -60
  634. package/dist/runtime/pause-sentinel.js +0 -156
  635. package/dist/runtime/pause-sentinel.js.map +0 -1
  636. package/dist/runtime/pending-approval.d.ts +0 -23
  637. package/dist/runtime/pending-approval.js +0 -67
  638. package/dist/runtime/pending-approval.js.map +0 -1
  639. package/dist/runtime/read-only-bash.d.ts +0 -141
  640. package/dist/runtime/read-only-bash.js +0 -2204
  641. package/dist/runtime/read-only-bash.js.map +0 -1
  642. package/dist/runtime/recovery-git-commit.d.ts +0 -22
  643. package/dist/runtime/recovery-git-commit.js +0 -284
  644. package/dist/runtime/recovery-git-commit.js.map +0 -1
  645. package/dist/runtime/reject-malformed-session-id.d.ts +0 -8
  646. package/dist/runtime/reject-malformed-session-id.js +0 -16
  647. package/dist/runtime/reject-malformed-session-id.js.map +0 -1
  648. package/dist/runtime/risk-classifier.d.ts +0 -38
  649. package/dist/runtime/risk-classifier.js +0 -311
  650. package/dist/runtime/risk-classifier.js.map +0 -1
  651. package/dist/runtime/session-id.d.ts +0 -113
  652. package/dist/runtime/session-id.js +0 -193
  653. package/dist/runtime/session-id.js.map +0 -1
  654. package/dist/runtime/shell-word.d.ts +0 -62
  655. package/dist/runtime/shell-word.js +0 -410
  656. package/dist/runtime/shell-word.js.map +0 -1
  657. package/dist/runtime/task-providers/agent-tasks.d.ts +0 -103
  658. package/dist/runtime/task-providers/agent-tasks.js +0 -245
  659. package/dist/runtime/task-providers/agent-tasks.js.map +0 -1
  660. package/dist/runtime/when-eval.d.ts +0 -62
  661. package/dist/runtime/when-eval.js +0 -212
  662. package/dist/runtime/when-eval.js.map +0 -1
  663. package/dist/runtime/workflow-policies.d.ts +0 -207
  664. package/dist/runtime/workflow-policies.js +0 -596
  665. package/dist/runtime/workflow-policies.js.map +0 -1
  666. package/dist/schema/audit.d.ts +0 -71
  667. package/dist/schema/audit.js +0 -32
  668. package/dist/schema/audit.js.map +0 -1
  669. package/dist/schema/doctor.d.ts +0 -25
  670. package/dist/schema/doctor.js +0 -23
  671. package/dist/schema/doctor.js.map +0 -1
  672. package/dist/schema/environments.d.ts +0 -215
  673. package/dist/schema/environments.js +0 -101
  674. package/dist/schema/environments.js.map +0 -1
  675. package/dist/schema/extract.d.ts +0 -9
  676. package/dist/schema/extract.js +0 -86
  677. package/dist/schema/extract.js.map +0 -1
  678. package/dist/schema/permission-profiles.d.ts +0 -2292
  679. package/dist/schema/permission-profiles.js +0 -60
  680. package/dist/schema/permission-profiles.js.map +0 -1
  681. package/dist/schema/policies.d.ts +0 -974
  682. package/dist/schema/policies.js +0 -298
  683. package/dist/schema/policies.js.map +0 -1
  684. package/dist/schema/requires.d.ts +0 -131
  685. package/dist/schema/requires.js +0 -88
  686. package/dist/schema/requires.js.map +0 -1
  687. package/dist/schema/risk.d.ts +0 -144
  688. package/dist/schema/risk.js +0 -194
  689. package/dist/schema/risk.js.map +0 -1
  690. package/dist/schema/session-start-preflight.d.ts +0 -10
  691. package/dist/schema/session-start-preflight.js +0 -106
  692. package/dist/schema/session-start-preflight.js.map +0 -1
  693. package/dist/schema/stale-base-check.d.ts +0 -18
  694. package/dist/schema/stale-base-check.js +0 -37
  695. package/dist/schema/stale-base-check.js.map +0 -1
  696. package/dist/schema/toolchain-parity.d.ts +0 -21
  697. package/dist/schema/toolchain-parity.js +0 -48
  698. package/dist/schema/toolchain-parity.js.map +0 -1
  699. package/dist/schema/workflows.d.ts +0 -519
  700. package/dist/schema/workflows.js +0 -81
  701. package/dist/schema/workflows.js.map +0 -1
  702. package/scripts/runtime-reality-docker-probe.mjs +0 -71
@@ -0,0 +1,455 @@
1
+ /**
2
+ * Hook liveness: are the hooks `harness apply` generates actually present in
3
+ * the live runtime config? Without this check a hook that exists only in the
4
+ * generated artefact (never installed, dropped by a hand edit) leaves its
5
+ * gate silently absent.
6
+ *
7
+ * Per runtime the generated hook entries are compared with the live config
8
+ * by (event, matcher, command):
9
+ * - Claude Code: `settings.json` under the `CLAUDE_CONFIG_DIR` resolution
10
+ * `resolveSettingsPath` applies.
11
+ * - Codex: `~/.codex/config.toml`.
12
+ *
13
+ * Severity: a generated entry that is absent or carries another command is an
14
+ * error. An entry taken out by `harness gate disable` is a warning (the
15
+ * operator did it on purpose and can read it back from the recorded state:
16
+ * the live gate snapshot of either runtime). A Codex unit counts as disabled
17
+ * only when `harness gate enable --runtime codex` would restore it (an own
18
+ * snapshot that is not spent names it by id); an empty hooks array otherwise
19
+ * is a hand edit, so a missing error.
20
+ * The warning names the command that puts the entry back as that runtime's
21
+ * gate takes it: `harness gate enable` for Claude Code, with `--settings` when
22
+ * the compared file is not the one the gate targets by default (for example
23
+ * under `CLAUDE_CONFIG_DIR`) and `--force` when the gate would refuse the
24
+ * plain command (by its own refusal decision, `claudeEnableRefusal`: the file
25
+ * holds a group with the event and matcher of a removed one but other
26
+ * content, or it was edited since the disable and the still-missing groups do
27
+ * not add up to the pre-disable file); `harness gate enable --runtime codex`
28
+ * for Codex, with `--config` for a config other than the default one and
29
+ * `--force` when the config was edited since the disable (the restore refuses
30
+ * without it).
31
+ * A live hook that is not in the generated set is an info line, never counted.
32
+ * A live file that is missing or unreadable is one error finding, and so is a
33
+ * gate snapshot that cannot be read: the disabled state is then unknowable, so
34
+ * doctor fails closed and names the snapshot instead of guessing.
35
+ */
36
+ import * as fs from "node:fs";
37
+ import { parse as parseToml } from "smol-toml";
38
+ import { expandPolicyPacks } from "../../policy-packs/index.js";
39
+ import { generateCodexConfig } from "../apply/generate-codex-config.js";
40
+ import { generateSettings } from "../apply/generate-settings.js";
41
+ import { defaultCodexConfigPath, readCodexManagedHookUnits, } from "../apply/install-codex-config.js";
42
+ import { CODEX_INSTALL_COMMAND, codexConfigFlag, latestInstall, planCodexRestore, readLiveCodexSnapshots, resolveCodexConfig, spentCodexSnapshot, } from "../gate/codex-snapshot.js";
43
+ import { shellQuote } from "../shell-quote.js";
44
+ import { claudeEnableRefusal, listLiveSnapshots, nextEnableSnapshots, parseSettingsHooks, planRestore, settingsFlag, sha256Hex, } from "../gate/snapshot.js";
45
+ import { resolveSettingsPath } from "./claude-mcp.js";
46
+ const keyId = (k) => JSON.stringify([k.event, k.matcher, k.command]);
47
+ const slotId = (k) => JSON.stringify([k.event, k.matcher]);
48
+ export function describeHook(k) {
49
+ return `${k.event} matcher ${k.matcher === null ? "(none)" : `"${k.matcher}"`} command ${k.command}`;
50
+ }
51
+ function isRecord(v) {
52
+ return v !== null && typeof v === "object" && !Array.isArray(v);
53
+ }
54
+ /** Flatten `{ [event]: [{ matcher?, hooks: [{ command }] }] }` into keys; malformed shapes are skipped. */
55
+ function flattenHookTable(table) {
56
+ const out = [];
57
+ if (!isRecord(table))
58
+ return out;
59
+ for (const [event, groups] of Object.entries(table)) {
60
+ if (!Array.isArray(groups))
61
+ continue;
62
+ for (const group of groups) {
63
+ if (!isRecord(group))
64
+ continue;
65
+ const matcher = typeof group["matcher"] === "string" ? group["matcher"] : null;
66
+ const hooks = group["hooks"];
67
+ if (!Array.isArray(hooks))
68
+ continue;
69
+ for (const h of hooks) {
70
+ if (isRecord(h) && typeof h["command"] === "string") {
71
+ out.push({ event, matcher, command: h["command"] });
72
+ }
73
+ }
74
+ }
75
+ }
76
+ return out;
77
+ }
78
+ export function expectedClaudeHooks(manifest) {
79
+ const hooks = [...manifest.hooks, ...expandPolicyPacks(manifest, "claude-code").hooks];
80
+ return flattenHookTable(generateSettings({ ...manifest, hooks }).hooks);
81
+ }
82
+ export function expectedCodexHooks(manifest) {
83
+ const hooks = [...manifest.hooks, ...expandPolicyPacks(manifest, "codex").hooks];
84
+ const text = generateCodexConfig({ ...manifest, hooks }).content;
85
+ const doc = parseToml(text);
86
+ return flattenHookTable(doc["hooks"]);
87
+ }
88
+ function fileFinding(message) {
89
+ return { kind: "file", status: "error", event: "", matcher: null, command: "", message };
90
+ }
91
+ /**
92
+ * Compare `expected` with `live`. `isDisabled` answers from the gate's own
93
+ * recorded state whether a missing entry was taken out by `harness gate disable`;
94
+ * `disabledMessage` words the warning for such an entry.
95
+ */
96
+ function compare(expected, live, isDisabled, disabledMessage, liveLabel, fixHintFor) {
97
+ const out = [];
98
+ const liveIds = new Set(live.map(keyId));
99
+ const expectedIds = new Set(expected.map(keyId));
100
+ const extraOrDisabled = live.some((l) => !expectedIds.has(keyId(l))) ||
101
+ expected.some((e) => !liveIds.has(keyId(e)) && isDisabled(e));
102
+ const fixHint = fixHintFor({ extraOrDisabled });
103
+ const liveBySlot = new Map();
104
+ for (const l of live) {
105
+ const list = liveBySlot.get(slotId(l)) ?? [];
106
+ list.push(l);
107
+ liveBySlot.set(slotId(l), list);
108
+ }
109
+ for (const e of expected) {
110
+ if (liveIds.has(keyId(e))) {
111
+ out.push({ ...e, kind: "present", status: "ok", message: `present: ${describeHook(e)}` });
112
+ continue;
113
+ }
114
+ if (isDisabled(e)) {
115
+ out.push({ ...e, kind: "disabled", status: "warn", message: disabledMessage(e) });
116
+ continue;
117
+ }
118
+ const sameSlot = (liveBySlot.get(slotId(e)) ?? []).filter((l) => !expectedIds.has(keyId(l)));
119
+ if (sameSlot.length > 0) {
120
+ out.push({
121
+ ...e,
122
+ kind: "differing",
123
+ status: "error",
124
+ message: `differs in ${liveLabel}: expected ${describeHook(e)}, live has ` +
125
+ `${sameSlot.map((l) => l.command).join(", ")}; ${fixHint}`,
126
+ });
127
+ continue;
128
+ }
129
+ out.push({
130
+ ...e,
131
+ kind: "missing",
132
+ status: "error",
133
+ message: `missing from ${liveLabel}: ${describeHook(e)}; ${fixHint}`,
134
+ });
135
+ }
136
+ const differingLive = new Set(out.filter((o) => o.kind === "differing").map((o) => slotId(o)));
137
+ for (const l of live) {
138
+ if (expectedIds.has(keyId(l)))
139
+ continue;
140
+ // A live entry that stands in for a generated one is reported by the
141
+ // differing line, not a second time as extra.
142
+ if (differingLive.has(slotId(l)))
143
+ continue;
144
+ out.push({
145
+ ...l,
146
+ kind: "extra",
147
+ status: "info",
148
+ message: `not generated by harness: ${describeHook(l)}`,
149
+ });
150
+ }
151
+ return out;
152
+ }
153
+ function readText(p, fixHint) {
154
+ try {
155
+ return { ok: true, text: fs.readFileSync(p, "utf8") };
156
+ }
157
+ catch (err) {
158
+ const code = err.code;
159
+ if (code === "ENOENT") {
160
+ return { ok: false, message: `${p} not found; ${fixHint}` };
161
+ }
162
+ return { ok: false, message: `cannot read ${p}: ${err.message}` };
163
+ }
164
+ }
165
+ export function checkClaudeLiveHooks(manifest, settingsPath, opts = {}) {
166
+ const report = { runtime: "claude-code", livePath: settingsPath, entries: [] };
167
+ const expected = expectedClaudeHooks(manifest);
168
+ if (expected.length === 0)
169
+ return report;
170
+ const applyHint = `run \`harness apply --target ${shellQuote(settingsPath)} --merge\``;
171
+ const read = readText(settingsPath, applyHint);
172
+ if (!read.ok) {
173
+ report.entries.push(fileFinding(read.message));
174
+ return report;
175
+ }
176
+ let doc;
177
+ try {
178
+ doc = JSON.parse(read.text);
179
+ }
180
+ catch (err) {
181
+ report.entries.push(fileFinding(`${settingsPath} is not valid JSON: ${err.message}`));
182
+ return report;
183
+ }
184
+ if (!isRecord(doc)) {
185
+ report.entries.push(fileFinding(`${settingsPath} is not a JSON object`));
186
+ return report;
187
+ }
188
+ const live = flattenHookTable(doc["hooks"]);
189
+ // The gate's own record of what it took out: every live snapshot beside the
190
+ // file lists the removed groups. A snapshot that cannot be read leaves the
191
+ // disabled state unknowable: one error finding names it, and the missing
192
+ // entries point at it instead of at an apply that would not help.
193
+ const removed = [];
194
+ const snaps = listLiveSnapshots(settingsPath);
195
+ let snapshotProblem = false;
196
+ if (snaps.ok) {
197
+ for (const s of snaps.live) {
198
+ for (const r of s.snapshot.removed) {
199
+ removed.push(...flattenHookTable({ [r.event]: [r.group] }));
200
+ }
201
+ }
202
+ }
203
+ else {
204
+ snapshotProblem = true;
205
+ report.entries.push(fileFinding(`cannot read the gate snapshot ${snaps.path}: ${snaps.reason}; ` +
206
+ "a hook taken out by `harness gate disable` cannot be told from a missing one until it is readable " +
207
+ "(fix or move the snapshot aside)"));
208
+ }
209
+ const removedIds = new Set(removed.map(keyId));
210
+ // The gate does not read CLAUDE_CONFIG_DIR: any other file than its default needs --settings.
211
+ const enable = `harness gate enable${settingsPath === opts.gateDefaultPath ? "" : ` ${settingsFlag(settingsPath)}`}`;
212
+ // A disabled hook comes back with `gate enable` alone, or with `gate enable
213
+ // --force`, by the gate's own decision: when the gate refuses the snapshot
214
+ // the next plain call applies without `--force`, that snapshot marks every
215
+ // group it removed, so the warning names the flag exactly when the plain
216
+ // command would refuse and say why.
217
+ const forceOf = claudeEnableForce(read.text, doc, snaps.ok ? snaps.live : []);
218
+ report.entries.push(...compare(expected, live, (k) => removedIds.has(keyId(k)), (k) => {
219
+ const head = `disabled via \`harness gate disable\`: ${describeHook(k)}; `;
220
+ const force = forceOf.get(keyId(k));
221
+ if (force === undefined)
222
+ return `${head}run \`${enable}\` to put it back`;
223
+ // An edit since the disable is a fact about the file, true for every
224
+ // hook; a changed group is a fact about the refusing snapshot's own
225
+ // removed groups, so a hook only another live snapshot removed must
226
+ // name the refusing snapshot instead of claiming such a group stands
227
+ // in for ITS removed one.
228
+ const reason = force.reason !== "changed-group"
229
+ ? "settings.json was edited since the disable"
230
+ : force.removedByRefusing
231
+ ? "settings.json holds a group with the event and matcher of the removed one but other content"
232
+ : "the snapshot the next `harness gate enable` applies refuses, because settings.json holds a group with the event and matcher of a group that snapshot removed, but other content";
233
+ return (`${head}run \`${enable} --force\` to put it back: ${reason}` +
234
+ `, so the restore refuses without \`--force\` (inspect the diff against ${force.settingsBackupPath} first)`);
235
+ }, "settings.json", ({ extraOrDisabled }) => snapshotProblem
236
+ ? "see the gate snapshot finding above"
237
+ : applyHint +
238
+ (extraOrDisabled
239
+ ? " (`--merge` replaces the hooks key: live hooks harness did not generate are lost, hooks " +
240
+ "taken out by `harness gate disable` come back and the gate snapshot goes stale)"
241
+ : "")));
242
+ return report;
243
+ }
244
+ /**
245
+ * Why doctor must name `--force` for each group a live snapshot removed, by
246
+ * the gate's own decision and not a copy of it: the snapshots a plain
247
+ * `gate enable` applies next are the only refusal the operator is about to
248
+ * meet. `nextEnableSnapshots` answers which those are (the newest; an older
249
+ * one waits until that restore changed the file, so its own decision against
250
+ * this file is never what the next plain enable does). When one of them needs
251
+ * `--force`, the plain command refuses for every gate-disabled group, so
252
+ * every group any live snapshot removed is marked with that refusal, and the
253
+ * mark says whether the refusing snapshot itself removed the group: a changed
254
+ * group is a fact about that snapshot's own removed groups, so the warning
255
+ * for a group only an older snapshot removed must name the refusing snapshot
256
+ * rather than claim the changed group stands in for that group. A `hooks`
257
+ * shape the gate refuses to read marks nothing: that refusal is not one of
258
+ * the two `--force` answers this warning could name.
259
+ */
260
+ function claudeEnableForce(text, doc, live) {
261
+ const out = new Map();
262
+ const parsedHooks = parseSettingsHooks(doc);
263
+ if (!parsedHooks.ok)
264
+ return out;
265
+ for (const { snapshot } of nextEnableSnapshots(live)) {
266
+ const reason = claudeEnableRefusal(sha256Hex(text), doc, planRestore(parsedHooks.hooks, snapshot), snapshot);
267
+ if (reason === null)
268
+ continue;
269
+ // The refusing snapshot first, so the "first one wins" below counts a
270
+ // group both it and an older snapshot removed as removed by the refusing
271
+ // one: the refusal's reason is then a fact about that group's own slot.
272
+ for (const named of [snapshot, ...live.map((s) => s.snapshot).filter((s) => s !== snapshot)]) {
273
+ for (const r of named.removed) {
274
+ for (const k of flattenHookTable({ [r.event]: [r.group] })) {
275
+ if (!out.has(keyId(k))) {
276
+ out.set(keyId(k), {
277
+ reason,
278
+ settingsBackupPath: snapshot.settingsBackupPath,
279
+ removedByRefusing: named === snapshot,
280
+ });
281
+ }
282
+ }
283
+ }
284
+ }
285
+ break;
286
+ }
287
+ return out;
288
+ }
289
+ export function checkCodexLiveHooks(manifest, configPath, opts = {}) {
290
+ const report = { runtime: "codex", livePath: configPath, entries: [] };
291
+ const expected = expectedCodexHooks(manifest);
292
+ if (expected.length === 0)
293
+ return report;
294
+ const namedPath = configPath === opts.gateDefaultPath ? null : configPath;
295
+ const fixHint = `run \`${CODEX_INSTALL_COMMAND}${codexConfigFlag(namedPath, "--codex-config")}\``;
296
+ const read = readText(configPath, fixHint);
297
+ if (!read.ok) {
298
+ report.entries.push(fileFinding(read.message));
299
+ return report;
300
+ }
301
+ let doc;
302
+ try {
303
+ doc = parseToml(read.text);
304
+ }
305
+ catch (err) {
306
+ report.entries.push(fileFinding(`${configPath} is not valid TOML: ${err.message}`));
307
+ return report;
308
+ }
309
+ const live = flattenHookTable(doc["hooks"]);
310
+ // The gate neutralises a unit in place (`hooks = []`) and records it in an
311
+ // own snapshot beside the config. A unit counts as disabled only when
312
+ // `harness gate enable --runtime codex` would restore it: the unit is still
313
+ // neutralised in the block, an own snapshot names it by id, that snapshot is
314
+ // not spent (the gate's own predicate: an install re-rendered the block
315
+ // after it, the config is back at its pre-disable state, or it names units
316
+ // that were deleted), the restore plan holds and does not hit the refusal
317
+ // for an unedited config. The original hooks text must carry the expected
318
+ // command. An empty array without that record is a hand edit and stays a
319
+ // missing error, since `gate enable` could not put it back. A config edited
320
+ // since the disable is restored only with `--force`, so the warning says so.
321
+ let snapshotProblem = false;
322
+ let ownSnapshots = [];
323
+ try {
324
+ ownSnapshots = readLiveCodexSnapshots(configPath, (m) => new Error(m), namedPath).own;
325
+ }
326
+ catch (err) {
327
+ snapshotProblem = true;
328
+ report.entries.push(fileFinding(`cannot read the gate snapshot beside ${configPath}: ${err.message} ` +
329
+ "A hook taken out by `harness gate disable` cannot be told from a missing one until it is readable."));
330
+ }
331
+ const disabledUnits = [];
332
+ if (ownSnapshots.length > 0) {
333
+ disabledUnits.push(...restorableCodexUnits(read.text, configPath, ownSnapshots));
334
+ }
335
+ const recordsOf = (k) => disabledUnits.filter((d) => keyId(d.key) === keyId(k));
336
+ const enable = `harness gate enable --runtime codex${codexConfigFlag(namedPath)}`;
337
+ const disabledMessage = (k) => {
338
+ const head = `disabled via \`harness gate disable --runtime codex\`: ${describeHook(k)}; `;
339
+ const edited = recordsOf(k).find((d) => d.needsForce);
340
+ return edited === undefined
341
+ ? `${head}run \`${enable}\` to put it back`
342
+ : `${head}run \`${enable} --force\` to put it back: the config was edited since the disable, so the ` +
343
+ `restore refuses without \`--force\` (inspect the diff against ${edited.configBackupPath} first)`;
344
+ };
345
+ report.entries.push(...compare(expected, live, (k) => recordsOf(k).length > 0, disabledMessage, "config.toml", () => (snapshotProblem ? "see the gate snapshot finding above" : fixHint)));
346
+ return report;
347
+ }
348
+ /**
349
+ * The hooks `harness gate enable --runtime codex` would put back into `text`,
350
+ * by the gate's own rules (the same predicates, not a re-implementation): a
351
+ * snapshot that is spent is skipped (enable only retires it), a restore plan
352
+ * that fails restores nothing, and neither does the refusal for a config that
353
+ * is exactly what the snapshot left behind but does not rebuild its pre-disable
354
+ * sha. Units match by id only, like the restore.
355
+ */
356
+ function restorableCodexUnits(text, configPath, snapshots) {
357
+ let units;
358
+ let generation;
359
+ try {
360
+ const block = readCodexManagedHookUnits(text, configPath);
361
+ units = block?.units ?? null;
362
+ generation = block?.generation ?? null;
363
+ }
364
+ catch {
365
+ // A block the scanner refuses yields no record; the entry stays a plain missing error.
366
+ return [];
367
+ }
368
+ let requestedPath = configPath;
369
+ let resolvedPath = configPath;
370
+ try {
371
+ const resolved = resolveCodexConfig({ configPath }, (m) => new Error(m));
372
+ requestedPath = resolved.requestedPath;
373
+ resolvedPath = resolved.configPath;
374
+ }
375
+ catch {
376
+ // A dangling link: the install backups are looked for beside the path as given.
377
+ }
378
+ const install = latestInstall(requestedPath, resolvedPath);
379
+ const sha = sha256Hex(text);
380
+ const out = [];
381
+ for (const live of snapshots) {
382
+ const { snapshot } = live;
383
+ const spent = spentCodexSnapshot(snapshot, sha, units, install, generation);
384
+ if (spent.retire !== null)
385
+ continue;
386
+ const plan = planCodexRestore(text, units, configPath, live);
387
+ if (!plan.ok)
388
+ continue;
389
+ if (sha === snapshot.configAfterSha256 && sha256Hex(plan.text) !== snapshot.configBeforeSha256)
390
+ continue;
391
+ // An unedited config that the restore does not rebuild was skipped above, so a restore that does not
392
+ // rebuild the pre-disable bytes here is one on an edited config: the gate makes it only under --force.
393
+ const needsForce = sha256Hex(plan.text) !== snapshot.configBeforeSha256;
394
+ for (const restored of plan.restored) {
395
+ for (const command of snapshotCommands(restored.hooksText)) {
396
+ out.push({
397
+ key: { event: restored.event, matcher: restored.matcher, command },
398
+ needsForce,
399
+ configBackupPath: snapshot.configBackupPath,
400
+ });
401
+ }
402
+ }
403
+ }
404
+ return out;
405
+ }
406
+ /** The commands in a snapshot's original `hooks = [...]` line; none when it does not parse. */
407
+ function snapshotCommands(hooksText) {
408
+ try {
409
+ const doc = parseToml(hooksText);
410
+ const hooks = doc["hooks"];
411
+ return Array.isArray(hooks)
412
+ ? hooks.flatMap((h) => (isRecord(h) && typeof h["command"] === "string" ? [h["command"]] : []))
413
+ : [];
414
+ }
415
+ catch {
416
+ return [];
417
+ }
418
+ }
419
+ export function buildHookLiveness(manifest, opts) {
420
+ const runtimes = [];
421
+ if (opts.runtimes.includes("claude-code")) {
422
+ // `harness gate enable` without --settings targets `~/.claude/settings.json`; it does not read CLAUDE_CONFIG_DIR.
423
+ runtimes.push(checkClaudeLiveHooks(manifest, resolveSettingsPath(opts.home, opts.env), {
424
+ gateDefaultPath: resolveSettingsPath(opts.home, {}),
425
+ }));
426
+ }
427
+ if (opts.runtimes.includes("codex")) {
428
+ const defaultConfig = defaultCodexConfigPath(opts.home);
429
+ runtimes.push(checkCodexLiveHooks(manifest, opts.codexConfigPath ?? defaultConfig, { gateDefaultPath: defaultConfig }));
430
+ }
431
+ return { runtimes };
432
+ }
433
+ export function countHookLiveness(section) {
434
+ let errorCount = 0;
435
+ let warningCount = 0;
436
+ for (const r of section.runtimes) {
437
+ for (const e of r.entries) {
438
+ if (e.status === "error")
439
+ errorCount++;
440
+ else if (e.status === "warn")
441
+ warningCount++;
442
+ }
443
+ }
444
+ return { errorCount, warningCount };
445
+ }
446
+ /** The runtimes whose live config doctor compares: the one a plain apply selects, plus Codex under `--target codex`. */
447
+ export function livenessRuntimes(selected, target) {
448
+ const out = [];
449
+ if (selected === "claude-code")
450
+ out.push("claude-code");
451
+ if (selected === "codex" || target === "codex")
452
+ out.push("codex");
453
+ return out;
454
+ }
455
+ //# sourceMappingURL=hook-liveness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hook-liveness.js","sourceRoot":"","sources":["../../../src/cli/doctor/hook-liveness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAEL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,aAAa,EAEb,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EACL,mBAAmB,EAGnB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,SAAS,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAmDtD,MAAM,KAAK,GAAG,CAAC,CAAU,EAAU,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACtF,MAAM,MAAM,GAAG,CAAC,CAAqC,EAAU,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAEvG,MAAM,UAAU,YAAY,CAAC,CAAU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,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACjC,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;YAC1B,IAAI,CAAC,CAAC,MAAM,KAAK,OAAO;gBAAE,UAAU,EAAE,CAAC;iBAClC,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM;gBAAE,YAAY,EAAE,CAAC;QAC/C,CAAC;IACH,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AACtC,CAAC;AAED,wHAAwH;AACxH,MAAM,UAAU,gBAAgB,CAAC,QAAiB,EAAE,MAA0B;IAC5E,MAAM,GAAG,GAA0B,EAAE,CAAC;IACtC,IAAI,QAAQ,KAAK,aAAa;QAAE,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACxD,IAAI,QAAQ,KAAK,OAAO,IAAI,MAAM,KAAK,OAAO;QAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClE,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1,12 +1,9 @@
1
1
  import { type McpProbe } from "../../probes/mcp.js";
2
- import type { Manifest } from "../../schema/index.js";
3
- import { type GitIgnoreProbe } from "../validate/checks.js";
2
+ import { type Manifest } from "../../schema/index.js";
4
3
  import { type LoaderOptions } from "../loader.js";
5
4
  import { type RunCodexCheckOptions } from "./codex.js";
6
5
  import { type RunOpencodeCheckOptions } from "./opencode.js";
7
6
  import { type NpmExec } from "./npm-bin-path.js";
8
- import { type RogueLedgerScanOptions } from "./rogue-ledger.js";
9
- import { type RunDoctorToolchainParityOptions } from "./toolchain-parity.js";
10
7
  import type { ClaudeMcpExec } from "../../io/claude-mcp.js";
11
8
  import { isDoctorTarget, KNOWN_DOCTOR_TARGETS, type DoctorReport, type DoctorTarget } from "./types.js";
12
9
  export interface DoctorOptions extends LoaderOptions {
@@ -17,11 +14,12 @@ export interface DoctorOptions extends LoaderOptions {
17
14
  now?: Date;
18
15
  homeOverride?: string;
19
16
  /**
20
- * Phase 6 #6 follow-up: when set to `codex`, run the harness-side
21
- * codex adapter health checks in addition to the default suite.
22
- * Future runtimes plug in here without restructuring the surface.
23
- * Restricted to targets that have a wired adapter-health module
24
- * (today: `codex`); see `KNOWN_DOCTOR_TARGETS`.
17
+ * Phase 6 #6 follow-up: when set to `codex` or `opencode`, run the
18
+ * harness-side adapter health checks for that target in addition to
19
+ * the default suite. Future runtimes plug in here without
20
+ * restructuring the surface. Restricted to targets that have a wired
21
+ * adapter-health module (today: `codex` and `opencode`); see
22
+ * `KNOWN_DOCTOR_TARGETS`.
25
23
  */
26
24
  target?: DoctorTarget;
27
25
  /** Test-injection knobs forwarded to the codex target evaluator. */
@@ -29,11 +27,10 @@ export interface DoctorOptions extends LoaderOptions {
29
27
  /** Test-injection knobs forwarded to the opencode target evaluator. */
30
28
  opencodeCheckOptions?: Partial<RunOpencodeCheckOptions>;
31
29
  /**
32
- * Test-injection knobs for the rogue-ledger scan. `homeDir` and `cwd`
33
- * default to the runtime values resolved inside `doctor`; tests
34
- * usually override both plus `fsInterface`.
30
+ * Test-injection knob for the hook-liveness check: the Codex config to
31
+ * compare. Defaults to `~/.codex/config.toml` under the operator home.
35
32
  */
36
- rogueLedgerScanOptions?: Partial<RogueLedgerScanOptions>;
33
+ codexLiveConfigPath?: string;
37
34
  /**
38
35
  * Test-injection knob for the npm global-bin PATH check (task
39
36
  * 4ddd78ed). Tests fake the `npm prefix -g` invocation by passing a
@@ -41,18 +38,10 @@ export interface DoctorOptions extends LoaderOptions {
41
38
  * this and the real `npm` is spawned.
42
39
  */
43
40
  npmBinExec?: NpmExec;
44
- /**
45
- * Test-injection knob for the solution-acceptance knob-ignored check
46
- * (task 24f6ceb9). Defaults to a real `git check-ignore` probe against
47
- * the process cwd; `shallow` runs degrade it to `() => null` (no spawn),
48
- * mirroring how the version probe degrades. An explicit probe wins over
49
- * `shallow` so tests can exercise the check without paying for spawns.
50
- */
51
- gitIgnoreProbe?: GitIgnoreProbe;
52
41
  /**
53
42
  * Test-injection knob for the claude-code MCP registration check (task
54
43
  * init-mcp-wiring-claude-code/T-003). Tests fake the `claude mcp list`
55
- * spawn the same way `npmBinExec`/`gitIgnoreProbe` fake theirs;
44
+ * spawn the same way `npmBinExec` fakes theirs;
56
45
  * production omits this and the real `claude` CLI is spawned. The live
57
46
  * call itself is additionally gated on `!shallow` and at least one
58
47
  * enabled `tools.mcp[]` entry — see `buildClaudeMcpRegistration`.
@@ -60,49 +49,11 @@ export interface DoctorOptions extends LoaderOptions {
60
49
  claudeMcpExec?: ClaudeMcpExec;
61
50
  /**
62
51
  * Test-injection knob for env-dependent checks: the dead settings.json
63
- * `mcpServers` block lookup (honors `CLAUDE_CONFIG_DIR`), and the
64
- * understanding-gate mode env/config divergence advisory (task
65
- * 24abdecb, reads `UNDERSTANDING_GATE_MODE`). Defaults to
52
+ * `mcpServers` block lookup (honors `CLAUDE_CONFIG_DIR`). Defaults to
66
53
  * `process.env`; tests inject `{}` (or specific values) to stay
67
54
  * hermetic against the operator's real env.
68
55
  */
69
56
  envOverride?: NodeJS.ProcessEnv;
70
- /**
71
- * Test-injection knobs for the toolchain-parity comparison (task
72
- * 13919613). Mirrors `codexCheckOptions`/`opencodeCheckOptions`: tests
73
- * inject `runNodeVersion`/`runNpmGlobals`/`readOwKitVersion`/
74
- * `readMcpServerNames` to fake the reused session-start Collector
75
- * without a real spawn (see the hermetic-spawn-guard doc on those
76
- * collectors); production omits this and the real collectors run,
77
- * gated the same way `--shallow` gates every other live-spawn check.
78
- */
79
- toolchainParityOptions?: Partial<RunDoctorToolchainParityOptions>;
80
- /**
81
- * Window size for the understanding-gate auto-approval doctor listing
82
- * (ADR docs/decisions/2026-08-27-ug-auto-mode-approval.md slice 1,
83
- * agent-tasks 74b4b17d): how many of the newest `.approvals/` session
84
- * markers to scan for the "auto approvals in the last N sessions"
85
- * metric. Defaults to {@link DEFAULT_RECENT_SESSIONS}. Must be an
86
- * integer >= 1; `doctor()` throws otherwise (mirrors the CLI's own
87
- * `--recent-sessions` validation, but also covers direct/programmatic
88
- * callers that bypass the CLI parser).
89
- */
90
- recentSessions?: number;
91
- /**
92
- * cwd the two project-scoped settings-drift candidates
93
- * (`.claude/settings.json`, `.claude/settings.local.json`) resolve
94
- * against, mirroring how `harness apply --target <relative path>`
95
- * resolves its own target (`resolveTargetPath` in apply.ts, which
96
- * calls bare `path.resolve`). Defaults to `process.cwd()`; tests
97
- * inject a fixture dir to stay hermetic against the real cwd.
98
- *
99
- * Also the cwd `session_start_preflight.setup`'s per-repo project
100
- * layer is derived from when `opts.project` is absent (task
101
- * c88461c1, review round 2, decision D-021b), via the same
102
- * `deriveProjectName` helper `harness session-start preflight` and
103
- * `harness explain-policy` feed their own `loadManifest` calls from.
104
- */
105
- cwd?: string;
106
57
  }
107
58
  export { isDoctorTarget, KNOWN_DOCTOR_TARGETS };
108
59
  /** One unresolved `tools.mcp[]` / `tools.cli[]` binary from `checkBinResolution`. */
@@ -143,37 +94,12 @@ export declare function formatBinResolutionIssues(report: BinResolutionReport):
143
94
  /**
144
95
  * Wraps a version probe with a per-full-argv cache, keyed on
145
96
  * `JSON.stringify(cmd)` so two commands sharing only `cmd[0]` (e.g.
146
- * `["understanding-gate", "--version"]` vs. `["understanding-gate",
147
- * "--check"]`) are never conflated into the same cache slot; only a
97
+ * `["some-bin", "--version"]` vs. `["some-bin", "--check"]`) are never conflated into the same cache slot; only a
148
98
  * byte-identical argv array is deduped. Exported standalone (task
149
99
  * ab634898) so this caching contract has its own focused
150
100
  * unit test independent of any particular pack's hook shape.
151
101
  */
152
102
  export declare function memoizeVersionProbe(probe: (cmd: readonly string[]) => string | null): (cmd: readonly string[]) => string | null;
153
- /**
154
- * Declared-but-not-live policy pack check. `expandPolicyPacks` silently
155
- * skips a pack whose `source:` token is unrecognised or whose builtin
156
- * `name:` doesn't resolve in the registry — its hooks never reach
157
- * `settings.json`, so the operator's gate is inert. Surface each gap
158
- * as a doctor error so the misconfig is impossible to miss.
159
- *
160
- * Skipped (`enabled: false`) packs are NOT checked: they're not
161
- * expected to be live, and flagging them would flood the report.
162
- */
163
- /**
164
- * Sentinel "cannot tell" probe: shallow runs answer every ignoredness
165
- * question with `null` instead of spawning `git check-ignore`. Exported
166
- * (with the resolver below) so a test can pin the no-spawn contract by
167
- * identity instead of mocking `node:child_process`.
168
- */
169
- export declare const NULL_GIT_IGNORE_PROBE: GitIgnoreProbe;
170
- /**
171
- * Probe resolution order: an explicit (test) probe always wins; `shallow`
172
- * degrades to the no-spawn sentinel, mirroring how the npm-bin probe and
173
- * MCP probes degrade; otherwise the real `git check-ignore` probe runs
174
- * against the process cwd.
175
- */
176
- export declare function resolveGitIgnoreProbe(opts: Pick<DoctorOptions, "gitIgnoreProbe" | "shallow">): GitIgnoreProbe;
177
103
  export declare function doctor(opts?: DoctorOptions): Promise<DoctorReport>;
178
104
  export { format } from "./format.js";
179
105
  export type * from "./types.js";