@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,611 +0,0 @@
1
- // Built-in destructive-shell floor for the Risk Classifier (task 2929c5b7).
2
- //
3
- // WHY THIS IS CODE AND NOT ONLY A MANIFEST PATTERN. `when-eval.ts` no
4
- // longer lets an UNCLASSIFIED action satisfy `risk.severity_at_least:
5
- // critical` on its own. That change ships in the binary and takes effect
6
- // for every install on upgrade. Its compensating half, explicit
7
- // classification for the mutating heads that used to ride the blanket
8
- // fail-close (`dd`, `truncate`, `shred`, `mkfs`, `find -delete`, ...),
9
- // would take effect only for installs that ADOPT the new `dangerous-shell`
10
- // template patterns, because `harness init` writes the manifest once and
11
- // never rewrites it. An existing manifest carrying the original four
12
- // patterns would have kept the loosened fallback and lost the hard block
13
- // in the same upgrade. So the recognition ships HERE, composed into
14
- // `classifyRisk` like the existing built-in floors, and the template
15
- // patterns are its operator-visible, operator-editable mirror.
16
- //
17
- // FLOOR SEMANTICS, same as every other built-in floor: it composes under
18
- // highest-severity-wins. It can only RAISE an action's severity, never
19
- // lower one an operator classifier already assigned, and an operator
20
- // pattern can always raise above it.
21
- //
22
- // SCOPE, deliberately narrow. This is not a general "is this command
23
- // dangerous" oracle and must not grow into one: it recognises a closed set
24
- // of heads whose DESTRUCTIVE INVOCATION SHAPE is decidable from argv
25
- // tokens alone. Anything else stays unclassified and rides the "high" rung
26
- // fallback (approval-gated), which is the honest answer. A truncating
27
- // redirection (`cmd > file`) is NOT recognised here for the same reason it
28
- // is not a template pattern: this module has no redirection model, and a
29
- // text heuristic for a bare `>` over-matches `2>&1`, heredocs, and
30
- // comparison operators. See docs/risk-gate.md.
31
- //
32
- // TWO KNOWN OVER-BLOCKS, both in the raise-severity direction and both
33
- // accepted. (1) The boundary split is not quote-aware, so a floored head
34
- // name inside a torn-open quoted string is examined as if it were a real
35
- // invocation. (2) `shred` and `mkfs` are matched on their HEAD TOKEN
36
- // ALONE, with no argument shape to check, so any such fragment starting
37
- // with one of them classifies `critical`. The single exception carved out
38
- // of (2) is an invocation whose only argument is a help/version flag
39
- // (`isLoneVersionOrHelp`), which cannot destroy anything.
40
- //
41
- // HEAD-RESOLUTION SPELLINGS THIS FLOOR DOES NOT REACH, by design and
42
- // measured: a brace group (`{ dd of=y; }`), a backtick substitution
43
- // (`` `dd of=y` ``), `eval "dd of=y"`, an `-exec sh -c '<cmd>'` payload
44
- // (only a direct `-exec rm` is recognised), and `git -c k=v push --force`
45
- // (`-c` is deliberately absent from the git global-flag skip list because
46
- // config injection can execute code, so the subcommand walk stops there).
47
- // Each stays UNCLASSIFIED, which is approval-gated rather than silently
48
- // allowed, and each is pinned as such in
49
- // tests/runtime/destructive-shell-floor.test.ts so a future change to the
50
- // split or the wrapper peel cannot flip one without a test noticing.
51
- // Closing them would mean a real shell parser; see docs/risk-gate.md's
52
- // "Not recognized, by design".
53
- import { GIT_GLOBAL_NO_VALUE_FLAGS, GIT_GLOBAL_VALUE_TAKING_FLAGS, GIT_TOKEN_RE, peelWrapperPrefixes, } from "./command-normalize.js";
54
- import { decodeShellWord, truncateNulRuns } from "./shell-word.js";
55
- // Shell boundary characters. The command text is split on these before any
56
- // head resolution, so a destructive invocation after `;`, `&&`, `||`, `|`,
57
- // `&`, a subshell paren, or a newline is still examined. Splitting is
58
- // deliberately NOT quote-aware: over-splitting inside a quoted string only
59
- // produces MORE candidate heads to examine, which is the safe direction
60
- // for a floor that raises severity. Under-splitting is what would hide a
61
- // destructive tail, and that cannot happen here.
62
- const BOUNDARY_SPLIT_RE = /[;&|()\n]+/;
63
- /** Multi-call binaries: `busybox dd if=... of=...` really runs `dd`. */
64
- const MULTICALL_HEADS = new Set(["busybox", "toybox"]);
65
- /** Shells whose `-c` argument is a nested command string. */
66
- const SHELL_HEADS = new Set([
67
- "sh", "bash", "zsh", "dash", "ksh", "ash",
68
- ]);
69
- /** Depth bound for `sh -c "sh -c ..."` nesting. */
70
- const MAX_NESTING_DEPTH = 4;
71
- /**
72
- * Recognise every built-in destructive invocation in `command`.
73
- *
74
- * Pure and linear in the length of the command: whitespace tokenisation,
75
- * set lookups, and a bounded wrapper peel. No regex with a backtracking
76
- * risk runs over the command text (`BOUNDARY_SPLIT_RE` is a character
77
- * class), so this may be called on the UNCAPPED command string, which it
78
- * must be, so a destructive tail past the classifier's 16 KiB ReDoS cap
79
- * cannot be laundered by a long benign head.
80
- */
81
- export function classifyDestructiveShellFloor(command) {
82
- const hits = [];
83
- scanCommand(command, 0, hits);
84
- // A word with a NUL-decoding ANSI-C escape decodes to a value that keeps a
85
- // literal U+0000 (`$'--force\0'`, `$'dd\0'`), which no exact comparison
86
- // below (a whole flag, a head or subcommand name) can equal, while bash cuts
87
- // the run at the NUL and runs the plain command (task `5cc64860`, GNU bash
88
- // 3.2.57). The command is therefore scanned a second time with each such
89
- // run replaced by the value bash passes (`truncateNulRuns`), and the hits of
90
- // both scans are kept: the second scan can only add a hit, so no verdict is
91
- // lowered, and the NUL spelling is classified at least as severely as its
92
- // plain twin. The rewrite runs before the boundary split, so a boundary
93
- // character inside the cut-off part of a run (`$'--force\0;'`) cannot tear
94
- // the word. A command without such a run is scanned once, as before.
95
- const nul = truncateNulRuns(command);
96
- if (nul !== null)
97
- scanCommand(nul, 0, hits);
98
- return dedupe(hits);
99
- }
100
- function dedupe(hits) {
101
- const seen = new Set();
102
- const out = [];
103
- for (const hit of hits) {
104
- if (seen.has(hit.reason))
105
- continue;
106
- seen.add(hit.reason);
107
- out.push(hit);
108
- }
109
- return out;
110
- }
111
- function scanCommand(command, depth, hits) {
112
- if (depth > MAX_NESTING_DEPTH)
113
- return;
114
- // WHOLE-STRING pass first, and only for the `<shell> -c "<command>"`
115
- // shape. The boundary split below is not quote-aware, so it would tear
116
- // `sh -c "dd if=x of=y; rm -rf /"` apart mid-quote and leave the nested
117
- // `dd` unrecognisable. Resolving the shell head before splitting keeps
118
- // the nested command intact for the recursive scan.
119
- const wholeTokens = tokenize(command);
120
- const wholeHead = resolveHead(wholeTokens);
121
- if (wholeHead !== null && SHELL_HEADS.has(wholeHead.name)) {
122
- scanShellDashC(wholeTokens.slice(wholeHead.idx + 1), depth, hits);
123
- }
124
- for (const piece of command.split(BOUNDARY_SPLIT_RE)) {
125
- const tokens = tokenize(piece);
126
- if (tokens.length === 0)
127
- continue;
128
- scanInvocation(tokens, depth, hits);
129
- }
130
- }
131
- function tokenize(s) {
132
- return s.trim().split(/\s+/).filter((t) => t !== "");
133
- }
134
- /**
135
- * Resolve the real head of one invocation: peel `VAR=x` assignments and
136
- * the `sudo`/`env`/`command`/`timeout`/... wrapper chain, then any
137
- * `busybox`/`toybox` multi-call prefix. Returns the head's literal name
138
- * (decoded, path prefix stripped) and its token index, or `null` when no
139
- * head token survives.
140
- */
141
- function resolveHead(rawTokens) {
142
- // Basename + decode every token that is not a flag and not a `NAME=value`
143
- // assignment, so `/bin/dd`, `/usr/bin/env`, and `"sudo"` all resolve like
144
- // their bare spellings. Assignments and `of=`-style operands keep their
145
- // text (their `=` is load-bearing), and flags keep theirs (a flag has no
146
- // path prefix to strip).
147
- const peelTokens = rawTokens.map((t) => ({ text: headNameOf(t) }));
148
- let idx = 0;
149
- for (let guard = 0; guard <= MAX_NESTING_DEPTH; guard += 1) {
150
- const before = idx;
151
- // Shared wrapper vocabulary (`peelWrapperPrefixes`, command-normalize.ts)
152
- // rather than a second hand-rolled copy of it: a wrapper added there
153
- // benefits this floor automatically.
154
- idx = peelWrapperPrefixes(peelTokens, idx).idx;
155
- const peeled = peelTokens[idx]?.text;
156
- if (peeled !== undefined && MULTICALL_HEADS.has(peeled)) {
157
- idx += 1;
158
- continue;
159
- }
160
- if (idx === before)
161
- break;
162
- }
163
- const name = peelTokens[idx]?.text;
164
- return name === undefined ? null : { name, idx };
165
- }
166
- /** Resolve one boundary-delimited invocation's head, then dispatch on it. */
167
- function scanInvocation(rawTokens, depth, hits) {
168
- const resolved = resolveHead(rawTokens);
169
- if (resolved === null)
170
- return;
171
- const head = resolved.name;
172
- const args = rawTokens.slice(resolved.idx + 1);
173
- if (SHELL_HEADS.has(head)) {
174
- scanShellDashC(args, depth, hits);
175
- return;
176
- }
177
- if (head === "dd")
178
- return scanDd(args, hits);
179
- if (head === "truncate")
180
- return scanTruncate(args, hits);
181
- if (head === "shred") {
182
- if (isLoneVersionOrHelp(args))
183
- return;
184
- hits.push({
185
- severity: "critical",
186
- categories: ["destructive", "data_loss", "irreversible_action"],
187
- reason: "built-in destructive floor: shred overwrites a file in place",
188
- });
189
- return;
190
- }
191
- if (head === "mkfs" || head.startsWith("mkfs.")) {
192
- if (isLoneVersionOrHelp(args))
193
- return;
194
- hits.push({
195
- severity: "critical",
196
- categories: ["destructive", "data_loss", "infrastructure_change"],
197
- reason: "built-in destructive floor: mkfs formats a filesystem",
198
- });
199
- return;
200
- }
201
- if (head === "find")
202
- return scanFind(args, hits);
203
- if (GIT_TOKEN_RE.test(head))
204
- return scanGit(args, hits);
205
- if (head === "chmod" || head === "chown")
206
- return scanChmodChown(head, args, hits);
207
- if (head === "sed")
208
- return scanSed(args, hits);
209
- if (head === "curl")
210
- return scanCurl(args, hits);
211
- }
212
- /**
213
- * `sh -c "<command>"` / `bash -lc '<command>'`: the nested command string
214
- * is re-scanned from the top. The `-c` value is reconstructed by rejoining
215
- * the tokens after the flag run (the whitespace tokenizer split the quoted
216
- * string apart) and stripping one layer of surrounding quotes.
217
- */
218
- function scanShellDashC(args, depth, hits) {
219
- let i = 0;
220
- let sawDashC = false;
221
- for (; i < args.length; i += 1) {
222
- const t = decodeShellWord(args[i]);
223
- if (!t.startsWith("-"))
224
- break;
225
- if (t === "--") {
226
- i += 1;
227
- break;
228
- }
229
- if (!t.startsWith("--") && t.includes("c")) {
230
- sawDashC = true;
231
- i += 1;
232
- break;
233
- }
234
- if (t === "--command") {
235
- sawDashC = true;
236
- i += 1;
237
- break;
238
- }
239
- }
240
- if (!sawDashC)
241
- return;
242
- const nested = stripOuterQuotes(args.slice(i).join(" "));
243
- if (nested === "")
244
- return;
245
- scanCommand(nested, depth + 1, hits);
246
- }
247
- function stripOuterQuotes(s) {
248
- const t = s.trim();
249
- if (t.length >= 2) {
250
- const first = t[0];
251
- const last = t[t.length - 1];
252
- if ((first === "'" || first === '"') && first === last)
253
- return t.slice(1, -1);
254
- }
255
- return t;
256
- }
257
- /**
258
- * The literal name a head token invokes: decoded, with any path prefix
259
- * stripped. `NAME=value` assignment tokens and flags are returned
260
- * unchanged (stripping a `/` out of an assignment's VALUE would corrupt
261
- * the token `peelWrapperPrefixes` needs to recognise, and a flag has no
262
- * path prefix).
263
- */
264
- function headNameOf(token) {
265
- const decoded = decodeShellWord(token);
266
- if (decoded.startsWith("-"))
267
- return decoded;
268
- if (/^[A-Za-z_][A-Za-z0-9_]*=/.test(decoded))
269
- return decoded;
270
- const slash = decoded.lastIndexOf("/");
271
- return slash === -1 ? decoded : decoded.slice(slash + 1);
272
- }
273
- /** `true` when `arg`, raw or decoded, satisfies `pred`. */
274
- function eitherForm(arg, pred) {
275
- return pred(arg) || pred(decodeShellWord(arg));
276
- }
277
- /** `true` when `t` is a single-dash short-flag cluster containing `ch`. */
278
- function shortClusterHas(t, ch) {
279
- return t.startsWith("-") && !t.startsWith("--") && t.slice(1).includes(ch);
280
- }
281
- /**
282
- * Flags that mean "print and exit", never "act". Same set and same
283
- * precedent as `VERSION_OR_HELP_FLAGS` in `read-only-bash.ts` (kept as a
284
- * local copy rather than an import so this module stays free of that
285
- * 2000-line predicate; the two sets are five literals and are pinned
286
- * against each other in tests/runtime/destructive-shell-floor.test.ts).
287
- */
288
- const VERSION_OR_HELP_FLAGS = new Set([
289
- "--version", "-V", "-v", "--help", "-h",
290
- ]);
291
- /**
292
- * `true` for an invocation whose ONLY argument is a help/version flag.
293
- *
294
- * The argument-free heads below (`shred`, `mkfs`) are matched on the head
295
- * token alone, because every real invocation of them destroys something.
296
- * That over-blocks the one shape that destroys nothing: `shred --help`.
297
- * The LONE requirement is what keeps this safe: `shred -v secret.txt` is
298
- * a real shred with a verbose flag and keeps its `critical`, and a bare
299
- * `shred -v` has no operand to destroy.
300
- *
301
- * NOTE, the same over-block in general: an argument-free head match fires
302
- * on ANY boundary-split fragment whose first token resolves to that head,
303
- * so a fragment like `echo mkfs` never reaches here (its head is `echo`)
304
- * but `mkfs` inside a quoted string the non-quote-aware split tore open
305
- * does. That is the deliberate direction for a floor that only RAISES
306
- * severity, and is the same trade the split itself documents.
307
- */
308
- function isLoneVersionOrHelp(args) {
309
- return args.length === 1 && VERSION_OR_HELP_FLAGS.has(decodeShellWord(args[0]));
310
- }
311
- // `dd` writes only when it is given an output file. `dd if=/dev/sda | gzip`
312
- // (a read into a pipe) is deliberately NOT floored: it mutates nothing, and
313
- // flooring it would hard-block a backup on a production-resolved session,
314
- // the exact false positive this task exists to remove.
315
- function scanDd(args, hits) {
316
- if (!args.some((a) => eitherForm(a, (t) => t.startsWith("of="))))
317
- return;
318
- hits.push({
319
- severity: "critical",
320
- categories: ["destructive", "data_loss"],
321
- reason: "built-in destructive floor: dd with an of= write target",
322
- });
323
- }
324
- // `truncate -s <size>` / `--size=<size>`, including the glued `-s0` form
325
- // and any cluster carrying `s` (`-cs 0`). Without a size there is nothing
326
- // to truncate to.
327
- function scanTruncate(args, hits) {
328
- const sized = args.some((a) => eitherForm(a, (t) => t === "--size" || t.startsWith("--size=") || shortClusterHas(t, "s")));
329
- if (!sized)
330
- return;
331
- hits.push({
332
- severity: "critical",
333
- categories: ["destructive", "data_loss"],
334
- reason: "built-in destructive floor: truncate with a size argument",
335
- });
336
- }
337
- // `find ... -delete` and `find ... -exec/-execdir rm`. Both spellings are
338
- // compared raw OR decoded, the measured bypass class from task fdee7d0f
339
- // (`-"delete"`, `-'delete'`, `-\delete` all reach find as `-delete`).
340
- function scanFind(args, hits) {
341
- for (let i = 0; i < args.length; i += 1) {
342
- const a = args[i];
343
- if (eitherForm(a, (t) => t === "-delete")) {
344
- hits.push({
345
- severity: "critical",
346
- categories: ["destructive", "data_loss"],
347
- reason: "built-in destructive floor: find -delete",
348
- });
349
- continue;
350
- }
351
- if (eitherForm(a, (t) => t === "-exec" || t === "-execdir")) {
352
- const payload = args[i + 1];
353
- if (payload !== undefined && headNameOf(payload) === "rm") {
354
- hits.push({
355
- severity: "critical",
356
- categories: ["destructive", "data_loss"],
357
- reason: "built-in destructive floor: find -exec rm",
358
- });
359
- }
360
- }
361
- }
362
- }
363
- /**
364
- * git's own global options sit BETWEEN the binary and the subcommand
365
- * (`git -C /repo push -f`), so they are skipped before the subcommand is
366
- * read, reusing command-normalize.ts's exported flag sets. `-c` is
367
- * deliberately absent from `GIT_GLOBAL_VALUE_TAKING_FLAGS` (config
368
- * injection can execute code); a command carrying it stops the walk and
369
- * simply yields no subcommand here.
370
- */
371
- function scanGit(args, hits) {
372
- let i = 0;
373
- while (i < args.length) {
374
- const t = decodeShellWord(args[i]);
375
- if (!t.startsWith("-"))
376
- break;
377
- if (GIT_GLOBAL_NO_VALUE_FLAGS.has(t)) {
378
- i += 1;
379
- continue;
380
- }
381
- const eq = t.indexOf("=");
382
- const name = eq === -1 ? t : t.slice(0, eq);
383
- if (GIT_GLOBAL_VALUE_TAKING_FLAGS.has(name)) {
384
- i += eq === -1 ? 2 : 1;
385
- continue;
386
- }
387
- break;
388
- }
389
- const sub = args[i] === undefined ? "" : decodeShellWord(args[i]);
390
- const subArgs = args.slice(i + 1);
391
- const push = (categories, reason) => {
392
- hits.push({ severity: "high", categories, reason: `built-in destructive floor: ${reason}` });
393
- };
394
- if (sub === "reset" && subArgs.some((a) => eitherForm(a, (t) => t === "--hard"))) {
395
- push(["destructive", "data_loss"], "git reset --hard");
396
- return;
397
- }
398
- if (sub === "push") {
399
- const forced = subArgs.some((a) => eitherForm(a, (t) => t === "--force" ||
400
- t === "--force-with-lease" ||
401
- t.startsWith("--force-with-lease=") ||
402
- t.startsWith("+") ||
403
- shortClusterHas(t, "f")));
404
- if (forced)
405
- push(["destructive", "production_mutation", "deployment_change"], "git push --force");
406
- return;
407
- }
408
- if (sub === "clean") {
409
- const forced = subArgs.some((a) => eitherForm(a, (t) => t === "--force" || shortClusterHas(t, "f")));
410
- if (forced)
411
- push(["destructive", "data_loss"], "git clean --force");
412
- return;
413
- }
414
- if (sub === "checkout" || sub === "restore") {
415
- const operands = subArgs.map((a) => decodeShellWord(a)).filter((t) => t !== "--");
416
- if (operands.length === 1 && operands[0] === ".") {
417
- push(["destructive", "data_loss"], `git ${sub} . discards every uncommitted change`);
418
- }
419
- }
420
- }
421
- // `chmod -R` / `chown -R` (and `--recursive`), cluster-aware so `-Rf` and
422
- // `-fR` are both caught. Categories: `mass_update` only, deliberately NOT
423
- // `destructive`/`data_loss`: a recursive mode or owner change rewrites
424
- // metadata across a tree (worth a `high` gate) but is reversible by the
425
- // inverse command, so the profile stays `reversible: true`.
426
- function scanChmodChown(head, args, hits) {
427
- const recursive = args.some((a) => eitherForm(a, (t) => t === "--recursive" || shortClusterHas(t, "R")));
428
- if (!recursive)
429
- return;
430
- hits.push({
431
- severity: "high",
432
- categories: ["mass_update"],
433
- reason: `built-in destructive floor: ${head} -R rewrites a whole tree`,
434
- });
435
- }
436
- // `sed -i` in every spelling: `-i`, `-i.bak`, the cluster `-ni`,
437
- // `--in-place`, `--in-place=SUFFIX`.
438
- function scanSed(args, hits) {
439
- const inPlace = args.some((a) => eitherForm(a, (t) => t === "--in-place" || t.startsWith("--in-place=") || shortClusterHas(t, "i")));
440
- if (!inPlace)
441
- return;
442
- hits.push({
443
- severity: "high",
444
- categories: ["destructive", "data_loss"],
445
- reason: "built-in destructive floor: sed in-place edit",
446
- });
447
- }
448
- /** curl flags that write a LOCAL file. */
449
- const CURL_LOCAL_WRITE_LONG_FLAGS = new Set([
450
- "--output", "--remote-name", "--dump-header", "--cookie-jar", "--config",
451
- "--create-dirs", "--output-dir", "--etag-save", "--trace", "--trace-ascii",
452
- "--stderr", "--remote-header-name",
453
- ]);
454
- const CURL_LOCAL_WRITE_SHORT_CHARS = ["o", "O", "D", "c", "K"];
455
- /** curl flags that send a REQUEST BODY (making the request a write). */
456
- const CURL_BODY_LONG_FLAGS = new Set([
457
- "--data", "--data-raw", "--data-binary", "--data-urlencode", "--data-ascii",
458
- "--json", "--form", "--form-string", "--form-escape", "--upload-file",
459
- ]);
460
- const CURL_BODY_SHORT_CHARS = ["d", "F", "T"];
461
- /**
462
- * `-H`/`--header`: curl reads the VALUE from a local file when it starts
463
- * with `@` (`-H @/etc/passwd` sends that file's lines as request
464
- * headers).
465
- */
466
- const CURL_HEADER_FLAG = { long: "--header", short: "H" };
467
- /**
468
- * `-b`/`--cookie` uses a DIFFERENT rule than `-H`, measured on curl 8.7.1:
469
- * a value containing no `=` is read as a cookie-jar FILENAME, `@`-prefixed
470
- * or not (`curl -b jar.txt` reads the jar; `curl -b @jar.txt` opens a file
471
- * literally named `@jar.txt`, the `@` is not a file marker for this
472
- * flag). A value containing `=` is sent as inline cookie data
473
- * (`-b 'name=value'`) and stays inert.
474
- */
475
- const CURL_COOKIE_FLAG = { long: "--cookie", short: "b" };
476
- /**
477
- * The value curl reads for one flag, whichever of the three ways it is
478
- * spelled: `=`-joined (`--header=@f`), glued into a short-flag cluster
479
- * (`-H@f`, `-sH@f`), or the next argv token (`-H @f`, `--header @f`).
480
- * `undefined` when this token does not carry the flag at all.
481
- *
482
- * Short-flag lookup is a plain cluster search, so a value character that
483
- * happens to sit inside ANOTHER flag's glued value can be misread as this
484
- * flag. That direction only ever adds a candidate value to inspect, which
485
- * for a floor that exclusively RAISES severity is the safe one.
486
- */
487
- function curlFlagValue(token, next, longName, shortChar) {
488
- const nextValue = () => next === undefined ? undefined : decodeShellWord(next);
489
- if (token.startsWith("--")) {
490
- const eq = token.indexOf("=");
491
- if ((eq === -1 ? token : token.slice(0, eq)) !== longName)
492
- return undefined;
493
- return eq === -1 ? nextValue() : token.slice(eq + 1);
494
- }
495
- if (!token.startsWith("-"))
496
- return undefined;
497
- const at = token.indexOf(shortChar, 1);
498
- if (at === -1)
499
- return undefined;
500
- const glued = token.slice(at + 1);
501
- return glued.length > 0 ? glued : nextValue();
502
- }
503
- /** `true` when `t` is `-w`/`--write-out` in any spelling. */
504
- function isCurlWriteOutFlag(t) {
505
- return t === "--write-out" || t.startsWith("--write-out=") || shortClusterHas(t, "w");
506
- }
507
- // What the read-only side no longer tries to decide. Decision D-013 removed
508
- // the `curl` `low` floor entirely: a per-flag allowlist has to know every
509
- // curl flag's write capability across curl versions, and two rounds of it
510
- // leaked. This scan carries the opposite, tractable obligation: it names
511
- // only capability it CAN name, and everything it does not name stays
512
- // unclassified (approval-gated) rather than floored.
513
- function scanCurl(args, hits) {
514
- let localWrite = false;
515
- let body = false;
516
- let atFile = false;
517
- // `-w`/`--write-out`'s format string writes a LOCAL FILE when it carries
518
- // curl 8.3.0's `%output{FILE}` directive (verified on curl 8.7.1), which
519
- // is the hole review round 3 found in the removed read-only floor: it
520
- // allowlisted `-w` as inert. The format string is operator text that this
521
- // module's whitespace tokenizer may have split across several tokens
522
- // (`-w 'code=%{http_code} %output{/etc/x}'`), so `%output` is looked for
523
- // in EVERY token once a write-out flag is present, not only in the one
524
- // token that follows the flag. That over-matches a URL or an unrelated
525
- // argument carrying the literal `%output`, which is the safe direction.
526
- const decoded = args.map((a) => decodeShellWord(a));
527
- if (decoded.some(isCurlWriteOutFlag) && decoded.some((t) => t.includes("%output"))) {
528
- localWrite = true;
529
- }
530
- // `-H @FILE`: a LOCAL file read into the outgoing request. The `@` sits
531
- // at the very start of the value, so the first token of the value is
532
- // always the right place to look and the precise per-flag extraction is
533
- // hole-free here.
534
- //
535
- // `-b`/`--cookie` is checked separately, by its own rule (see
536
- // CURL_COOKIE_FLAG above): a value with no `=` is a filename curl reads,
537
- // regardless of an `@` prefix.
538
- for (let i = 0; i < args.length; i += 1) {
539
- const headerValue = curlFlagValue(decoded[i], args[i + 1], CURL_HEADER_FLAG.long, CURL_HEADER_FLAG.short);
540
- if (headerValue !== undefined && headerValue.startsWith("@"))
541
- atFile = true;
542
- const cookieValue = curlFlagValue(decoded[i], args[i + 1], CURL_COOKIE_FLAG.long, CURL_COOKIE_FLAG.short);
543
- // An empty value (-b '') only switches curl's cookie engine on without
544
- // opening a file; it is raised anyway, an accepted over-block in the safe
545
- // direction.
546
- if (cookieValue !== undefined && !cookieValue.includes("="))
547
- atFile = true;
548
- }
549
- for (let i = 0; i < args.length; i += 1) {
550
- const t = decodeShellWord(args[i]);
551
- if (!t.startsWith("-") || t === "-" || t === "--")
552
- continue;
553
- const eq = t.indexOf("=");
554
- const name = eq === -1 ? t : t.slice(0, eq);
555
- if (name === "--request" || (t.startsWith("-X") && !t.startsWith("--"))) {
556
- let value;
557
- if (name === "--request") {
558
- value = eq === -1 ? (args[i + 1] === undefined ? undefined : decodeShellWord(args[i + 1])) : t.slice(eq + 1);
559
- }
560
- else {
561
- const glued = t.slice(2);
562
- value = glued.length > 0 ? glued : args[i + 1] === undefined ? undefined : decodeShellWord(args[i + 1]);
563
- }
564
- const method = (value ?? "").toUpperCase();
565
- if (method !== "" && method !== "GET" && method !== "HEAD")
566
- body = true;
567
- continue;
568
- }
569
- if (CURL_LOCAL_WRITE_LONG_FLAGS.has(name)) {
570
- localWrite = true;
571
- continue;
572
- }
573
- if (CURL_BODY_LONG_FLAGS.has(name)) {
574
- body = true;
575
- continue;
576
- }
577
- if (t.startsWith("--"))
578
- continue;
579
- if (CURL_LOCAL_WRITE_SHORT_CHARS.some((c) => shortClusterHas(t, c)))
580
- localWrite = true;
581
- if (CURL_BODY_SHORT_CHARS.some((c) => shortClusterHas(t, c)))
582
- body = true;
583
- }
584
- if (localWrite) {
585
- hits.push({
586
- severity: "high",
587
- categories: ["destructive", "data_loss"],
588
- reason: "built-in destructive floor: curl writes a local file",
589
- });
590
- }
591
- if (body) {
592
- hits.push({
593
- severity: "high",
594
- categories: ["production_mutation", "network_exfiltration"],
595
- reason: "built-in destructive floor: curl sends a request body or a non-GET/HEAD method",
596
- });
597
- }
598
- if (atFile) {
599
- // `network_exfiltration` alone, not the request-body pair: reading a
600
- // local file into a header or a cookie ships data OUT, but it does not
601
- // by itself mutate the remote resource, so `production_mutation` would
602
- // be a claim this scan cannot make. Without an irreversible category
603
- // the profile stays `reversible: true`, which is honest for a read.
604
- hits.push({
605
- severity: "high",
606
- categories: ["network_exfiltration"],
607
- reason: "built-in destructive floor: curl reads a local file into the request (@ value on -H, or a no-= value on -b)",
608
- });
609
- }
610
- }
611
- //# sourceMappingURL=destructive-shell-floor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"destructive-shell-floor.js","sourceRoot":"","sources":["../../src/runtime/destructive-shell-floor.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,yEAAyE;AACzE,gEAAgE;AAChE,sEAAsE;AACtE,uEAAuE;AACvE,2EAA2E;AAC3E,yEAAyE;AACzE,qEAAqE;AACrE,yEAAyE;AACzE,oEAAoE;AACpE,qEAAqE;AACrE,+DAA+D;AAC/D,EAAE;AACF,yEAAyE;AACzE,uEAAuE;AACvE,qEAAqE;AACrE,qCAAqC;AACrC,EAAE;AACF,qEAAqE;AACrE,2EAA2E;AAC3E,qEAAqE;AACrE,2EAA2E;AAC3E,sEAAsE;AACtE,2EAA2E;AAC3E,yEAAyE;AACzE,mEAAmE;AACnE,+CAA+C;AAC/C,EAAE;AACF,uEAAuE;AACvE,yEAAyE;AACzE,yEAAyE;AACzE,qEAAqE;AACrE,wEAAwE;AACxE,0EAA0E;AAC1E,qEAAqE;AACrE,0DAA0D;AAC1D,EAAE;AACF,qEAAqE;AACrE,oEAAoE;AACpE,wEAAwE;AACxE,0EAA0E;AAC1E,0EAA0E;AAC1E,0EAA0E;AAC1E,wEAAwE;AACxE,yCAAyC;AACzC,0EAA0E;AAC1E,qEAAqE;AACrE,uEAAuE;AACvE,+BAA+B;AAG/B,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,YAAY,EACZ,mBAAmB,GAEpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAUnE,2EAA2E;AAC3E,2EAA2E;AAC3E,sEAAsE;AACtE,2EAA2E;AAC3E,wEAAwE;AACxE,yEAAyE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