@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
@@ -1,95 +0,0 @@
1
- // Doctor finding for the Mac-mini incident shape (task 8f637efd,
2
- // docs/decisions/2026-08-27-ug-auto-mode-approval.md, "Amendment: install
3
- // default"): a session ran under `bypassPermissions` (observed on the
4
- // PreToolUse payload by the hook itself, see
5
- // permission-mode-observations.ts) but `auto_approve` is missing, or
6
- // present without covering `bypassPermissions` for `claude-code`. In
7
- // that shape every gated call in the session falls through to the manual
8
- // `harness approve understanding` prompt, which is exactly the gap the
9
- // operator hit: the pack expects an unattended session under
10
- // `bypassPermissions` to have opted in, and nothing said otherwise.
11
- //
12
- // This check reads ONLY the hook-written observation
13
- // (`.permission-mode-observations/`), never the ledger and never the
14
- // persisted report: both are agent-writable, and the evidence-ledger
15
- // trust boundary this pack already enforces for approval
16
- // (docs/okf/evidence-ledger-trust-boundary.md) applies to a doctor
17
- // finding just as much as to a gate decision: a fact the AGENT can write
18
- // must not be what tells the operator "you meant to opt in and didn't".
19
- //
20
- // Deliberately advisory (⚠), never an error: an operator who runs
21
- // `bypassPermissions` sessions on the manual approval path on purpose
22
- // (never wanting unattended auto-approval) is not misconfigured.
23
- //
24
- // THE OBSERVATION IS UNSIGNED (review round 3, F2). "Never the ledger,
25
- // never the persisted report" above is about the WRITE PATH (this
26
- // finding does not trust an agent-writable ledger row or report field),
27
- // not a claim that the observation itself is tamper-proof: unlike the
28
- // approval marker, `permission-mode-observations.ts`'s record carries no
29
- // signature, so it is evidence that `harness pack hook pre-tool-use` was
30
- // invoked with a given `session_id`/`permission_mode` on its stdin, not
31
- // proof that a particular session actually ran under that mode: an
32
- // already-approved session (or anything else able to invoke the hook
33
- // binary directly) can write, or forge, one. That is exactly why this
34
- // finding stays advisory-only and never feeds a gate or an approval: the
35
- // operator who reads it decides what it means. Signing the observation
36
- // was considered and rejected: a signature would only prove the hook
37
- // signed the record, not that the named session actually ran under that
38
- // mode, and it would open a second, unconditional signing surface for
39
- // the marker-signing key (not a path to mint an approval marker, which
40
- // stays namespaced by markerId). See
41
- // docs/decisions/2026-08-27-ug-auto-mode-approval.md's "Amendment:
42
- // permission-mode observation stays unsigned" for the full reasoning and
43
- // the reopen criterion.
44
- import { CLAUDE_CODE_HARNESS, harnessAllowed, listPermissionModeObservations, parseAutoApprove, permissionModeAllowed, renderAutoApproveSnippet, sanitizeForDisplay, } from "../../policy-packs/builtin/understanding-before-execution-runtime.js";
45
- import { findEnabledUnderstandingPack } from "./understanding-mode-env.js";
46
- /** The one payload literal this finding cares about (T1, see the ADR's signal table). */
47
- const BYPASS_MODE = "bypassPermissions";
48
- /**
49
- * Pure(-ish): manifest + `generatedDir` in, a finding out (or
50
- * `undefined` when there is nothing to flag). Only fires when:
51
- * - the `understanding-before-execution` pack is declared AND enabled
52
- * (mirrors every sibling advisory's gate: a pack that never runs
53
- * has no auto-approve path to be missing);
54
- * - at least one of the newest `recentSessions` hook-written
55
- * observations records `permissionMode === "bypassPermissions"`;
56
- * - `auto_approve` does NOT cover that combination today: either the
57
- * block is absent/malformed (`parseAutoApprove` returns `null`), or
58
- * `bypassPermissions` is not in `when`, or `claude-code` is not in
59
- * `harnesses` (an operator who opted Codex in alone, dropping
60
- * Claude Code, still has this exact gap on the Claude Code side).
61
- *
62
- * Reports the NEWEST qualifying observation only: this is a "you have
63
- * at least one gap" flag, not a per-session audit; `ugAutoApprovals`
64
- * already owns the full listing idiom for that.
65
- */
66
- export function checkBypassWithoutAutoApprove(manifest, generatedDir, opts) {
67
- const pack = findEnabledUnderstandingPack(manifest);
68
- if (!pack)
69
- return undefined;
70
- const observations = listPermissionModeObservations(generatedDir, {
71
- windowSize: opts.recentSessions,
72
- });
73
- const bypassObserved = observations.entries.find((e) => e.permissionMode === BYPASS_MODE);
74
- if (!bypassObserved)
75
- return undefined;
76
- const autoApprove = parseAutoApprove(pack.config["auto_approve"]);
77
- const covered = permissionModeAllowed(autoApprove, BYPASS_MODE) &&
78
- harnessAllowed(autoApprove, CLAUDE_CODE_HARNESS);
79
- if (covered)
80
- return undefined;
81
- // Sanitise at the render boundary as well, not only in the reader
82
- // (mirrors persisted-reports.ts): both fields are payload-controlled.
83
- const sessionId = sanitizeForDisplay(bypassObserved.sessionId);
84
- const observedAt = sanitizeForDisplay(bypassObserved.observedAt);
85
- return {
86
- sessionId,
87
- observedAt,
88
- message: `bypassPermissions observed for session ${sessionId} (${observedAt}) but auto_approve does not cover it (hook-written, unsigned self-report; confirm from your own launch settings before enabling auto_approve); every gated call in that session needed a manual approval`,
89
- detail: [
90
- "run `harness pack upgrade understanding-before-execution` to insert the block below, or add it by hand under policy_packs[understanding-before-execution].config:",
91
- ...renderAutoApproveSnippet(0).split("\n"),
92
- ],
93
- };
94
- }
95
- //# sourceMappingURL=bypass-without-auto-approve.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bypass-without-auto-approve.js","sourceRoot":"","sources":["../../../src/cli/doctor/bypass-without-auto-approve.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,0EAA0E;AAC1E,sEAAsE;AACtE,6CAA6C;AAC7C,qEAAqE;AACrE,qEAAqE;AACrE,yEAAyE;AACzE,uEAAuE;AACvE,6DAA6D;AAC7D,oEAAoE;AACpE,EAAE;AACF,qDAAqD;AACrD,qEAAqE;AACrE,qEAAqE;AACrE,yDAAyD;AACzD,mEAAmE;AACnE,yEAAyE;AACzE,wEAAwE;AACxE,EAAE;AACF,kEAAkE;AAClE,sEAAsE;AACtE,iEAAiE;AACjE,EAAE;AACF,uEAAuE;AACvE,kEAAkE;AAClE,wEAAwE;AACxE,sEAAsE;AACtE,yEAAyE;AACzE,yEAAyE;AACzE,wEAAwE;AACxE,mEAAmE;AACnE,qEAAqE;AACrE,sEAAsE;AACtE,yEAAyE;AACzE,uEAAuE;AACvE,qEAAqE;AACrE,wEAAwE;AACxE,sEAAsE;AACtE,uEAAuE;AACvE,qCAAqC;AACrC,mEAAmE;AACnE,yEAAyE;AACzE,wBAAwB;AAExB,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,8BAA8B,EAC9B,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,sEAAsE,CAAC;AAE9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAE3E,yFAAyF;AACzF,MAAM,WAAW,GAAG,mBAAmB,CAAC;AAmBxC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,6BAA6B,CAC3C,QAAkB,EAClB,YAAoB,EACpB,IAAgC;IAEhC,MAAM,IAAI,GAAG,4BAA4B,CAAC,QAAQ,CAAC,CAAC;IACpD,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAE5B,MAAM,YAAY,GAAG,8BAA8B,CAAC,YAAY,EAAE;QAChE,UAAU,EAAE,IAAI,CAAC,cAAc;KAChC,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,KAAK,WAAW,CAAC,CAAC;IAC1F,IAAI,CAAC,cAAc;QAAE,OAAO,SAAS,CAAC;IAEtC,MAAM,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;IAClE,MAAM,OAAO,GACX,qBAAqB,CAAC,WAAW,EAAE,WAAW,CAAC;QAC/C,cAAc,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;IACnD,IAAI,OAAO;QAAE,OAAO,SAAS,CAAC;IAE9B,kEAAkE;IAClE,sEAAsE;IACtE,MAAM,SAAS,GAAG,kBAAkB,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IAC/D,MAAM,UAAU,GAAG,kBAAkB,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IACjE,OAAO;QACL,SAAS;QACT,UAAU;QACV,OAAO,EAAE,0CAA0C,SAAS,KAAK,UAAU,0MAA0M;QACrR,MAAM,EAAE;YACN,mKAAmK;YACnK,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;SAC3C;KACF,CAAC;AACJ,CAAC"}
@@ -1,28 +0,0 @@
1
- import type { Manifest } from "../../schema/index.js";
2
- export interface CodexConfigDriftSection {
3
- /** ⚠ lines; each rolls into warningCount. */
4
- warnings: string[];
5
- }
6
- /**
7
- * Whether the manifest's `understanding-before-execution` pack has opted
8
- * Codex into the `auto_approve` path (`auto_approve.harnesses` contains
9
- * `"codex"`). Pure and side-effect-free: reuses the same fail-closed
10
- * parser the Codex PreToolUse hook itself consults
11
- * (`attemptAutoApproval` in `../pack/auto-approve-path.ts`), so a
12
- * malformed `auto_approve` block resolves to "not opted in" here too,
13
- * never a guess.
14
- */
15
- export declare function isCodexOptedIntoAutoApprove(manifest: Manifest): boolean;
16
- export interface BuildCodexConfigDriftOptions {
17
- /** `harness.generated/` for the manifest in use; kept for shape-parity with `BuildSettingsDriftOptions` (`driftCheckOpts` in index.ts is shared between both), unused by this check (see module header: no baseline exists to read here). */
18
- generatedDir: string;
19
- /** `harness.lock` path for the manifest in use; kept for the same shape-parity reason as `generatedDir`, unused by this check. */
20
- lockPath: string;
21
- /** Resolves the repo-scoped candidate file (`<cwd>/.codex/config.toml`). */
22
- cwd: string;
23
- /** Operator home; resolves the default `$CODEX_HOME` when the env var is unset. */
24
- home: string;
25
- /** Env for `CODEX_HOME` resolution. */
26
- env: NodeJS.ProcessEnv;
27
- }
28
- export declare function buildCodexConfigDrift(opts: BuildCodexConfigDriftOptions): CodexConfigDriftSection;
@@ -1,240 +0,0 @@
1
- // Codex counterpart of settings-drift.ts (ADR
2
- // docs/decisions/2026-08-27-ug-auto-mode-approval.md, threat model (c),
3
- // "Audit and doctor"), follow-up of slice 2 (agent-tasks f59ea0eb).
4
- //
5
- // `approval_policy = "never"` is the MEASURED signal: dogfood/ug-auto-
6
- // mode-signals/README.md section (l) (Codex TUI) shows `tui-config-never`
7
- // (`config.toml`: `approval_policy = "never"`) reports `bypassPermissions`
8
- // where the otherwise-comparable `tui-default` shape (no `approval_policy`
9
- // set) reports `default`, and section (k) (Codex exec) shows the same
10
- // key discriminating `exec-onrequest`/`exec-onfailure` (`bypassPermissions`
11
- // regardless, exec auto-approves almost everything headless) from nothing
12
- // special, i.e. exec's own vocabulary does not turn on this key either
13
- // way there. The `default_permissions` full-access check below is NOT a
14
- // measured signal in the same sense: section (k)'s exec rows show
15
- // `config-perm-fullaccess` (`default_permissions = ":danger-full-access"`)
16
- // and `config-perm-readonly` (`default_permissions = ":read-only"`) both
17
- // reporting `bypassPermissions`, i.e. this key does not discriminate
18
- // `permission_mode` at all under `codex exec`, and section (l)'s TUI
19
- // table has no `default_permissions`-via-`config.toml` row at all (the
20
- // one full-access TUI shape, `tui-perm-full-access`, was set through the
21
- // `/permissions` menu, not this config key, per
22
- // `payloads/codex-tui-perm-full-access.config.toml`). This check flags
23
- // `default_permissions` as a threat-model heuristic on a key the operator
24
- // can set (it is documented Codex config surface that plausibly feeds a
25
- // yet-unmeasured code path), not because measurement showed it moving
26
- // `permission_mode`.
27
- //
28
- // Either key pre-sets the trusted `when`-allowlist signal the Codex
29
- // auto-approval path (`src/cli/pack/auto-approve-path.ts`,
30
- // `CODEX_HARNESS`) consumes, the same way `permissions.defaultMode` does
31
- // for Claude Code (settings-drift.ts's module header, threat model (c)).
32
- //
33
- // Gated on the pack's `auto_approve.harnesses` actually listing `codex`
34
- // (`isCodexOptedIntoAutoApprove` below): a repo that never opted Codex
35
- // into the auto path has no live Codex `permission_mode` signal for this
36
- // key to pre-set, so warning there would be noise unconnected to any
37
- // live risk (mirrors the per-harness gate `attemptAutoApproval` itself
38
- // applies before the `when` allowlist, `auto-approve.ts`'s module
39
- // header).
40
- //
41
- // Unlike settings-drift.ts's `permissions.defaultMode` check, this is
42
- // NOT drift-gated (warn only when the live value differs from the
43
- // apply-time baseline): `approval_policy = "never"` is a real live risk
44
- // the moment it is present, whether or not it was already there at the
45
- // last `harness apply`, so this check always warns while present and
46
- // opted in. There is no apply-time three-way distinction to annotate
47
- // with either: harness never snapshots the operator's live, whole
48
- // `config.toml` (only `harness apply --runtime codex --install`'s own
49
- // generated hook block, merged in place by `install-codex-config.ts`,
50
- // ever lands in `.last-apply`'s `"codex/config.toml"` entry), and
51
- // `apply.ts` never records a `kind: "target"` lock entry for the
52
- // installed Codex config path the way it does for Claude Code's
53
- // `--target` write, so there is no baseline to compare the live value
54
- // against and no lock entry to tell a harness-touched file apart from
55
- // one it has never seen. Every warning below therefore carries the same
56
- // constant `NO_SNAPSHOT_SUFFIX`, reporting presence, not drift.
57
- //
58
- // Fail-open, like every other doctor check in this family: a missing or
59
- // unreadable candidate file resolves to "nothing to report" for that
60
- // file, and a candidate whose TOML this module's minimal scanner cannot
61
- // make sense of (an unterminated quoted string) adds ONE diagnostic
62
- // line, never a thrown error; the keys that did parse from the rest of
63
- // that same file are still evaluated and can still warn.
64
- //
65
- // No full TOML parser: none is a dependency of this package (checked
66
- // before writing this file), and `install-codex-config.ts` itself never
67
- // parses the operator's config.toml into an object either, it locates
68
- // harness's own managed block by string search. This module only needs
69
- // two ROOT-LEVEL (not inside any `[table]`) string-valued keys, so a
70
- // small line-oriented scanner is enough: it accepts a bare or quoted key
71
- // (`approval_policy = ...` and `"approval_policy" = ...`), skips over
72
- // multi-line basic/literal string bodies (`"""`/`'''`) so a body line
73
- // that happens to look like `key = "value"` inside one is never
74
- // mistaken for a root-level assignment, and does not attempt custom
75
- // `[profiles.*]` tables: a profile-scoped `approval_policy` under
76
- // `[profiles.<name>]` is out of scope and not detected today (see the
77
- // task's constraints).
78
- import * as fs from "node:fs";
79
- import * as path from "node:path";
80
- import { PACK_NAME as UNDERSTANDING_PACK_NAME } from "../../policy-packs/builtin/understanding-before-execution.js";
81
- import { CODEX_HARNESS, harnessAllowed, parseAutoApprove, } from "../../policy-packs/builtin/understanding-before-execution/auto-approve.js";
82
- import { tildeize } from "./settings-drift.js";
83
- /** Every warning line carries this: harness keeps no apply-time snapshot of a live Codex config.toml (see module header). */
84
- const NO_SNAPSHOT_SUFFIX = " (harness keeps no apply-time snapshot of this file; presence only)";
85
- /**
86
- * Whether the manifest's `understanding-before-execution` pack has opted
87
- * Codex into the `auto_approve` path (`auto_approve.harnesses` contains
88
- * `"codex"`). Pure and side-effect-free: reuses the same fail-closed
89
- * parser the Codex PreToolUse hook itself consults
90
- * (`attemptAutoApproval` in `../pack/auto-approve-path.ts`), so a
91
- * malformed `auto_approve` block resolves to "not opted in" here too,
92
- * never a guess.
93
- */
94
- export function isCodexOptedIntoAutoApprove(manifest) {
95
- const pack = manifest.policy_packs.find((p) => p.name === UNDERSTANDING_PACK_NAME && p.enabled !== false);
96
- if (!pack)
97
- return false;
98
- const cfg = parseAutoApprove(pack.config["auto_approve"], null);
99
- return harnessAllowed(cfg, CODEX_HARNESS);
100
- }
101
- /**
102
- * Scan the ROOT-LEVEL (before the first `[table]` header) `key = "..."`
103
- * assignments in a Codex `config.toml` body. Returns the string-valued
104
- * keys found, plus `malformed: true` when a candidate assignment opens a
105
- * single-line quoted string that never closes on the same line (the one
106
- * shape this scanner treats as broken TOML rather than "not a string /
107
- * not a key we track"). A multi-line basic/literal string (`"""`/`'''`)
108
- * is a different, valid TOML shape: every line up to and including its
109
- * closing delimiter is skipped rather than scanned as assignments, and
110
- * skipping it never sets `malformed`. Non-string values (numbers,
111
- * booleans, arrays, inline tables) are silently skipped too, not flagged
112
- * malformed: this scanner has no opinion about them. The key itself may
113
- * be bare (`approval_policy`) or a quoted TOML key
114
- * (`"approval_policy"` / `'approval_policy'`); either form is accepted.
115
- */
116
- function scanRootLevelStringKeys(raw) {
117
- const values = {};
118
- let malformed = false;
119
- let multilineDelim = null;
120
- for (const rawLine of raw.split(/\r?\n/)) {
121
- if (multilineDelim !== null) {
122
- // Inside a multi-line basic/literal string body: this line is
123
- // string content, never a root-level assignment, however much it
124
- // may look like one. Only the closing delimiter ends the skip.
125
- if (rawLine.includes(multilineDelim))
126
- multilineDelim = null;
127
- continue;
128
- }
129
- const line = rawLine.trim();
130
- if (line.length === 0 || line.startsWith("#"))
131
- continue;
132
- // A `[table]` or `[[array-of-tables]]` header ends the root-level
133
- // scope for every key from here on; this module only tracks
134
- // root-level keys.
135
- if (line.startsWith("["))
136
- break;
137
- const eq = line.indexOf("=");
138
- if (eq === -1)
139
- continue;
140
- let key = line.slice(0, eq).trim();
141
- if ((key.startsWith('"') && key.endsWith('"') && key.length >= 2) ||
142
- (key.startsWith("'") && key.endsWith("'") && key.length >= 2)) {
143
- key = key.slice(1, -1);
144
- }
145
- if (!/^[A-Za-z0-9_-]+$/.test(key))
146
- continue;
147
- const valuePart = line.slice(eq + 1).trim();
148
- if (valuePart.startsWith('"""') || valuePart.startsWith("'''")) {
149
- const delim = valuePart.slice(0, 3);
150
- // A closing delimiter later on this same line makes it a
151
- // single-line multi-line-string literal; this scanner does not
152
- // track such values (out of scope, same as any other value shape
153
- // it has no opinion about), it just must not treat the rest of
154
- // the file as still inside the string.
155
- if (valuePart.indexOf(delim, 3) === -1)
156
- multilineDelim = delim;
157
- continue;
158
- }
159
- const parsed = matchTomlString(valuePart);
160
- if (parsed === null) {
161
- if (valuePart.startsWith('"') || valuePart.startsWith("'"))
162
- malformed = true;
163
- continue;
164
- }
165
- values[key] = parsed;
166
- }
167
- return { values, malformed };
168
- }
169
- /** A basic (`"..."`) or literal (`'...'`) single-line TOML string, or `null` if `value` is not one. */
170
- function matchTomlString(value) {
171
- if (value.startsWith('"')) {
172
- const m = /^"((?:[^"\\]|\\.)*)"/.exec(value);
173
- if (!m)
174
- return null;
175
- return (m[1] ?? "")
176
- .replace(/\\"/g, '"')
177
- .replace(/\\n/g, "\n")
178
- .replace(/\\t/g, "\t")
179
- .replace(/\\\\/g, "\\");
180
- }
181
- if (value.startsWith("'")) {
182
- const m = /^'([^']*)'/.exec(value);
183
- if (!m)
184
- return null;
185
- return m[1] ?? "";
186
- }
187
- return null;
188
- }
189
- function checkOneFile(file, warnings) {
190
- let raw;
191
- try {
192
- raw = fs.readFileSync(file.absolutePath, "utf8");
193
- }
194
- catch {
195
- return;
196
- }
197
- const scan = scanRootLevelStringKeys(raw);
198
- if (scan.malformed) {
199
- warnings.push(`${file.displayLabel}: unreadable/invalid Codex config TOML`);
200
- // Keep going: a malformed line elsewhere in the file must not hide a
201
- // risky key that DID parse from a different line of the same file.
202
- }
203
- const approvalPolicy = scan.values["approval_policy"];
204
- if (approvalPolicy === "never") {
205
- warnings.push(`approval_policy = "never" set in ${file.displayLabel}${NO_SNAPSHOT_SUFFIX}`);
206
- }
207
- const defaultPermissions = scan.values["default_permissions"];
208
- if (defaultPermissions !== undefined) {
209
- const stripped = defaultPermissions.startsWith(":")
210
- ? defaultPermissions.slice(1)
211
- : defaultPermissions;
212
- if (stripped === "danger-full-access") {
213
- warnings.push(`default_permissions = ${JSON.stringify(defaultPermissions)} (full access) set in ${file.displayLabel}${NO_SNAPSHOT_SUFFIX}`);
214
- }
215
- }
216
- }
217
- export function buildCodexConfigDrift(opts) {
218
- const warnings = [];
219
- const codexHomeEnv = opts.env["CODEX_HOME"];
220
- const codexHomeFromEnv = typeof codexHomeEnv === "string" && codexHomeEnv.trim().length > 0;
221
- const codexHomeDir = codexHomeFromEnv ? codexHomeEnv : path.join(opts.home, ".codex");
222
- const codexHomeConfigPath = path.join(codexHomeDir, "config.toml");
223
- const candidates = [
224
- {
225
- absolutePath: path.resolve(codexHomeConfigPath),
226
- displayLabel: codexHomeFromEnv
227
- ? "$CODEX_HOME/config.toml"
228
- : tildeize(codexHomeConfigPath, opts.home),
229
- },
230
- {
231
- absolutePath: path.resolve(opts.cwd, ".codex", "config.toml"),
232
- displayLabel: ".codex/config.toml",
233
- },
234
- ];
235
- for (const c of candidates) {
236
- checkOneFile(c, warnings);
237
- }
238
- return { warnings };
239
- }
240
- //# sourceMappingURL=codex-config-drift.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"codex-config-drift.js","sourceRoot":"","sources":["../../../src/cli/doctor/codex-config-drift.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,wEAAwE;AACxE,oEAAoE;AACpE,EAAE;AACF,uEAAuE;AACvE,0EAA0E;AAC1E,2EAA2E;AAC3E,2EAA2E;AAC3E,sEAAsE;AACtE,4EAA4E;AAC5E,0EAA0E;AAC1E,uEAAuE;AACvE,wEAAwE;AACxE,kEAAkE;AAClE,2EAA2E;AAC3E,yEAAyE;AACzE,qEAAqE;AACrE,qEAAqE;AACrE,uEAAuE;AACvE,yEAAyE;AACzE,gDAAgD;AAChD,uEAAuE;AACvE,0EAA0E;AAC1E,wEAAwE;AACxE,sEAAsE;AACtE,qBAAqB;AACr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,EAAE,gBAAgB;gBAC5B,CAAC,CAAC,yBAAyB;gBAC3B,CAAC,CAAC,QAAQ,CAAC,mBAAmB,EAAE,IAAI,CAAC,IAAI,CAAC;SAC7C;QACD;YACE,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,aAAa,CAAC;YAC7D,YAAY,EAAE,oBAAoB;SACnC;KACF,CAAC;IAEF,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3B,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,CAAC;AACtB,CAAC"}
@@ -1,53 +0,0 @@
1
- import * as fs from "node:fs";
2
- export interface RogueLedgerDb {
3
- /** Absolute path to the rogue ledger.db file. */
4
- path: string;
5
- /** Absolute path to the rogue `~` directory (the cleanup target). */
6
- rogueDir: string;
7
- }
8
- export interface RogueLedgerScanOptions {
9
- homeDir: string;
10
- cwd: string;
11
- /**
12
- * Test injection: override fs operations. realpathSync is included so
13
- * fixtures can simulate symlinks-with-same-target without actually
14
- * creating cross-tmpdir symlinks (which surface differently on macOS
15
- * and Linux because of /tmp -> /private/tmp resolution).
16
- */
17
- fsInterface?: Pick<typeof fs, "existsSync" | "statSync" | "lstatSync" | "readdirSync" | "realpathSync">;
18
- }
19
- /**
20
- * Walk a small set of well-known parent directories for a literal `~`
21
- * subdirectory that contains `.evidence-ledger/ledger.db`. Best-effort:
22
- * unreadable directories are silently skipped. Returns deduplicated
23
- * results (by realpath) sorted by path for stable rendering.
24
- */
25
- export declare function scanForRogueLedgers(opts: RogueLedgerScanOptions): RogueLedgerDb[];
26
- export interface DeleteRogueLedgersOptions {
27
- /**
28
- * When true, skip per-hit confirmation prompts and delete immediately.
29
- * Maps to `harness doctor --rm-rogue-ledgers --yes`.
30
- */
31
- yes?: boolean;
32
- /**
33
- * Test injection: called per hit with the rogueDir path; returns true to
34
- * confirm deletion, false to skip. When omitted and `yes` is false,
35
- * production code prompts via readline on stdin.
36
- * Same knob pattern as `mcpProbe` / `fsInterface` elsewhere in doctor.
37
- */
38
- promptFn?: (rogueDir: string) => Promise<boolean>;
39
- }
40
- export interface DeleteRogueLedgersResult {
41
- /** Hits that were confirmed and whose rogueDir was removed. */
42
- deleted: RogueLedgerDb[];
43
- /** Hits that were skipped (operator declined or safety check failed). */
44
- skipped: RogueLedgerDb[];
45
- }
46
- /**
47
- * Delete confirmed rogue ledger directories.
48
- *
49
- * Safety invariant: only deletes `hit.rogueDir` (the literal-tilde `~`
50
- * directory), never its parent. Any hit whose rogueDir basename is not
51
- * exactly `~` is silently skipped as a belt-and-suspenders guard.
52
- */
53
- export declare function deleteRogueLedgers(hits: RogueLedgerDb[], opts?: DeleteRogueLedgersOptions): Promise<DeleteRogueLedgersResult>;
@@ -1,153 +0,0 @@
1
- // Detect leftover rogue evidence-ledger DBs from the literal-tilde
2
- // `EVIDENCE_LEDGER_DB` env leak (root cause + fix: agent-tasks/42d224a6,
3
- // harness PR #101). The env block expanded `~/.evidence-ledger/ledger.db`
4
- // as a literal directory name relative to the grounding-mcp cwd, so
5
- // every spawn cwd grew a sibling `~/.evidence-ledger/ledger.db` tree.
6
- //
7
- // The fix removed the env block, so no new rogue DBs appear. The existing
8
- // ones on disk are harmless orphans, but they take up space and confuse
9
- // forensics ("why do I have three identical-shape ledger DBs?"). This
10
- // scan flags them so the operator can `rm -rf` at their convenience.
11
- //
12
- // Scan scope is bounded by design: the literal `~` directory only ever
13
- // appears one level deep under wherever grounding-mcp was spawned. The
14
- // well-known spawn-cwd locations are: $HOME (when claude-code spawns from
15
- // the user's home), $HOME/git/<repo> (the per-repo working tree), and
16
- // $PWD (whatever directory the operator invoked harness from). No
17
- // recursion past one level: we are not a generic disk-cleanup tool.
18
- import * as fs from "node:fs";
19
- import * as path from "node:path";
20
- import * as readline from "node:readline/promises";
21
- const ROGUE_DIRNAME = "~";
22
- const LEDGER_RELPATH = path.join(".evidence-ledger", "ledger.db");
23
- function hasRogueLedgerUnder(parent, fsi) {
24
- // lstat (not stat) the `~` dir: a symlink at <parent>/~ pointing at
25
- // /etc or at the real ~/.evidence-ledger would otherwise yield a
26
- // false-positive flag (read-only, no security impact, but the
27
- // operator gets nudged to rm -rf an arbitrary target). The orphan
28
- // pattern we care about is a *real* literal-tilde directory.
29
- const rogueDir = path.join(parent, ROGUE_DIRNAME);
30
- if (!fsi.existsSync(rogueDir))
31
- return null;
32
- try {
33
- if (fsi.lstatSync(rogueDir).isSymbolicLink())
34
- return null;
35
- }
36
- catch {
37
- return null;
38
- }
39
- const candidate = path.join(rogueDir, LEDGER_RELPATH);
40
- if (!fsi.existsSync(candidate))
41
- return null;
42
- try {
43
- if (!fsi.statSync(candidate).isFile())
44
- return null;
45
- }
46
- catch {
47
- return null;
48
- }
49
- return { path: candidate, rogueDir };
50
- }
51
- /**
52
- * Dedup key for a hit: prefer the realpath of the ledger.db file so two
53
- * parent dirs that symlink to the same physical location collapse into a
54
- * single hit. Falls back to the joined path when realpath is unavailable
55
- * (EACCES on a strict-mode mount, ENOENT during a race with deletion).
56
- * The fallback preserves the v1 dedup behavior so existing fixtures
57
- * stay stable.
58
- */
59
- function dedupKey(hit, fsi) {
60
- try {
61
- return fsi.realpathSync(hit.path);
62
- }
63
- catch {
64
- return hit.path;
65
- }
66
- }
67
- /**
68
- * Walk a small set of well-known parent directories for a literal `~`
69
- * subdirectory that contains `.evidence-ledger/ledger.db`. Best-effort:
70
- * unreadable directories are silently skipped. Returns deduplicated
71
- * results (by realpath) sorted by path for stable rendering.
72
- */
73
- export function scanForRogueLedgers(opts) {
74
- const fsi = opts.fsInterface ?? fs;
75
- const seen = new Set();
76
- const out = [];
77
- const consider = (parent) => {
78
- const hit = hasRogueLedgerUnder(parent, fsi);
79
- if (!hit)
80
- return;
81
- const key = dedupKey(hit, fsi);
82
- if (seen.has(key))
83
- return;
84
- seen.add(key);
85
- out.push(hit);
86
- };
87
- consider(opts.homeDir);
88
- consider(opts.cwd);
89
- const gitParent = path.join(opts.homeDir, "git");
90
- if (fsi.existsSync(gitParent)) {
91
- let entries = [];
92
- try {
93
- entries = fsi.readdirSync(gitParent, { withFileTypes: true });
94
- }
95
- catch {
96
- entries = [];
97
- }
98
- for (const e of entries) {
99
- if (!e.isDirectory())
100
- continue;
101
- consider(path.join(gitParent, e.name));
102
- }
103
- }
104
- out.sort((a, b) => a.path.localeCompare(b.path));
105
- return out;
106
- }
107
- /**
108
- * Delete confirmed rogue ledger directories.
109
- *
110
- * Safety invariant: only deletes `hit.rogueDir` (the literal-tilde `~`
111
- * directory), never its parent. Any hit whose rogueDir basename is not
112
- * exactly `~` is silently skipped as a belt-and-suspenders guard.
113
- */
114
- export async function deleteRogueLedgers(hits, opts = {}) {
115
- const deleted = [];
116
- const skipped = [];
117
- for (const hit of hits) {
118
- // Safety: only ever remove a directory whose basename is the literal `~`.
119
- if (path.basename(hit.rogueDir) !== "~") {
120
- skipped.push(hit);
121
- continue;
122
- }
123
- let confirmed;
124
- if (opts.yes) {
125
- confirmed = true;
126
- }
127
- else if (opts.promptFn) {
128
- confirmed = await opts.promptFn(hit.rogueDir);
129
- }
130
- else {
131
- confirmed = await defaultDeletePrompt(hit.rogueDir);
132
- }
133
- if (confirmed) {
134
- fs.rmSync(hit.rogueDir, { recursive: true, force: true });
135
- deleted.push(hit);
136
- }
137
- else {
138
- skipped.push(hit);
139
- }
140
- }
141
- return { deleted, skipped };
142
- }
143
- async function defaultDeletePrompt(rogueDir) {
144
- const rl = readline.createInterface({ input: process.stdin, output: process.stderr });
145
- try {
146
- const answer = await rl.question(`Delete rogue directory ${rogueDir}? (y/N) `);
147
- return answer.trim().toLowerCase() === "y";
148
- }
149
- finally {
150
- rl.close();
151
- }
152
- }
153
- //# sourceMappingURL=rogue-ledger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rogue-ledger.js","sourceRoot":"","sources":["../../../src/cli/doctor/rogue-ledger.ts"],"names":[],"mappings":"AA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