@rt-tools/agent-kit 0.37.0 → 0.38.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 (436) hide show
  1. package/README.md +5 -5
  2. package/assets/checks/action-of.mjs +154 -0
  3. package/assets/checks/board-pull-state.github.mjs +82 -13
  4. package/assets/checks/board-runs.github.mjs +40 -5
  5. package/assets/checks/board.github.mjs +1 -1
  6. package/assets/checks/check-board.github.mjs +58 -19
  7. package/assets/checks/check-specs.mjs +2 -2
  8. package/assets/checks/check-state-next.mjs +22 -10
  9. package/assets/checks/check-turn-map.mjs +26 -6
  10. package/assets/checks/check-work-steps.mjs +4 -173
  11. package/assets/checks/decide.mjs +285 -0
  12. package/assets/checks/decision-table.json +21365 -0
  13. package/assets/checks/decision-table.mjs +495 -0
  14. package/assets/checks/epic-table.github.mjs +4 -3
  15. package/assets/checks/epic-window.mjs +98 -0
  16. package/assets/checks/flow-condition.mjs +64 -0
  17. package/assets/checks/flow-data.mjs +136 -0
  18. package/assets/checks/flow-forecast.mjs +330 -0
  19. package/assets/checks/flow-guard-run.mjs +90 -0
  20. package/assets/checks/flow-guard.mjs +294 -0
  21. package/assets/checks/flow-model.mjs +271 -0
  22. package/assets/checks/flow-override.mjs +130 -0
  23. package/assets/checks/flow-plan.mjs +206 -0
  24. package/assets/checks/flow-scaffold.mjs +224 -0
  25. package/assets/checks/flow-step.mjs +365 -0
  26. package/assets/checks/flow-sync.mjs +296 -0
  27. package/assets/checks/flow-syntax.mjs +292 -0
  28. package/assets/checks/flow-verdict.mjs +112 -0
  29. package/assets/checks/lib-common.mjs +10 -2
  30. package/assets/checks/lib-domains.mjs +1 -1
  31. package/assets/checks/lib-manifests.mjs +34 -2
  32. package/assets/checks/merge-read.mjs +239 -0
  33. package/assets/checks/owner-nudges.mjs +389 -0
  34. package/assets/checks/push-inputs.mjs +444 -0
  35. package/assets/checks/push-trace.mjs +108 -0
  36. package/assets/checks/record-count.mjs +410 -0
  37. package/assets/checks/record-recount.mjs +187 -0
  38. package/assets/checks/record-turn.mjs +155 -0
  39. package/assets/checks/rt-kit-checks.config.mjs +17 -2
  40. package/assets/checks/spec-anchors.mjs +4 -4
  41. package/assets/checks/spec-contract.mjs +5 -5
  42. package/assets/checks/task-flow-script.mjs +292 -0
  43. package/assets/checks/tree-assignment.mjs +26 -7
  44. package/assets/checks/work-result.mjs +281 -0
  45. package/assets/checks/work-steps-lib.mjs +205 -0
  46. package/assets/commands/next-session.md +3 -1
  47. package/assets/commands/night.md +28 -18
  48. package/assets/defaults/gate-map.sh +39 -12
  49. package/assets/defaults/merges.sh +48 -0
  50. package/assets/defaults/project.sh +43 -13
  51. package/assets/defaults/push.sh +23 -0
  52. package/assets/defaults/turn-map.md +24 -21
  53. package/assets/docs/GLOSSARY.md +6 -2
  54. package/assets/hooks/ask-judge.md +65 -0
  55. package/assets/hooks/browser-guard-device-id.sh +11 -9
  56. package/assets/hooks/browser-guard-no-asking.sh +12 -6
  57. package/assets/hooks/browser-guard-no-listing.sh +13 -7
  58. package/assets/hooks/browser-guard-no-other-drivers.sh +25 -17
  59. package/assets/hooks/browser-guard-require-select.sh +15 -15
  60. package/assets/hooks/commit-msg.sh +13 -3
  61. package/assets/hooks/conscience-guard.sh +9 -25
  62. package/assets/hooks/decide.sh +141 -0
  63. package/assets/hooks/deny-tail.sh +16 -11
  64. package/assets/hooks/dev-server-guard.sh +27 -20
  65. package/assets/hooks/dispatch.sh +47 -4
  66. package/assets/hooks/docs-guard.sh +31 -200
  67. package/assets/hooks/end-conversation-guard.sh +12 -21
  68. package/assets/hooks/epic-stop-guard.sh +54 -105
  69. package/assets/hooks/exam-guard.sh +32 -65
  70. package/assets/hooks/facts-docs.sh +221 -0
  71. package/assets/hooks/facts-flow.sh +173 -0
  72. package/assets/hooks/facts.sh +308 -0
  73. package/assets/hooks/flow-step-guard.sh +93 -0
  74. package/assets/hooks/git-guard-delivery-body.sh +4 -4
  75. package/assets/hooks/git-guard-delivery-conflict.sh +16 -10
  76. package/assets/hooks/git-guard-delivery-draft.sh +3 -3
  77. package/assets/hooks/git-guard-delivery-epic.sh +18 -9
  78. package/assets/hooks/git-guard-delivery-folder.sh +32 -7
  79. package/assets/hooks/git-guard-delivery-merge.sh +2 -2
  80. package/assets/hooks/git-guard-delivery-merged.sh +12 -1
  81. package/assets/hooks/git-guard-delivery-pipeline.sh +1 -1
  82. package/assets/hooks/git-guard-delivery-rerun.sh +32 -0
  83. package/assets/hooks/git-guard-delivery-signature.sh +82 -45
  84. package/assets/hooks/git-guard-delivery-task.sh +47 -0
  85. package/assets/hooks/git-guard-delivery.sh +112 -101
  86. package/assets/hooks/git-guard-discard.sh +8 -18
  87. package/assets/hooks/git-guard-main.sh +13 -19
  88. package/assets/hooks/git-guard-no-verify.sh +56 -16
  89. package/assets/hooks/git-guard-push-ahead.sh +46 -5
  90. package/assets/hooks/git-guard-push-marks.sh +227 -31
  91. package/assets/hooks/git-guard-push-tests.sh +51 -53
  92. package/assets/hooks/git-guard-tree-assignment.sh +7 -4
  93. package/assets/hooks/guard-note.sh +8 -6
  94. package/assets/hooks/handoff-entry-guard.sh +20 -39
  95. package/assets/hooks/handoff-write.sh +3 -1
  96. package/assets/hooks/hook-input.sh +0 -41
  97. package/assets/hooks/metric-marks.sh +19 -7
  98. package/assets/hooks/observe.sh +1 -1
  99. package/assets/hooks/override-write-guard.sh +27 -9
  100. package/assets/hooks/pre-push.sh +20 -10
  101. package/assets/hooks/prose-style-guard.sh +6 -19
  102. package/assets/hooks/pull-merges.sh +76 -0
  103. package/assets/hooks/push-set.sh +39 -7
  104. package/assets/hooks/qa-dataid-guard.sh +7 -17
  105. package/assets/hooks/record-turn.sh +52 -0
  106. package/assets/hooks/rerun-guard.sh +11 -16
  107. package/assets/hooks/reuse-first-guard.sh +7 -21
  108. package/assets/hooks/role-calls.sh +25 -3
  109. package/assets/hooks/rule-source-guard.sh +54 -21
  110. package/assets/hooks/skill-gate-rearm.sh +18 -5
  111. package/assets/hooks/skill-gate.sh +156 -20
  112. package/assets/hooks/skill-loaded.sh +18 -3
  113. package/assets/hooks/sql-guard-target.sh +2 -2
  114. package/assets/hooks/sql-guard-write.sh +12 -12
  115. package/assets/hooks/sql-guard.sh +58 -16
  116. package/assets/hooks/task-context-load.sh +3 -1
  117. package/assets/hooks/task-flow-context.sh +20 -22
  118. package/assets/hooks/task-flow-draft-guard.sh +25 -74
  119. package/assets/hooks/task-flow-guard.sh +28 -129
  120. package/assets/hooks/tree-assignment-guard.sh +25 -14
  121. package/assets/hooks/turn-entry-load.sh +3 -1
  122. package/assets/hooks/turn-exit-guard.sh +92 -452
  123. package/assets/hooks/turn-exit-role.sh +47 -0
  124. package/assets/hooks/turn-judge.md +103 -0
  125. package/assets/hooks/window-fill-guard.sh +22 -41
  126. package/assets/laws/work-conduct.md +9 -8
  127. package/assets/patterns/autonomous-work-run.md +35 -10
  128. package/assets/patterns/browser-verification-measure.md +10 -20
  129. package/assets/patterns/browser-verification-stand.md +30 -42
  130. package/assets/patterns/doc-style-human.md +0 -6
  131. package/assets/patterns/doc-style-sweep.md +7 -7
  132. package/assets/patterns/doc-style-trace.md +5 -4
  133. package/assets/patterns/doc-style-write.md +7 -7
  134. package/assets/patterns/epic-flow-declare.md +15 -8
  135. package/assets/patterns/git-workflow-commit.azure.md +9 -155
  136. package/assets/patterns/git-workflow-commit.github.md +11 -269
  137. package/assets/patterns/git-workflow-commit.gitlab.md +9 -161
  138. package/assets/patterns/git-workflow-docker.md +8 -231
  139. package/assets/patterns/git-workflow-freshness.md +9 -56
  140. package/assets/patterns/git-workflow-merge.md +7 -174
  141. package/assets/patterns/git-workflow-migration.md +5 -73
  142. package/assets/patterns/git-workflow-pr-body.github.md +6 -159
  143. package/assets/patterns/git-workflow-pr-ready.md +9 -69
  144. package/assets/patterns/git-workflow-pr.azure.md +14 -220
  145. package/assets/patterns/git-workflow-pr.github.md +13 -253
  146. package/assets/patterns/git-workflow-pr.gitlab.md +14 -241
  147. package/assets/patterns/git-workflow-restart.md +5 -41
  148. package/assets/patterns/git-workflow-secrets.md +10 -76
  149. package/assets/patterns/git-workflow-stack.md +9 -205
  150. package/assets/patterns/lib-layers-new.md +7 -3
  151. package/assets/patterns/queue-audit-read.github.md +9 -3
  152. package/assets/patterns/spec-driven-domain.md +50 -48
  153. package/assets/patterns/spec-driven-rule.md +18 -19
  154. package/assets/patterns/status-report-table.github.md +2 -2
  155. package/assets/patterns/task-flow-archive.md +15 -256
  156. package/assets/patterns/task-flow-close.md +16 -291
  157. package/assets/patterns/task-flow-cycle.md +13 -39
  158. package/assets/patterns/task-flow-graph.needs-graph.md +8 -58
  159. package/assets/patterns/task-flow-handoff.md +13 -161
  160. package/assets/patterns/task-flow-resume.md +19 -183
  161. package/assets/patterns/task-flow-start.md +9 -248
  162. package/assets/patterns/testing-e2e.md +14 -18
  163. package/assets/patterns/testing-unit.md +9 -13
  164. package/assets/patterns/turn-entry-map.md +15 -5
  165. package/assets/pitfalls/agent-kit-extend.md +200 -0
  166. package/assets/pitfalls/agent-kit.2.md +323 -0
  167. package/assets/pitfalls/angular-patterns.md +98 -0
  168. package/assets/pitfalls/autonomous-work.md +15 -0
  169. package/assets/pitfalls/browser-verification.md +265 -0
  170. package/assets/pitfalls/component-structure.md +98 -0
  171. package/assets/pitfalls/dependencies.md +92 -0
  172. package/assets/pitfalls/deploy-flow.azure.md +171 -0
  173. package/assets/pitfalls/deploy-flow.github.md +211 -0
  174. package/assets/pitfalls/deploy-flow.gitlab.md +173 -0
  175. package/assets/pitfalls/doc-style.2.md +286 -0
  176. package/assets/pitfalls/doc-style.md +3 -3
  177. package/assets/pitfalls/entity-conventions.needs-admin.md +96 -0
  178. package/assets/pitfalls/entity-models.md +89 -0
  179. package/assets/pitfalls/git-workflow-commit.azure.md +190 -0
  180. package/assets/pitfalls/git-workflow-commit.github.md +307 -0
  181. package/assets/pitfalls/git-workflow-commit.gitlab.md +196 -0
  182. package/assets/pitfalls/git-workflow-docker.md +275 -0
  183. package/assets/pitfalls/git-workflow-freshness.md +88 -0
  184. package/assets/pitfalls/git-workflow-hosting.azure.md +31 -0
  185. package/assets/pitfalls/git-workflow-hosting.github.md +32 -0
  186. package/assets/pitfalls/git-workflow-hosting.gitlab.md +31 -0
  187. package/assets/pitfalls/git-workflow-merge.md +220 -0
  188. package/assets/pitfalls/git-workflow-migration.md +103 -0
  189. package/assets/pitfalls/git-workflow-pr-body.github.md +185 -0
  190. package/assets/pitfalls/git-workflow-pr-ready.md +104 -0
  191. package/assets/pitfalls/git-workflow-pr.2.azure.md +172 -0
  192. package/assets/pitfalls/git-workflow-pr.2.github.md +184 -0
  193. package/assets/pitfalls/git-workflow-pr.2.gitlab.md +180 -0
  194. package/assets/pitfalls/git-workflow-pr.azure.md +159 -0
  195. package/assets/pitfalls/git-workflow-pr.github.md +107 -0
  196. package/assets/pitfalls/git-workflow-pr.gitlab.md +151 -0
  197. package/assets/pitfalls/git-workflow-push.azure.md +30 -0
  198. package/assets/pitfalls/git-workflow-push.github.md +30 -0
  199. package/assets/pitfalls/git-workflow-push.gitlab.md +30 -0
  200. package/assets/pitfalls/git-workflow-queue.azure.md +30 -0
  201. package/assets/pitfalls/git-workflow-queue.github.md +30 -0
  202. package/assets/pitfalls/git-workflow-queue.gitlab.md +30 -0
  203. package/assets/pitfalls/git-workflow-restart.md +72 -0
  204. package/assets/pitfalls/git-workflow-secrets.md +114 -0
  205. package/assets/pitfalls/git-workflow-stack.md +254 -0
  206. package/assets/pitfalls/git-workflow.2.azure.md +291 -0
  207. package/assets/pitfalls/git-workflow.2.github.md +294 -0
  208. package/assets/pitfalls/git-workflow.2.gitlab.md +278 -0
  209. package/assets/pitfalls/git-workflow.github.md +5 -9
  210. package/assets/pitfalls/lib-layers.md +114 -0
  211. package/assets/pitfalls/lists.md +117 -0
  212. package/assets/pitfalls/navigation.md +94 -0
  213. package/assets/pitfalls/reuse-first.md +201 -0
  214. package/assets/pitfalls/spec-driven.2.md +318 -0
  215. package/assets/pitfalls/spec-driven.md +9 -7
  216. package/assets/pitfalls/styling-bem.2.md +125 -0
  217. package/assets/pitfalls/task-flow-archive.md +264 -0
  218. package/assets/pitfalls/task-flow-close.2.md +165 -0
  219. package/assets/pitfalls/task-flow-close.md +167 -0
  220. package/assets/pitfalls/task-flow-cycle.md +73 -0
  221. package/assets/pitfalls/task-flow-graph.needs-graph.md +98 -0
  222. package/assets/pitfalls/task-flow-handoff.md +200 -0
  223. package/assets/pitfalls/task-flow-handover.md +30 -0
  224. package/assets/pitfalls/task-flow-owner.md +29 -0
  225. package/assets/pitfalls/task-flow-plan.md +29 -0
  226. package/assets/pitfalls/task-flow-resume.md +257 -0
  227. package/assets/pitfalls/task-flow-start.md +287 -0
  228. package/assets/pitfalls/task-flow.2.md +303 -0
  229. package/assets/pitfalls/task-flow.md +18 -29
  230. package/assets/pitfalls/testing.2.md +279 -0
  231. package/assets/pitfalls/testing.md +11 -12
  232. package/assets/pitfalls/turn-conduct.md +17 -18
  233. package/assets/pitfalls/typescript-conventions.md +161 -0
  234. package/assets/pitfalls/write-a-skill.md +128 -0
  235. package/assets/rules/angular-patterns.md +21 -86
  236. package/assets/rules/autonomous-work.md +37 -29
  237. package/assets/rules/browser-verification.md +28 -251
  238. package/assets/rules/component-structure.md +25 -87
  239. package/assets/rules/dependencies.md +20 -78
  240. package/assets/rules/deploy-flow.azure.md +27 -134
  241. package/assets/rules/deploy-flow.github.md +34 -196
  242. package/assets/rules/deploy-flow.gitlab.md +28 -137
  243. package/assets/rules/doc-style.md +32 -282
  244. package/assets/rules/entity-conventions.needs-admin.md +26 -82
  245. package/assets/rules/entity-models.md +14 -63
  246. package/assets/rules/epic-flow.md +5 -3
  247. package/assets/rules/git-workflow-hosting.azure.md +26 -0
  248. package/assets/rules/git-workflow-hosting.github.md +38 -0
  249. package/assets/rules/git-workflow-hosting.gitlab.md +27 -0
  250. package/assets/rules/git-workflow-push.azure.md +28 -0
  251. package/assets/rules/git-workflow-push.github.md +28 -0
  252. package/assets/rules/git-workflow-push.gitlab.md +28 -0
  253. package/assets/rules/git-workflow-queue.azure.md +23 -0
  254. package/assets/rules/git-workflow-queue.github.md +30 -0
  255. package/assets/rules/git-workflow-queue.gitlab.md +23 -0
  256. package/assets/rules/git-workflow.azure.md +21 -264
  257. package/assets/rules/git-workflow.github.md +24 -285
  258. package/assets/rules/git-workflow.gitlab.md +21 -258
  259. package/assets/rules/lib-layers.md +30 -103
  260. package/assets/rules/lists.md +21 -105
  261. package/assets/rules/navigation.md +10 -69
  262. package/assets/rules/queue-audit.github.md +5 -3
  263. package/assets/rules/reuse-first.md +20 -195
  264. package/assets/rules/spec-driven.md +35 -316
  265. package/assets/rules/status-report.md +5 -3
  266. package/assets/rules/styling-bem.md +20 -117
  267. package/assets/rules/task-flow-handover.md +24 -0
  268. package/assets/rules/task-flow-owner.md +34 -0
  269. package/assets/rules/task-flow-plan.md +38 -0
  270. package/assets/rules/task-flow.md +22 -289
  271. package/assets/rules/testing.md +32 -270
  272. package/assets/rules/turn-conduct.md +109 -111
  273. package/assets/rules/turn-entry.md +2 -2
  274. package/assets/rules/typescript-conventions.md +41 -147
  275. package/assets/samples/tasks/_template/plan.md +30 -6
  276. package/assets/samples/tasks/_template/progress.md +0 -1
  277. package/assets/skills/agent-kit-extend.md +25 -168
  278. package/assets/skills/agent-kit.md +27 -299
  279. package/assets/skills/write-a-skill.md +20 -106
  280. package/assets/task-flow/flow.js +188 -0
  281. package/assets/task-flow/flow.md +102 -0
  282. package/assets/task-flow/measure/agreement.mjs +24 -0
  283. package/assets/task-flow/measure/copy.mjs +22 -0
  284. package/assets/task-flow/measure/epic-of.mjs +50 -0
  285. package/assets/task-flow/measure/epic-text.mjs +35 -0
  286. package/assets/task-flow/measure/epic.mjs +114 -0
  287. package/assets/task-flow/measure/folder.mjs +16 -0
  288. package/assets/task-flow/measure/footprint.mjs +28 -0
  289. package/assets/task-flow/measure/grill.mjs +21 -0
  290. package/assets/task-flow/measure/host.mjs +8 -0
  291. package/assets/task-flow/measure/owner.mjs +20 -0
  292. package/assets/task-flow/measure/plan.mjs +27 -0
  293. package/assets/task-flow/measure/pr.mjs +20 -0
  294. package/assets/task-flow/measure/progress.mjs +50 -0
  295. package/assets/task-flow/measure/session.mjs +175 -0
  296. package/assets/task-flow/measure/task.mjs +23 -0
  297. package/assets/task-flow/measure/text.mjs +77 -0
  298. package/assets/task-flow/source/git.mjs +86 -0
  299. package/assets/task-flow/source/host.mjs +172 -0
  300. package/assets/task-flow/source/marks.mjs +56 -0
  301. package/assets/task-flow/source/owner.mjs +74 -0
  302. package/assets/task-flow/source/records.mjs +116 -0
  303. package/assets/task-flow/source/session.mjs +232 -0
  304. package/assets/task-flow/source/steps.mjs +28 -0
  305. package/assets/task-flow/source/tree.mjs +42 -0
  306. package/assets/templates/rule.md +2 -2
  307. package/bin/agent-kit.d.ts.map +1 -1
  308. package/bin/agent-kit.js +30 -0
  309. package/bin/agent-kit.js.map +1 -1
  310. package/lib/agent-checks.d.ts +55 -0
  311. package/lib/agent-checks.d.ts.map +1 -0
  312. package/lib/agent-checks.js +209 -0
  313. package/lib/agent-checks.js.map +1 -0
  314. package/lib/assets.d.ts.map +1 -1
  315. package/lib/assets.js +7 -2
  316. package/lib/assets.js.map +1 -1
  317. package/lib/cargo-prose.d.ts +2 -1
  318. package/lib/cargo-prose.d.ts.map +1 -1
  319. package/lib/cargo-prose.js.map +1 -1
  320. package/lib/cargo.d.ts +29 -0
  321. package/lib/cargo.d.ts.map +1 -1
  322. package/lib/cargo.js +27 -1
  323. package/lib/cargo.js.map +1 -1
  324. package/lib/cascade.d.ts.map +1 -1
  325. package/lib/cascade.js +3 -1
  326. package/lib/cascade.js.map +1 -1
  327. package/lib/commands.d.ts.map +1 -1
  328. package/lib/commands.js +78 -2
  329. package/lib/commands.js.map +1 -1
  330. package/lib/companion.d.ts +0 -5
  331. package/lib/companion.d.ts.map +1 -1
  332. package/lib/companion.js +1 -1
  333. package/lib/companion.js.map +1 -1
  334. package/lib/config.d.ts +18 -0
  335. package/lib/config.d.ts.map +1 -1
  336. package/lib/config.js +18 -1
  337. package/lib/config.js.map +1 -1
  338. package/lib/cost.d.ts +0 -8
  339. package/lib/cost.d.ts.map +1 -1
  340. package/lib/cost.js +4 -4
  341. package/lib/cost.js.map +1 -1
  342. package/lib/epic-window-send.d.ts +74 -0
  343. package/lib/epic-window-send.d.ts.map +1 -0
  344. package/lib/epic-window-send.js +166 -0
  345. package/lib/epic-window-send.js.map +1 -0
  346. package/lib/hooks-map.d.ts +4 -12
  347. package/lib/hooks-map.d.ts.map +1 -1
  348. package/lib/hooks-map.js +4 -27
  349. package/lib/hooks-map.js.map +1 -1
  350. package/lib/integrity.d.ts +3 -0
  351. package/lib/integrity.d.ts.map +1 -1
  352. package/lib/integrity.js +7 -0
  353. package/lib/integrity.js.map +1 -1
  354. package/lib/metric-lines.d.ts +2 -1
  355. package/lib/metric-lines.d.ts.map +1 -1
  356. package/lib/metric-lines.js +49 -1
  357. package/lib/metric-lines.js.map +1 -1
  358. package/lib/metric-send-mark.d.ts +6 -3
  359. package/lib/metric-send-mark.d.ts.map +1 -1
  360. package/lib/metric-send-mark.js +15 -5
  361. package/lib/metric-send-mark.js.map +1 -1
  362. package/lib/metric-send.d.ts +6 -2
  363. package/lib/metric-send.d.ts.map +1 -1
  364. package/lib/metric-send.js +47 -13
  365. package/lib/metric-send.js.map +1 -1
  366. package/lib/metrics.d.ts +17 -0
  367. package/lib/metrics.d.ts.map +1 -1
  368. package/lib/metrics.js +26 -15
  369. package/lib/metrics.js.map +1 -1
  370. package/lib/observations-cargo.d.ts +1 -5
  371. package/lib/observations-cargo.d.ts.map +1 -1
  372. package/lib/observations-cargo.js +2 -2
  373. package/lib/observations-cargo.js.map +1 -1
  374. package/lib/observations.d.ts +0 -2
  375. package/lib/observations.d.ts.map +1 -1
  376. package/lib/observations.js +3 -3
  377. package/lib/observations.js.map +1 -1
  378. package/lib/order.d.ts +0 -2
  379. package/lib/order.d.ts.map +1 -1
  380. package/lib/order.js +0 -4
  381. package/lib/order.js.map +1 -1
  382. package/lib/outcomes.d.ts +7 -9
  383. package/lib/outcomes.d.ts.map +1 -1
  384. package/lib/outcomes.js +8 -7
  385. package/lib/outcomes.js.map +1 -1
  386. package/lib/proposals.d.ts +0 -1
  387. package/lib/proposals.d.ts.map +1 -1
  388. package/lib/proposals.js +1 -1
  389. package/lib/proposals.js.map +1 -1
  390. package/lib/push-gate.d.ts +13 -0
  391. package/lib/push-gate.d.ts.map +1 -1
  392. package/lib/push-gate.js +11 -7
  393. package/lib/push-gate.js.map +1 -1
  394. package/lib/push-set-usefulness.d.ts +78 -0
  395. package/lib/push-set-usefulness.d.ts.map +1 -0
  396. package/lib/push-set-usefulness.js +225 -0
  397. package/lib/push-set-usefulness.js.map +1 -0
  398. package/lib/shipment.d.ts +2 -11
  399. package/lib/shipment.d.ts.map +1 -1
  400. package/lib/shipment.fixture.d.ts +0 -3
  401. package/lib/shipment.fixture.d.ts.map +1 -1
  402. package/lib/shipment.fixture.js +3 -3
  403. package/lib/shipment.fixture.js.map +1 -1
  404. package/lib/shipment.js +2 -2
  405. package/lib/shipment.js.map +1 -1
  406. package/lib/sync.d.ts +10 -0
  407. package/lib/sync.d.ts.map +1 -1
  408. package/lib/sync.js +14 -1
  409. package/lib/sync.js.map +1 -1
  410. package/lib/traits.d.ts +0 -3
  411. package/lib/traits.d.ts.map +1 -1
  412. package/lib/traits.js +2 -2
  413. package/lib/traits.js.map +1 -1
  414. package/lib/variants.d.ts +0 -1
  415. package/lib/variants.d.ts.map +1 -1
  416. package/lib/variants.js +1 -1
  417. package/lib/variants.js.map +1 -1
  418. package/lib/work-result.d.ts +43 -0
  419. package/lib/work-result.d.ts.map +1 -0
  420. package/lib/work-result.js +39 -0
  421. package/lib/work-result.js.map +1 -0
  422. package/package.json +1 -1
  423. package/assets/checks/signals/ui-kit.json +0 -11
  424. package/assets/hooks/claim-guard.sh +0 -212
  425. package/assets/hooks/grill-gate-ask.sh +0 -26
  426. package/assets/hooks/grill-gate-bypass.sh +0 -61
  427. package/assets/hooks/grill-gate-options.sh +0 -50
  428. package/assets/hooks/grill-gate.sh +0 -482
  429. package/assets/hooks/postmortem-guard.sh +0 -124
  430. package/assets/hooks/proposal-guard.sh +0 -154
  431. package/assets/hooks/stand-login-guard.sh +0 -107
  432. package/assets/hooks/turn-exit-epic.sh +0 -173
  433. package/assets/hooks/turn-exit-patterns.sh +0 -123
  434. package/assets/hooks/turn-exit-verdict.sh +0 -149
  435. package/assets/hooks/waiting-turn-guard.sh +0 -320
  436. package/assets/hooks/work-start-guard.sh +0 -175
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # rt-hook: PreToolUse Bash|mcp__webstorm__execute_terminal_command|mcp__webstorm__execute_tool
3
- # Requires: hooks/git-guard-delivery-merged.sh, hooks/git-guard-delivery-folder.sh,hooks/git-guard-delivery-epic.sh, hooks/git-guard-delivery-pipeline.sh, hooks/git-guard-tree-assignment.sh, hooks/git-guard-delivery-conflict.sh, hooks/profile-check.sh, hooks/deny-tail.sh, hooks/guard-note.sh
3
+ # Requires: hooks/git-guard-delivery-merged.sh, hooks/git-guard-delivery-task.sh, hooks/git-guard-delivery-folder.sh,hooks/git-guard-delivery-epic.sh, hooks/git-guard-delivery-pipeline.sh, hooks/git-guard-tree-assignment.sh, hooks/git-guard-delivery-conflict.sh, hooks/git-guard-delivery-rerun.sh, hooks/profile-check.sh, hooks/deny-tail.sh, hooks/guard-note.sh
4
4
  # Delivery guard. PreToolUse on creating a branch, on the push and on opening a PR.
5
5
  #
6
6
  # The delivery law demands three things nothing usually checks: an edit starts from a task visible
@@ -84,6 +84,8 @@ root="${CLAUDE_PROJECT_DIR:-$(git rev-parse --show-toplevel 2>/dev/null)}"
84
84
  # the `_default` suffix. Neither one nor the other — the hook lets through: an empty guard is
85
85
  # better than a guard that refuses at random.
86
86
  rt_hooks_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
87
+ # shellcheck disable=SC1091
88
+ [ -f "$rt_hooks_dir/facts.sh" ] && . "$rt_hooks_dir/facts.sh"
87
89
  for profile in "$rt_hooks_dir/../rt-kit/defaults/project.sh" "$rt_hooks_dir/../defaults/project.sh" "$root/.claude/rt-kit/defaults/project.sh" "$root/.claude/rt-kit/project.sh"; do
88
90
  # shellcheck disable=SC1090
89
91
  [ -f "$profile" ] && . "$profile" 2>/dev/null
@@ -101,6 +103,10 @@ title_re="${RT_TASK_TITLE_RE:-^\[[A-Za-z]+-[0-9]+\][[:space:]]+[^[:space:]]}"
101
103
  task_new="${RT_TASK_NEW_CMD:-npm run task:new}"
102
104
  board_check="${RT_BOARD_CHECK_CMD:-npm run check:board}"
103
105
  task_move="${RT_TASK_MOVE_CMD:-npm run task:move}"
106
+ # A refusal whose fix ends with a push names the run ahead before it: the push guard refuses a push
107
+ # while the heavy steps of the tree have no green mark, and a refusal naming a bare push would lead
108
+ # into that second refusal.
109
+ ahead_cmd="bash ${rt_hooks_dir#"$PWD"/}/git-guard-push-ahead.sh"
104
110
  # The first column of the work queue is the one a task leaves when it is taken. It has no default:
105
111
  # a tree names its columns in its own words, and an invented name would match nothing and would
106
112
  # silently switch the check off.
@@ -137,49 +143,65 @@ main_branch="${RT_MAIN_BRANCH:-main}"
137
143
  # requirement by itself.
138
144
  folder_skip_re='(^|#)[[:space:]]*Task-folder-skip:[[:space:]]*[^[:space:]<"'"'"'][^[:space:]"'"'"']{2,}'
139
145
 
140
- deny() {
141
- # A guard refusal is an observation: the guard that refuses more often than the rest says which
142
- # place of the delivery is done wrong time after time. The refusal text does not go there: it
143
- # holds the task numbers and the branch names of the tree.
144
-
145
- # The refusal tail: the two lawful moves and the form of the bypass as the second parameter.
146
- # shellcheck disable=SC1090
147
- [ -f "$rt_hooks_dir/deny-tail.sh" ] && . "$rt_hooks_dir/deny-tail.sh" 2>/dev/null
148
- reason="$1"
149
- command -v rt_deny_tail >/dev/null 2>&1 && reason="$1 $(rt_deny_tail "$2")"
150
- # A neighbour's conflict travels inside the refusal: the guard says one thing per call, and a
151
- # second JSON document next to the first is read as plain text — that is, as no refusal at all.
152
- [ -n "${rt_delivery_neighbour_note:-}" ] && reason="${reason}
153
-
154
- ${rt_delivery_neighbour_note}"
155
- rt_delivery_said=1
156
-
157
- jq -n --arg r "$reason" '{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:$r}}' 2>/dev/null \
158
- || printf '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"The delivery guard."}}\n'
159
- exit 0
146
+ # The facts of the state, as the decision table names them. What the hook did not find wrong keeps its
147
+ # lawful value from `delivery_lawful`; a check that finds a miss records the fact with the value of
148
+ # the miss. The facts the table reads apart from the miss — whether the task belongs to an epic,
149
+ # whether the folder lies in the branch — are recorded by the check that learns them.
150
+ delivery_lawful='{"own_pr_conflicting":"no","branch_is_main":"no","branch_is_task_branch":"yes","branch_has_main_tip":"yes","task_exists":"yes","task_open":"yes","task_on_board":"yes","task_assigned":"yes","task_title_numbered":"yes","task_column_taken":"yes","copy_assignment":"ok","assigned_epic_open":"yes","origin_main_fresh":"yes","worktree_email_declared":"yes","commits_signed_declared":"yes","archive_gained":"yes","draft_spec_merged":"yes","epic_folders_left":"no","pr_tip_run":"green","pr_conflicting":"no","pr_reviewed":"yes","task_in_epic":"no","task_folder_in_branch":"no","branch_pr_merged":"no","epic_branch":"one","epic_has_main_tip":"yes","branch_has_epic_tip":"yes","steps_remeasured":"yes"}'
151
+ delivery_facts='{}'
152
+ # The class of the call when a check finds the miss in the call itself — the title, the base, the
153
+ # body: the table keeps such a miss as the action, not as a fact. The first class found stands.
154
+ delivery_class=''
155
+
156
+ fact() {
157
+ delivery_facts="$(printf '%s' "$delivery_facts" | jq -c --arg k "$1" --arg v "$2" '. + {($k): $v}' 2>/dev/null || printf '%s' "$delivery_facts")"
160
158
  }
161
159
 
162
- # Conditions that did not come together pile up and are named all at once: a refusal on the first
163
- # miss makes them fixed one at a time — the base, a repeat, the title, another repeat, the task —
164
- # although everything that did not come together is known already on the first round. Readiness for
165
- # delivery is one state, and it is named whole.
160
+ # Misses pile up and are named at once: readiness for delivery is one state, named whole.
166
161
  faults=''
167
162
 
168
- fault() {
163
+ # unmet <fact> <value> <words> — a miss of the state; `unmet_class <action> <words>` — of the call
164
+ unmet() {
165
+ fact "$1" "$2"
169
166
  faults="${faults}${faults:+
170
- }— $1"
167
+ }— $3"
168
+ }
169
+ unmet_class() {
170
+ [ -n "$delivery_class" ] || delivery_class="$1"
171
+ faults="${faults}${faults:+
172
+ }— $2"
173
+ }
174
+
175
+ # refuse <action> [params] [bypass] — the decision and its text come from the table.
176
+ refuse() {
177
+ _sid="$(printf '%s' "$input" | jq -r '.session_id // "nosession"' 2>/dev/null)"
178
+ _record="$(rt_fact_transcript "$input")"
179
+ problems=''
180
+ # shellcheck disable=SC1091
181
+ [ -f "$rt_hooks_dir/facts-docs.sh" ] && . "$rt_hooks_dir/facts-docs.sh" 2>/dev/null
182
+ _pair=yes
183
+ command -v rt_fact_doc_problems >/dev/null 2>&1 && rt_fact_doc_problems 'git commit -m wip' && [ -n "$problems" ] && _pair=no
184
+ _facts="$(jq -cn --argjson lawful "$delivery_lawful" --argjson found "$delivery_facts" \
185
+ --arg r "$(rt_fact_rule_loaded "${RT_GUARD_RULE:-git-workflow}" "$_sid")" --arg d "$_pair" \
186
+ --arg e "$(rt_fact_exam_holds "$_record")" --arg w "$(rt_fact_window_over_stop "$_sid" "$_record")" \
187
+ '$lawful + {rule_loaded:$r, doc_pair:$d, exam:$e, window_over_stop:$w} + $found')"
188
+ _params="$(jq -cn --argjson own "${2:-"{}"}" --arg f "$faults" --arg p "$problems" --arg b "${3:-}" \
189
+ --arg a "${rt_delivery_neighbour_note:-}" --arg h "${ahead_cmd:-bash git-guard-push-ahead.sh}" \
190
+ '{faults:$f, problems:$p, bypass:$b, after:$a, ahead_cmd:$h} + $own')"
191
+ rt_delivery_said=1
192
+ # shellcheck disable=SC1091
193
+ . "$rt_hooks_dir/decide.sh" 2>/dev/null
194
+ command -v rt_decide >/dev/null 2>&1 || exit 0
195
+ # A class with no row for these misses is decided by the plain action named after «>».
196
+ rt_decide git-guard-delivery.sh "$1${delivery_base:+>$delivery_base}" "$_facts" "$_params"
197
+ exit 0
171
198
  }
172
199
 
173
- # The conditions about the task folder are moved out into a neighbouring file: the folder has a
174
- # subject of its own, a bypass of its own and a record of its own in the archive, and together with
175
- # the command parsing and the work queue they outgrew the length limit. It is sourced after `deny`
176
- # and `fault` — both are called from inside it.
200
+ # The conditions about the task folder live in a neighbouring file, sourced after `refuse`.
177
201
  # shellcheck disable=SC1090
178
202
  [ -f "$rt_hooks_dir/git-guard-delivery-folder.sh" ] && . "$rt_hooks_dir/git-guard-delivery-folder.sh" 2>/dev/null
179
203
 
180
- # The epic of a task: the same technique as with the folder. It is sourced before the branch block —
181
- # there the base of a new branch is judged, and with an epic it is judged against the branch of the
182
- # epic. No helper — the epic is not judged, and the base is asked against the main branch as before.
204
+ # The epic of a task: a new branch's base is judged against the epic branch, without it — main.
183
205
  # shellcheck disable=SC1090
184
206
  [ -f "$rt_hooks_dir/git-guard-delivery-epic.sh" ] && . "$rt_hooks_dir/git-guard-delivery-epic.sh" 2>/dev/null
185
207
 
@@ -188,7 +210,7 @@ fault() {
188
210
  [ -f "$rt_hooks_dir/git-guard-delivery-tree.sh" ] && . "$rt_hooks_dir/git-guard-delivery-tree.sh" 2>/dev/null
189
211
  command -v rt_delivery_branch_form_ok >/dev/null 2>&1 || rt_delivery_branch_form_ok() { rt_task_branch_ok "$1"; }
190
212
  command -v rt_delivery_task_state >/dev/null 2>&1 || rt_delivery_task_state() { (cd "$root" && rt_task_state "$1"); }
191
- command -v rt_delivery_current_branch >/dev/null 2>&1 || rt_delivery_current_branch() { git branch --show-current 2>/dev/null; }
213
+ command -v rt_delivery_current_branch >/dev/null 2>&1 || rt_delivery_current_branch() { rt_fact_branch; }
192
214
 
193
215
  # A conflicting PR of one's own: the same technique as with the folder and the signature. The helper
194
216
  # is called before all the tiers below and judges not the readiness of this work but the right to
@@ -199,50 +221,19 @@ command -v rt_delivery_current_branch >/dev/null 2>&1 || rt_delivery_current_bra
199
221
  command -v rt_delivery_note_out >/dev/null 2>&1 && trap rt_delivery_note_out EXIT
200
222
  command -v rt_delivery_conflict >/dev/null 2>&1 && rt_delivery_conflict
201
223
 
202
- # The refusal on what has piled up. Empty — the calling side goes on.
203
- deny_faults() {
224
+ # The refusal on what has piled up, for the action of the call: the class a check found in the call
225
+ # itself stands first. Empty — the calling side goes on.
226
+ refuse_unmet() {
204
227
  [ -z "$faults" ] && return 0
205
- deny "BLOCKED: the work is not ready for delivery. Everything unmet is named whole — so that it
206
- is fixed in one session, not one miss per round:
207
-
208
- ${faults}"
228
+ delivery_base="$1"
229
+ refuse "${delivery_class:-$1}"
209
230
  }
210
231
 
211
- check_task() {
212
- number="$1"
213
- where="$2"
214
- # The column is asked about where it should already have been moved. At branch creation it has
215
- # not been moved yet — the work pattern moves the column with the next command — and the
216
- # requirement here would refuse the very first command of the work together with the one that
217
- # lifts it.
218
- judge_column="${3:-no}"
219
- rt_needs rt_task_state git-guard-delivery || return 0
220
- state="$(rt_delivery_task_state "$number" 2>/dev/null)" || return 0
221
- [ -z "$state" ] && return 0
222
-
223
- printf '%s' "$state" | jq -e '.exists' >/dev/null 2>&1 \
224
- || fault "${where} refers to the task #${number}, which does not exist. Check the number or create the task — ${task_new}."
225
- printf '%s' "$state" | jq -e '.open' >/dev/null 2>&1 \
226
- || fault "the task #${number} is closed, and a task has one branch. Work behind a closed task is created as a new task — ${task_new}."
227
- printf '%s' "$state" | jq -e '.onBoard' >/dev/null 2>&1 \
228
- || fault "the task #${number} is not in the work queue — the edit behind it is invisible. The queue is not bound to the repository and does not take a task by itself; add it and check — ${board_check}."
229
- printf '%s' "$state" | jq -e '.assigned' >/dev/null 2>&1 \
230
- || fault "the task #${number} has no assignee — by the work queue there is no seeing who took it. Set the assignee${task_bot:+: }${task_bot}."
231
- printf '%s' "$state" | jq -e '.numbered' >/dev/null 2>&1 \
232
- || fault "the title of the task #${number} does not start with its number — one work would have to be recognised by the text of the title. Fix the title and check the queue — ${board_check}."
233
-
234
- # The task column. The work queue answer has been giving it for a long time, and nobody read it:
235
- # the column was judged only by the queue audit, that is, already after the PR is opened. A task
236
- # left in the first column reads through the queue as not taken — while the work is done and put
237
- # out.
238
- if [ -n "$backlog_column" ] && [ "$judge_column" = "yes" ]; then
239
- column="$(printf '%s' "$state" | jq -r '.status // empty' 2>/dev/null)"
240
- [ "$column" = "$backlog_column" ] \
241
- && fault "the task #${number} stands in the column «${column}» — by the work queue it is not taken, though the work on it is going. Move it: ${task_move}."
242
- fi
243
-
244
- return 0
245
- }
232
+ # The task checks live in a helper next door — `git-guard-delivery-task.sh`. No helper — the task is
233
+ # not judged, and the work goes on.
234
+ # shellcheck disable=SC1090
235
+ [ -f "$rt_hooks_dir/git-guard-delivery-task.sh" ] && . "$rt_hooks_dir/git-guard-delivery-task.sh" 2>/dev/null
236
+ command -v check_task >/dev/null 2>&1 || check_task() { :; }
246
237
 
247
238
  # The signature of a new branch and of a push live in one helper, so it is sourced before both.
248
239
  # shellcheck disable=SC1090
@@ -261,15 +252,20 @@ if [ -n "$branch_arg" ]; then
261
252
  # not a deliberate task-less branch. Caught before the first commit.
262
253
  # The number is extracted by the profile: with its own regex the branch `feat/88-slug` gave no
263
254
  # number at all.
255
+ #
256
+ # The name is one fault among the others, not a refusal of its own: refused alone, a fixed name
257
+ # met the task checks only on the second call, and the first refusal named a branch the second
258
+ # one refused again.
264
259
  number_arg="$(rt_task_branch_number "$branch_arg")"
265
260
  if [ -n "$number_arg" ]; then
266
261
  rt_delivery_branch_form_ok "$branch_arg" \
267
- || deny "BLOCKED: the branch name «${branch_arg}» is not of the form accepted here. The branch number is the same as the number of the task and of the title of the merge request."
262
+ || unmet_class branch_create_bad_name "the branch name «${branch_arg}» is not of the form accepted here. The branch number is the same as the number of the task and of the title of the merge request."
268
263
  state=''
269
264
  check_task "$number_arg" "the branch «${branch_arg}»"
270
265
  # The epic of the task: with one, the base is judged against the branch of the epic, and the
271
266
  # freshness of the main branch moves there too — see `git-guard-delivery-epic.sh`.
272
267
  epic_arg="$(printf '%s' "$state" | jq -r '.epic // empty' 2>/dev/null)"
268
+ [ -n "$epic_arg" ] && fact task_in_epic yes
273
269
 
274
270
  # The delivery conditions already known here are checked here. After the work is done, the
275
271
  # base is fixed by a merge with conflict resolution, and the commit signature by rewriting
@@ -280,30 +276,29 @@ if [ -n "$branch_arg" ]; then
280
276
  # base fresh — `git checkout -b <branch> origin/<main>` — would be forbidden.
281
277
  base_arg="$(printf '%s' "$cmd" | sed -nE 's/.*git[[:space:]]+(checkout([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-b|switch([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-c)[[:space:]]+[^[:space:];&|]+[[:space:]]+([^[:space:];&|-][^[:space:];&|]*).*/\4/p' | head -1)"
282
278
  base_ref="${base_arg:-HEAD}"
283
- command -v rt_assignment_fault >/dev/null 2>&1 && rt_assignment_fault "$epic_arg" "the branch «${branch_arg}»"
279
+ command -v rt_assignment_unmet >/dev/null 2>&1 && rt_assignment_unmet "$epic_arg" "the branch «${branch_arg}»"
284
280
  if [ -n "$epic_arg" ] && command -v rt_epic_base >/dev/null 2>&1; then
285
281
  rt_epic_base "$epic_arg" "$base_ref" "$branch_arg"
286
282
  elif git rev-parse --verify --quiet "refs/remotes/origin/${main_branch}" >/dev/null 2>&1 \
287
283
  && git rev-parse --verify --quiet "$base_ref" >/dev/null 2>&1 \
288
284
  && ! git merge-base --is-ancestor "origin/${main_branch}" "$base_ref" 2>/dev/null; then
289
285
  behind="$(git rev-list --count "${base_ref}..origin/${main_branch}" 2>/dev/null)"
290
- fault "the branch will grow from a base that does not carry the tip of «${main_branch}» — it has moved ahead by ${behind:-several} commits. Take a fresh base: git fetch origin && git checkout -b ${branch_arg} origin/${main_branch}."
286
+ unmet_class branch_create_stale_base "the branch will grow from a base that does not carry the tip of «${main_branch}» — it has moved ahead by ${behind:-several} commits. Take a fresh base: git fetch origin && git checkout -b ${branch_arg} origin/${main_branch}."
291
287
  fi
292
288
 
293
289
  # The second tier: the local reference to the main branch could itself have gone stale, and
294
290
  # then the silence of the first tier means "the base is not older than my reference", not
295
291
  # "the base is fresh". No answer — the tier stays silent, as everywhere the guard goes to
296
292
  # the network.
297
- remote_head="$(GIT_HTTP_LOW_SPEED_LIMIT=1000 GIT_HTTP_LOW_SPEED_TIME=5 GIT_TERMINAL_PROMPT=0 \
298
- git ls-remote origin "refs/heads/${main_branch}" 2>/dev/null | cut -f1)"
293
+ remote_head="$(rt_fact_remote_head "$main_branch")"
299
294
  local_head="$(git rev-parse --verify --quiet "refs/remotes/origin/${main_branch}" 2>/dev/null)"
300
295
  if [ -n "$remote_head" ] && [ -n "$local_head" ] && [ "$remote_head" != "$local_head" ]; then
301
- fault "your ref origin/${main_branch} lags behind the remote one — ${local_head:0:8} against ${remote_head:0:8}. The branch will grow from yesterday tree, and the owner sees that at the opening of the request. Pull and repeat: git fetch origin."
296
+ unmet origin_main_fresh no "your ref origin/${main_branch} lags behind the remote one — ${local_head:0:8} against ${remote_head:0:8}. The branch will grow from yesterday tree, and the owner sees that at the opening of the request. Pull and repeat: git fetch origin."
302
297
  fi
303
298
 
304
299
  command -v rt_delivery_branch_signature >/dev/null 2>&1 && rt_delivery_branch_signature
305
300
 
306
- deny_faults
301
+ refuse_unmet branch_create
307
302
  fi
308
303
  # A branch without a number is lawful and lives locally: no PR opens from it.
309
304
  exit 0
@@ -338,7 +333,7 @@ if printf '%s' "$cmd" | grep -qE "${RT_CMD_BOUND}(gh[[:space:]]+pr[[:space:]]+me
338
333
  # The run on the tip goes first: the folder tier below leaves the guard early on many paths.
339
334
  [ -f "$rt_hooks_dir/git-guard-delivery-merge.sh" ] && . "$rt_hooks_dir/git-guard-delivery-merge.sh" 2>/dev/null
340
335
  command -v rt_delivery_merge_run >/dev/null 2>&1 && rt_delivery_merge_run
341
- deny_faults
336
+ refuse_unmet pr_merge
342
337
  rt_delivery_merge_folder
343
338
  fi
344
339
 
@@ -354,8 +349,16 @@ branch="$(rt_delivery_current_branch)"
354
349
 
355
350
  # A local branch without a number is lawful, and a PR from it is not: an edit that travels to the
356
351
  # main branch starts from a task. This is the only place where a task-less branch runs into a wall.
357
- rt_delivery_branch_form_ok "$branch" \
358
- || deny "BLOCKED: a request from the branch «${branch}», with no task standing behind it. An edit begins with a task visible in the work queue: create it — ${task_new} — and move the work into a branch with its number."
352
+ #
353
+ # The move named here takes work, and the assignment of the copy judges every such move: with no
354
+ # assignment the creation of the task is refused in its turn. So the assignment is asked here too,
355
+ # and what it lacks is named before the creation.
356
+ if ! rt_delivery_branch_form_ok "$branch"; then
357
+ command -v rt_assignment_unmet >/dev/null 2>&1 && rt_assignment_unmet '' 'a new task'
358
+ fact branch_is_task_branch no
359
+ refuse pr_create "$(jq -cn --arg b "$branch" --arg t "$task_new" --arg f "${faults:+ Before the creation:
360
+ ${faults}}" '{branch_name:$b, task_new:$t, before:$f}')"
361
+ fi
359
362
 
360
363
  number="$(rt_task_branch_number "$branch")"
361
364
 
@@ -365,6 +368,14 @@ number="$(rt_task_branch_number "$branch")"
365
368
  state=''
366
369
  check_task "$number" "the request from the branch «${branch}»" yes
367
370
  epic_pull="$(printf '%s' "$state" | jq -r '.epic // empty' 2>/dev/null)"
371
+ [ -n "$epic_pull" ] && fact task_in_epic yes
372
+ # A fault that names the creation of a task or the move of its column names a move that takes work,
373
+ # and the assignment of the copy judges every such move. Its lack is named in the same list.
374
+ case "$faults" in
375
+ *"$task_new"* | *"$task_move"*)
376
+ command -v rt_assignment_unmet >/dev/null 2>&1 && rt_assignment_unmet '' 'the work the fixes above take'
377
+ ;;
378
+ esac
368
379
  # The branch of an epic itself: its request goes into the main branch, and it opens only when the
369
380
  # folders of all its tasks are taken apart.
370
381
  command -v rt_epic_own_pull >/dev/null 2>&1 && rt_epic_own_pull "$state"
@@ -384,7 +395,7 @@ fi
384
395
 
385
396
  if [ -n "$title" ]; then
386
397
  printf '%s' "$title" | grep -qE "$title_re" \
387
- || fault "the title of the request does not start with the number of the task. In the list of requests the body is invisible, and the line of the link lives exactly there — without the number in the title the PR cannot be matched to the task."
398
+ || unmet_class pr_create_bad_title "the title of the request does not start with the number of the task. In the list of requests the body is invisible, and the line of the link lives exactly there — without the number in the title the PR cannot be matched to the task."
388
399
  # The number is extracted from the part of the title the form itself recognised, not by a second
389
400
  # regex next to it. The own regex knows only the package form: a tree that paved the form over
390
401
  # with its own got an empty number — and the check of the title number against the branch number
@@ -393,7 +404,7 @@ if [ -n "$title" ]; then
393
404
  title_number="$(printf '%s' "$title_matched" | grep -oE '[A-Za-z]+-[0-9]+' | head -1 | sed -E 's/^[A-Za-z]+-//')"
394
405
  if [ -n "$number" ] && [ -n "$title_number" ]; then
395
406
  [ "$title_number" = "$number" ] \
396
- || fault "the title of the request carries the number ${title_number}, the branch — ${number}. The task, the branch and the PR carry one and the same number."
407
+ || unmet_class pr_create_wrong_number "the title of the request carries the number ${title_number}, the branch — ${number}. The task, the branch and the PR carry one and the same number."
397
408
  fi
398
409
  fi
399
410
 
@@ -412,13 +423,12 @@ if [ -n "$epic_pull" ] && command -v rt_epic_pull_base >/dev/null 2>&1; then
412
423
  elif git rev-parse --verify --quiet "refs/remotes/origin/${main_branch}" >/dev/null 2>&1 \
413
424
  && ! git merge-base --is-ancestor "origin/${main_branch}" HEAD 2>/dev/null; then
414
425
  behind="$(git rev-list --count "HEAD..origin/${main_branch}" 2>/dev/null)"
415
- fault "«${main_branch}» has moved ahead by ${behind:-several} commits and is not merged into the branch. A PR from a diverged branch shows the reviewer the edit mixed with someone else, and the checks on it run from a stale base. Merge it in and repeat: git fetch origin && git merge origin/${main_branch} — the order and the resolving of the conflict are in the pattern git-workflow-merge."
426
+ unmet branch_has_main_tip no "«${main_branch}» has moved ahead by ${behind:-several} commits and is not merged into the branch. A PR from a diverged branch shows the reviewer the edit mixed with someone else, and the checks on it run from a stale base. Merge it in and repeat: git fetch origin && git merge origin/${main_branch} — the order and the resolving of the conflict are in the pattern git-workflow-merge."
416
427
  fi
417
428
 
418
429
  # The second tier: the local reference could itself have gone stale. No answer — the tier stays
419
430
  # silent.
420
- remote_main="$(GIT_HTTP_LOW_SPEED_LIMIT=1000 GIT_HTTP_LOW_SPEED_TIME=5 GIT_TERMINAL_PROMPT=0 \
421
- git ls-remote origin "refs/heads/${main_branch}" 2>/dev/null | cut -f1)"
431
+ remote_main="$(rt_fact_remote_head "$main_branch")"
422
432
  local_main="$(git rev-parse --verify --quiet "refs/remotes/origin/${main_branch}" 2>/dev/null)"
423
433
  if [ -n "$remote_main" ] && [ -n "$local_main" ] && [ "$remote_main" != "$local_main" ]; then
424
434
  # The age of the reference is what the executor does not see at all, and it is exactly what
@@ -430,7 +440,7 @@ if [ -n "$remote_main" ] && [ -n "$local_main" ] && [ "$remote_main" != "$local_
430
440
  if [ -n "$fetched_at" ]; then
431
441
  age=" The last git fetch was $(( ( $(date +%s) - fetched_at ) / 60 )) min ago."
432
442
  fi
433
- fault "your ref origin/${main_branch} lags behind the remote one — ${local_main:0:8} against ${remote_main:0:8}.${age} The guard compares the branch with what lies in the tree, so silence of the first tier means «the ref is not older than the branch», not «the main branch is merged in». Merge it in and repeat: git fetch origin && git merge origin/${main_branch}."
443
+ unmet origin_main_fresh no "your ref origin/${main_branch} lags behind the remote one — ${local_main:0:8} against ${remote_main:0:8}.${age} The guard compares the branch with what lies in the tree, so silence of the first tier means «the ref is not older than the branch», not «the main branch is merged in». Merge it in and repeat: git fetch origin && git merge origin/${main_branch}."
434
444
  fi
435
445
 
436
446
  # The identity of the call. The hosting client holds two accounts — the logged-in one and the one
@@ -454,7 +464,7 @@ command -v rt_pull_token_login >/dev/null 2>&1 && token_login="$(rt_pull_token_l
454
464
 
455
465
  if [ -n "$token_login" ]; then
456
466
  if [ -n "$pull_reviewer" ] && [ "$token_login" = "$pull_reviewer" ]; then
457
- fault "the request would be opened by the account «${token_login}», and the same one is named as its reviewer. The hosting accepts such a review request and silently does not create it, and the author of a request cannot be changed — it is fixed only by reopening. Open it by another account${pull_token_hint:+, substituting the token: ${pull_token_hint} …}, or name another reviewer."
467
+ unmet_class pr_create_self_review "the request would be opened by the account «${token_login}», and the same one is named as its reviewer. The hosting accepts such a review request and silently does not create it, and the author of a request cannot be changed — it is fixed only by reopening. Open it by another account${pull_token_hint:+, substituting the token: ${pull_token_hint} …}, or name another reviewer."
458
468
  elif [ -n "$task_bot" ] && [ "$token_login" != "$task_bot" ]; then
459
469
  # Not a refusal: the reviewer is somebody else, and the review will be created. But silence
460
470
  # about a foreign account is indistinguishable from a check that did not fire at all.
@@ -464,7 +474,7 @@ elif [ -n "$pull_token_var" ] \
464
474
  && ! printf '%s' "$cmd" | grep -qE "(^|[;&|(]|&&|\|\||[[:space:]])${pull_token_var}="; then
465
475
  # There is nothing to learn the author by — no helper, or an empty answer from it. Then the only
466
476
  # lawful call is the one that names the account in its own text.
467
- fault "who will open the request cannot be learned: the hosting was not asked, and the command carries no substitution of «${pull_token_var}». Opened by the logged-in account, the request may come out from the very person named as its reviewer, and that is fixed only by reopening.${pull_token_hint:+ Substitute the token: ${pull_token_hint} …}"
477
+ unmet_class pr_create_self_review "who will open the request cannot be learned: the hosting was not asked, and the command carries no substitution of «${pull_token_var}». Opened by the logged-in account, the request may come out from the very person named as its reviewer, and that is fixed only by reopening.${pull_token_hint:+ Substitute the token: ${pull_token_hint} …}"
468
478
  fi
469
479
 
470
480
  # The body of the request: the section about the remaining step and the line that closes the task.
@@ -473,15 +483,16 @@ fi
473
483
  [ -f "$rt_hooks_dir/git-guard-delivery-body.sh" ] && . "$rt_hooks_dir/git-guard-delivery-body.sh" 2>/dev/null
474
484
  command -v rt_delivery_pull_body >/dev/null 2>&1 && rt_delivery_pull_body
475
485
 
476
- # The task folder is taken apart before the PR opens, not after the approval: the owner merges as
477
- # soon as he sees green, and no room is left for a closing commit — three times in a row the folder
478
- # travelled into the main branch without being taken apart. After the cleanup the progress guard
479
- # takes the plan from the branch history.
486
+ # The task folder is taken apart before the PR opens: the owner merges on green, with no room left
487
+ # for a closing commit. After the cleanup the progress guard takes the plan from the branch history.
480
488
  rt_delivery_open_folder
489
+ # Every done step is measured once more: a mark written past the engine stops here.
490
+ # shellcheck disable=SC1090
491
+ [ -f "$rt_hooks_dir/git-guard-delivery-rerun.sh" ] && . "$rt_hooks_dir/git-guard-delivery-rerun.sh" 2>/dev/null
492
+ command -v rt_delivery_rerun >/dev/null 2>&1 && rt_delivery_rerun
481
493
 
482
- # Everything that did not come together is named here, all at once: up to this line the conditions
483
- # were being collected, each of which used to refuse the call on its own.
484
- deny_faults
494
+ # Everything that did not come together is named here at once, not one condition per call.
495
+ refuse_unmet pr_create
485
496
  command -v rt_delivery_open_handover >/dev/null 2>&1 && rt_delivery_open_handover "$cmd" "$branch"
486
497
 
487
498
  exit 0
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # rt-hook: PreToolUse Bash|mcp__webstorm__execute_terminal_command|mcp__webstorm__execute_tool
3
- # Requires: hooks/deny-tail.sh, hooks/guard-note.sh
3
+ # Requires: checks/decide.mjs, hooks/decide.sh, hooks/facts.sh, hooks/deny-tail.sh, hooks/guard-note.sh
4
4
  # Guard of the working tree. PreToolUse on a git command that throws uncommitted edits away.
5
5
  #
6
6
  # `git reset --hard`, `git checkout -- <path>`, `git restore <path>` and `git clean -f` erase what
@@ -125,21 +125,11 @@ files="$(printf '%s\n' "$changed" | sed 's/^...//' | head -20 | sed 's/^/ /')
125
125
  … and $((count - 20)) more"
126
126
  what="$(printf '%s\n' "$hits" | sort -u | paste -sd ',' - | sed 's/,/, /g')"
127
127
 
128
- reason="BLOCKED by git-guard-discard: «git ${what}» throws away uncommitted edits, and the working tree holds ${count} of them:
129
- ${files}
130
-
131
- Git keeps no object of an uncommitted edit: after this call there is nothing to restore it from. In one working copy two sessions work at once, so these files may be a neighbour's as well as your own. To drop a commit and keep the edits, take \`git reset --soft\`; to keep them aside, commit or stash them by name first. \`--hard\` is taken only when the goal is to throw the edits away, and then they are named before the call — the rule git-workflow."
132
-
133
- # shellcheck disable=SC1090
134
- [ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" ] \
135
- && . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" 2>/dev/null
136
- command -v rt_deny_tail >/dev/null 2>&1 || rt_deny_tail() { :; }
137
- deny_tail_text="$(rt_deny_tail 'the comment `# discard: <reason>` in the same command, the erased files named in the reason')"
138
- [ -n "$deny_tail_text" ] && reason="${reason}
139
-
140
- ${deny_tail_text}"
141
-
142
- jq -n --arg r "$reason" '{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:$r}}' 2>/dev/null \
143
- || printf '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"A discarding git command on a dirty working tree is refused. Commit or name the edits first."}}\n'
144
-
128
+ # The decision and its text come from the decision table; the hook names the state and the files.
129
+ params="$(jq -cn --arg w "$what" --arg c "$count" --arg f "$files" \
130
+ --arg b 'the comment `# discard: <reason>` in the same command, the erased files named in the reason' \
131
+ '{what:$w, count:$c, files:$f, bypass:$b}')"
132
+ # shellcheck disable=SC1091
133
+ . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/decide.sh" 2>/dev/null
134
+ command -v rt_decide >/dev/null 2>&1 && rt_decide git-guard-discard.sh discard '{"tree_dirty":"yes"}' "$params"
145
135
  exit 0
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # rt-hook: PreToolUse Bash|mcp__webstorm__execute_terminal_command|mcp__webstorm__execute_tool
3
- # Requires: hooks/deny-tail.sh, hooks/guard-note.sh
3
+ # Requires: checks/decide.mjs, hooks/decide.sh, hooks/facts.sh, hooks/deny-tail.sh, hooks/guard-note.sh
4
4
  # Guard of the main branch. PreToolUse on a commit call.
5
5
  #
6
6
  # A commit into the main branch bypasses the branch, the PR and the review, while delivery is built
@@ -97,7 +97,9 @@ cd "$workdir" 2>/dev/null || exit 0
97
97
 
98
98
  git rev-parse --is-inside-work-tree >/dev/null 2>&1 || exit 0
99
99
 
100
- branch="$(git branch --show-current 2>/dev/null)"
100
+ # shellcheck disable=SC1091
101
+ . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/facts.sh" 2>/dev/null
102
+ branch="$(rt_fact_branch)"
101
103
  [ -z "$branch" ] && exit 0 # a detached HEAD is not about this case
102
104
 
103
105
  # The name is read from the tree's own profile — the one the commit runs in — as the other delivery
@@ -113,7 +115,7 @@ declared="$(
113
115
  )"
114
116
 
115
117
  default="$declared"
116
- [ -z "$default" ] && default="$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null | sed 's#^origin/##')"
118
+ [ -z "$default" ] && default="$(rt_fact_default_branch)"
117
119
  if [ -z "$default" ]; then
118
120
  for candidate in main master; do
119
121
  if git show-ref --verify --quiet "refs/remotes/origin/$candidate" 2>/dev/null; then
@@ -126,20 +128,12 @@ fi
126
128
 
127
129
  [ "$branch" = "$default" ] || exit 0
128
130
 
129
- reason="Refused: a commit straight into «${default}». Work travels through a branch and a PR — the rule git-workflow. Create a branch by a separate call and commit into it: the staged changes stay in place. If a commit into ${default} really is needed — ask the owner, do not bypass it yourself."
130
-
131
- # The shared deny tail: the two lawful moves and the lawful form of bypass, if the refusal has one.
132
- # The file may not be laid out — then there is no tail, and the refusal reason stays as it is.
133
- # shellcheck disable=SC1090
134
- [ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" ] \
135
- && . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" 2>/dev/null
136
- command -v rt_deny_tail >/dev/null 2>&1 || rt_deny_tail() { :; }
137
- deny_tail_text="$(rt_deny_tail "")"
138
- [ -n "$deny_tail_text" ] && reason="${reason}
139
-
140
- ${deny_tail_text}"
141
-
142
- jq -n --arg r "$reason" '{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:$r}}' 2>/dev/null \
143
- || printf '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"A commit into the main branch is refused. Create a branch."}}\n'
144
-
131
+ # The decision and its text come from the decision table. Whether the rule of delivery is loaded is
132
+ # a fact of the state as the table writes it; an unloaded rule is refused first by the rules gate.
133
+ sid="$(printf '%s' "$RT_HOOK_INPUT" | jq -r '.session_id // "nosession"' 2>/dev/null)"
134
+ facts="$(jq -cn --arg r "$(rt_fact_rule_loaded git-workflow "$sid")" '{rule_loaded:$r, branch_is_main:"yes"}')"
135
+ params="$(jq -cn --arg m "$default" '{main_branch:$m}')"
136
+ # shellcheck disable=SC1091
137
+ . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/decide.sh" 2>/dev/null
138
+ command -v rt_decide >/dev/null 2>&1 && rt_decide git-guard-main.sh "?commit" "$facts" "$params"
145
139
  exit 0
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # rt-hook: PreToolUse Bash|mcp__webstorm__execute_terminal_command|mcp__webstorm__execute_tool
3
- # Requires: hooks/deny-tail.sh, hooks/guard-note.sh
3
+ # Requires: checks/decide.mjs, hooks/decide.sh, hooks/facts.sh, hooks/facts-docs.sh, hooks/git-guard-delivery-signature.sh, hooks/deny-tail.sh, hooks/guard-note.sh
4
4
  # Guard of the commit hooks. PreToolUse on a git commit or push that skips the tree's git hooks.
5
5
  #
6
6
  # The commit hooks check the message, the formatting and the document pair; the push gate does not
@@ -124,20 +124,60 @@ hits="$(printf '%s\n' "$cmd" | awk -v sq="'" '
124
124
 
125
125
  what="$(printf '%s\n' "$hits" | sed 's/^/git /' | paste -sd ',' - | sed 's/,/, /g')"
126
126
 
127
- reason="BLOCKED by git-guard-no-verify: «${what}» skips the git hooks of the tree.
128
-
129
- The commit hooks check the message, the formatting and the document pair, and the push gate does not read commit messages: a commit made past the hooks reaches the host unchecked. An amend goes through the same hooks as a commit, a one-letter typo included. Run the same command without the skip; when a hook refuses, fix what it names. A commit already made past the hooks is redone without the skip before the push — the rule git-workflow."
130
-
131
- # shellcheck disable=SC1090
132
- [ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" ] \
133
- && . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" 2>/dev/null
134
- command -v rt_deny_tail >/dev/null 2>&1 || rt_deny_tail() { :; }
135
- deny_tail_text="$(rt_deny_tail)"
136
- [ -n "$deny_tail_text" ] && reason="${reason}
137
-
138
- ${deny_tail_text}"
139
-
140
- jq -n --arg r "$reason" '{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:$r}}' 2>/dev/null \
141
- || printf '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"A git commit or push that skips the git hooks is refused. Run it without the skip."}}\n'
127
+ # The decision, the move and the text come from the decision table. The same command without the skip
128
+ # meets the other delivery guards, and the refusal names what they refuse it for first: a commit on
129
+ # the main branch, a commit while the contribution carries a foreign signature, the document pair and
130
+ # the exam the commit waits for, a push while the heavy steps have no green mark. The hook gathers the
131
+ # facts of that state; the decider composes the words.
132
+ rt_hooks_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
133
+ # shellcheck disable=SC1091
134
+ . "$rt_hooks_dir/facts.sh" 2>/dev/null
135
+ command -v rt_fact_branch >/dev/null 2>&1 || exit 0
136
+ sid="$(printf '%s' "$input" | jq -r '.session_id // "nosession"' 2>/dev/null)"
137
+ record="$(rt_fact_transcript "$input")"
138
+ main_branch=main
139
+ on_main=no
140
+ signed=yes
141
+ signature=''
142
+ doc_pair=yes
143
+ problems=''
144
+ workdir="$(rt_hook_cwd)"
145
+ [ -z "$workdir" ] && workdir="${CLAUDE_PROJECT_DIR:-.}"
146
+ if cd "$workdir" 2>/dev/null && git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
147
+ root="${CLAUDE_PROJECT_DIR:-$(git rev-parse --show-toplevel 2>/dev/null)}"
148
+ for profile in "$rt_hooks_dir/../rt-kit/defaults/project.sh" "$rt_hooks_dir/../defaults/project.sh" "$root/.claude/rt-kit/defaults/project.sh" "$root/.claude/rt-kit/project.sh"; do
149
+ # shellcheck disable=SC1090
150
+ [ -f "$profile" ] && . "$profile" >/dev/null 2>&1 </dev/null
151
+ done
152
+ commit_email="${RT_COMMIT_EMAIL:-}"
153
+ main_branch="${RT_MAIN_BRANCH:-main}"
154
+ if printf '%s\n' "$hits" | grep -q '^commit'; then
155
+ plain="$(printf '%s' "$cmd" | sed -E 's/[[:space:]](--no-verify|--no-verif|--no-veri|-n)([[:space:]]|$)/ /g')"
156
+ if [ "$(rt_fact_branch)" = "$main_branch" ]; then
157
+ on_main=yes
158
+ else
159
+ # shellcheck disable=SC1091
160
+ [ -f "$rt_hooks_dir/git-guard-delivery-signature.sh" ] && . "$rt_hooks_dir/git-guard-delivery-signature.sh" 2>/dev/null
161
+ command -v rt_signature_commit_note >/dev/null 2>&1 && signature="$(rt_signature_commit_note)"
162
+ [ -n "$signature" ] && signed=no
163
+ # shellcheck disable=SC1091
164
+ [ -f "$rt_hooks_dir/facts-docs.sh" ] && . "$rt_hooks_dir/facts-docs.sh" 2>/dev/null
165
+ if command -v rt_fact_doc_problems >/dev/null 2>&1 && rt_fact_doc_problems "$plain"; then
166
+ [ -n "$problems" ] && doc_pair=no
167
+ fi
168
+ fi
169
+ fi
170
+ fi
142
171
 
172
+ action=push_skip_hooks
173
+ printf '%s\n' "$hits" | grep -q '^commit' && action=commit_skip_hooks
174
+ facts="$(jq -cn --arg r "$(rt_fact_rule_loaded git-workflow "$sid")" --arg m "$on_main" --arg s "$signed" --arg d "$doc_pair" \
175
+ --arg e "$(rt_fact_exam_holds "$record")" --arg w "$(rt_fact_window_over_stop "$sid" "$record")" \
176
+ '{rule_loaded:$r, branch_is_main:$m, commits_signed_declared:$s, doc_pair:$d, exam:$e, window_over_stop:$w}')"
177
+ params="$(jq -cn --arg w "$what" --arg m "$main_branch" --arg s "$signature" --arg p "$problems" \
178
+ --arg a "bash ${rt_hooks_dir#"$PWD"/}/git-guard-push-ahead.sh" \
179
+ '{what:$w, main_branch:$m, signature:$s, problems:$p, ahead_cmd:$a}')"
180
+ # shellcheck disable=SC1091
181
+ . "$rt_hooks_dir/decide.sh" 2>/dev/null
182
+ command -v rt_decide >/dev/null 2>&1 && rt_decide git-guard-no-verify.sh "$action" "$facts" "$params"
143
183
  exit 0