@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,596 +0,0 @@
1
- import { TASK_FINISH_AUTOMERGE_INPUT_MATCH as ADAPTER_TASK_FINISH_AUTOMERGE_INPUT_MATCH, TASK_FINISH_TOOL, TASK_ID_EXTRACT as ADAPTER_TASK_ID_EXTRACT, TASK_MERGE_TOOL, PULL_REQUESTS_MERGE_TOOL, PR_NUMBER_EXTRACT as ADAPTER_PR_NUMBER_EXTRACT, } from "./task-providers/agent-tasks.js";
2
- /**
3
- * Runtime enforcement for `workflows:` (99f47307, Slice 1).
4
- *
5
- * `manifest.workflows[]` describes a review-then-merge process (schema:
6
- * `src/schema/workflows.ts`), but until now nothing read it at
7
- * enforcement time: `src/runtime/intercept.ts` (the Risk Gate / policy
8
- * engine `harness policy intercept` runs on every PreToolUse) only ever
9
- * evaluates `manifest.policies[]`. A `workflows:` declaration alone was
10
- * documentation, not a gate (`docs/for-agents.md`, pre-Slice-1 wording:
11
- * "The schema cannot enforce that today").
12
- *
13
- * This module closes that gap for exactly ONE step pairing: a
14
- * `review_subagent` step with `spawn: "required"` followed (at any
15
- * later index in the same workflow) by a `merge` step. When BOTH
16
- * `require-review-evidence` and `require-review-evidence-bash` are
17
- * declared in `manifest.hooks[]`, `deriveWorkflowGatePolicies` returns
18
- * the SAME policies `harness init --template full` would hand-author
19
- * (`src/cli/init/templates.ts` `review-before-merge` /
20
- * `review-before-merge-bash`), renamed per workflow so the provenance
21
- * is visible in `harness list policies` / `harness explain`.
22
- *
23
- * Task 2699b476 added the two task-scoped merge surfaces to that set:
24
- * `review-before-task-merge` (`mcp__agent-tasks__task_merge`) and
25
- * `review-before-task-finish-automerge`
26
- * (`mcp__agent-tasks__task_finish` narrowed by `trigger.input_match` to
27
- * `autoMerge: true`), each derived only when its own hook
28
- * (`require-review-evidence-task-merge` /
29
- * `require-review-evidence-task-finish`) is declared. A manifest that
30
- * predates those hooks derives exactly the pair it always did.
31
- *
32
- * Deliberately does NOT touch `src/runtime/intercept.ts`: the engine
33
- * already knows how to evaluate a `Policy`, so the only thing missing
34
- * was a `Policy` to hand it. `src/cli/loader.ts#loadManifest` calls
35
- * `withDerivedPolicies` after parsing and appends the result to
36
- * `manifest.policies` before any consumer (the CLI `policy intercept`
37
- * entrypoint, `list`, `explain`, `explain-policy`) reads it.
38
- *
39
- * TWO VIEWS OF ONE MANIFEST (review round 3, 99f47307 Slice 1). Every
40
- * reader of a parsed manifest sees exactly one of:
41
- *
42
- * - the HAND-AUTHORED view: `parseManifest(...)` as-is, only what the
43
- * operator wrote under `policies:`. Right for anything that writes a
44
- * manifest back to disk or serialises it for later comparison
45
- * (`harness export`, the `.last-apply` manifest snapshot, `add` /
46
- * `remove` / `adopt` / `pack reseed` file rewrites, the schema gate in
47
- * `io/validate-before-write.ts`), because a derived policy written out
48
- * as if hand-authored would be re-derived on top of itself next time.
49
- * `withoutDerivedPolicies` turns a derived view back into this one.
50
- * - the DERIVED view: `withDerivedPolicies(parseManifest(...))`, hand-
51
- * authored policies plus the workflow gate pair. Right for enforcement
52
- * (`policy intercept`, hook entrypoints), validation (`validate`,
53
- * `doctor`, `add`'s asset gate), display (`list`, `explain[-policy]`,
54
- * `describe`, `dry-run`), and every COMPARISON where the other side is
55
- * also derived (`diff --since` ref side vs working side; the
56
- * `.last-apply` snapshot vs the current manifest in restart hints).
57
- * `loadManifest` hands out this view; the few readers that parse
58
- * without it (`validate`, `diff`'s ref side, `apply`'s snapshot
59
- * reader, `add`'s gate) call `withDerivedPolicies` themselves.
60
- *
61
- * Both helpers are idempotent and accept either view as input (they
62
- * partition on `isDerivedPolicy`), so a reader can never "double derive"
63
- * or strip a hand-authored policy by calling them on the wrong view.
64
- * Review rounds 1 and 2 each found one reader on the wrong side of this
65
- * line (`apply` vs `validate`; `diff --since`'s two sides); the table
66
- * above plus tests/cli/manifest-view-parity.test.ts are the guard.
67
- *
68
- * Fail direction: when the two evidence hooks are NOT wired, this
69
- * returns `[]` for every workflow rather than deriving an
70
- * unenforceable policy (there would be no hook name to bind it to, and
71
- * `manifest.policies[].hook` must reference a declared hook, see
72
- * `ManifestSchema`'s superRefine in `src/schema/index.ts`). That silent
73
- * non-enforcement case is exactly what `checkWorkflowGateWiring`
74
- * (`src/cli/validate/checks.ts`) turns into a loud `validate` error, so
75
- * "declared `spawn: required`, gate never wired" cannot pass silently.
76
- */
77
- /** The two hooks templates.ts wires for the hand-authored merge gate. */
78
- export const REVIEW_EVIDENCE_HOOK_MCP = "require-review-evidence";
79
- export const REVIEW_EVIDENCE_HOOK_BASH = "require-review-evidence-bash";
80
- /**
81
- * The two hooks templates.ts wires for the task-scoped merge surfaces
82
- * (task 2699b476). Unlike the pair above these are NOT part of
83
- * `hasWiredMergeGateHooks`: a manifest that predates them still derives
84
- * the `pull_requests_merge` / `gh pr merge` gates exactly as before, and
85
- * each task-scoped gate is derived only when ITS OWN hook is declared.
86
- *
87
- * That per-hook gating is not a style choice. A derived policy's `hook:`
88
- * must name a declared hook (`ManifestSchema`'s superRefine), and, more
89
- * importantly, the hook's `match` is what `harness apply` projects into
90
- * settings.json's tool-name matcher: without a matcher for
91
- * `mcp__agent-tasks__task_merge`, Claude Code never spawns `harness
92
- * policy intercept` for that verb, so a gate derived anyway would be
93
- * INERT while looking enforced in `harness list policies` (the exact
94
- * "No-Op that LOOKS protective" shape `checkWorkflowGateWiring` exists
95
- * to prevent). Deriving nothing until the hook is wired keeps the
96
- * absence visible instead of fake-covering it.
97
- */
98
- export const REVIEW_EVIDENCE_HOOK_TASK_MERGE = "require-review-evidence-task-merge";
99
- export const REVIEW_EVIDENCE_HOOK_TASK_FINISH = "require-review-evidence-task-finish";
100
- // Exported (review round 2, F5) so `src/cli/validate/checks.ts` can check a
101
- // declared hook's `match`/`bash_match` against the EXACT surface the
102
- // derivation binds to, instead of trusting the hook name alone. See
103
- // `checkWorkflowGateWiring`'s header for the "right name, wrong trigger"
104
- // gap this closes.
105
- export const MERGE_MCP_MATCH = PULL_REQUESTS_MERGE_TOOL;
106
- // Byte-identical to templates.ts's `review-before-merge-bash` trigger
107
- // (verified against the parsed FULL_TEMPLATE at authoring time; pinned
108
- // by tests/runtime/workflow-policies.test.ts's parity assertion so the
109
- // two cannot silently drift apart).
110
- export const MERGE_BASH_MATCH = "(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S+\\s+)*gh pr merge\\b";
111
- // The two task-scoped agent-tasks merge surfaces (task 2699b476), pinned
112
- // here the same way `MERGE_MCP_MATCH` / `MERGE_BASH_MATCH` are and held
113
- // byte-identical to templates.ts by this module's parity assertion in
114
- // tests/runtime/workflow-policies.test.ts.
115
- export const TASK_MERGE_MCP_MATCH = TASK_MERGE_TOOL;
116
- export const TASK_FINISH_MCP_MATCH = TASK_FINISH_TOOL;
117
- /**
118
- * The `trigger.input_match` predicate that separates the merging mode of
119
- * `task_finish` from the ordinary one. Both auto-merge modes the MCP
120
- * server documents (soloMode work claim, review claim + approve) carry
121
- * `autoMerge: true`; a plain finish omits the argument entirely, and a
122
- * missing path never satisfies an `input_match` entry, so the gate stays
123
- * out of the way of the non-merging call.
124
- */
125
- export const TASK_FINISH_AUTOMERGE_INPUT_MATCH = ADAPTER_TASK_FINISH_AUTOMERGE_INPUT_MATCH;
126
- /** `toolArgs.taskId` is the only identifier either task-scoped verb carries. */
127
- export const TASK_ID_EXTRACT = ADAPTER_TASK_ID_EXTRACT;
128
- export const PR_NUMBER_EXTRACT = ADAPTER_PR_NUMBER_EXTRACT;
129
- /**
130
- * True when `workflow.steps` contains a `review_subagent` step with
131
- * `spawn: "required"` at an index earlier than some `merge` step
132
- * (not necessarily adjacent; a `ci_gate` or another step may sit
133
- * between them). A workflow with no `merge` step at all, or whose only
134
- * `review_subagent` steps are `spawn: "optional"` / `"skip"`, returns
135
- * `false`.
136
- */
137
- export function workflowRequiresMergeGate(workflow) {
138
- let sawRequiredReview = false;
139
- for (const step of workflow.steps) {
140
- if (step.kind === "review_subagent" && step.spawn === "required") {
141
- sawRequiredReview = true;
142
- }
143
- else if (step.kind === "merge" && sawRequiredReview) {
144
- return true;
145
- }
146
- }
147
- return false;
148
- }
149
- /** True when both merge-gate evidence hooks are declared in `manifest.hooks[]`. */
150
- export function hasWiredMergeGateHooks(manifest) {
151
- const hookNames = new Set(manifest.hooks.map((h) => h.name));
152
- return hookNames.has(REVIEW_EVIDENCE_HOOK_MCP) && hookNames.has(REVIEW_EVIDENCE_HOOK_BASH);
153
- }
154
- /**
155
- * Canonical key for "does this policy intercept the same surface for the
156
- * same evidence?": event + match + bash_match + requires.ledger_tag. Two
157
- * policies sharing this key fire on the identical event for the identical
158
- * ledger tag, so the derivation treats a hand-authored policy with this
159
- * key as a CANDIDATE for standing in for the derived gate. Whether it
160
- * actually does is decided by `isEquivalentToDerivedGate` below: it must
161
- * also extract its template variables the same way (F4, review round 3)
162
- * and be at least as strong (F1, review round 2).
163
- */
164
- function triggerSurfaceKey(policy) {
165
- return JSON.stringify({
166
- event: policy.trigger.event,
167
- match: policy.trigger.match ?? null,
168
- bash_match: policy.trigger.bash_match ?? null,
169
- input_match: inputMatchKey(policy),
170
- ledger_tag: policy.requires?.ledger_tag ?? null,
171
- });
172
- }
173
- /**
174
- * Canonical form of `trigger.input_match` for the surface key: key-sorted
175
- * so authoring order does not change identity, `null` when the policy
176
- * declares none.
177
- *
178
- * `input_match` is part of the SURFACE, not of the extract comparison
179
- * (task 2699b476): two policies on `mcp__agent-tasks__task_finish` that
180
- * disagree about which `autoMerge` value they gate intercept DIFFERENT
181
- * tool calls, so they are no more interchangeable than a policy on a
182
- * different tool name would be. Leaving it out of the key would let a
183
- * hand-authored `input_match: { toolArgs.autoMerge: false }` policy dedupe
184
- * the derived `autoMerge: true` gate away and leave the merging call
185
- * ungated while the manifest still reads as covered.
186
- */
187
- function inputMatchKey(policy) {
188
- const inputMatch = policy.trigger.input_match;
189
- if (inputMatch === undefined)
190
- return null;
191
- const sorted = {};
192
- for (const key of Object.keys(inputMatch).sort()) {
193
- sorted[key] = inputMatch[key];
194
- }
195
- return sorted;
196
- }
197
- /**
198
- * Canonical form of `trigger.extract` for equality: key-sorted so two
199
- * maps that declare the same variables from the same paths compare equal
200
- * regardless of authoring order. `null` when the policy extracts nothing.
201
- *
202
- * F4 (review round 3): `extract` was NOT part of the dedupe key before,
203
- * so a hand-authored block policy on the derived surface that extracted
204
- * `PR_NUMBER` from a WRONG path (say `toolArgs.pr` instead of
205
- * `toolArgs.prNumber`) counted as equivalent, suppressed the derived
206
- * gate, and then evaluated its own `review:${PR_NUMBER}` against an
207
- * unresolved variable. Under `risk.degraded_fail_posture: fail_open` that
208
- * is an allow with "template variables unresolved": the merge went
209
- * through with no review evidence at all. A differently-extracting policy
210
- * no longer dedupes: the derived gate is produced as well, both apply,
211
- * and `findWeakGatePolicyOverlaps` names the mismatch.
212
- */
213
- function extractKey(policy) {
214
- const extract = policy.trigger.extract;
215
- if (extract === undefined)
216
- return null;
217
- const sorted = {};
218
- for (const key of Object.keys(extract).sort()) {
219
- const value = extract[key];
220
- if (value !== undefined)
221
- sorted[key] = value;
222
- }
223
- return JSON.stringify(sorted);
224
- }
225
- /**
226
- * True when a hand-authored policy sharing the derived gate's trigger
227
- * surface + ledger_tag is strong enough to stand in for it: `enforcement:
228
- * "block"`, no `when:` risk/environment scoping, and not `operator_only:
229
- * true` (which carries no `requires:`/ledger_tag at all, so it would not
230
- * normally share a key, but the check is defensive since operator_only
231
- * would otherwise read as "block" and pass the enforcement check alone).
232
- *
233
- * F1 (review round 2, 99f47307 Slice 1): before this, `triggerSurfaceKey`
234
- * alone decided dedupe, so a hand-authored `enforcement: "warn"` policy
235
- * (or a `block` policy scoped down via `when:` to only some environments)
236
- * on the identical surface silently suppressed the derived BLOCK gate: a
237
- * `spawn: "required"` workflow step that LOOKED enforced actually
238
- * degraded to warn-only, or to unenforced outside the `when:` scope,
239
- * with no diagnostic anywhere. A weaker match no longer dedupes: the
240
- * derived block gate is ALSO produced (both apply), and
241
- * `findWeakGatePolicyOverlaps` surfaces the overlap so validate/doctor
242
- * can flag it instead of leaving it silent.
243
- */
244
- function isAtLeastAsStrongAsDerivedGate(policy) {
245
- return (policy.enforcement === "block" &&
246
- policy.when === undefined &&
247
- policy.operator_only !== true);
248
- }
249
- /**
250
- * Why `policy` does NOT qualify as at-least-as-strong (see
251
- * `isAtLeastAsStrongAsDerivedGate`), in a form suitable for a diagnostic
252
- * message. `null` when the policy DOES qualify (nothing weak to report).
253
- */
254
- function weaknessReason(policy) {
255
- if (isAtLeastAsStrongAsDerivedGate(policy))
256
- return null;
257
- if (policy.enforcement !== "block")
258
- return `enforcement: ${policy.enforcement}`;
259
- if (policy.when !== undefined)
260
- return "when: (risk/environment-scoped)";
261
- if (policy.operator_only === true)
262
- return "operator_only: true";
263
- return "weaker than a plain block gate";
264
- }
265
- /**
266
- * Why a hand-authored policy on the derived gate's surface does NOT stand
267
- * in for it, or `null` when it does (same surface, same extract, at least
268
- * as strong). Strength is reported before an extract mismatch: a warn
269
- * policy with a wrong extract path is first and foremost a warn policy.
270
- */
271
- function nonEquivalenceReason(handPolicy, derivedGate) {
272
- const weakness = weaknessReason(handPolicy);
273
- if (weakness !== null)
274
- return weakness;
275
- const handExtract = extractKey(handPolicy);
276
- const gateExtract = extractKey(derivedGate);
277
- if (handExtract !== gateExtract) {
278
- return `trigger.extract differs (${handExtract ?? "none"} vs derived ${gateExtract ?? "none"})`;
279
- }
280
- return null;
281
- }
282
- function buildMcpMergeGatePolicy(workflowName) {
283
- return {
284
- name: `workflow:${workflowName}:review-before-merge`,
285
- description: `Derived from workflows[] (workflow "${workflowName}"): a review_subagent step ` +
286
- `with spawn: "required" precedes a merge step, so block PR merges unless a ` +
287
- "ledger entry tagged review:<pr-number> exists for this session.",
288
- trigger: {
289
- event: "PreToolUse",
290
- match: MERGE_MCP_MATCH,
291
- extract: { ...PR_NUMBER_EXTRACT },
292
- },
293
- requires: { ledger_tag: "review:${PR_NUMBER}" },
294
- hook: REVIEW_EVIDENCE_HOOK_MCP,
295
- enforcement: "block",
296
- producers: [
297
- {
298
- kind: "mcp",
299
- verb: "mcp__grounding-mcp__ledger_add",
300
- example: '{sessionId:"${SESSION_ID}", type:"fact", content:"review:${PR_NUMBER}: <verdict + key findings + nits>", source:"Agent(general-purpose) review"}',
301
- description: "Spawn a review subagent against the PR diff, capture its verdict, then persist a ledger entry tagged with the PR number. The content should be self-contained enough for an auditor to read without re-opening the chat.",
302
- },
303
- ],
304
- ux: {
305
- cannot: "You cannot merge PR #${PR_NUMBER} yet.",
306
- required: ["a recorded review of PR #${PR_NUMBER}"],
307
- run: ['harness record review --pr ${PR_NUMBER} "<summary>"'],
308
- },
309
- };
310
- }
311
- function buildBashMergeGatePolicy(workflowName) {
312
- return {
313
- name: `workflow:${workflowName}:review-before-merge-bash`,
314
- description: `Derived from workflows[] (workflow "${workflowName}"): a review_subagent step ` +
315
- 'with spawn: "required" precedes a merge step, so block `gh pr merge` unless a ' +
316
- "ledger entry tagged review:<branch> exists for this session.",
317
- trigger: {
318
- event: "PreToolUse",
319
- match: "Bash",
320
- bash_match: MERGE_BASH_MATCH,
321
- },
322
- requires: { ledger_tag: "review:${BRANCH}" },
323
- hook: REVIEW_EVIDENCE_HOOK_BASH,
324
- enforcement: "block",
325
- producers: [
326
- {
327
- kind: "mcp",
328
- verb: "mcp__grounding-mcp__ledger_add",
329
- example: '{sessionId:"${SESSION_ID}", type:"fact", content:"review:${BRANCH}: <verdict + key findings + nits>", source:"Agent(general-purpose) review"}',
330
- description: "Spawn a review subagent against the branch diff, capture its verdict, then persist a ledger entry tagged with the branch name. Mirror of the review-before-merge producer for the gh-cli surface.",
331
- },
332
- ],
333
- ux: {
334
- cannot: "You cannot merge the PR for branch ${BRANCH} via `gh pr merge` yet.",
335
- required: ["a recorded review of the PR for branch ${BRANCH}"],
336
- run: ['harness record review --pr <pr> "<summary>"'],
337
- },
338
- };
339
- }
340
- /**
341
- * The two task-scoped merge gates (task 2699b476), structurally identical
342
- * to templates.ts's `review-before-task-merge` /
343
- * `review-before-task-finish-automerge` apart from name and description.
344
- * They key on `review:${TASK_ID}` rather than the PR number because both
345
- * verbs derive owner/repo/PR from the task, so `toolArgs.taskId` is the
346
- * only identifier in the payload; `harness record review --pr <pr> --task
347
- * <id>` writes both tag families in ONE fact so a single recorded review
348
- * opens every merge surface.
349
- */
350
- function buildTaskMergeGatePolicy(workflowName) {
351
- return {
352
- name: `workflow:${workflowName}:review-before-task-merge`,
353
- description: `Derived from workflows[] (workflow "${workflowName}"): a review_subagent step ` +
354
- `with spawn: "required" precedes a merge step, so block agent-tasks task_merge ` +
355
- "unless a ledger entry tagged review:<task-id> exists for this session.",
356
- trigger: {
357
- event: "PreToolUse",
358
- match: TASK_MERGE_MCP_MATCH,
359
- extract: { ...TASK_ID_EXTRACT },
360
- },
361
- requires: { ledger_tag: "review:${TASK_ID}" },
362
- hook: REVIEW_EVIDENCE_HOOK_TASK_MERGE,
363
- enforcement: "block",
364
- producers: [
365
- {
366
- kind: "mcp",
367
- verb: "mcp__grounding-mcp__ledger_add",
368
- example: '{sessionId:"${SESSION_ID}", type:"fact", content:"review:${TASK_ID}: <verdict + key findings + nits>", source:"Agent(general-purpose) review"}',
369
- description: "Spawn a review subagent against the PR diff, capture its verdict, then persist a ledger entry tagged with the task id. Mirror of the review-before-merge producer for the task-scoped merge surface.",
370
- },
371
- ],
372
- ux: {
373
- cannot: "You cannot merge the PR for task ${TASK_ID} yet.",
374
- required: ["a recorded review of task ${TASK_ID}"],
375
- run: ['harness record review --pr <pr> --task ${TASK_ID} "<summary>"'],
376
- },
377
- };
378
- }
379
- function buildTaskFinishAutoMergeGatePolicy(workflowName) {
380
- return {
381
- name: `workflow:${workflowName}:review-before-task-finish-automerge`,
382
- description: `Derived from workflows[] (workflow "${workflowName}"): a review_subagent step ` +
383
- `with spawn: "required" precedes a merge step, so block agent-tasks task_finish ` +
384
- "in its auto-merge mode unless a ledger entry tagged review:<task-id> exists for " +
385
- "this session.",
386
- trigger: {
387
- event: "PreToolUse",
388
- match: TASK_FINISH_MCP_MATCH,
389
- input_match: { ...TASK_FINISH_AUTOMERGE_INPUT_MATCH },
390
- extract: { ...TASK_ID_EXTRACT },
391
- },
392
- requires: { ledger_tag: "review:${TASK_ID}" },
393
- hook: REVIEW_EVIDENCE_HOOK_TASK_FINISH,
394
- enforcement: "block",
395
- producers: [
396
- {
397
- kind: "mcp",
398
- verb: "mcp__grounding-mcp__ledger_add",
399
- example: '{sessionId:"${SESSION_ID}", type:"fact", content:"review:${TASK_ID}: <verdict + key findings + nits>", source:"Agent(general-purpose) review"}',
400
- description: "Spawn a review subagent against the PR diff, capture its verdict, then persist a ledger entry tagged with the task id. Same evidence the task_merge gate reads, so one recorded review opens both.",
401
- },
402
- ],
403
- ux: {
404
- cannot: "You cannot finish task ${TASK_ID} with autoMerge yet.",
405
- required: ["a recorded review of task ${TASK_ID}"],
406
- run: ['harness record review --pr <pr> --task ${TASK_ID} "<summary>"'],
407
- },
408
- };
409
- }
410
- // F7 (review round 2): a registry of every `Policy` object this module has
411
- // ever handed back from `deriveWorkflowGatePolicies`. `WeakSet` keys on
412
- // object identity, not value equality, deliberately: two DIFFERENT
413
- // workflows can derive value-identical-looking policies with different
414
- // names, and a hand-authored policy could theoretically share a derived
415
- // policy's exact shape too (nothing stops an operator hand-copying one
416
- // into `policies:`). Identity is the only unambiguous "did THIS module
417
- // produce THIS object" test. `harness export`/`list`/`doctor` use
418
- // `isDerivedPolicy` to distinguish "declared by the operator" from
419
- // "derived from workflows[]" without re-deriving and re-comparing.
420
- const derivedPolicyRegistry = new WeakSet();
421
- /** True when `policy` is an object this module derived (see `withDerivedPolicies`). */
422
- export function isDerivedPolicy(policy) {
423
- return derivedPolicyRegistry.has(policy);
424
- }
425
- /**
426
- * The hand-authored slice of `manifest.policies`: everything the operator
427
- * wrote under `policies:`, none of the workflow-derived entries. Works on
428
- * either view (see module doc); on a hand-authored view it is the
429
- * identity.
430
- */
431
- export function handAuthoredPolicies(manifest) {
432
- return manifest.policies.filter((p) => !isDerivedPolicy(p));
433
- }
434
- /**
435
- * The ONE walk that decides, per qualifying workflow and per surface,
436
- * whether a gate is derived and which hand-authored policies overlap it.
437
- * `deriveWorkflowGatePolicies` and `findWeakGatePolicyOverlaps` are both
438
- * projections of this result, so they cannot disagree about what was
439
- * derived (F1, review round 3: the overlap finder used to re-implement
440
- * the walk without the `seen` set, and warned about a "derived" gate that
441
- * a strong hand-authored policy had in fact suppressed).
442
- *
443
- * Only HAND-authored policies feed the walk (`handAuthoredPolicies`), so
444
- * the result is the same whether the input is the hand-authored or the
445
- * derived view.
446
- */
447
- function deriveWorkflowGates(manifest) {
448
- const empty = { policies: [], overlaps: [] };
449
- if (!hasWiredMergeGateHooks(manifest))
450
- return empty;
451
- const hand = handAuthoredPolicies(manifest);
452
- const declaredHookNames = new Set(manifest.hooks.map((h) => h.name));
453
- const bySurface = new Map();
454
- for (const policy of hand) {
455
- const key = triggerSurfaceKey(policy);
456
- const bucket = bySurface.get(key);
457
- if (bucket)
458
- bucket.push(policy);
459
- else
460
- bySurface.set(key, [policy]);
461
- }
462
- // Surfaces already covered: by an equivalent hand-authored policy (F1 +
463
- // F4: at least as strong AND extracting the same way), or by a gate an
464
- // earlier workflow in this same manifest already derived.
465
- const seen = new Set();
466
- const derived = [];
467
- const overlaps = [];
468
- for (const workflow of manifest.workflows) {
469
- if (!workflowRequiresMergeGate(workflow))
470
- continue;
471
- const candidates = [
472
- { policy: buildMcpMergeGatePolicy(workflow.name), surface: MERGE_MCP_MATCH },
473
- { policy: buildBashMergeGatePolicy(workflow.name), surface: "`gh pr merge` (Bash)" },
474
- { policy: buildTaskMergeGatePolicy(workflow.name), surface: TASK_MERGE_MCP_MATCH },
475
- {
476
- policy: buildTaskFinishAutoMergeGatePolicy(workflow.name),
477
- surface: `${TASK_FINISH_MCP_MATCH} (autoMerge: true)`,
478
- },
479
- ];
480
- for (const { policy: candidate, surface } of candidates) {
481
- // A candidate whose own hook is not declared is skipped rather than
482
- // derived (task 2699b476): see REVIEW_EVIDENCE_HOOK_TASK_MERGE's
483
- // doc for why an unwired hook makes a derived gate inert rather
484
- // than enforcing. `hasWiredMergeGateHooks` above already guarantees
485
- // this holds for the two pull_requests_merge / gh pr merge
486
- // candidates, so their behaviour is unchanged.
487
- if (!declaredHookNames.has(candidate.hook))
488
- continue;
489
- const key = triggerSurfaceKey(candidate);
490
- if (seen.has(key))
491
- continue;
492
- const sharing = bySurface.get(key) ?? [];
493
- const reasons = sharing.map((hp) => ({
494
- handPolicy: hp,
495
- reason: nonEquivalenceReason(hp, candidate),
496
- }));
497
- if (reasons.some((r) => r.reason === null)) {
498
- // An equivalent hand-authored policy already gates this surface;
499
- // nothing is derived, so there is nothing to overlap with either.
500
- seen.add(key);
501
- continue;
502
- }
503
- derived.push(candidate);
504
- seen.add(key);
505
- for (const { handPolicy, reason } of reasons) {
506
- if (reason === null)
507
- continue;
508
- overlaps.push({
509
- workflowName: workflow.name,
510
- derivedPolicyName: candidate.name,
511
- surface,
512
- handPolicyName: handPolicy.name,
513
- reason,
514
- });
515
- }
516
- }
517
- }
518
- return { policies: derived, overlaps };
519
- }
520
- /**
521
- * Derive the merge-gate `Policy` pair for every workflow that needs one
522
- * and does not already have an equivalent policy (hand-authored, or
523
- * derived from an earlier workflow in the same manifest) intercepting
524
- * the same surface for the same evidence tag.
525
- *
526
- * Returns `[]` when `manifest.hooks[]` is missing either evidence hook
527
- * (see module doc: that gap is a `validate` error, not silent
528
- * derivation of an unenforceable policy) or when no workflow declares
529
- * a `spawn: "required"` review step followed by a merge step.
530
- */
531
- export function deriveWorkflowGatePolicies(manifest) {
532
- return deriveWorkflowGates(manifest).policies;
533
- }
534
- /**
535
- * Every hand-authored policy that shares an ACTUALLY DERIVED gate's
536
- * trigger surface + ledger_tag but does not stand in for it: weaker
537
- * (F1, review round 2) or extracting its variables differently (F4,
538
- * review round 3). Both policies apply in that case, and the overlap is
539
- * worth flagging: an operator reading `enforcement: warn` on a
540
- * `two-reviewers-required`-shaped policy might reasonably believe THAT
541
- * is the only gate on the surface. `src/cli/validate/checks.ts` turns
542
- * each entry into a warning Diagnostic; `src/cli/doctor/index.ts`
543
- * renders the same list in the Workflows section.
544
- *
545
- * Mirrors `deriveWorkflowGatePolicies` exactly (same walk, same `seen`
546
- * set): a surface an equivalent hand-authored policy already covers
547
- * derives nothing and therefore reports nothing, even when a second,
548
- * weaker policy sits on it too. Returns `[]` when the evidence hooks are
549
- * not wired or no workflow needs a gate.
550
- */
551
- export function findWeakGatePolicyOverlaps(manifest) {
552
- return deriveWorkflowGates(manifest).overlaps;
553
- }
554
- /**
555
- * The ONE place `workflows[]` gets folded into `manifest.policies` (F2,
556
- * review round 2). Before this, `src/cli/loader.ts#loadManifest` inlined
557
- * the append, so every OTHER manifest consumer that parses the manifest
558
- * a different way (`src/cli/validate/index.ts`'s `loadMergedRaw` +
559
- * `parseManifest`, notably) saw a manifest with no derived policies at
560
- * all, and `apply` and `validate` diverged. See the module doc for the
561
- * full list of readers and which view each one takes.
562
- *
563
- * Idempotent and view-agnostic (review round 3): the derivation runs on
564
- * `handAuthoredPolicies(manifest)` only and any derived entries already
565
- * present are replaced, so calling this on an already-derived view yields
566
- * the same policy names with no duplicates. Returns the input object
567
- * unchanged when there is nothing to derive and nothing to replace.
568
- *
569
- * Registers each derived `Policy` object in the module-level
570
- * `derivedPolicyRegistry` (F7) so `isDerivedPolicy` can later distinguish
571
- * it from a hand-authored one (used by `harness export`'s filter and
572
- * `list`/`doctor`'s "(derived from workflows[])" marker).
573
- */
574
- export function withDerivedPolicies(manifest) {
575
- const hand = handAuthoredPolicies(manifest);
576
- const derivedPolicies = deriveWorkflowGatePolicies(manifest);
577
- if (derivedPolicies.length === 0 && hand.length === manifest.policies.length)
578
- return manifest;
579
- for (const policy of derivedPolicies)
580
- derivedPolicyRegistry.add(policy);
581
- return { ...manifest, policies: [...hand, ...derivedPolicies] };
582
- }
583
- /**
584
- * The hand-authored view of a manifest that may carry derived policies:
585
- * what `harness export` emits and what the `.last-apply` manifest
586
- * snapshot stores, so nothing that gets written out or re-read later
587
- * carries a derived policy as if the operator had declared it. Returns
588
- * the input object unchanged when it carries no derived policy.
589
- */
590
- export function withoutDerivedPolicies(manifest) {
591
- const hand = handAuthoredPolicies(manifest);
592
- if (hand.length === manifest.policies.length)
593
- return manifest;
594
- return { ...manifest, policies: hand };
595
- }
596
- //# sourceMappingURL=workflow-policies.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflow-policies.js","sourceRoot":"","sources":["../../src/runtime/workflow-policies.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iCAAiC,IAAI,yCAAyC,EAC9E,gBAAgB,EAChB,eAAe,IAAI,uBAAuB,EAC1C,eAAe,EACf,wBAAwB,EACxB,iBAAiB,IAAI,yBAAyB,GAC/C,MAAM,iCAAiC,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AAEH,yEAAyE;AACzE,MAAM,CAAC,MAAM,wBAAwB,GAAG,yBAAyB,CAAC;AAClE,MAAM,CAAC,MAAM,yBAAyB,GAAG,8BAA8B,CAAC;AAExE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,oCAAoC,CAAC;AACpF,MAAM,CAAC,MAAM,gCAAgC,GAAG,qCAAqC,CAAC;AAEtF,4EAA4E;AAC5E,qEAAqE;AACrE,oEAAoE;AACpE,yEAAyE;AACzE,mBAAmB;AACnB,MAAM,CAAC,MAAM,eAAe,GAAG,wBAAwB,CAAC;AACxD,sEAAsE;AACtE,uEAAuE;AACvE,uEAAuE;AACvE,oCAAoC;AACpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,uDAAuD,CAAC;AAExF,yEAAyE;AACzE,wEAAwE;AACxE,sEAAsE;AACtE,2CAA2C;AAC3C,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC;AACpD,MAAM,CAAC,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,yCAAyC,CAAC;AAE3F,gFAAgF;AAChF,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