@lannguyensi/harness 0.64.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 (710) hide show
  1. package/CHANGELOG.md +64 -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 -345
  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 -713
  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 -387
  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 +9 -2131
  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 -245
  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/{delegate/register.d.ts → register-gate-group.d.ts} +1 -1
  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 +1 -1
  145. package/dist/cli/register-operator-lifecycle.js +3 -100
  146. package/dist/cli/register-operator-lifecycle.js.map +1 -1
  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-audit-group.d.ts → register-setup-group.d.ts} +1 -1
  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.js +2 -19
  160. package/dist/cli/remove/register.js.map +1 -1
  161. package/dist/cli/shell-quote.d.ts +7 -0
  162. package/dist/cli/shell-quote.js +17 -0
  163. package/dist/cli/shell-quote.js.map +1 -0
  164. package/dist/cli/uninstall/index.d.ts +4 -2
  165. package/dist/cli/uninstall/index.js +15 -7
  166. package/dist/cli/uninstall/index.js.map +1 -1
  167. package/dist/cli/uninstall/register.js +6 -4
  168. package/dist/cli/uninstall/register.js.map +1 -1
  169. package/dist/cli/uninstall/snapshot.d.ts +15 -0
  170. package/dist/cli/uninstall/snapshot.js +38 -0
  171. package/dist/cli/uninstall/snapshot.js.map +1 -1
  172. package/dist/cli/validate/checks.d.ts +0 -77
  173. package/dist/cli/validate/checks.js +3 -1049
  174. package/dist/cli/validate/checks.js.map +1 -1
  175. package/dist/cli/validate/index.js +19 -15
  176. package/dist/cli/validate/index.js.map +1 -1
  177. package/dist/index.d.ts +0 -3
  178. package/dist/index.js +0 -3
  179. package/dist/index.js.map +1 -1
  180. package/dist/io/claude-mcp.d.ts +1 -1
  181. package/dist/io/claude-mcp.js +27 -14
  182. package/dist/io/claude-mcp.js.map +1 -1
  183. package/dist/io/harness-lock.js +2 -2
  184. package/dist/io/harness-lock.js.map +1 -1
  185. package/dist/io/lock.d.ts +0 -26
  186. package/dist/io/lock.js +10 -27
  187. package/dist/io/lock.js.map +1 -1
  188. package/dist/io/merge-settings.js +6 -4
  189. package/dist/io/merge-settings.js.map +1 -1
  190. package/dist/io/project-name.d.ts +22 -39
  191. package/dist/io/project-name.js +25 -42
  192. package/dist/io/project-name.js.map +1 -1
  193. package/dist/io/read-regular-file.d.ts +103 -40
  194. package/dist/io/read-regular-file.js +196 -35
  195. package/dist/io/read-regular-file.js.map +1 -1
  196. package/dist/io/restart-hints.js +3 -6
  197. package/dist/io/restart-hints.js.map +1 -1
  198. package/dist/io/version-compare.d.ts +1 -3
  199. package/dist/io/version-compare.js +1 -3
  200. package/dist/io/version-compare.js.map +1 -1
  201. package/dist/io/write-regular-file.d.ts +30 -0
  202. package/dist/io/write-regular-file.js +85 -0
  203. package/dist/io/write-regular-file.js.map +1 -0
  204. package/dist/overrides/index.d.ts +1 -0
  205. package/dist/overrides/index.js +1 -0
  206. package/dist/overrides/index.js.map +1 -1
  207. package/dist/overrides/merge-layers.d.ts +43 -0
  208. package/dist/overrides/merge-layers.js +76 -0
  209. package/dist/overrides/merge-layers.js.map +1 -0
  210. package/dist/overrides/merge.d.ts +16 -0
  211. package/dist/overrides/merge.js +21 -8
  212. package/dist/overrides/merge.js.map +1 -1
  213. package/dist/policy-packs/builtin/branch-protection-runtime.d.ts +4 -69
  214. package/dist/policy-packs/builtin/branch-protection-runtime.js +12 -84
  215. package/dist/policy-packs/builtin/branch-protection-runtime.js.map +1 -1
  216. package/dist/policy-packs/builtin/branch-protection.d.ts +7 -30
  217. package/dist/policy-packs/builtin/branch-protection.js +56 -89
  218. package/dist/policy-packs/builtin/branch-protection.js.map +1 -1
  219. package/dist/policy-packs/config-check.d.ts +7 -5
  220. package/dist/policy-packs/config-check.js +2 -2
  221. package/dist/policy-packs/config-check.js.map +1 -1
  222. package/dist/policy-packs/expand.d.ts +1 -3
  223. package/dist/policy-packs/expand.js +5 -42
  224. package/dist/policy-packs/expand.js.map +1 -1
  225. package/dist/policy-packs/index.d.ts +3 -3
  226. package/dist/policy-packs/index.js +2 -2
  227. package/dist/policy-packs/index.js.map +1 -1
  228. package/dist/policy-packs/registry.d.ts +9 -38
  229. package/dist/policy-packs/registry.js +5 -65
  230. package/dist/policy-packs/registry.js.map +1 -1
  231. package/dist/policy-packs/runtime.d.ts +0 -4
  232. package/dist/policy-packs/runtime.js +9 -22
  233. package/dist/policy-packs/runtime.js.map +1 -1
  234. package/dist/policy-packs/types.d.ts +0 -19
  235. package/dist/policy-packs/ux-compare.d.ts +1 -11
  236. package/dist/policy-packs/ux-compare.js +6 -42
  237. package/dist/policy-packs/ux-compare.js.map +1 -1
  238. package/dist/policy-packs/ux-drift-check.d.ts +5 -5
  239. package/dist/policy-packs/ux-drift-check.js +17 -22
  240. package/dist/policy-packs/ux-drift-check.js.map +1 -1
  241. package/dist/policy-packs/version-check.d.ts +5 -26
  242. package/dist/policy-packs/version-check.js +19 -74
  243. package/dist/policy-packs/version-check.js.map +1 -1
  244. package/dist/probes/memory.d.ts +1 -1
  245. package/dist/probes/memory.js +1 -1
  246. package/dist/probes/memory.js.map +1 -1
  247. package/dist/runtime/agent-facing.d.ts +9 -0
  248. package/dist/runtime/agent-facing.js +28 -14
  249. package/dist/runtime/agent-facing.js.map +1 -1
  250. package/dist/runtime/bounded-text.d.ts +15 -0
  251. package/dist/runtime/bounded-text.js +27 -0
  252. package/dist/runtime/bounded-text.js.map +1 -0
  253. package/dist/runtime/git-branch.d.ts +125 -0
  254. package/dist/runtime/git-branch.js +381 -0
  255. package/dist/runtime/git-branch.js.map +1 -0
  256. package/dist/runtime/hermetic-spawn-guard.d.ts +2 -2
  257. package/dist/runtime/hermetic-spawn-guard.js +24 -34
  258. package/dist/runtime/hermetic-spawn-guard.js.map +1 -1
  259. package/dist/runtime/home-dir.js +3 -2
  260. package/dist/runtime/home-dir.js.map +1 -1
  261. package/dist/runtime/tool-name-aliases.d.ts +0 -6
  262. package/dist/runtime/tool-name-aliases.js +5 -18
  263. package/dist/runtime/tool-name-aliases.js.map +1 -1
  264. package/dist/schema/grounding.d.ts +7 -54
  265. package/dist/schema/grounding.js +10 -12
  266. package/dist/schema/grounding.js.map +1 -1
  267. package/dist/schema/hooks.d.ts +39 -136
  268. package/dist/schema/hooks.js +3 -6
  269. package/dist/schema/hooks.js.map +1 -1
  270. package/dist/schema/index.d.ts +114 -3828
  271. package/dist/schema/index.js +41 -80
  272. package/dist/schema/index.js.map +1 -1
  273. package/dist/schema/memory.d.ts +54 -131
  274. package/dist/schema/memory.js +2 -2
  275. package/dist/schema/memory.js.map +1 -1
  276. package/dist/schema/policy-packs.d.ts +3 -45
  277. package/dist/schema/policy-packs.js +7 -13
  278. package/dist/schema/policy-packs.js.map +1 -1
  279. package/dist/schema/policy-ux.d.ts +7 -0
  280. package/dist/schema/policy-ux.js +18 -0
  281. package/dist/schema/policy-ux.js.map +1 -0
  282. package/dist/schema/removed-keys.d.ts +185 -0
  283. package/dist/schema/removed-keys.js +531 -0
  284. package/dist/schema/removed-keys.js.map +1 -0
  285. package/dist/schema/tools.d.ts +30 -268
  286. package/dist/schema/tools.js +4 -4
  287. package/dist/schema/tools.js.map +1 -1
  288. package/package.json +5 -16
  289. package/dist/cli/approve/branch-protection.d.ts +0 -69
  290. package/dist/cli/approve/branch-protection.js +0 -144
  291. package/dist/cli/approve/branch-protection.js.map +0 -1
  292. package/dist/cli/approve/risk.d.ts +0 -112
  293. package/dist/cli/approve/risk.js +0 -197
  294. package/dist/cli/approve/risk.js.map +0 -1
  295. package/dist/cli/approve/stdin-report.d.ts +0 -57
  296. package/dist/cli/approve/stdin-report.js +0 -145
  297. package/dist/cli/approve/stdin-report.js.map +0 -1
  298. package/dist/cli/approve/understanding.d.ts +0 -410
  299. package/dist/cli/approve/understanding.js +0 -996
  300. package/dist/cli/approve/understanding.js.map +0 -1
  301. package/dist/cli/audit.d.ts +0 -80
  302. package/dist/cli/audit.js +0 -252
  303. package/dist/cli/audit.js.map +0 -1
  304. package/dist/cli/delegate/index.d.ts +0 -76
  305. package/dist/cli/delegate/index.js +0 -444
  306. package/dist/cli/delegate/index.js.map +0 -1
  307. package/dist/cli/delegate/register.js +0 -90
  308. package/dist/cli/delegate/register.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/expire-on-tool-match.d.ts +0 -15
  319. package/dist/cli/doctor/expire-on-tool-match.js +0 -58
  320. package/dist/cli/doctor/expire-on-tool-match.js.map +0 -1
  321. package/dist/cli/doctor/rogue-ledger.d.ts +0 -53
  322. package/dist/cli/doctor/rogue-ledger.js +0 -153
  323. package/dist/cli/doctor/rogue-ledger.js.map +0 -1
  324. package/dist/cli/doctor/session-start-preflight-setup-version.d.ts +0 -83
  325. package/dist/cli/doctor/session-start-preflight-setup-version.js +0 -114
  326. package/dist/cli/doctor/session-start-preflight-setup-version.js.map +0 -1
  327. package/dist/cli/doctor/settings-drift.d.ts +0 -25
  328. package/dist/cli/doctor/settings-drift.js +0 -213
  329. package/dist/cli/doctor/settings-drift.js.map +0 -1
  330. package/dist/cli/doctor/toolchain-parity.d.ts +0 -63
  331. package/dist/cli/doctor/toolchain-parity.js +0 -154
  332. package/dist/cli/doctor/toolchain-parity.js.map +0 -1
  333. package/dist/cli/doctor/ug-auto-approvals.d.ts +0 -40
  334. package/dist/cli/doctor/ug-auto-approvals.js +0 -91
  335. package/dist/cli/doctor/ug-auto-approvals.js.map +0 -1
  336. package/dist/cli/doctor/ug-delegations.d.ts +0 -26
  337. package/dist/cli/doctor/ug-delegations.js +0 -121
  338. package/dist/cli/doctor/ug-delegations.js.map +0 -1
  339. package/dist/cli/doctor/ug-inflight.d.ts +0 -35
  340. package/dist/cli/doctor/ug-inflight.js +0 -57
  341. package/dist/cli/doctor/ug-inflight.js.map +0 -1
  342. package/dist/cli/doctor/understanding-mode-env.d.ts +0 -51
  343. package/dist/cli/doctor/understanding-mode-env.js +0 -98
  344. package/dist/cli/doctor/understanding-mode-env.js.map +0 -1
  345. package/dist/cli/dry-run.d.ts +0 -58
  346. package/dist/cli/dry-run.js +0 -283
  347. package/dist/cli/dry-run.js.map +0 -1
  348. package/dist/cli/enriched-event.d.ts +0 -35
  349. package/dist/cli/enriched-event.js +0 -60
  350. package/dist/cli/enriched-event.js.map +0 -1
  351. package/dist/cli/event-input.d.ts +0 -28
  352. package/dist/cli/event-input.js +0 -73
  353. package/dist/cli/event-input.js.map +0 -1
  354. package/dist/cli/explain-action.d.ts +0 -25
  355. package/dist/cli/explain-action.js +0 -57
  356. package/dist/cli/explain-action.js.map +0 -1
  357. package/dist/cli/explain-policy.d.ts +0 -147
  358. package/dist/cli/explain-policy.js +0 -248
  359. package/dist/cli/explain-policy.js.map +0 -1
  360. package/dist/cli/explain.d.ts +0 -31
  361. package/dist/cli/explain.js +0 -159
  362. package/dist/cli/explain.js.map +0 -1
  363. package/dist/cli/gc/index.d.ts +0 -63
  364. package/dist/cli/gc/index.js +0 -566
  365. package/dist/cli/gc/index.js.map +0 -1
  366. package/dist/cli/pack/approve-escape.d.ts +0 -19
  367. package/dist/cli/pack/approve-escape.js +0 -190
  368. package/dist/cli/pack/approve-escape.js.map +0 -1
  369. package/dist/cli/pack/auto-approve-path.d.ts +0 -146
  370. package/dist/cli/pack/auto-approve-path.js +0 -462
  371. package/dist/cli/pack/auto-approve-path.js.map +0 -1
  372. package/dist/cli/pack/hook-codex-post-tool-use.d.ts +0 -25
  373. package/dist/cli/pack/hook-codex-post-tool-use.js +0 -160
  374. package/dist/cli/pack/hook-codex-post-tool-use.js.map +0 -1
  375. package/dist/cli/pack/hook-codex-pre-tool-use.d.ts +0 -48
  376. package/dist/cli/pack/hook-codex-pre-tool-use.js +0 -474
  377. package/dist/cli/pack/hook-codex-pre-tool-use.js.map +0 -1
  378. package/dist/cli/pack/hook-codex-stop.d.ts +0 -35
  379. package/dist/cli/pack/hook-codex-stop.js +0 -329
  380. package/dist/cli/pack/hook-codex-stop.js.map +0 -1
  381. package/dist/cli/pack/hook-codex-user-prompt-submit.d.ts +0 -24
  382. package/dist/cli/pack/hook-codex-user-prompt-submit.js +0 -93
  383. package/dist/cli/pack/hook-codex-user-prompt-submit.js.map +0 -1
  384. package/dist/cli/pack/hook-post-merge-gate-record.d.ts +0 -37
  385. package/dist/cli/pack/hook-post-merge-gate-record.js +0 -190
  386. package/dist/cli/pack/hook-post-merge-gate-record.js.map +0 -1
  387. package/dist/cli/pack/hook-post-merge-gate.d.ts +0 -34
  388. package/dist/cli/pack/hook-post-merge-gate.js +0 -277
  389. package/dist/cli/pack/hook-post-merge-gate.js.map +0 -1
  390. package/dist/cli/pack/hook-post-tool-use.d.ts +0 -45
  391. package/dist/cli/pack/hook-post-tool-use.js +0 -137
  392. package/dist/cli/pack/hook-post-tool-use.js.map +0 -1
  393. package/dist/cli/pack/hook-pre-tool-use.d.ts +0 -92
  394. package/dist/cli/pack/hook-pre-tool-use.js +0 -1328
  395. package/dist/cli/pack/hook-pre-tool-use.js.map +0 -1
  396. package/dist/cli/pack/hook-runtime-reality.d.ts +0 -63
  397. package/dist/cli/pack/hook-runtime-reality.js +0 -210
  398. package/dist/cli/pack/hook-runtime-reality.js.map +0 -1
  399. package/dist/cli/pack/hook-solution-acceptance-writeguard.d.ts +0 -32
  400. package/dist/cli/pack/hook-solution-acceptance-writeguard.js +0 -438
  401. package/dist/cli/pack/hook-solution-acceptance-writeguard.js.map +0 -1
  402. package/dist/cli/pack/hook-solution-acceptance.d.ts +0 -157
  403. package/dist/cli/pack/hook-solution-acceptance.js +0 -530
  404. package/dist/cli/pack/hook-solution-acceptance.js.map +0 -1
  405. package/dist/cli/pack/hook-stay-in-scope.d.ts +0 -37
  406. package/dist/cli/pack/hook-stay-in-scope.js +0 -128
  407. package/dist/cli/pack/hook-stay-in-scope.js.map +0 -1
  408. package/dist/cli/pack/hook-subagent-start.d.ts +0 -23
  409. package/dist/cli/pack/hook-subagent-start.js +0 -88
  410. package/dist/cli/pack/hook-subagent-start.js.map +0 -1
  411. package/dist/cli/pack/hook-subagent-stop.d.ts +0 -19
  412. package/dist/cli/pack/hook-subagent-stop.js +0 -41
  413. package/dist/cli/pack/hook-subagent-stop.js.map +0 -1
  414. package/dist/cli/pack/hook-track-active-claim.d.ts +0 -27
  415. package/dist/cli/pack/hook-track-active-claim.js +0 -275
  416. package/dist/cli/pack/hook-track-active-claim.js.map +0 -1
  417. package/dist/cli/pack/transcript-report-scan.d.ts +0 -71
  418. package/dist/cli/pack/transcript-report-scan.js +0 -359
  419. package/dist/cli/pack/transcript-report-scan.js.map +0 -1
  420. package/dist/cli/pack/understanding-report-schema-hint.d.ts +0 -26
  421. package/dist/cli/pack/understanding-report-schema-hint.js +0 -120
  422. package/dist/cli/pack/understanding-report-schema-hint.js.map +0 -1
  423. package/dist/cli/pack/upgrade.d.ts +0 -32
  424. package/dist/cli/pack/upgrade.js +0 -273
  425. package/dist/cli/pack/upgrade.js.map +0 -1
  426. package/dist/cli/pause/index.d.ts +0 -113
  427. package/dist/cli/pause/index.js +0 -251
  428. package/dist/cli/pause/index.js.map +0 -1
  429. package/dist/cli/pause-check.d.ts +0 -22
  430. package/dist/cli/pause-check.js +0 -54
  431. package/dist/cli/pause-check.js.map +0 -1
  432. package/dist/cli/policy/intercept.d.ts +0 -233
  433. package/dist/cli/policy/intercept.js +0 -1022
  434. package/dist/cli/policy/intercept.js.map +0 -1
  435. package/dist/cli/policy/risk-envelope-enrichment.d.ts +0 -40
  436. package/dist/cli/policy/risk-envelope-enrichment.js +0 -110
  437. package/dist/cli/policy/risk-envelope-enrichment.js.map +0 -1
  438. package/dist/cli/record/index.d.ts +0 -81
  439. package/dist/cli/record/index.js +0 -348
  440. package/dist/cli/record/index.js.map +0 -1
  441. package/dist/cli/register-audit-group.js +0 -91
  442. package/dist/cli/register-audit-group.js.map +0 -1
  443. package/dist/cli/resolve-env.d.ts +0 -32
  444. package/dist/cli/resolve-env.js +0 -46
  445. package/dist/cli/resolve-env.js.map +0 -1
  446. package/dist/cli/session-export/index.d.ts +0 -46
  447. package/dist/cli/session-export/index.js +0 -169
  448. package/dist/cli/session-export/index.js.map +0 -1
  449. package/dist/cli/session-export/redact.d.ts +0 -22
  450. package/dist/cli/session-export/redact.js +0 -47
  451. package/dist/cli/session-export/redact.js.map +0 -1
  452. package/dist/cli/session-export/transcript.d.ts +0 -24
  453. package/dist/cli/session-export/transcript.js +0 -164
  454. package/dist/cli/session-export/transcript.js.map +0 -1
  455. package/dist/cli/session-start/branch-check.d.ts +0 -18
  456. package/dist/cli/session-start/branch-check.js +0 -140
  457. package/dist/cli/session-start/branch-check.js.map +0 -1
  458. package/dist/cli/session-start/index.d.ts +0 -121
  459. package/dist/cli/session-start/index.js +0 -591
  460. package/dist/cli/session-start/index.js.map +0 -1
  461. package/dist/cli/session-start/shared-options.d.ts +0 -103
  462. package/dist/cli/session-start/shared-options.js +0 -107
  463. package/dist/cli/session-start/shared-options.js.map +0 -1
  464. package/dist/cli/session-start/stale-base-check.d.ts +0 -46
  465. package/dist/cli/session-start/stale-base-check.js +0 -352
  466. package/dist/cli/session-start/stale-base-check.js.map +0 -1
  467. package/dist/cli/session-start/toolchain-parity.d.ts +0 -267
  468. package/dist/cli/session-start/toolchain-parity.js +0 -797
  469. package/dist/cli/session-start/toolchain-parity.js.map +0 -1
  470. package/dist/cli/smoke/assertions.d.ts +0 -46
  471. package/dist/cli/smoke/assertions.js +0 -170
  472. package/dist/cli/smoke/assertions.js.map +0 -1
  473. package/dist/cli/smoke/index.d.ts +0 -76
  474. package/dist/cli/smoke/index.js +0 -245
  475. package/dist/cli/smoke/index.js.map +0 -1
  476. package/dist/cli/smoke/runner.d.ts +0 -55
  477. package/dist/cli/smoke/runner.js +0 -134
  478. package/dist/cli/smoke/runner.js.map +0 -1
  479. package/dist/cli/smoke/stream-parser.d.ts +0 -65
  480. package/dist/cli/smoke/stream-parser.js +0 -115
  481. package/dist/cli/smoke/stream-parser.js.map +0 -1
  482. package/dist/cli/test-risk.d.ts +0 -27
  483. package/dist/cli/test-risk.js +0 -38
  484. package/dist/cli/test-risk.js.map +0 -1
  485. package/dist/io/display-path.d.ts +0 -11
  486. package/dist/io/display-path.js +0 -29
  487. package/dist/io/display-path.js.map +0 -1
  488. package/dist/io/duration.d.ts +0 -5
  489. package/dist/io/duration.js +0 -50
  490. package/dist/io/duration.js.map +0 -1
  491. package/dist/io/extract.d.ts +0 -79
  492. package/dist/io/extract.js +0 -226
  493. package/dist/io/extract.js.map +0 -1
  494. package/dist/io/ledger-record.d.ts +0 -83
  495. package/dist/io/ledger-record.js +0 -301
  496. package/dist/io/ledger-record.js.map +0 -1
  497. package/dist/io/read-json-dir-entries.d.ts +0 -36
  498. package/dist/io/read-json-dir-entries.js +0 -48
  499. package/dist/io/read-json-dir-entries.js.map +0 -1
  500. package/dist/io/safe-json-parse.d.ts +0 -5
  501. package/dist/io/safe-json-parse.js +0 -21
  502. package/dist/io/safe-json-parse.js.map +0 -1
  503. package/dist/policies/index.d.ts +0 -5
  504. package/dist/policies/index.js +0 -6
  505. package/dist/policies/index.js.map +0 -1
  506. package/dist/policies/ledger-client.d.ts +0 -113
  507. package/dist/policies/ledger-client.js +0 -500
  508. package/dist/policies/ledger-client.js.map +0 -1
  509. package/dist/policies/producers.d.ts +0 -12
  510. package/dist/policies/producers.js +0 -61
  511. package/dist/policies/producers.js.map +0 -1
  512. package/dist/policies/requires.d.ts +0 -75
  513. package/dist/policies/requires.js +0 -240
  514. package/dist/policies/requires.js.map +0 -1
  515. package/dist/policies/timestamp.d.ts +0 -14
  516. package/dist/policies/timestamp.js +0 -36
  517. package/dist/policies/timestamp.js.map +0 -1
  518. package/dist/policy-packs/builtin/permission-profiles.d.ts +0 -11
  519. package/dist/policy-packs/builtin/permission-profiles.js +0 -74
  520. package/dist/policy-packs/builtin/permission-profiles.js.map +0 -1
  521. package/dist/policy-packs/builtin/post-merge-gate-runtime.d.ts +0 -286
  522. package/dist/policy-packs/builtin/post-merge-gate-runtime.js +0 -397
  523. package/dist/policy-packs/builtin/post-merge-gate-runtime.js.map +0 -1
  524. package/dist/policy-packs/builtin/post-merge-gate.d.ts +0 -56
  525. package/dist/policy-packs/builtin/post-merge-gate.js +0 -347
  526. package/dist/policy-packs/builtin/post-merge-gate.js.map +0 -1
  527. package/dist/policy-packs/builtin/solution-acceptance-reconnect.d.ts +0 -50
  528. package/dist/policy-packs/builtin/solution-acceptance-reconnect.js +0 -151
  529. package/dist/policy-packs/builtin/solution-acceptance-reconnect.js.map +0 -1
  530. package/dist/policy-packs/builtin/solution-acceptance-runtime.d.ts +0 -323
  531. package/dist/policy-packs/builtin/solution-acceptance-runtime.js +0 -672
  532. package/dist/policy-packs/builtin/solution-acceptance-runtime.js.map +0 -1
  533. package/dist/policy-packs/builtin/solution-acceptance.d.ts +0 -45
  534. package/dist/policy-packs/builtin/solution-acceptance.js +0 -226
  535. package/dist/policy-packs/builtin/solution-acceptance.js.map +0 -1
  536. package/dist/policy-packs/builtin/understanding-before-execution/active-claim.d.ts +0 -25
  537. package/dist/policy-packs/builtin/understanding-before-execution/active-claim.js +0 -94
  538. package/dist/policy-packs/builtin/understanding-before-execution/active-claim.js.map +0 -1
  539. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.d.ts +0 -35
  540. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.js +0 -86
  541. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.js.map +0 -1
  542. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.d.ts +0 -210
  543. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.js +0 -361
  544. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.js.map +0 -1
  545. package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.d.ts +0 -304
  546. package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.js +0 -734
  547. package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.js.map +0 -1
  548. package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.d.ts +0 -36
  549. package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.js +0 -73
  550. package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.js.map +0 -1
  551. package/dist/policy-packs/builtin/understanding-before-execution/index.d.ts +0 -19
  552. package/dist/policy-packs/builtin/understanding-before-execution/index.js +0 -83
  553. package/dist/policy-packs/builtin/understanding-before-execution/index.js.map +0 -1
  554. package/dist/policy-packs/builtin/understanding-before-execution/inflight-records.d.ts +0 -135
  555. package/dist/policy-packs/builtin/understanding-before-execution/inflight-records.js +0 -643
  556. package/dist/policy-packs/builtin/understanding-before-execution/inflight-records.js.map +0 -1
  557. package/dist/policy-packs/builtin/understanding-before-execution/ledger.d.ts +0 -25
  558. package/dist/policy-packs/builtin/understanding-before-execution/ledger.js +0 -56
  559. package/dist/policy-packs/builtin/understanding-before-execution/ledger.js.map +0 -1
  560. package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.d.ts +0 -20
  561. package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.js +0 -106
  562. package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.js.map +0 -1
  563. package/dist/policy-packs/builtin/understanding-before-execution/markers.d.ts +0 -126
  564. package/dist/policy-packs/builtin/understanding-before-execution/markers.js +0 -245
  565. package/dist/policy-packs/builtin/understanding-before-execution/markers.js.map +0 -1
  566. package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.d.ts +0 -29
  567. package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.js +0 -82
  568. package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.js.map +0 -1
  569. package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.d.ts +0 -71
  570. package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.js +0 -175
  571. package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.js.map +0 -1
  572. package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.d.ts +0 -625
  573. package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.js +0 -1076
  574. package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.js.map +0 -1
  575. package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.d.ts +0 -128
  576. package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.js +0 -213
  577. package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.js.map +0 -1
  578. package/dist/policy-packs/builtin/understanding-before-execution/stay-in-scope-config.d.ts +0 -129
  579. package/dist/policy-packs/builtin/understanding-before-execution/stay-in-scope-config.js +0 -166
  580. package/dist/policy-packs/builtin/understanding-before-execution/stay-in-scope-config.js.map +0 -1
  581. package/dist/policy-packs/builtin/understanding-before-execution/task-markers.d.ts +0 -164
  582. package/dist/policy-packs/builtin/understanding-before-execution/task-markers.js +0 -275
  583. package/dist/policy-packs/builtin/understanding-before-execution/task-markers.js.map +0 -1
  584. package/dist/policy-packs/builtin/understanding-before-execution-runtime.d.ts +0 -1
  585. package/dist/policy-packs/builtin/understanding-before-execution-runtime.js +0 -10
  586. package/dist/policy-packs/builtin/understanding-before-execution-runtime.js.map +0 -1
  587. package/dist/policy-packs/builtin/understanding-before-execution.d.ts +0 -526
  588. package/dist/policy-packs/builtin/understanding-before-execution.js +0 -1078
  589. package/dist/policy-packs/builtin/understanding-before-execution.js.map +0 -1
  590. package/dist/policy-packs/permission-translator.d.ts +0 -9
  591. package/dist/policy-packs/permission-translator.js +0 -76
  592. package/dist/policy-packs/permission-translator.js.map +0 -1
  593. package/dist/runtime/action-envelope.d.ts +0 -64
  594. package/dist/runtime/action-envelope.js +0 -46
  595. package/dist/runtime/action-envelope.js.map +0 -1
  596. package/dist/runtime/approval-signing.d.ts +0 -111
  597. package/dist/runtime/approval-signing.js +0 -384
  598. package/dist/runtime/approval-signing.js.map +0 -1
  599. package/dist/runtime/bash-match-facts.d.ts +0 -60
  600. package/dist/runtime/bash-match-facts.js +0 -196
  601. package/dist/runtime/bash-match-facts.js.map +0 -1
  602. package/dist/runtime/bash-match-registry.d.ts +0 -112
  603. package/dist/runtime/bash-match-registry.js +0 -406
  604. package/dist/runtime/bash-match-registry.js.map +0 -1
  605. package/dist/runtime/bash-prefix-parse.d.ts +0 -31
  606. package/dist/runtime/bash-prefix-parse.js +0 -576
  607. package/dist/runtime/bash-prefix-parse.js.map +0 -1
  608. package/dist/runtime/command-normalize.d.ts +0 -658
  609. package/dist/runtime/command-normalize.js +0 -2410
  610. package/dist/runtime/command-normalize.js.map +0 -1
  611. package/dist/runtime/deletion-target-resolve.d.ts +0 -28
  612. package/dist/runtime/deletion-target-resolve.js +0 -1078
  613. package/dist/runtime/deletion-target-resolve.js.map +0 -1
  614. package/dist/runtime/destructive-shell-floor.d.ts +0 -19
  615. package/dist/runtime/destructive-shell-floor.js +0 -611
  616. package/dist/runtime/destructive-shell-floor.js.map +0 -1
  617. package/dist/runtime/environment-resolver.d.ts +0 -36
  618. package/dist/runtime/environment-resolver.js +0 -138
  619. package/dist/runtime/environment-resolver.js.map +0 -1
  620. package/dist/runtime/git-context.d.ts +0 -201
  621. package/dist/runtime/git-context.js +0 -422
  622. package/dist/runtime/git-context.js.map +0 -1
  623. package/dist/runtime/index.d.ts +0 -12
  624. package/dist/runtime/index.js +0 -13
  625. package/dist/runtime/index.js.map +0 -1
  626. package/dist/runtime/intercept.d.ts +0 -623
  627. package/dist/runtime/intercept.js +0 -1384
  628. package/dist/runtime/intercept.js.map +0 -1
  629. package/dist/runtime/kube-context.d.ts +0 -16
  630. package/dist/runtime/kube-context.js +0 -63
  631. package/dist/runtime/kube-context.js.map +0 -1
  632. package/dist/runtime/kubectl-target-parse.d.ts +0 -31
  633. package/dist/runtime/kubectl-target-parse.js +0 -249
  634. package/dist/runtime/kubectl-target-parse.js.map +0 -1
  635. package/dist/runtime/ledger-add.d.ts +0 -16
  636. package/dist/runtime/ledger-add.js +0 -150
  637. package/dist/runtime/ledger-add.js.map +0 -1
  638. package/dist/runtime/ledger-writer.d.ts +0 -27
  639. package/dist/runtime/ledger-writer.js +0 -46
  640. package/dist/runtime/ledger-writer.js.map +0 -1
  641. package/dist/runtime/pause-sentinel.d.ts +0 -60
  642. package/dist/runtime/pause-sentinel.js +0 -156
  643. package/dist/runtime/pause-sentinel.js.map +0 -1
  644. package/dist/runtime/pending-approval.d.ts +0 -23
  645. package/dist/runtime/pending-approval.js +0 -67
  646. package/dist/runtime/pending-approval.js.map +0 -1
  647. package/dist/runtime/read-only-bash.d.ts +0 -141
  648. package/dist/runtime/read-only-bash.js +0 -2204
  649. package/dist/runtime/read-only-bash.js.map +0 -1
  650. package/dist/runtime/recovery-git-commit.d.ts +0 -22
  651. package/dist/runtime/recovery-git-commit.js +0 -284
  652. package/dist/runtime/recovery-git-commit.js.map +0 -1
  653. package/dist/runtime/reject-malformed-session-id.d.ts +0 -8
  654. package/dist/runtime/reject-malformed-session-id.js +0 -16
  655. package/dist/runtime/reject-malformed-session-id.js.map +0 -1
  656. package/dist/runtime/risk-classifier.d.ts +0 -38
  657. package/dist/runtime/risk-classifier.js +0 -311
  658. package/dist/runtime/risk-classifier.js.map +0 -1
  659. package/dist/runtime/session-id.d.ts +0 -113
  660. package/dist/runtime/session-id.js +0 -193
  661. package/dist/runtime/session-id.js.map +0 -1
  662. package/dist/runtime/shell-word.d.ts +0 -62
  663. package/dist/runtime/shell-word.js +0 -410
  664. package/dist/runtime/shell-word.js.map +0 -1
  665. package/dist/runtime/task-providers/agent-tasks.d.ts +0 -105
  666. package/dist/runtime/task-providers/agent-tasks.js +0 -247
  667. package/dist/runtime/task-providers/agent-tasks.js.map +0 -1
  668. package/dist/runtime/when-eval.d.ts +0 -62
  669. package/dist/runtime/when-eval.js +0 -212
  670. package/dist/runtime/when-eval.js.map +0 -1
  671. package/dist/runtime/workflow-policies.d.ts +0 -207
  672. package/dist/runtime/workflow-policies.js +0 -596
  673. package/dist/runtime/workflow-policies.js.map +0 -1
  674. package/dist/schema/audit.d.ts +0 -71
  675. package/dist/schema/audit.js +0 -32
  676. package/dist/schema/audit.js.map +0 -1
  677. package/dist/schema/doctor.d.ts +0 -25
  678. package/dist/schema/doctor.js +0 -23
  679. package/dist/schema/doctor.js.map +0 -1
  680. package/dist/schema/environments.d.ts +0 -215
  681. package/dist/schema/environments.js +0 -101
  682. package/dist/schema/environments.js.map +0 -1
  683. package/dist/schema/extract.d.ts +0 -9
  684. package/dist/schema/extract.js +0 -86
  685. package/dist/schema/extract.js.map +0 -1
  686. package/dist/schema/permission-profiles.d.ts +0 -2292
  687. package/dist/schema/permission-profiles.js +0 -60
  688. package/dist/schema/permission-profiles.js.map +0 -1
  689. package/dist/schema/policies.d.ts +0 -974
  690. package/dist/schema/policies.js +0 -298
  691. package/dist/schema/policies.js.map +0 -1
  692. package/dist/schema/requires.d.ts +0 -131
  693. package/dist/schema/requires.js +0 -88
  694. package/dist/schema/requires.js.map +0 -1
  695. package/dist/schema/risk.d.ts +0 -144
  696. package/dist/schema/risk.js +0 -194
  697. package/dist/schema/risk.js.map +0 -1
  698. package/dist/schema/session-start-preflight.d.ts +0 -10
  699. package/dist/schema/session-start-preflight.js +0 -106
  700. package/dist/schema/session-start-preflight.js.map +0 -1
  701. package/dist/schema/stale-base-check.d.ts +0 -18
  702. package/dist/schema/stale-base-check.js +0 -37
  703. package/dist/schema/stale-base-check.js.map +0 -1
  704. package/dist/schema/toolchain-parity.d.ts +0 -21
  705. package/dist/schema/toolchain-parity.js +0 -48
  706. package/dist/schema/toolchain-parity.js.map +0 -1
  707. package/dist/schema/workflows.d.ts +0 -519
  708. package/dist/schema/workflows.js +0 -81
  709. package/dist/schema/workflows.js.map +0 -1
  710. package/scripts/runtime-reality-docker-probe.mjs +0 -71
@@ -1,80 +0,0 @@
1
- // Doctor advisory (agent-tasks abfad738, follow-up of ADR
2
- // docs/decisions/2026-08-27-ug-auto-mode-approval.md slice 1): warn when
3
- // an operator has opted into the hook-written signed auto-marker path
4
- // (`policy_packs[understanding-before-execution].config.auto_approve`)
5
- // without also pairing it with `mode: grill_me`.
6
- //
7
- // Why this matters: the auto-approval path's report precondition reuses
8
- // `validatePersistedReport` (`src/cli/approve/understanding.ts`), which
9
- // only enforces the report's `mode` field when it is `grill_me`.
10
- // Outside that mode, report validation is structural only (the report
11
- // exists and belongs to the session, not that its contents reflect any
12
- // real understanding exchange). Both the ADR (recommendation 4) and the
13
- // pack doc recommend pairing `auto_approve` with `grill_me` for exactly
14
- // this reason. Nothing surfaced the gap before this check: an operator
15
- // who opts a non-grill_me mode into `auto_approve` gets no signal that
16
- // the auto path's report gate has degraded to a near-no-op.
17
- //
18
- // Deliberately advisory, never an error: `auto_approve` outside
19
- // `grill_me` is a real, if weaker, gate (the permission-mode allowlist
20
- // and the signed marker still apply), not a misconfiguration.
21
- //
22
- // This check reads `resolveModeFromConfig(pack).mode`, the same
23
- // GENERATION-path resolver `checkUnderstandingModeEnvDivergence` and
24
- // `resolveBuiltinDefaultConfig` use, NOT `pack.config.mode` verbatim.
25
- // A missing `config.mode` resolves to `DEFAULT_MODE` (`grill_me`), and
26
- // that resolved value is what the generated Stop-hook command actually
27
- // passes as `UNDERSTANDING_GATE_MODE`, so a report written under an
28
- // unset `mode` genuinely carries `grill_me` and IS the strict check;
29
- // there is no gap to warn about. An unrecognised `config.mode` literal
30
- // also resolves to `grill_me` this same way, with its own warning
31
- // already surfaced elsewhere (`resolveModeFromConfig`'s `warning`
32
- // return, consumed by `harness validate` / other doctor checks); this
33
- // check does not duplicate that.
34
- //
35
- // A session-level `UNDERSTANDING_GATE_MODE` env override that diverges
36
- // from the resolved `config.mode` is a SEPARATE gap, already covered by
37
- // `checkUnderstandingModeEnvDivergence` (`understanding-mode-env.ts`)'s
38
- // own advisory line, this check only ever reads the manifest, never
39
- // `process.env`.
40
- import { resolveModeFromConfig } from "../../policy-packs/builtin/understanding-before-execution.js";
41
- import { parseAutoApprove } from "../../policy-packs/builtin/understanding-before-execution/index.js";
42
- import { findEnabledUnderstandingPack } from "./understanding-mode-env.js";
43
- /**
44
- * Pure: manifest in, a warning out (or `undefined` when there is nothing
45
- * to flag). Only fires when:
46
- * - the `understanding-before-execution` pack is declared AND enabled
47
- * (a pack that never runs has no live auto-approve path to warn
48
- * about, mirrors the enabled-gate `understanding-mode-env.ts` and
49
- * `ug-auto-approvals.ts` use);
50
- * - `config.auto_approve` parses as a valid opt-in block (schema
51
- * validation already rejects a malformed block at lint time, so a
52
- * manifest that reaches doctor with an unparseable block has
53
- * already failed loud elsewhere; this mirrors that same fail-closed
54
- * "not opted in" reading rather than re-deriving a second opinion);
55
- * - the RESOLVED effective mode (`resolveModeFromConfig(pack).mode`)
56
- * is not `"grill_me"`. An absent or unrecognised `config.mode`
57
- * resolves to `grill_me` (`DEFAULT_MODE`) and therefore never fires
58
- * this warning, see the module header for why that resolved value,
59
- * not the literal config key, is what the auto path's report
60
- * actually carries.
61
- */
62
- export function checkAutoApproveMode(manifest) {
63
- const pack = findEnabledUnderstandingPack(manifest);
64
- if (!pack)
65
- return undefined;
66
- const autoApprove = parseAutoApprove(pack.config["auto_approve"]);
67
- if (autoApprove === null)
68
- return undefined;
69
- const { mode } = resolveModeFromConfig(pack);
70
- if (mode === "grill_me")
71
- return undefined;
72
- return {
73
- mode,
74
- message: `auto_approve is configured with mode ${mode} (policy_packs[understanding-before-execution].config.mode); report validation is structural only outside grill_me`,
75
- detail: [
76
- "set config.mode: grill_me, or accept the weaker report gate; see docs/policy-packs/understanding-before-execution.md",
77
- ],
78
- };
79
- }
80
- //# sourceMappingURL=auto-approve-mode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auto-approve-mode.js","sourceRoot":"","sources":["../../../src/cli/doctor/auto-approve-mode.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,yEAAyE;AACzE,sEAAsE;AACtE,uEAAuE;AACvE,iDAAiD;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@
1
- import type { Manifest } from "../../schema/index.js";
2
- export interface BypassWithoutAutoApproveFinding {
3
- /** The newest observed session that tripped this finding. */
4
- sessionId: string;
5
- /** That observation's `observedAt` (ISO). */
6
- observedAt: string;
7
- /** Rendered as the `⚠` line itself. */
8
- message: string;
9
- /**
10
- * Indented detail lines rendered directly under {@link message},
11
- * mirroring the other advisory checks' idiom. Ends with the exact
12
- * `auto_approve` snippet (the same one `harness init` ships and
13
- * `harness pack upgrade understanding-before-execution` inserts, see
14
- * auto-approve-default.ts) and names the upgrade command.
15
- */
16
- detail: string[];
17
- }
18
- /**
19
- * Pure(-ish): manifest + `generatedDir` in, a finding out (or
20
- * `undefined` when there is nothing to flag). Only fires when:
21
- * - the `understanding-before-execution` pack is declared AND enabled
22
- * (mirrors every sibling advisory's gate: a pack that never runs
23
- * has no auto-approve path to be missing);
24
- * - at least one of the newest `recentSessions` hook-written
25
- * observations records `permissionMode === "bypassPermissions"`;
26
- * - `auto_approve` does NOT cover that combination today: either the
27
- * block is absent/malformed (`parseAutoApprove` returns `null`), or
28
- * `bypassPermissions` is not in `when`, or `claude-code` is not in
29
- * `harnesses` (an operator who opted Codex in alone, dropping
30
- * Claude Code, still has this exact gap on the Claude Code side).
31
- *
32
- * Reports the NEWEST qualifying observation only: this is a "you have
33
- * at least one gap" flag, not a per-session audit; `ugAutoApprovals`
34
- * already owns the full listing idiom for that.
35
- */
36
- export declare function checkBypassWithoutAutoApprove(manifest: Manifest, generatedDir: string, opts: {
37
- recentSessions: number;
38
- }): BypassWithoutAutoApproveFinding | undefined;
@@ -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,uEAA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AC,CAAC;IAEnE,MAAM,UAAU,GAA2B;QACzC;YACE,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC;YAC/C,YAAY,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,15 +0,0 @@
1
- import type { Manifest } from "../../schema/index.js";
2
- export interface ExpireOnToolMatchWarning {
3
- /** Rendered as the `⚠` line itself. */
4
- message: string;
5
- /** Indented detail lines rendered directly under {@link message}. */
6
- detail: string[];
7
- }
8
- /**
9
- * Pure: manifest in, a warning out (or `undefined` when there is nothing
10
- * to flag). Fires only when the pack is declared and enabled, the
11
- * `approval_lifecycle` block is an object that is not `mode: session`,
12
- * and `expire_on_tool_match` is a non-empty array that contains
13
- * `task_finish` but not `task_merge`.
14
- */
15
- export declare function checkExpireOnToolMatch(manifest: Manifest): ExpireOnToolMatchWarning | undefined;
@@ -1,58 +0,0 @@
1
- // Doctor advisory (agent-tasks 0c6b2cb9): warn when an operator's explicit
2
- // `policy_packs[understanding-before-execution].config.approval_lifecycle
3
- // .expire_on_tool_match` lists `task_finish` but not `task_merge`.
4
- //
5
- // Why this matters: a `task_finish` that lands the task in `review` keeps
6
- // the approval marker (the work claim is kept, task 5018c0c4), so the
7
- // approval only expires on the later `task_merge`. An explicit list
8
- // without `task_merge` therefore never re-arms the gate on the
9
- // review-then-merge path. Every `harness init` scaffold lists it; a
10
- // hand-written list can miss it.
11
- //
12
- // Deliberately advisory, never an error: the list is the operator's
13
- // explicit choice. Silent for an absent block (the runtime applies
14
- // DEFAULT_BOUNDARY_TOOL_NAMES, which includes `task_merge`), for
15
- // `mode: session` (tool expiry is off by design), for an empty list, and
16
- // for a list that has `task_merge`.
17
- //
18
- // Tool names are matched through `toolNameMatchesAny`, the same
19
- // alias-aware helper the PostToolUse hook uses, so a Claude Code or Codex
20
- // name variant of the two tools counts the way it does at runtime.
21
- import { toolNameMatchesAny } from "../../policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.js";
22
- import { TASK_FINISH_TOOL, TASK_MERGE_TOOL, } from "../../runtime/task-providers/agent-tasks.js";
23
- import { findEnabledUnderstandingPack } from "./understanding-mode-env.js";
24
- /**
25
- * Pure: manifest in, a warning out (or `undefined` when there is nothing
26
- * to flag). Fires only when the pack is declared and enabled, the
27
- * `approval_lifecycle` block is an object that is not `mode: session`,
28
- * and `expire_on_tool_match` is a non-empty array that contains
29
- * `task_finish` but not `task_merge`.
30
- */
31
- export function checkExpireOnToolMatch(manifest) {
32
- const pack = findEnabledUnderstandingPack(manifest);
33
- if (!pack)
34
- return undefined;
35
- const block = pack.config["approval_lifecycle"];
36
- if (typeof block !== "object" || block === null || Array.isArray(block))
37
- return undefined;
38
- const lifecycle = block;
39
- if (lifecycle["mode"] === "session")
40
- return undefined;
41
- const list = lifecycle["expire_on_tool_match"];
42
- if (!Array.isArray(list))
43
- return undefined;
44
- const tools = list.filter((v) => typeof v === "string" && v.length > 0);
45
- if (tools.length === 0)
46
- return undefined;
47
- const hasFinish = tools.some((t) => toolNameMatchesAny(t, [TASK_FINISH_TOOL]));
48
- const hasMerge = tools.some((t) => toolNameMatchesAny(t, [TASK_MERGE_TOOL]));
49
- if (!hasFinish || hasMerge)
50
- return undefined;
51
- return {
52
- message: "approval_lifecycle.expire_on_tool_match lists task_finish but not task_merge (policy_packs[understanding-before-execution].config); a task_finish that lands in review keeps the approval, so it never expires on the review-then-task_merge path",
53
- detail: [
54
- `add ${TASK_MERGE_TOOL} to expire_on_tool_match; see docs/policy-packs/understanding-before-execution.md`,
55
- ],
56
- };
57
- }
58
- //# sourceMappingURL=expire-on-tool-match.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"expire-on-tool-match.js","sourceRoot":"","sources":["../../../src/cli/doctor/expire-on-tool-match.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,0EAA0E;AAC1E,mEAAmE;AACnE,EAAE;AACF,0EAA0E;AAC1E,sEAAsE;AACtE,oEAAoE;AACpE,+DAA+D;AAC/D,oEAAoE;AACpE,iCAAiC;AACjC,EAAE;AACF,oEAAoE;AACpE,mEAAmE;AACnE,iEAAiE;AACjE,yEAAyE;AACzE,oCAAoC;AACpC,EAAE;AACF,gEAAgE;AAChE,0EAA0E;AAC1E,mEAAmE;AAEnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qFAAqF,CAAC;AACzH,OAAO,EACL,gBAAgB,EAChB,eAAe,GAChB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAS3E;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAkB;IACvD,MAAM,IAAI,GAAG,4BAA4B,CAAC,QAAQ,CAAC,CAAC;IACpD,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAE5B,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAChD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC1F,MAAM,SAAS,GAAG,KAAgC,CAAC;IACnD,IAAI,SAAS,CAAC,MAAM,CAAC,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAEtD,MAAM,IAAI,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAC;IAC/C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAEzC,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC/E,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAC7E,IAAI,CAAC,SAAS,IAAI,QAAQ;QAAE,OAAO,SAAS,CAAC;IAE7C,OAAO;QACL,OAAO,EACL,mPAAmP;QACrP,MAAM,EAAE;YACN,OAAO,eAAe,mFAAmF;SAC1G;KACF,CAAC;AACJ,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>;