@lannguyensi/harness 0.63.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (702) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/README.md +46 -42
  3. package/dist/cli/add/index.js +17 -21
  4. package/dist/cli/add/index.js.map +1 -1
  5. package/dist/cli/adopt/derive.d.ts +2 -2
  6. package/dist/cli/adopt/derive.js +2 -19
  7. package/dist/cli/adopt/derive.js.map +1 -1
  8. package/dist/cli/adopt/index.d.ts +1 -1
  9. package/dist/cli/adopt/index.js +1 -12
  10. package/dist/cli/adopt/index.js.map +1 -1
  11. package/dist/cli/apply/apply.d.ts +20 -35
  12. package/dist/cli/apply/apply.js +61 -136
  13. package/dist/cli/apply/apply.js.map +1 -1
  14. package/dist/cli/apply/generate-codex-config.js +10 -58
  15. package/dist/cli/apply/generate-codex-config.js.map +1 -1
  16. package/dist/cli/apply/generate-memory-index.js +1 -2
  17. package/dist/cli/apply/generate-memory-index.js.map +1 -1
  18. package/dist/cli/apply/generate-opencode-config.d.ts +2 -10
  19. package/dist/cli/apply/generate-opencode-config.js +74 -113
  20. package/dist/cli/apply/generate-opencode-config.js.map +1 -1
  21. package/dist/cli/apply/generate-settings.d.ts +11 -64
  22. package/dist/cli/apply/generate-settings.js +27 -132
  23. package/dist/cli/apply/generate-settings.js.map +1 -1
  24. package/dist/cli/apply/index.d.ts +1 -1
  25. package/dist/cli/apply/index.js +1 -1
  26. package/dist/cli/apply/index.js.map +1 -1
  27. package/dist/cli/apply/install-codex-config.d.ts +153 -1
  28. package/dist/cli/apply/install-codex-config.js +445 -70
  29. package/dist/cli/apply/install-codex-config.js.map +1 -1
  30. package/dist/cli/apply/next-steps.d.ts +7 -0
  31. package/dist/cli/apply/next-steps.js +13 -1
  32. package/dist/cli/apply/next-steps.js.map +1 -1
  33. package/dist/cli/bounded-stdin.d.ts +0 -23
  34. package/dist/cli/bounded-stdin.js +2 -49
  35. package/dist/cli/bounded-stdin.js.map +1 -1
  36. package/dist/cli/describe.d.ts +1 -1
  37. package/dist/cli/describe.js +0 -3
  38. package/dist/cli/describe.js.map +1 -1
  39. package/dist/cli/diff/engine.d.ts +0 -11
  40. package/dist/cli/diff/engine.js +1 -17
  41. package/dist/cli/diff/engine.js.map +1 -1
  42. package/dist/cli/diff/index.js +14 -25
  43. package/dist/cli/diff/index.js.map +1 -1
  44. package/dist/cli/doctor/claude-mcp.d.ts +4 -19
  45. package/dist/cli/doctor/claude-mcp.js +11 -22
  46. package/dist/cli/doctor/claude-mcp.js.map +1 -1
  47. package/dist/cli/doctor/codex.d.ts +12 -14
  48. package/dist/cli/doctor/codex.js +31 -144
  49. package/dist/cli/doctor/codex.js.map +1 -1
  50. package/dist/cli/doctor/format.js +23 -338
  51. package/dist/cli/doctor/format.js.map +1 -1
  52. package/dist/cli/doctor/hook-liveness.d.ts +56 -0
  53. package/dist/cli/doctor/hook-liveness.js +455 -0
  54. package/dist/cli/doctor/hook-liveness.js.map +1 -0
  55. package/dist/cli/doctor/index.d.ts +13 -87
  56. package/dist/cli/doctor/index.js +57 -705
  57. package/dist/cli/doctor/index.js.map +1 -1
  58. package/dist/cli/doctor/opencode.d.ts +2 -1
  59. package/dist/cli/doctor/opencode.js.map +1 -1
  60. package/dist/cli/doctor/types.d.ts +21 -378
  61. package/dist/cli/doctor/types.js.map +1 -1
  62. package/dist/cli/drain-stdio.d.ts +31 -0
  63. package/dist/cli/drain-stdio.js +76 -0
  64. package/dist/cli/drain-stdio.js.map +1 -0
  65. package/dist/cli/export.d.ts +3 -1
  66. package/dist/cli/export.js +7 -16
  67. package/dist/cli/export.js.map +1 -1
  68. package/dist/cli/gate/codex-disable.d.ts +29 -0
  69. package/dist/cli/gate/codex-disable.js +195 -0
  70. package/dist/cli/gate/codex-disable.js.map +1 -0
  71. package/dist/cli/gate/codex-enable.d.ts +41 -0
  72. package/dist/cli/gate/codex-enable.js +127 -0
  73. package/dist/cli/gate/codex-enable.js.map +1 -0
  74. package/dist/cli/gate/codex-snapshot.d.ts +208 -0
  75. package/dist/cli/gate/codex-snapshot.js +402 -0
  76. package/dist/cli/gate/codex-snapshot.js.map +1 -0
  77. package/dist/cli/gate/disable.d.ts +9 -0
  78. package/dist/cli/gate/disable.js +263 -28
  79. package/dist/cli/gate/disable.js.map +1 -1
  80. package/dist/cli/gate/enable.d.ts +26 -6
  81. package/dist/cli/gate/enable.js +152 -80
  82. package/dist/cli/gate/enable.js.map +1 -1
  83. package/dist/cli/gate/link-chain.d.ts +53 -0
  84. package/dist/cli/gate/link-chain.js +122 -0
  85. package/dist/cli/gate/link-chain.js.map +1 -0
  86. package/dist/cli/gate/snapshot.d.ts +289 -12
  87. package/dist/cli/gate/snapshot.js +481 -22
  88. package/dist/cli/gate/snapshot.js.map +1 -1
  89. package/dist/cli/index.d.ts +0 -9
  90. package/dist/cli/index.js +15 -2607
  91. package/dist/cli/index.js.map +1 -1
  92. package/dist/cli/init/composer.d.ts +3 -6
  93. package/dist/cli/init/composer.js +6 -370
  94. package/dist/cli/init/composer.js.map +1 -1
  95. package/dist/cli/init/dependencies.d.ts +1 -2
  96. package/dist/cli/init/dependencies.js +4 -80
  97. package/dist/cli/init/dependencies.js.map +1 -1
  98. package/dist/cli/init/detect.js +5 -4
  99. package/dist/cli/init/detect.js.map +1 -1
  100. package/dist/cli/init/interactive.d.ts +1 -23
  101. package/dist/cli/init/interactive.js +33 -247
  102. package/dist/cli/init/interactive.js.map +1 -1
  103. package/dist/cli/init/profiles.d.ts +2 -2
  104. package/dist/cli/init/profiles.js +51 -243
  105. package/dist/cli/init/profiles.js.map +1 -1
  106. package/dist/cli/init/templates.d.ts +2 -37
  107. package/dist/cli/init/templates.js +25 -1237
  108. package/dist/cli/init/templates.js.map +1 -1
  109. package/dist/cli/list.d.ts +1 -1
  110. package/dist/cli/list.js +1 -38
  111. package/dist/cli/list.js.map +1 -1
  112. package/dist/cli/loader.d.ts +15 -1
  113. package/dist/cli/loader.js +56 -39
  114. package/dist/cli/loader.js.map +1 -1
  115. package/dist/cli/main.js +7 -2
  116. package/dist/cli/main.js.map +1 -1
  117. package/dist/cli/migrate-home/index.js +2 -2
  118. package/dist/cli/migrate-home/index.js.map +1 -1
  119. package/dist/cli/pack/add.js +1 -1
  120. package/dist/cli/pack/add.js.map +1 -1
  121. package/dist/cli/pack/hook-bootstrap.d.ts +5 -164
  122. package/dist/cli/pack/hook-bootstrap.js +15 -291
  123. package/dist/cli/pack/hook-bootstrap.js.map +1 -1
  124. package/dist/cli/pack/hook-branch-protection.d.ts +28 -21
  125. package/dist/cli/pack/hook-branch-protection.js +365 -340
  126. package/dist/cli/pack/hook-branch-protection.js.map +1 -1
  127. package/dist/cli/pack/index.d.ts +0 -1
  128. package/dist/cli/pack/index.js +0 -1
  129. package/dist/cli/pack/index.js.map +1 -1
  130. package/dist/cli/pack/list.js +1 -6
  131. package/dist/cli/pack/list.js.map +1 -1
  132. package/dist/cli/pack/mutate.d.ts +7 -9
  133. package/dist/cli/pack/mutate.js +6 -9
  134. package/dist/cli/pack/mutate.js.map +1 -1
  135. package/dist/cli/pack/reseed.d.ts +2 -2
  136. package/dist/cli/pack/reseed.js +16 -22
  137. package/dist/cli/pack/reseed.js.map +1 -1
  138. package/dist/cli/register-gate-group.d.ts +5 -0
  139. package/dist/cli/register-gate-group.js +348 -0
  140. package/dist/cli/register-gate-group.js.map +1 -0
  141. package/dist/cli/register-inspect-group.d.ts +6 -0
  142. package/dist/cli/register-inspect-group.js +189 -0
  143. package/dist/cli/register-inspect-group.js.map +1 -0
  144. package/dist/cli/register-operator-lifecycle.d.ts +5 -0
  145. package/dist/cli/register-operator-lifecycle.js +20 -0
  146. package/dist/cli/register-operator-lifecycle.js.map +1 -0
  147. package/dist/cli/register-pack-group.d.ts +5 -0
  148. package/dist/cli/register-pack-group.js +134 -0
  149. package/dist/cli/register-pack-group.js.map +1 -0
  150. package/dist/cli/register-setup-group.d.ts +5 -0
  151. package/dist/cli/register-setup-group.js +495 -0
  152. package/dist/cli/register-setup-group.js.map +1 -0
  153. package/dist/cli/remove/index.d.ts +0 -14
  154. package/dist/cli/remove/index.js +2 -115
  155. package/dist/cli/remove/index.js.map +1 -1
  156. package/dist/cli/remove/mutate.d.ts +0 -2
  157. package/dist/cli/remove/mutate.js +1 -19
  158. package/dist/cli/remove/mutate.js.map +1 -1
  159. package/dist/cli/remove/register.d.ts +5 -0
  160. package/dist/cli/remove/register.js +25 -0
  161. package/dist/cli/remove/register.js.map +1 -0
  162. package/dist/cli/shell-quote.d.ts +7 -0
  163. package/dist/cli/shell-quote.js +17 -0
  164. package/dist/cli/shell-quote.js.map +1 -0
  165. package/dist/cli/uninstall/index.d.ts +4 -2
  166. package/dist/cli/uninstall/index.js +15 -7
  167. package/dist/cli/uninstall/index.js.map +1 -1
  168. package/dist/cli/uninstall/register.d.ts +5 -0
  169. package/dist/cli/uninstall/register.js +171 -0
  170. package/dist/cli/uninstall/register.js.map +1 -0
  171. package/dist/cli/uninstall/snapshot.d.ts +15 -0
  172. package/dist/cli/uninstall/snapshot.js +38 -0
  173. package/dist/cli/uninstall/snapshot.js.map +1 -1
  174. package/dist/cli/validate/checks.d.ts +0 -77
  175. package/dist/cli/validate/checks.js +3 -1049
  176. package/dist/cli/validate/checks.js.map +1 -1
  177. package/dist/cli/validate/index.js +19 -15
  178. package/dist/cli/validate/index.js.map +1 -1
  179. package/dist/index.d.ts +0 -3
  180. package/dist/index.js +0 -3
  181. package/dist/index.js.map +1 -1
  182. package/dist/io/claude-mcp.d.ts +1 -1
  183. package/dist/io/claude-mcp.js +27 -14
  184. package/dist/io/claude-mcp.js.map +1 -1
  185. package/dist/io/harness-lock.js +2 -2
  186. package/dist/io/harness-lock.js.map +1 -1
  187. package/dist/io/lock.d.ts +0 -26
  188. package/dist/io/lock.js +10 -27
  189. package/dist/io/lock.js.map +1 -1
  190. package/dist/io/merge-settings.js +6 -4
  191. package/dist/io/merge-settings.js.map +1 -1
  192. package/dist/io/project-name.d.ts +22 -39
  193. package/dist/io/project-name.js +25 -42
  194. package/dist/io/project-name.js.map +1 -1
  195. package/dist/io/read-regular-file.d.ts +103 -40
  196. package/dist/io/read-regular-file.js +196 -35
  197. package/dist/io/read-regular-file.js.map +1 -1
  198. package/dist/io/restart-hints.js +3 -6
  199. package/dist/io/restart-hints.js.map +1 -1
  200. package/dist/io/version-compare.d.ts +1 -3
  201. package/dist/io/version-compare.js +1 -3
  202. package/dist/io/version-compare.js.map +1 -1
  203. package/dist/io/write-regular-file.d.ts +30 -0
  204. package/dist/io/write-regular-file.js +85 -0
  205. package/dist/io/write-regular-file.js.map +1 -0
  206. package/dist/overrides/index.d.ts +1 -0
  207. package/dist/overrides/index.js +1 -0
  208. package/dist/overrides/index.js.map +1 -1
  209. package/dist/overrides/merge-layers.d.ts +43 -0
  210. package/dist/overrides/merge-layers.js +76 -0
  211. package/dist/overrides/merge-layers.js.map +1 -0
  212. package/dist/overrides/merge.d.ts +16 -0
  213. package/dist/overrides/merge.js +21 -8
  214. package/dist/overrides/merge.js.map +1 -1
  215. package/dist/policy-packs/builtin/branch-protection-runtime.d.ts +4 -69
  216. package/dist/policy-packs/builtin/branch-protection-runtime.js +12 -84
  217. package/dist/policy-packs/builtin/branch-protection-runtime.js.map +1 -1
  218. package/dist/policy-packs/builtin/branch-protection.d.ts +7 -30
  219. package/dist/policy-packs/builtin/branch-protection.js +56 -89
  220. package/dist/policy-packs/builtin/branch-protection.js.map +1 -1
  221. package/dist/policy-packs/config-check.d.ts +7 -5
  222. package/dist/policy-packs/config-check.js +2 -2
  223. package/dist/policy-packs/config-check.js.map +1 -1
  224. package/dist/policy-packs/expand.d.ts +1 -3
  225. package/dist/policy-packs/expand.js +5 -42
  226. package/dist/policy-packs/expand.js.map +1 -1
  227. package/dist/policy-packs/index.d.ts +3 -3
  228. package/dist/policy-packs/index.js +2 -2
  229. package/dist/policy-packs/index.js.map +1 -1
  230. package/dist/policy-packs/registry.d.ts +9 -38
  231. package/dist/policy-packs/registry.js +5 -65
  232. package/dist/policy-packs/registry.js.map +1 -1
  233. package/dist/policy-packs/runtime.d.ts +0 -4
  234. package/dist/policy-packs/runtime.js +9 -22
  235. package/dist/policy-packs/runtime.js.map +1 -1
  236. package/dist/policy-packs/types.d.ts +0 -19
  237. package/dist/policy-packs/ux-compare.d.ts +1 -11
  238. package/dist/policy-packs/ux-compare.js +6 -42
  239. package/dist/policy-packs/ux-compare.js.map +1 -1
  240. package/dist/policy-packs/ux-drift-check.d.ts +5 -5
  241. package/dist/policy-packs/ux-drift-check.js +17 -22
  242. package/dist/policy-packs/ux-drift-check.js.map +1 -1
  243. package/dist/policy-packs/version-check.d.ts +5 -26
  244. package/dist/policy-packs/version-check.js +19 -74
  245. package/dist/policy-packs/version-check.js.map +1 -1
  246. package/dist/probes/memory.d.ts +1 -1
  247. package/dist/probes/memory.js +1 -1
  248. package/dist/probes/memory.js.map +1 -1
  249. package/dist/runtime/agent-facing.d.ts +9 -0
  250. package/dist/runtime/agent-facing.js +28 -14
  251. package/dist/runtime/agent-facing.js.map +1 -1
  252. package/dist/runtime/bounded-text.d.ts +15 -0
  253. package/dist/runtime/bounded-text.js +27 -0
  254. package/dist/runtime/bounded-text.js.map +1 -0
  255. package/dist/runtime/git-branch.d.ts +125 -0
  256. package/dist/runtime/git-branch.js +381 -0
  257. package/dist/runtime/git-branch.js.map +1 -0
  258. package/dist/runtime/hermetic-spawn-guard.d.ts +2 -2
  259. package/dist/runtime/hermetic-spawn-guard.js +24 -34
  260. package/dist/runtime/hermetic-spawn-guard.js.map +1 -1
  261. package/dist/runtime/home-dir.js +3 -2
  262. package/dist/runtime/home-dir.js.map +1 -1
  263. package/dist/runtime/tool-name-aliases.d.ts +0 -6
  264. package/dist/runtime/tool-name-aliases.js +5 -18
  265. package/dist/runtime/tool-name-aliases.js.map +1 -1
  266. package/dist/schema/grounding.d.ts +7 -54
  267. package/dist/schema/grounding.js +10 -12
  268. package/dist/schema/grounding.js.map +1 -1
  269. package/dist/schema/hooks.d.ts +39 -136
  270. package/dist/schema/hooks.js +3 -6
  271. package/dist/schema/hooks.js.map +1 -1
  272. package/dist/schema/index.d.ts +114 -3828
  273. package/dist/schema/index.js +41 -80
  274. package/dist/schema/index.js.map +1 -1
  275. package/dist/schema/memory.d.ts +54 -131
  276. package/dist/schema/memory.js +2 -2
  277. package/dist/schema/memory.js.map +1 -1
  278. package/dist/schema/policy-packs.d.ts +3 -45
  279. package/dist/schema/policy-packs.js +7 -13
  280. package/dist/schema/policy-packs.js.map +1 -1
  281. package/dist/schema/policy-ux.d.ts +7 -0
  282. package/dist/schema/policy-ux.js +18 -0
  283. package/dist/schema/policy-ux.js.map +1 -0
  284. package/dist/schema/removed-keys.d.ts +185 -0
  285. package/dist/schema/removed-keys.js +531 -0
  286. package/dist/schema/removed-keys.js.map +1 -0
  287. package/dist/schema/tools.d.ts +30 -268
  288. package/dist/schema/tools.js +4 -4
  289. package/dist/schema/tools.js.map +1 -1
  290. package/package.json +5 -16
  291. package/dist/cli/approve/branch-protection.d.ts +0 -69
  292. package/dist/cli/approve/branch-protection.js +0 -144
  293. package/dist/cli/approve/branch-protection.js.map +0 -1
  294. package/dist/cli/approve/risk.d.ts +0 -112
  295. package/dist/cli/approve/risk.js +0 -197
  296. package/dist/cli/approve/risk.js.map +0 -1
  297. package/dist/cli/approve/stdin-report.d.ts +0 -57
  298. package/dist/cli/approve/stdin-report.js +0 -145
  299. package/dist/cli/approve/stdin-report.js.map +0 -1
  300. package/dist/cli/approve/understanding.d.ts +0 -410
  301. package/dist/cli/approve/understanding.js +0 -996
  302. package/dist/cli/approve/understanding.js.map +0 -1
  303. package/dist/cli/audit.d.ts +0 -80
  304. package/dist/cli/audit.js +0 -252
  305. package/dist/cli/audit.js.map +0 -1
  306. package/dist/cli/delegate/index.d.ts +0 -76
  307. package/dist/cli/delegate/index.js +0 -443
  308. package/dist/cli/delegate/index.js.map +0 -1
  309. package/dist/cli/doctor/auto-approve-mode.d.ts +0 -37
  310. package/dist/cli/doctor/auto-approve-mode.js +0 -80
  311. package/dist/cli/doctor/auto-approve-mode.js.map +0 -1
  312. package/dist/cli/doctor/bypass-without-auto-approve.d.ts +0 -38
  313. package/dist/cli/doctor/bypass-without-auto-approve.js +0 -95
  314. package/dist/cli/doctor/bypass-without-auto-approve.js.map +0 -1
  315. package/dist/cli/doctor/codex-config-drift.d.ts +0 -28
  316. package/dist/cli/doctor/codex-config-drift.js +0 -240
  317. package/dist/cli/doctor/codex-config-drift.js.map +0 -1
  318. package/dist/cli/doctor/rogue-ledger.d.ts +0 -53
  319. package/dist/cli/doctor/rogue-ledger.js +0 -153
  320. package/dist/cli/doctor/rogue-ledger.js.map +0 -1
  321. package/dist/cli/doctor/session-start-preflight-setup-version.d.ts +0 -83
  322. package/dist/cli/doctor/session-start-preflight-setup-version.js +0 -114
  323. package/dist/cli/doctor/session-start-preflight-setup-version.js.map +0 -1
  324. package/dist/cli/doctor/settings-drift.d.ts +0 -25
  325. package/dist/cli/doctor/settings-drift.js +0 -213
  326. package/dist/cli/doctor/settings-drift.js.map +0 -1
  327. package/dist/cli/doctor/toolchain-parity.d.ts +0 -63
  328. package/dist/cli/doctor/toolchain-parity.js +0 -154
  329. package/dist/cli/doctor/toolchain-parity.js.map +0 -1
  330. package/dist/cli/doctor/ug-auto-approvals.d.ts +0 -40
  331. package/dist/cli/doctor/ug-auto-approvals.js +0 -91
  332. package/dist/cli/doctor/ug-auto-approvals.js.map +0 -1
  333. package/dist/cli/doctor/ug-delegations.d.ts +0 -26
  334. package/dist/cli/doctor/ug-delegations.js +0 -121
  335. package/dist/cli/doctor/ug-delegations.js.map +0 -1
  336. package/dist/cli/doctor/ug-inflight.d.ts +0 -35
  337. package/dist/cli/doctor/ug-inflight.js +0 -57
  338. package/dist/cli/doctor/ug-inflight.js.map +0 -1
  339. package/dist/cli/doctor/understanding-mode-env.d.ts +0 -51
  340. package/dist/cli/doctor/understanding-mode-env.js +0 -98
  341. package/dist/cli/doctor/understanding-mode-env.js.map +0 -1
  342. package/dist/cli/dry-run.d.ts +0 -46
  343. package/dist/cli/dry-run.js +0 -250
  344. package/dist/cli/dry-run.js.map +0 -1
  345. package/dist/cli/event-input.d.ts +0 -28
  346. package/dist/cli/event-input.js +0 -73
  347. package/dist/cli/event-input.js.map +0 -1
  348. package/dist/cli/explain-action.d.ts +0 -20
  349. package/dist/cli/explain-action.js +0 -27
  350. package/dist/cli/explain-action.js.map +0 -1
  351. package/dist/cli/explain-policy.d.ts +0 -135
  352. package/dist/cli/explain-policy.js +0 -266
  353. package/dist/cli/explain-policy.js.map +0 -1
  354. package/dist/cli/explain.d.ts +0 -31
  355. package/dist/cli/explain.js +0 -159
  356. package/dist/cli/explain.js.map +0 -1
  357. package/dist/cli/gc/index.d.ts +0 -63
  358. package/dist/cli/gc/index.js +0 -566
  359. package/dist/cli/gc/index.js.map +0 -1
  360. package/dist/cli/pack/approve-escape.d.ts +0 -19
  361. package/dist/cli/pack/approve-escape.js +0 -190
  362. package/dist/cli/pack/approve-escape.js.map +0 -1
  363. package/dist/cli/pack/auto-approve-path.d.ts +0 -146
  364. package/dist/cli/pack/auto-approve-path.js +0 -462
  365. package/dist/cli/pack/auto-approve-path.js.map +0 -1
  366. package/dist/cli/pack/hook-codex-post-tool-use.d.ts +0 -25
  367. package/dist/cli/pack/hook-codex-post-tool-use.js +0 -160
  368. package/dist/cli/pack/hook-codex-post-tool-use.js.map +0 -1
  369. package/dist/cli/pack/hook-codex-pre-tool-use.d.ts +0 -48
  370. package/dist/cli/pack/hook-codex-pre-tool-use.js +0 -474
  371. package/dist/cli/pack/hook-codex-pre-tool-use.js.map +0 -1
  372. package/dist/cli/pack/hook-codex-stop.d.ts +0 -35
  373. package/dist/cli/pack/hook-codex-stop.js +0 -329
  374. package/dist/cli/pack/hook-codex-stop.js.map +0 -1
  375. package/dist/cli/pack/hook-codex-user-prompt-submit.d.ts +0 -24
  376. package/dist/cli/pack/hook-codex-user-prompt-submit.js +0 -93
  377. package/dist/cli/pack/hook-codex-user-prompt-submit.js.map +0 -1
  378. package/dist/cli/pack/hook-post-merge-gate-record.d.ts +0 -37
  379. package/dist/cli/pack/hook-post-merge-gate-record.js +0 -190
  380. package/dist/cli/pack/hook-post-merge-gate-record.js.map +0 -1
  381. package/dist/cli/pack/hook-post-merge-gate.d.ts +0 -34
  382. package/dist/cli/pack/hook-post-merge-gate.js +0 -277
  383. package/dist/cli/pack/hook-post-merge-gate.js.map +0 -1
  384. package/dist/cli/pack/hook-post-tool-use.d.ts +0 -45
  385. package/dist/cli/pack/hook-post-tool-use.js +0 -137
  386. package/dist/cli/pack/hook-post-tool-use.js.map +0 -1
  387. package/dist/cli/pack/hook-pre-tool-use.d.ts +0 -92
  388. package/dist/cli/pack/hook-pre-tool-use.js +0 -1328
  389. package/dist/cli/pack/hook-pre-tool-use.js.map +0 -1
  390. package/dist/cli/pack/hook-runtime-reality.d.ts +0 -63
  391. package/dist/cli/pack/hook-runtime-reality.js +0 -210
  392. package/dist/cli/pack/hook-runtime-reality.js.map +0 -1
  393. package/dist/cli/pack/hook-solution-acceptance-writeguard.d.ts +0 -32
  394. package/dist/cli/pack/hook-solution-acceptance-writeguard.js +0 -337
  395. package/dist/cli/pack/hook-solution-acceptance-writeguard.js.map +0 -1
  396. package/dist/cli/pack/hook-solution-acceptance.d.ts +0 -157
  397. package/dist/cli/pack/hook-solution-acceptance.js +0 -530
  398. package/dist/cli/pack/hook-solution-acceptance.js.map +0 -1
  399. package/dist/cli/pack/hook-stay-in-scope.d.ts +0 -37
  400. package/dist/cli/pack/hook-stay-in-scope.js +0 -128
  401. package/dist/cli/pack/hook-stay-in-scope.js.map +0 -1
  402. package/dist/cli/pack/hook-subagent-start.d.ts +0 -23
  403. package/dist/cli/pack/hook-subagent-start.js +0 -88
  404. package/dist/cli/pack/hook-subagent-start.js.map +0 -1
  405. package/dist/cli/pack/hook-subagent-stop.d.ts +0 -19
  406. package/dist/cli/pack/hook-subagent-stop.js +0 -41
  407. package/dist/cli/pack/hook-subagent-stop.js.map +0 -1
  408. package/dist/cli/pack/hook-track-active-claim.d.ts +0 -27
  409. package/dist/cli/pack/hook-track-active-claim.js +0 -275
  410. package/dist/cli/pack/hook-track-active-claim.js.map +0 -1
  411. package/dist/cli/pack/transcript-report-scan.d.ts +0 -71
  412. package/dist/cli/pack/transcript-report-scan.js +0 -359
  413. package/dist/cli/pack/transcript-report-scan.js.map +0 -1
  414. package/dist/cli/pack/understanding-report-schema-hint.d.ts +0 -26
  415. package/dist/cli/pack/understanding-report-schema-hint.js +0 -120
  416. package/dist/cli/pack/understanding-report-schema-hint.js.map +0 -1
  417. package/dist/cli/pack/upgrade.d.ts +0 -32
  418. package/dist/cli/pack/upgrade.js +0 -273
  419. package/dist/cli/pack/upgrade.js.map +0 -1
  420. package/dist/cli/pause/index.d.ts +0 -113
  421. package/dist/cli/pause/index.js +0 -251
  422. package/dist/cli/pause/index.js.map +0 -1
  423. package/dist/cli/pause-check.d.ts +0 -22
  424. package/dist/cli/pause-check.js +0 -54
  425. package/dist/cli/pause-check.js.map +0 -1
  426. package/dist/cli/policy/intercept.d.ts +0 -233
  427. package/dist/cli/policy/intercept.js +0 -1020
  428. package/dist/cli/policy/intercept.js.map +0 -1
  429. package/dist/cli/policy/risk-envelope-enrichment.d.ts +0 -40
  430. package/dist/cli/policy/risk-envelope-enrichment.js +0 -108
  431. package/dist/cli/policy/risk-envelope-enrichment.js.map +0 -1
  432. package/dist/cli/record/index.d.ts +0 -81
  433. package/dist/cli/record/index.js +0 -348
  434. package/dist/cli/record/index.js.map +0 -1
  435. package/dist/cli/resolve-env.d.ts +0 -32
  436. package/dist/cli/resolve-env.js +0 -47
  437. package/dist/cli/resolve-env.js.map +0 -1
  438. package/dist/cli/session-export/index.d.ts +0 -46
  439. package/dist/cli/session-export/index.js +0 -169
  440. package/dist/cli/session-export/index.js.map +0 -1
  441. package/dist/cli/session-export/redact.d.ts +0 -22
  442. package/dist/cli/session-export/redact.js +0 -47
  443. package/dist/cli/session-export/redact.js.map +0 -1
  444. package/dist/cli/session-export/transcript.d.ts +0 -24
  445. package/dist/cli/session-export/transcript.js +0 -164
  446. package/dist/cli/session-export/transcript.js.map +0 -1
  447. package/dist/cli/session-start/branch-check.d.ts +0 -18
  448. package/dist/cli/session-start/branch-check.js +0 -140
  449. package/dist/cli/session-start/branch-check.js.map +0 -1
  450. package/dist/cli/session-start/index.d.ts +0 -121
  451. package/dist/cli/session-start/index.js +0 -591
  452. package/dist/cli/session-start/index.js.map +0 -1
  453. package/dist/cli/session-start/shared-options.d.ts +0 -103
  454. package/dist/cli/session-start/shared-options.js +0 -107
  455. package/dist/cli/session-start/shared-options.js.map +0 -1
  456. package/dist/cli/session-start/stale-base-check.d.ts +0 -46
  457. package/dist/cli/session-start/stale-base-check.js +0 -352
  458. package/dist/cli/session-start/stale-base-check.js.map +0 -1
  459. package/dist/cli/session-start/toolchain-parity.d.ts +0 -267
  460. package/dist/cli/session-start/toolchain-parity.js +0 -797
  461. package/dist/cli/session-start/toolchain-parity.js.map +0 -1
  462. package/dist/cli/smoke/assertions.d.ts +0 -46
  463. package/dist/cli/smoke/assertions.js +0 -170
  464. package/dist/cli/smoke/assertions.js.map +0 -1
  465. package/dist/cli/smoke/index.d.ts +0 -76
  466. package/dist/cli/smoke/index.js +0 -245
  467. package/dist/cli/smoke/index.js.map +0 -1
  468. package/dist/cli/smoke/runner.d.ts +0 -55
  469. package/dist/cli/smoke/runner.js +0 -134
  470. package/dist/cli/smoke/runner.js.map +0 -1
  471. package/dist/cli/smoke/stream-parser.d.ts +0 -65
  472. package/dist/cli/smoke/stream-parser.js +0 -115
  473. package/dist/cli/smoke/stream-parser.js.map +0 -1
  474. package/dist/cli/test-risk.d.ts +0 -26
  475. package/dist/cli/test-risk.js +0 -34
  476. package/dist/cli/test-risk.js.map +0 -1
  477. package/dist/io/display-path.d.ts +0 -11
  478. package/dist/io/display-path.js +0 -29
  479. package/dist/io/display-path.js.map +0 -1
  480. package/dist/io/duration.d.ts +0 -5
  481. package/dist/io/duration.js +0 -50
  482. package/dist/io/duration.js.map +0 -1
  483. package/dist/io/extract.d.ts +0 -79
  484. package/dist/io/extract.js +0 -226
  485. package/dist/io/extract.js.map +0 -1
  486. package/dist/io/ledger-record.d.ts +0 -83
  487. package/dist/io/ledger-record.js +0 -301
  488. package/dist/io/ledger-record.js.map +0 -1
  489. package/dist/io/read-json-dir-entries.d.ts +0 -36
  490. package/dist/io/read-json-dir-entries.js +0 -48
  491. package/dist/io/read-json-dir-entries.js.map +0 -1
  492. package/dist/io/safe-json-parse.d.ts +0 -5
  493. package/dist/io/safe-json-parse.js +0 -21
  494. package/dist/io/safe-json-parse.js.map +0 -1
  495. package/dist/policies/index.d.ts +0 -5
  496. package/dist/policies/index.js +0 -6
  497. package/dist/policies/index.js.map +0 -1
  498. package/dist/policies/ledger-client.d.ts +0 -113
  499. package/dist/policies/ledger-client.js +0 -500
  500. package/dist/policies/ledger-client.js.map +0 -1
  501. package/dist/policies/producers.d.ts +0 -12
  502. package/dist/policies/producers.js +0 -61
  503. package/dist/policies/producers.js.map +0 -1
  504. package/dist/policies/requires.d.ts +0 -75
  505. package/dist/policies/requires.js +0 -240
  506. package/dist/policies/requires.js.map +0 -1
  507. package/dist/policies/timestamp.d.ts +0 -14
  508. package/dist/policies/timestamp.js +0 -36
  509. package/dist/policies/timestamp.js.map +0 -1
  510. package/dist/policy-packs/builtin/permission-profiles.d.ts +0 -11
  511. package/dist/policy-packs/builtin/permission-profiles.js +0 -74
  512. package/dist/policy-packs/builtin/permission-profiles.js.map +0 -1
  513. package/dist/policy-packs/builtin/post-merge-gate-runtime.d.ts +0 -286
  514. package/dist/policy-packs/builtin/post-merge-gate-runtime.js +0 -397
  515. package/dist/policy-packs/builtin/post-merge-gate-runtime.js.map +0 -1
  516. package/dist/policy-packs/builtin/post-merge-gate.d.ts +0 -56
  517. package/dist/policy-packs/builtin/post-merge-gate.js +0 -347
  518. package/dist/policy-packs/builtin/post-merge-gate.js.map +0 -1
  519. package/dist/policy-packs/builtin/solution-acceptance-reconnect.d.ts +0 -50
  520. package/dist/policy-packs/builtin/solution-acceptance-reconnect.js +0 -151
  521. package/dist/policy-packs/builtin/solution-acceptance-reconnect.js.map +0 -1
  522. package/dist/policy-packs/builtin/solution-acceptance-runtime.d.ts +0 -323
  523. package/dist/policy-packs/builtin/solution-acceptance-runtime.js +0 -672
  524. package/dist/policy-packs/builtin/solution-acceptance-runtime.js.map +0 -1
  525. package/dist/policy-packs/builtin/solution-acceptance.d.ts +0 -45
  526. package/dist/policy-packs/builtin/solution-acceptance.js +0 -226
  527. package/dist/policy-packs/builtin/solution-acceptance.js.map +0 -1
  528. package/dist/policy-packs/builtin/understanding-before-execution/active-claim.d.ts +0 -25
  529. package/dist/policy-packs/builtin/understanding-before-execution/active-claim.js +0 -94
  530. package/dist/policy-packs/builtin/understanding-before-execution/active-claim.js.map +0 -1
  531. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.d.ts +0 -35
  532. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.js +0 -86
  533. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.js.map +0 -1
  534. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.d.ts +0 -210
  535. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.js +0 -361
  536. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.js.map +0 -1
  537. package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.d.ts +0 -304
  538. package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.js +0 -734
  539. package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.js.map +0 -1
  540. package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.d.ts +0 -36
  541. package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.js +0 -73
  542. package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.js.map +0 -1
  543. package/dist/policy-packs/builtin/understanding-before-execution/index.d.ts +0 -19
  544. package/dist/policy-packs/builtin/understanding-before-execution/index.js +0 -83
  545. package/dist/policy-packs/builtin/understanding-before-execution/index.js.map +0 -1
  546. package/dist/policy-packs/builtin/understanding-before-execution/inflight-records.d.ts +0 -135
  547. package/dist/policy-packs/builtin/understanding-before-execution/inflight-records.js +0 -618
  548. package/dist/policy-packs/builtin/understanding-before-execution/inflight-records.js.map +0 -1
  549. package/dist/policy-packs/builtin/understanding-before-execution/ledger.d.ts +0 -25
  550. package/dist/policy-packs/builtin/understanding-before-execution/ledger.js +0 -56
  551. package/dist/policy-packs/builtin/understanding-before-execution/ledger.js.map +0 -1
  552. package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.d.ts +0 -20
  553. package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.js +0 -93
  554. package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.js.map +0 -1
  555. package/dist/policy-packs/builtin/understanding-before-execution/markers.d.ts +0 -126
  556. package/dist/policy-packs/builtin/understanding-before-execution/markers.js +0 -245
  557. package/dist/policy-packs/builtin/understanding-before-execution/markers.js.map +0 -1
  558. package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.d.ts +0 -29
  559. package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.js +0 -82
  560. package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.js.map +0 -1
  561. package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.d.ts +0 -71
  562. package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.js +0 -175
  563. package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.js.map +0 -1
  564. package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.d.ts +0 -620
  565. package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.js +0 -1047
  566. package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.js.map +0 -1
  567. package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.d.ts +0 -128
  568. package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.js +0 -213
  569. package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.js.map +0 -1
  570. package/dist/policy-packs/builtin/understanding-before-execution/stay-in-scope-config.d.ts +0 -129
  571. package/dist/policy-packs/builtin/understanding-before-execution/stay-in-scope-config.js +0 -166
  572. package/dist/policy-packs/builtin/understanding-before-execution/stay-in-scope-config.js.map +0 -1
  573. package/dist/policy-packs/builtin/understanding-before-execution/task-markers.d.ts +0 -164
  574. package/dist/policy-packs/builtin/understanding-before-execution/task-markers.js +0 -275
  575. package/dist/policy-packs/builtin/understanding-before-execution/task-markers.js.map +0 -1
  576. package/dist/policy-packs/builtin/understanding-before-execution-runtime.d.ts +0 -1
  577. package/dist/policy-packs/builtin/understanding-before-execution-runtime.js +0 -10
  578. package/dist/policy-packs/builtin/understanding-before-execution-runtime.js.map +0 -1
  579. package/dist/policy-packs/builtin/understanding-before-execution.d.ts +0 -526
  580. package/dist/policy-packs/builtin/understanding-before-execution.js +0 -1074
  581. package/dist/policy-packs/builtin/understanding-before-execution.js.map +0 -1
  582. package/dist/policy-packs/permission-translator.d.ts +0 -9
  583. package/dist/policy-packs/permission-translator.js +0 -76
  584. package/dist/policy-packs/permission-translator.js.map +0 -1
  585. package/dist/runtime/action-envelope.d.ts +0 -64
  586. package/dist/runtime/action-envelope.js +0 -46
  587. package/dist/runtime/action-envelope.js.map +0 -1
  588. package/dist/runtime/approval-signing.d.ts +0 -111
  589. package/dist/runtime/approval-signing.js +0 -384
  590. package/dist/runtime/approval-signing.js.map +0 -1
  591. package/dist/runtime/bash-match-facts.d.ts +0 -60
  592. package/dist/runtime/bash-match-facts.js +0 -196
  593. package/dist/runtime/bash-match-facts.js.map +0 -1
  594. package/dist/runtime/bash-match-registry.d.ts +0 -112
  595. package/dist/runtime/bash-match-registry.js +0 -406
  596. package/dist/runtime/bash-match-registry.js.map +0 -1
  597. package/dist/runtime/bash-prefix-parse.d.ts +0 -31
  598. package/dist/runtime/bash-prefix-parse.js +0 -576
  599. package/dist/runtime/bash-prefix-parse.js.map +0 -1
  600. package/dist/runtime/command-normalize.d.ts +0 -658
  601. package/dist/runtime/command-normalize.js +0 -2410
  602. package/dist/runtime/command-normalize.js.map +0 -1
  603. package/dist/runtime/deletion-target-resolve.d.ts +0 -28
  604. package/dist/runtime/deletion-target-resolve.js +0 -1078
  605. package/dist/runtime/deletion-target-resolve.js.map +0 -1
  606. package/dist/runtime/destructive-shell-floor.d.ts +0 -19
  607. package/dist/runtime/destructive-shell-floor.js +0 -611
  608. package/dist/runtime/destructive-shell-floor.js.map +0 -1
  609. package/dist/runtime/environment-resolver.d.ts +0 -36
  610. package/dist/runtime/environment-resolver.js +0 -138
  611. package/dist/runtime/environment-resolver.js.map +0 -1
  612. package/dist/runtime/git-context.d.ts +0 -201
  613. package/dist/runtime/git-context.js +0 -422
  614. package/dist/runtime/git-context.js.map +0 -1
  615. package/dist/runtime/index.d.ts +0 -12
  616. package/dist/runtime/index.js +0 -13
  617. package/dist/runtime/index.js.map +0 -1
  618. package/dist/runtime/intercept.d.ts +0 -494
  619. package/dist/runtime/intercept.js +0 -1313
  620. package/dist/runtime/intercept.js.map +0 -1
  621. package/dist/runtime/kube-context.d.ts +0 -16
  622. package/dist/runtime/kube-context.js +0 -63
  623. package/dist/runtime/kube-context.js.map +0 -1
  624. package/dist/runtime/kubectl-target-parse.d.ts +0 -31
  625. package/dist/runtime/kubectl-target-parse.js +0 -249
  626. package/dist/runtime/kubectl-target-parse.js.map +0 -1
  627. package/dist/runtime/ledger-add.d.ts +0 -16
  628. package/dist/runtime/ledger-add.js +0 -150
  629. package/dist/runtime/ledger-add.js.map +0 -1
  630. package/dist/runtime/ledger-writer.d.ts +0 -27
  631. package/dist/runtime/ledger-writer.js +0 -46
  632. package/dist/runtime/ledger-writer.js.map +0 -1
  633. package/dist/runtime/pause-sentinel.d.ts +0 -60
  634. package/dist/runtime/pause-sentinel.js +0 -156
  635. package/dist/runtime/pause-sentinel.js.map +0 -1
  636. package/dist/runtime/pending-approval.d.ts +0 -23
  637. package/dist/runtime/pending-approval.js +0 -67
  638. package/dist/runtime/pending-approval.js.map +0 -1
  639. package/dist/runtime/read-only-bash.d.ts +0 -141
  640. package/dist/runtime/read-only-bash.js +0 -2204
  641. package/dist/runtime/read-only-bash.js.map +0 -1
  642. package/dist/runtime/recovery-git-commit.d.ts +0 -22
  643. package/dist/runtime/recovery-git-commit.js +0 -284
  644. package/dist/runtime/recovery-git-commit.js.map +0 -1
  645. package/dist/runtime/reject-malformed-session-id.d.ts +0 -8
  646. package/dist/runtime/reject-malformed-session-id.js +0 -16
  647. package/dist/runtime/reject-malformed-session-id.js.map +0 -1
  648. package/dist/runtime/risk-classifier.d.ts +0 -38
  649. package/dist/runtime/risk-classifier.js +0 -311
  650. package/dist/runtime/risk-classifier.js.map +0 -1
  651. package/dist/runtime/session-id.d.ts +0 -113
  652. package/dist/runtime/session-id.js +0 -193
  653. package/dist/runtime/session-id.js.map +0 -1
  654. package/dist/runtime/shell-word.d.ts +0 -62
  655. package/dist/runtime/shell-word.js +0 -410
  656. package/dist/runtime/shell-word.js.map +0 -1
  657. package/dist/runtime/task-providers/agent-tasks.d.ts +0 -103
  658. package/dist/runtime/task-providers/agent-tasks.js +0 -245
  659. package/dist/runtime/task-providers/agent-tasks.js.map +0 -1
  660. package/dist/runtime/when-eval.d.ts +0 -62
  661. package/dist/runtime/when-eval.js +0 -212
  662. package/dist/runtime/when-eval.js.map +0 -1
  663. package/dist/runtime/workflow-policies.d.ts +0 -207
  664. package/dist/runtime/workflow-policies.js +0 -596
  665. package/dist/runtime/workflow-policies.js.map +0 -1
  666. package/dist/schema/audit.d.ts +0 -71
  667. package/dist/schema/audit.js +0 -32
  668. package/dist/schema/audit.js.map +0 -1
  669. package/dist/schema/doctor.d.ts +0 -25
  670. package/dist/schema/doctor.js +0 -23
  671. package/dist/schema/doctor.js.map +0 -1
  672. package/dist/schema/environments.d.ts +0 -215
  673. package/dist/schema/environments.js +0 -101
  674. package/dist/schema/environments.js.map +0 -1
  675. package/dist/schema/extract.d.ts +0 -9
  676. package/dist/schema/extract.js +0 -86
  677. package/dist/schema/extract.js.map +0 -1
  678. package/dist/schema/permission-profiles.d.ts +0 -2292
  679. package/dist/schema/permission-profiles.js +0 -60
  680. package/dist/schema/permission-profiles.js.map +0 -1
  681. package/dist/schema/policies.d.ts +0 -974
  682. package/dist/schema/policies.js +0 -298
  683. package/dist/schema/policies.js.map +0 -1
  684. package/dist/schema/requires.d.ts +0 -131
  685. package/dist/schema/requires.js +0 -88
  686. package/dist/schema/requires.js.map +0 -1
  687. package/dist/schema/risk.d.ts +0 -144
  688. package/dist/schema/risk.js +0 -194
  689. package/dist/schema/risk.js.map +0 -1
  690. package/dist/schema/session-start-preflight.d.ts +0 -10
  691. package/dist/schema/session-start-preflight.js +0 -106
  692. package/dist/schema/session-start-preflight.js.map +0 -1
  693. package/dist/schema/stale-base-check.d.ts +0 -18
  694. package/dist/schema/stale-base-check.js +0 -37
  695. package/dist/schema/stale-base-check.js.map +0 -1
  696. package/dist/schema/toolchain-parity.d.ts +0 -21
  697. package/dist/schema/toolchain-parity.js +0 -48
  698. package/dist/schema/toolchain-parity.js.map +0 -1
  699. package/dist/schema/workflows.d.ts +0 -519
  700. package/dist/schema/workflows.js +0 -81
  701. package/dist/schema/workflows.js.map +0 -1
  702. package/scripts/runtime-reality-docker-probe.mjs +0 -71
@@ -1,591 +0,0 @@
1
- // `harness session-start preflight` — SessionStart hook entrypoint.
2
- //
3
- // Wired by the Full template's `git-preflight` SessionStart hook. Reads
4
- // the SessionStart event JSON from stdin, runs `agent-preflight`
5
- // (`preflight run --json [--setup] <cwd>`; `--setup` is opt-in via the
6
- // manifest's `session_start_preflight.setup` key, default `false`, task
7
- // 30183330, see ./src/schema/session-start-preflight.ts), and on a
8
- // `ready:true` result writes a `preflight:${REPO}` fact to the evidence
9
- // ledger so the `preflight-before-investigation` / `preflight-before-push`
10
- // policies have a fresh tag to match within their `within` windows.
11
- //
12
- // SessionStart hooks are `blocking:false`: this command MUST NOT break
13
- // the session loop. Every failure path — `preflight` not on PATH, a
14
- // timeout, a non-`ready` result, an unreachable ledger — logs one line
15
- // to stderr and exits 0. The only observable effect of a failure is
16
- // that the preflight policies stay closed (which is the safe default).
17
- //
18
- // `ready:false` deliberately does NOT write the tag: the policy intent
19
- // is "block investigative git reads until agent-preflight ran cleanly",
20
- // so a failing preflight must leave the gate shut, not satisfy it.
21
- import { execFile } from "node:child_process";
22
- import { randomBytes } from "node:crypto";
23
- import * as fs from "node:fs";
24
- import * as path from "node:path";
25
- import { resolveGitContext, resolveScopedProjectName, } from "../../runtime/index.js";
26
- import { resolveManifestLedgerWriter } from "../../runtime/ledger-writer.js";
27
- import { resolveGeneratedDir } from "../../runtime/pending-approval.js";
28
- import { resolveReadSessionId } from "../../runtime/session-id.js";
29
- import { readStdinBounded, STDIN_IDLE_TIMEOUT_MS, stdinTimeoutNote } from "../bounded-stdin.js";
30
- import { loadManifest, resolvePaths } from "../loader.js";
31
- import { classifySessionSource, explicitSessionId, FALLBACK_SESSION, } from "./shared-options.js";
32
- // Exported (task 6993d9b5, round 2 F5) so
33
- // `session-start-preflight-setup-version.ts`'s `PREFLIGHT_SETUP_VERSION_COMMAND`
34
- // derives from this producer's own binary name instead of carrying an
35
- // independent "preflight" string literal that could silently drift from it.
36
- export const PREFLIGHT_BIN = "preflight";
37
- // Default upper bound on `preflight run --json <cwd>` for the
38
- // SessionStart producer. Was 25s through v0.17.4; bumped to 60s after
39
- // the agent-grounding dogfood (agent-tasks/7265599e) where a healthy
40
- // preflight took ~28s, just past the old ceiling. The wrapper still
41
- // kills runaway invocations; this only widens the window for honest
42
- // medium-size repos. Operators with even larger preflights can still
43
- // override per-call via `harness preflight --timeout <ms>`.
44
- const DEFAULT_PREFLIGHT_TIMEOUT_MS = 60_000;
45
- const LEDGER_SOURCE = "harness-session-start-preflight";
46
- // Not-ready diagnostic log: the raw `preflight run --json` payload is
47
- // persisted so an operator (or a follow-up session) can see the FULL
48
- // check output, not just the capped first-N detail lines this producer
49
- // surfaces on stderr. `keep-last-20` rotation bounds the directory —
50
- // it is shared across every repo the operator preflights from this
51
- // host, so unbounded growth would be a slow disk leak.
52
- const FAIL_LOG_KEEP_LAST = 20;
53
- const FAIL_LOG_PREFIX = "preflight-";
54
- /**
55
- * Environment for the spawned `preflight` child: the parent env minus
56
- * HARNESS_ALLOW_REAL_GENERATED_DIR. The launcher sets that flag so the
57
- * real harness binary may fall back to the operator's home dir, but the
58
- * preflight child runs the repo's own test suite (its `npm-test` check),
59
- * and an inherited flag re-enables the implicit real-homedir fallback
60
- * INSIDE those test processes. With non-empty operator state (e.g. a
61
- * `harness pause` sentinel) that broke 110 tests and surfaced as a false
62
- * `failing: npm-test`, keeping the preflight gate shut. Third incident
63
- * of the operator-state-isolation class PR #199 pinned; the flag must
64
- * stay scoped to the process the operator actually invoked.
65
- */
66
- export function preflightChildEnv(parentEnv = process.env) {
67
- const env = { ...parentEnv };
68
- delete env["HARNESS_ALLOW_REAL_GENERATED_DIR"];
69
- return env;
70
- }
71
- /**
72
- * Build the argv passed to the `preflight` child (task 30183330). Pure
73
- * and exported so a test can pin the rendered command directly, with
74
- * and without `setup`, instead of only exercising the injected
75
- * `runPreflight` seam. `--setup` is inserted before the positional
76
- * `cwd` argument, matching agent-preflight's own `preflight run
77
- * [options] [repoPath]` usage.
78
- */
79
- export function buildPreflightArgv(cwd, setup) {
80
- return setup ? ["run", "--json", "--setup", cwd] : ["run", "--json", cwd];
81
- }
82
- /**
83
- * Default `preflight` runner: spawn `preflight run --json [--setup]
84
- * <cwd>` and parse its stdout. Resolves `{ ok: false }` (never throws)
85
- * for the not-installed / timeout / unparseable cases so the caller can
86
- * degrade.
87
- */
88
- function spawnPreflight(cwd, timeoutMs, setup) {
89
- return new Promise((resolve) => {
90
- execFile(PREFLIGHT_BIN, buildPreflightArgv(cwd, setup), {
91
- timeout: timeoutMs,
92
- maxBuffer: 16 * 1024 * 1024,
93
- encoding: "utf8",
94
- env: preflightChildEnv(),
95
- }, (err, stdout) => {
96
- // `preflight` may exit non-zero on a not-ready result while still
97
- // emitting valid JSON, so a parseable stdout wins over the exit
98
- // code. Only a missing binary / timeout / unparseable output is a
99
- // genuine "could not run".
100
- const text = (stdout ?? "").trim();
101
- if (text.length > 0) {
102
- try {
103
- return resolve({ ok: true, json: JSON.parse(text) });
104
- }
105
- catch {
106
- /* fall through to the error path */
107
- }
108
- }
109
- if (err) {
110
- const e = err;
111
- if (e.code === "ENOENT") {
112
- return resolve({
113
- ok: false,
114
- reason: `\`${PREFLIGHT_BIN}\` not on PATH (npm i -g @lannguyensi/agent-preflight)`,
115
- });
116
- }
117
- // maxBuffer overflow also sets `killed:true`; check it first so
118
- // an over-budget output is not mis-reported as a timeout.
119
- if (e.code === "ERR_CHILD_PROCESS_STDIO_MAXBUFFER") {
120
- return resolve({
121
- ok: false,
122
- reason: `\`${PREFLIGHT_BIN} run --json\` output exceeded the read buffer`,
123
- });
124
- }
125
- if (e.killed) {
126
- return resolve({
127
- ok: false,
128
- reason: `\`${PREFLIGHT_BIN} run\` timed out after ${timeoutMs}ms`,
129
- });
130
- }
131
- return resolve({ ok: false, reason: `\`${PREFLIGHT_BIN} run\` failed: ${e.message}` });
132
- }
133
- return resolve({
134
- ok: false,
135
- reason: `\`${PREFLIGHT_BIN} run --json\` produced no parseable JSON`,
136
- });
137
- });
138
- });
139
- }
140
- // Up to this many valid detail lines are surfaced per failing check.
141
- // Was 1 (the check's first detail line only) through v0.2x; a bare
142
- // check name plus a single truncated line once cost a long false-
143
- // negative diagnosis because the actual FAIL line (test name) sat
144
- // past the first line the producer looked at. Task T-001.
145
- const MAX_DETAIL_LINES_PER_CHECK = 3;
146
- const DETAIL_LINE_CHAR_CAP = 140;
147
- function capDetailLine(raw) {
148
- const trimmed = raw.trim().replace(/\s+/g, " ");
149
- return trimmed.length > DETAIL_LINE_CHAR_CAP
150
- ? `${trimmed.slice(0, DETAIL_LINE_CHAR_CAP - 1)}…`
151
- : trimmed;
152
- }
153
- function describeNotReady(json, logPath) {
154
- const failing = (json.checks ?? [])
155
- .filter((c) => c.status === "fail" || c.status === "error")
156
- .map((c) => {
157
- const name = c.name ?? "(unnamed)";
158
- // Surface up to MAX_DETAIL_LINES_PER_CHECK of the check's own detail
159
- // lines: a bare check name ("failing: npm-test") once cost a long
160
- // false-negative diagnosis because the actual reason never left the
161
- // child JSON. The typeof guards matter: this is untrusted subprocess
162
- // JSON behind a cast, and a SessionStart producer must never throw
163
- // (blocking:false, exit-0 contract above), so a malformed element is
164
- // filtered out instead of crashing; a check with no valid detail
165
- // line at all degrades to its bare name.
166
- const validDetails = Array.isArray(c.details)
167
- ? c.details.filter((d) => typeof d === "string" && d.trim().length > 0)
168
- : [];
169
- const lines = validDetails.length > 0
170
- ? validDetails.slice(0, MAX_DETAIL_LINES_PER_CHECK)
171
- : typeof c.message === "string" && c.message.trim().length > 0
172
- ? [c.message]
173
- : [];
174
- if (lines.length === 0)
175
- return name;
176
- const capped = lines.map(capDetailLine).join(" | ");
177
- return `${name} (${capped})`;
178
- });
179
- const confidence = typeof json.confidence === "number" ? json.confidence.toFixed(2) : "?";
180
- const failSuffix = failing.length > 0 ? `; failing: ${failing.join(", ")}` : "";
181
- const logSuffix = logPath ? `; log: ${logPath}` : "";
182
- return `preflight not ready (confidence ${confidence})${failSuffix}${logSuffix}`;
183
- }
184
- /**
185
- * Default not-ready log directory: `<home>/logs` (task T-001). Routed
186
- * through `resolvePaths()` — the same idiom `defaultReportsDir`'s caller
187
- * uses in approve/understanding.ts — instead of hardcoding
188
- * `path.join(os.homedir(), ".harness", "logs")` directly (task 80f49922,
189
- * reviewer finding on a48b9729). Two effects: (1) this now respects the
190
- * real home-dir precedence chain ($HARNESS_HOME, then `~/.harness/`,
191
- * then the legacy `~/.claude/` fallback) instead of silently diverging
192
- * from the rest of the harness state (regression from 31fbf856); (2) it
193
- * inherits the throw-on-real-home-dir guard in `resolvePaths()`
194
- * (loader.ts:45-64), which previously protected this seam only via a
195
- * suite-local `vi.mock("node:os")` pin in preflight.test.ts — a caller
196
- * that forgot to inject `logDir` from any OTHER test or child process
197
- * would still silently write into the operator's real home dir.
198
- * Evaluated lazily from the `opts.logDir ?? defaultFailLogDir(opts)`
199
- * call site, so injecting `logDir` alone still bypasses the guard.
200
- *
201
- * Precedence when BOTH `homeDir` and `configPath` are injected at once:
202
- * `configPath` wins here, inherited from `resolvePaths()`'s own `base =
203
- * opts.configPath ?? path.join(home, DEFAULT_BASENAME)` (loader.ts) —
204
- * `configPath`, when present, is used verbatim regardless of `homeDir`.
205
- * This is the opposite of `resolveGeneratedDir()` (io/generated-dir.ts),
206
- * which checks `homeDir` FIRST and only falls back to the manifest
207
- * path's directory when `homeDir` is undefined, so `homeDir` wins there.
208
- * Intentional, pre-existing divergence between the two resolvers, not a
209
- * bug to reconcile here — documented, not changed.
210
- */
211
- function defaultFailLogDir(opts) {
212
- return path.join(path.dirname(resolvePaths(opts).base), "logs");
213
- }
214
- /**
215
- * Resolve the not-ready fail-log directory, catching only the
216
- * `resolvePaths()` guard's throw (task 80f49922 reviewer finding).
217
- * `persistFailLog()` below has its own never-throws contract (see its
218
- * doc comment), so it is called OUTSIDE this try/catch at the call
219
- * site — wrapping it here too would blur which of the two failure
220
- * modes (guard throw vs. write failure) actually produced a given
221
- * `{ ok: false, reason }`.
222
- */
223
- function resolveFailLogDir(opts) {
224
- try {
225
- return { ok: true, logDir: opts.logDir ?? defaultFailLogDir(opts) };
226
- }
227
- catch (err) {
228
- return { ok: false, reason: err instanceof Error ? err.message : String(err) };
229
- }
230
- }
231
- /** Repo names land in a filename; strip anything not filename-safe. */
232
- function sanitizeForFilename(value) {
233
- const cleaned = value.replace(/[^a-zA-Z0-9._-]/g, "-");
234
- return cleaned.length > 0 ? cleaned : "repo";
235
- }
236
- /**
237
- * Rotate `logDir` down to the `FAIL_LOG_KEEP_LAST` most recently modified
238
- * `preflight-*.json` files, oldest first. Best-effort: any single stat/
239
- * unlink failure is swallowed so one unreadable entry cannot block
240
- * rotation of the rest. The directory is shared across every repo the
241
- * operator preflights from this host, so filename order is not a
242
- * reliable time proxy — mtime is.
243
- */
244
- function rotateFailLogDir(logDir) {
245
- const names = fs
246
- .readdirSync(logDir)
247
- .filter((name) => name.startsWith(FAIL_LOG_PREFIX) && name.endsWith(".json"));
248
- if (names.length <= FAIL_LOG_KEEP_LAST)
249
- return;
250
- const withMtime = names
251
- .map((name) => {
252
- const full = path.join(logDir, name);
253
- try {
254
- return { full, mtimeMs: fs.statSync(full).mtimeMs };
255
- }
256
- catch {
257
- return null;
258
- }
259
- })
260
- .filter((e) => e !== null)
261
- .sort((a, b) => a.mtimeMs - b.mtimeMs);
262
- const excess = withMtime.length - FAIL_LOG_KEEP_LAST;
263
- for (let i = 0; i < excess; i++) {
264
- const entry = withMtime[i];
265
- if (!entry)
266
- continue;
267
- try {
268
- fs.unlinkSync(entry.full);
269
- }
270
- catch {
271
- /* best-effort rotation; a stray leftover file is not fatal */
272
- }
273
- }
274
- }
275
- /**
276
- * Persist the not-ready `preflight run --json` payload (pretty-printed)
277
- * to `<logDir>/preflight-<repo>-<timestamp>-<hex4>.json`, then rotate the
278
- * directory. The 4-hex suffix disambiguates writes that land in the same
279
- * millisecond (the ISO timestamp's resolution), where the second write
280
- * would otherwise silently overwrite the first. Never throws: a write or
281
- * rotation failure degrades to `{ ok: false, reason }` so the caller can
282
- * note() and keep going — the SessionStart producer must exit 0 on every
283
- * path.
284
- */
285
- function persistFailLog(json, repo, logDir) {
286
- let filePath;
287
- try {
288
- fs.mkdirSync(logDir, { recursive: true });
289
- const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
290
- const unique = randomBytes(2).toString("hex");
291
- // Cap the sanitized basename so a very long repo/worktree name can't blow past filesystem name-length limits.
292
- filePath = path.join(logDir, `${FAIL_LOG_PREFIX}${sanitizeForFilename(repo).slice(0, 100)}-${timestamp}-${unique}.json`);
293
- fs.writeFileSync(filePath, `${JSON.stringify(json, null, 2)}\n`, "utf8");
294
- }
295
- catch (err) {
296
- return { ok: false, reason: err.message };
297
- }
298
- try {
299
- rotateFailLogDir(logDir);
300
- }
301
- catch {
302
- /* rotation failure must not undo an already-successful log write */
303
- }
304
- return { ok: true, path: filePath };
305
- }
306
- export async function runSessionStartPreflight(opts = {}) {
307
- const stdin = opts.stdin ?? process.stdin;
308
- const stderr = opts.stderr ?? process.stderr;
309
- const preflightTimeoutMs = opts.preflightTimeoutMs ?? DEFAULT_PREFLIGHT_TIMEOUT_MS;
310
- const note = (msg) => {
311
- stderr.write(`harness session-start preflight: ${msg}\n`);
312
- };
313
- const done = (wrote, repo, branch, sessionId, sessionSource, reason) => ({
314
- exitCode: 0,
315
- wrote,
316
- repo,
317
- branch,
318
- sessionId,
319
- sessionSource,
320
- ...(reason !== undefined && { reason }),
321
- });
322
- // An explicit --session id overrides every other source, so stdin is not
323
- // read at all in that case: a manual or scripted call must not wait on a
324
- // stream that may never close. Without it, the read is idle-bounded and a
325
- // timeout falls back to the default session resolution below.
326
- let event;
327
- try {
328
- if (typeof opts.session === "string" && opts.session.length > 0) {
329
- event = {};
330
- }
331
- else {
332
- const idleTimeoutMs = opts.stdinIdleTimeoutMs ?? STDIN_IDLE_TIMEOUT_MS;
333
- const read = await readStdinBounded(stdin, idleTimeoutMs);
334
- if (read.timedOut)
335
- note(stdinTimeoutNote(read, idleTimeoutMs));
336
- event = JSON.parse(read.text.trim() || "{}");
337
- }
338
- }
339
- catch (err) {
340
- const reason = `malformed event JSON: ${err.message}`;
341
- note(reason);
342
- return done(false, "", "", FALLBACK_SESSION, "default", reason);
343
- }
344
- const cwd = typeof event.cwd === "string" && event.cwd.length > 0 ? event.cwd : process.cwd();
345
- const { repo, branch, sha } = resolveGitContext(cwd);
346
- if (repo === "") {
347
- const reason = `cwd is not inside a git work tree (${cwd}); nothing to preflight`;
348
- note(reason);
349
- return done(false, "", "", FALLBACK_SESSION, "default", reason);
350
- }
351
- // Session-id resolution chain. The hook-driven path (Claude Code feeds
352
- // SessionStart event JSON on stdin) lands at tier "stdin" and is the
353
- // common case. Manual invocations from an operator's `!`-shell — where
354
- // there is no event JSON — fall back through env, then transcript
355
- // discovery (same heuristic `harness audit` / `harness explain --trace`
356
- // use), and only as a last resort to the literal `"default"`. Tags
357
- // recorded under `"default"` will never satisfy a `preflight-before-*`
358
- // gate, so we loud-warn rather than letting the success line read as
359
- // if the producer worked.
360
- const explicit = explicitSessionId(opts.session, event);
361
- const resolveSession = opts.resolveSession ?? resolveReadSessionId;
362
- const sessionId = resolveSession(explicit, {});
363
- const sessionSource = classifySessionSource(opts.session, event, sessionId);
364
- // Stage `.pending-approval` as soon as we resolve a real session id so
365
- // `harness approve understanding` (no flags) works from the operator's
366
- // `!`-shell without needing a prior PreToolUse gate-block. Producer
367
- // hand-off matches the PreToolUse hook's existing one (same writer,
368
- // same path, same single-line content). Skipped when the session id
369
- // is the literal "default", since pointing approve at "default" would
370
- // never satisfy any task-scoped gate. Best-effort: a write failure
371
- // must NOT break the session loop, so any error is silently swallowed
372
- // (the operator can always fall back to `--session <id>` as before).
373
- // Multi-session caveat: two parallel Claude sessions on the same host
374
- // will clobber each other's `.pending-approval` (single-slot file).
375
- // Acceptable for the one-Claude-per-repo operator pattern; the worst
376
- // case is approve resolving to the wrong session id, which the operator
377
- // catches via the canonical-gate-signal line in the approve output.
378
- // OPT-IN: only fires when the caller explicitly passes a writer. The
379
- // CLI entry points wire `writePendingApproval`; library callers (and
380
- // every existing vitest case) get the no-op default, so the producer
381
- // never pollutes the real `~/.claude/harness.generated/` from a test.
382
- // Hotfix for v0.21.0 which defaulted to ON and caused the npm-test
383
- // preflight check to clobber the operator's pending-approval file.
384
- if (sessionSource !== "default" &&
385
- typeof opts.stagePendingApproval === "function") {
386
- try {
387
- const generatedDir = resolveGeneratedDir({
388
- ...(opts.homeDir !== undefined ? { homeDir: opts.homeDir } : {}),
389
- manifestPath: resolvePaths(opts).base,
390
- });
391
- opts.stagePendingApproval(generatedDir, sessionId);
392
- }
393
- catch {
394
- /* best-effort, never escalate into a hook error */
395
- }
396
- }
397
- // Resolve `--setup` (task 30183330) BEFORE spawning `preflight` so the
398
- // flag reaches the very first invocation. Best-effort, independent of
399
- // the ledger-writer's own `loadManifest` call further down: a
400
- // config/parse failure here degrades to `setup: false` (matches the
401
- // sibling companions' "not configured -> skip" contract) rather than
402
- // aborting the whole preflight run over an unrelated manifest problem,
403
- // whereas the ledger-writer's later load failure DOES abort (existing
404
- // behavior, unrelated to this change).
405
- //
406
- // Per-repo scoping (task c88461c1): an explicit `opts.project` (the
407
- // CLI's `--project <name>`) still wins outright. Otherwise this
408
- // producer derives a project name from `cwd` via the shared
409
- // `deriveProjectName` helper (review round 2, decision D-021a:
410
- // resolves to the MAIN checkout's directory name, the basename of
411
- // the directory containing the repository's shared git common dir,
412
- // so every linked worktree of one repository shares the same
413
- // project layer, unlike `repo` above, which names the checkout
414
- // directory itself and differs per worktree) and feeds it through
415
- // the loader's EXISTING `LoaderOptions.project` mechanism
416
- // (src/cli/loader.ts's `resolvePaths`/`applyLayers`), the same seam
417
- // every other command's own `--project <name>` flag already uses.
418
- // `explain-policy` and `doctor` derive the SAME name from the SAME
419
- // helper (review round 2, decision D-021b), so all three consumers
420
- // of `session_start_preflight.setup` agree on which layer applies to
421
- // a given cwd. The `?? repo` fallback only matters when
422
- // `deriveProjectName` returns null (an unreadable `.git` file); `cwd`
423
- // is already known to sit inside a git work tree at this point (an
424
- // empty `repo` already returned early above), so in practice this
425
- // reduces to the checkout basename either way. A repo with no
426
- // `<home>/projects/<name>/harness.overrides.yaml` on disk keeps the
427
- // host-wide (base plus machine-layer) value: the loader resolves
428
- // `projectLayer: null` when that file does not exist (loader.ts's
429
- // `fs.existsSync` check), so nothing extra is merged in that case.
430
- // See docs/CLI.md's `session_start_preflight.setup` Notes for the
431
- // full rule.
432
- const sessionStartPreflightProjectName = resolveScopedProjectName({
433
- project: opts.project,
434
- cwd,
435
- fallback: repo,
436
- });
437
- const setupEnabled = (() => {
438
- try {
439
- const manifest = opts.manifest ??
440
- loadManifest({ ...opts, project: sessionStartPreflightProjectName }).manifest;
441
- return manifest.session_start_preflight.setup;
442
- }
443
- catch (err) {
444
- // One diagnostic line naming the layer path (task c88461c1,
445
- // review round 3 residual; task `1c4eb3ea`): a scoped-load
446
- // failure here was silent everywhere before this task, degrading
447
- // straight to `setup: false` with no trace of WHY. Best-effort:
448
- // only fires when `!opts.manifest` (an injected manifest never
449
- // reaches `loadManifest` above, so a throw from THAT branch would
450
- // be a caller bug, not a layer failure) and only names the layer
451
- // path when `resolvePaths` itself can resolve one (its own
452
- // "refused to fall back to the real harness home dir" test-safety
453
- // throw, see loader.ts, is swallowed here rather than surfaced as
454
- // a misleading "layer failed to load" line).
455
- //
456
- // Lead-in describes the SCOPED LOAD, not "the project layer"
457
- // (task 1c4eb3ea, round 2, D-027 item 5): `loadManifest` above
458
- // merges the base manifest, every applicable machine-override
459
- // layer, AND the project layer in one call, so a throw here can
460
- // come from any of the three; `layerPath` below is only ever
461
- // used to DECIDE whether to emit this line at all (a project
462
- // layer must actually exist on disk to attribute the failure to
463
- // project scoping at all) and as context in the message, never
464
- // as the claimed culprit, so a base- or machine-layer parse
465
- // failure with a valid, existing project layer no longer reads
466
- // as "the project layer failed to load" when it did not.
467
- // Multi-line YAML parse errors are collapsed to their FIRST line
468
- // (D-027 item 5) so this stays the promised one diagnostic line.
469
- if (!opts.manifest) {
470
- try {
471
- const layerPath = resolvePaths({
472
- ...opts,
473
- project: sessionStartPreflightProjectName,
474
- }).projectLayer;
475
- if (layerPath !== null) {
476
- const errMessage = err instanceof Error ? err.message : String(err);
477
- const errFirstLine = errMessage.split("\n")[0];
478
- note(`session_start_preflight.setup: the project-scoped manifest load for ` +
479
- `project ${sessionStartPreflightProjectName} failed (${errFirstLine}); ` +
480
- `degrading to setup: false (project layer: ${layerPath})`);
481
- }
482
- }
483
- catch {
484
- /* best-effort diagnostic only; setup:false below still happens */
485
- }
486
- }
487
- return false;
488
- }
489
- })();
490
- const runPreflight = opts.runPreflight ?? spawnPreflight;
491
- const preflight = await runPreflight(cwd, preflightTimeoutMs, setupEnabled);
492
- if (!preflight.ok) {
493
- note(preflight.reason);
494
- return done(false, repo, branch, sessionId, sessionSource, preflight.reason);
495
- }
496
- if (preflight.json.ready !== true) {
497
- // defaultFailLogDir() now routes through resolvePaths(), which throws
498
- // when neither homeDir nor configPath is injected and the real binary
499
- // has not set HARNESS_ALLOW_REAL_GENERATED_DIR=1 (loader.ts:45-64,
500
- // task 80f49922). Fold that into the same { ok: false, reason } shape
501
- // persistFailLog already returns for a write failure — this producer
502
- // must degrade, never throw (see file header).
503
- const logDirResult = resolveFailLogDir(opts);
504
- const persisted = logDirResult.ok
505
- ? persistFailLog(preflight.json, repo, logDirResult.logDir)
506
- : { ok: false, reason: logDirResult.reason };
507
- if (!persisted.ok) {
508
- note(`preflight fail-log write failed: ${persisted.reason}`);
509
- }
510
- const reason = describeNotReady(preflight.json, persisted.ok ? persisted.path : undefined);
511
- note(`${reason} — leaving the preflight tag unwritten so the gate stays closed`);
512
- return done(false, repo, branch, sessionId, sessionSource, reason);
513
- }
514
- const confidence = typeof preflight.json.confidence === "number"
515
- ? preflight.json.confidence.toFixed(2)
516
- : "?";
517
- // Emit BOTH per-repo and per-branch tags in one fact: the requires
518
- // evaluator substring-matches, so a single entry containing
519
- // `preflight:${REPO}` and `preflight:${BRANCH}` satisfies both
520
- // `preflight-before-investigation` (REPO, within 1h) and
521
- // `preflight-before-push` (BRANCH, within 10m). Caveat: a SessionStart
522
- // producer cannot keep the 10m push window fresh through a long
523
- // session — a push-time refresh is a separate concern (see task notes).
524
- // On a detached HEAD `branch` is "" — only the REPO tag is written.
525
- // `head:<sha>` is appended when resolveGitContext returned a sha (loose
526
- // ref read or packed-refs fallback succeeded, or detached HEAD held a
527
- // raw sha). The at_head requires-flag relies on this token to satisfy
528
- // the gate at the recorded HEAD regardless of `within`; consumers that
529
- // ignore the flag continue to work because the token is ignored by
530
- // substring-match logic.
531
- const tags = branch.length > 0 ? `preflight:${repo} preflight:${branch}` : `preflight:${repo}`;
532
- const headSuffix = sha.length > 0 ? ` head:${sha}` : "";
533
- const content = `${tags} ready:true confidence:${confidence}${headSuffix}`;
534
- let writeLedger = opts.writeLedger;
535
- if (!writeLedger) {
536
- let manifest;
537
- try {
538
- // Second `loadManifest(opts)` call of this run (task 30183330); the
539
- // `setupEnabled` resolution earlier in this function is the first.
540
- // Deliberately NOT reused, and deliberately NOT reading
541
- // `opts.manifest`: a failure here ABORTS the whole run (the catch
542
- // below returns early with no ledger write attempted), while the
543
- // `setupEnabled` call's failure degrades to `setup: false` and lets
544
- // the run proceed. One shared load could carry both outcomes (a
545
- // captured result plus its error), but two local try/catch blocks
546
- // keep each site's failure handling obvious where it is read, and
547
- // the second load is cheap; that is the whole reason for the repeat.
548
- //
549
- // Deliberately plain `opts` here (no `project: deriveProjectName(cwd)
550
- // ?? repo`, unlike the `setupEnabled` load above, task c88461c1):
551
- // this manifest only feeds `resolveManifestLedgerWriter` below, which
552
- // reads the ledger-writer wiring (`tools.mcp[]` / grounding config),
553
- // not `session_start_preflight`. The per-repo project layer exists
554
- // to scope THAT key; routing it through this unrelated load would
555
- // let a project layer silently reach ledger-writer config it was
556
- // never meant to touch, for zero benefit to this call site.
557
- manifest = loadManifest(opts).manifest;
558
- }
559
- catch (err) {
560
- const reason = `manifest load failed: ${err.message}`;
561
- note(reason);
562
- return done(false, repo, branch, sessionId, sessionSource, reason);
563
- }
564
- const resolved = resolveManifestLedgerWriter(manifest, {
565
- ...(opts.ledgerTimeoutMs !== undefined ? { ledgerTimeoutMs: opts.ledgerTimeoutMs } : {}),
566
- });
567
- if (!resolved.ok) {
568
- const reason = `${resolved.reason}; cannot record preflight tag`;
569
- note(reason);
570
- return done(false, repo, branch, sessionId, sessionSource, reason);
571
- }
572
- writeLedger = resolved.write;
573
- }
574
- const result = await writeLedger({ sessionId, content, source: LEDGER_SOURCE });
575
- if (!result.ok) {
576
- const reason = `ledger write failed: ${result.reason ?? "unknown error"}`;
577
- note(reason);
578
- return done(false, repo, branch, sessionId, sessionSource, reason);
579
- }
580
- note(`recorded ${content} for session ${sessionId}`);
581
- if (sessionSource === "default") {
582
- // Loud-warn: the tag landed under the literal "default" session, which
583
- // no `preflight-before-*` policy ever queries. The recorded line above
584
- // can read as success; this second line is the actionable corrective.
585
- note("WARNING: session resolved to the literal \"default\". preflight-before-* gates query " +
586
- "the real Claude Code session id and will NOT see this tag. Pipe SessionStart event JSON " +
587
- "on stdin, export $CLAUDE_SESSION_ID, or pass --session <id> for manual / scripted use.");
588
- }
589
- return done(true, repo, branch, sessionId, sessionSource);
590
- }
591
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/session-start/index.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,wEAAwE;AACxE,iEAAiE;AACjE,uEAAuE;AACvE,wEAAwE;AACxE,mEAAmE;AACnE,wEAAwE;AACxE,2EAA2E;AAC3E,oEAAoE;AACpE,EAAE;AACF,uEAAuE;AACvE,oEAAoE;AACpE,uEAAuE;AACvE,oEAAoE;AACpE,uEAAuE;AACvE,EAAE;AACF,uEAAuE;AACvE,wEAAwE;AACxE,mEAAmE;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAA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