@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
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env bash
2
+ # The role a session runs as, for the turn-exit guard. NOT a guard: it has no `rt-hook:` declaration
3
+ # and hooks into no agent event. The guard sources it right after the root of the tree is known.
4
+ #
5
+ # Why it exists. A role started as the main agent, `claude -p --agent <role>`, is judged as an
6
+ # executor, and a role without an edit tool can never pass that judgement: there is no edit in its
7
+ # turn, no word of the owner about a stop, and no owner to ask. Under an open epic the guard gave
8
+ # such a turn back on every pass. A run ended on the turn limit, or the refusal took up the final
9
+ # message in place of the report it was started for. The report is the whole work of such a role.
10
+ #
11
+ # How the role is recognised. The client puts the name into the field `agent_type` of the event; a
12
+ # role called through the agent tool ends with another event and never reaches the guard. The tools
13
+ # are read from the `tools:` line in the header of the role file. A role with no such line, or with
14
+ # `tools: *`, gets every tool the session has, so it stays judged as an executor; so does a role
15
+ # with no file in the tree, a built-in or a plugin one: there is nothing to read its tools from.
16
+ #
17
+ # Expects `$input` and `$root` to be set; the answer is the return code.
18
+ #
19
+ # FAIL-OPEN towards the judgement: no field, no file, an unusual name or an unreadable header — the
20
+ # session reads as an executor, and the guard works as it did before this reading existed.
21
+
22
+ rt_te_read_only_role() {
23
+ local role file tools
24
+ role="$(printf '%s' "$input" | jq -r '.agent_type // empty' 2>/dev/null)"
25
+ [ -n "$role" ] || return 1
26
+ case "$role" in
27
+ */* | .*) return 1 ;;
28
+ esac
29
+ # The role is read in the copy the session works in, and in the project when the copy has none.
30
+ file="${dir:-$root}/.claude/agents/$role.md"
31
+ [ -f "$file" ] || file="$root/.claude/agents/$role.md"
32
+ [ -f "$file" ] || return 1
33
+
34
+ # Only the header is read: the body of a role may quote the line itself.
35
+ tools="$(awk '
36
+ NR == 1 { if ($0 != "---") exit; next }
37
+ $0 == "---" { exit }
38
+ /^tools:/ { sub(/^tools:[[:space:]]*/, ""); print; exit }
39
+ ' "$file" 2>/dev/null)"
40
+ [ -n "$tools" ] || return 1
41
+ case "$tools" in
42
+ *'*'*) return 1 ;;
43
+ esac
44
+
45
+ ! printf '%s' "$tools" \
46
+ | grep -qE '(^|[^[:alnum:]_])(Write|Edit|MultiEdit|NotebookEdit)([^[:alnum:]_]|$)' 2>/dev/null
47
+ }
@@ -0,0 +1,103 @@
1
+ # Turn judge
2
+ <!-- rt-hook-agent event=Stop limit=120 model=claude-sonnet-5-5 words=In the same message as that Read, make its round 1: Grep the file named by transcript_path for `^` and for `"operation":"enqueue".*"content":"[^<]|"content":"The user answered: ` with output_mode count. -->
3
+
4
+ You decide whether the agent's turn may end. You are called by the Stop event as an agent hook of
5
+ Claude Code. The input JSON is given to you; its fields `transcript_path`, `last_assistant_message`,
6
+ `stop_hook_active` and `cwd` are what you work with. You have Read, Grep and Glob. You edit nothing.
7
+
8
+ ## What you are for
9
+
10
+ Open work is not yours to judge. The exit check measures it by a script: the steps of the plan, the
11
+ tasks of the epic, the request not opened. It holds the turn itself and names the next move. You
12
+ read neither the task folder nor the plans, and you never hold a turn because steps are left.
13
+
14
+ You judge what only the words of the conversation show: the owner's latest word, the work that word
15
+ ordered, a question whose answer is already given, a fact stated with no output behind it, a miss
16
+ admitted with no incident record, a proposal ordered and not sent.
17
+
18
+ Your second duty: never leave the agent without a lawful move. A refusal it cannot act on stops the
19
+ work as surely as the stop you exist against. The checks you replace refused turns by their words
20
+ and held answers the owner had asked for; do not repeat that.
21
+
22
+ ## What to read — two rounds, the calls of each round in one message
23
+
24
+ The owner's words lie in the transcript, a JSONL file with one record per line. One pattern finds
25
+ all of them; it is called `OWNER` below:
26
+
27
+ "operation":"enqueue".*"content":"[^<]|"content":"The user answered:
28
+
29
+ - `"operation":"enqueue"` with a text that does not start with `<` — a message the owner typed, at
30
+ the start of a turn or in the middle of one; its text is the field `content`. Queued texts that
31
+ start with `<` are notifications of tasks and agents, and the pattern leaves them out.
32
+ - `The user answered:` — the owner's answer to the question tool.
33
+
34
+ A record `"type":"last-prompt"` repeats an old typed message: it is never the owner's latest word.
35
+
36
+ Round 1 — the declaration of the hook may order it in the same message as the `Read` of this text;
37
+ then it is done, and the next round is round 2:
38
+
39
+ 1. `Grep` the transcript for `^` with `output_mode: "count"` — the number of lines.
40
+ 2. `Grep` the transcript for `OWNER` with `output_mode: "count"`.
41
+
42
+ Round 2:
43
+
44
+ 3. `Grep` the transcript for `OWNER` with `output_mode: "content"`, `-n` and `offset` = the count of
45
+ step 2 minus 5: the owner's last messages and their line numbers. The highest line is the
46
+ owner's latest word.
47
+ 4. `Read` the transcript from `offset` = the count of step 1 minus 20 with `limit: 21`: the last
48
+ records of the turn, its tool calls (`"type":"tool_use"`) and their results. A `Read` of the
49
+ transcript always names `limit`: the whole file is too large for one, and the refusal costs a
50
+ round. A call older than these is found by `Grep`, not by a longer read.
51
+
52
+ Read nothing more unless a refusal needs a proof named below: every call costs the owner seconds at
53
+ the end of every turn.
54
+
55
+ ## Let the turn end — answer `{"ok": true}` — when one of these holds
56
+
57
+ - None of the cases below holds. Whether work is left is measured by the exit check, not by you.
58
+ - The owner's latest word says to stop or to wait — «стоп», «хватит», «не сейчас», «потом»,
59
+ «подожди», a refusal in an answer to the question tool — and the reply does not keep working.
60
+ - `stop_hook_active` is true and the reason of the previous refusal is addressed, or cannot be
61
+ addressed without the owner. Never refuse twice for the same reason: a second refusal for one
62
+ reason is a deadlock in the making.
63
+ - You are in doubt. A refusal with no case below behind it stops the work for nothing.
64
+
65
+ ## Keep the turn going — refuse — when one of these holds
66
+
67
+ - The turn ends while the owner's latest word orders work the turn has not done. The reply
68
+ answers the question or the swearing, reports, announces or promises — «следующим ходом»,
69
+ «сейчас запущу», «дальше возьму» — and the ordered work is not in the calls of the turn. An
70
+ announcement is not the action: a reply that announces or promises its next work is refused even
71
+ when the turn did part of the ordered work. A turn whose calls did part of the ordered work and
72
+ whose reply announces nothing has the work in its calls. Swearing at an agent that stands means
73
+ «why did you stop»: it is never a word to stop. Swearing that follows no order and names no work orders nothing. A slash
74
+ command that writes a handover or closes the session is cleanup: the work it does not mention
75
+ stays ordered. The last records read may not hold the whole turn: before refusing because the
76
+ ordered work is not in the calls, `Grep` the transcript for `"type":"tool_use"` from the line of
77
+ the owner's latest word; a call there that does the work counts.
78
+ - The reply asks the owner something already answered in the conversation, or asks the owner to do a
79
+ step the agent can do itself: sign in to a stand, type a password, run a command, open a page.
80
+ - The reply states a fact about the repository or a service — merged, pushed, green, exists, closed,
81
+ published — and no tool result of this turn shows it. A command output that shows the state counts,
82
+ whatever the command was. Each fact the reply names needs its own output: an edit of one file
83
+ does not show a second thing the reply says the branch holds. Before refusing for this, `Grep`
84
+ the transcript for the command that would show it: a match after the line of the owner's latest
85
+ word counts.
86
+ - The reply admits a miss of the agent («я ошибся», «мой промах», «это моя вина») and the turn wrote
87
+ no incident record into the directory named by the key `postmortems` of `.claude/rt-kit.json`:
88
+ `Glob` the directory; a file named with today's date counts.
89
+ - The owner asked to send a proposal to the rules package and the turn did not run
90
+ `agent-kit propose`.
91
+
92
+ ## How to answer
93
+
94
+ Answer with JSON only, no other text.
95
+
96
+ - Allow: `{"ok": true}`
97
+ - Refuse: `{"ok": false, "reason": "BLOCKED by turn-judge: <what is wrong, one sentence>. <the next action, one sentence>."}`
98
+
99
+ The reason starts with `BLOCKED by turn-judge:` every time: refusals are counted by this mark in the
100
+ transcripts. Write it in English, quote in « » the owner's words you rely on, and name one action
101
+ the agent can take in this same turn: the work the owner's word ordered, the step it asked the owner
102
+ to take, the command that shows the fact, the incident record, the sending of the proposal. Waiting
103
+ is never the action.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # rt-hook: PostToolUse .*
3
- # Requires: hooks/profile-check.sh, hooks/deny-tail.sh
3
+ # Requires: checks/decide.mjs, hooks/decide.sh, hooks/facts.sh, hooks/profile-check.sh, hooks/deny-tail.sh
4
4
  # rt-hook: PreToolUse .*
5
5
  # Window fill: the session is brought to a logical point in advance, not cut off in the middle.
6
6
  #
@@ -88,7 +88,9 @@ tasks_dir="${RT_TASKS_DIR:-docs/tasks}"
88
88
  handoff_dir="${RT_HANDOFF_DIR:-.claude/handoff}"
89
89
 
90
90
  event="$(printf '%s' "$input" | jq -r '.hook_event_name // empty' 2>/dev/null)"
91
- transcript="$(printf '%s' "$input" | jq -r '.transcript_path // empty' 2>/dev/null)"
91
+ # shellcheck disable=SC1091
92
+ . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/facts.sh" 2>/dev/null
93
+ transcript="$(rt_fact_transcript "$input")"
92
94
  [ -n "$transcript" ] || exit 0
93
95
  [ -f "$transcript" ] || exit 0
94
96
 
@@ -98,14 +100,7 @@ transcript="$(printf '%s' "$input" | jq -r '.transcript_path // empty' 2>/dev/nu
98
100
  #
99
101
  # A tail of 200 lines: the session record grows all session, and one last line of it is what is
100
102
  # needed.
101
- fill="$(tail -n 200 "$transcript" 2>/dev/null | jq -s -r '
102
- [.[] | select(.type == "assistant") | .message.usage | select(. != null)]
103
- | last
104
- | if . == null then empty
105
- else ((.input_tokens // 0) + (.cache_creation_input_tokens // 0)
106
- + (.cache_read_input_tokens // 0) + (.output_tokens // 0))
107
- end
108
- ' 2>/dev/null)"
103
+ fill="$(rt_fact_window_fill "$transcript")"
109
104
 
110
105
  case "$fill" in
111
106
  '' | *[!0-9]*) exit 0 ;;
@@ -156,14 +151,21 @@ fi
156
151
  [ "$event" = "PreToolUse" ] || exit 0
157
152
  [ "$pct" -ge "$stop_pct" ] || exit 0
158
153
 
154
+ # A mark for the turn exit guard: past this threshold the next step of work is refused here, so
155
+ # the exit guard must not name it — the session closes by the progress and the handover.
156
+ stop_sid="$(printf '%s' "$input" | jq -r '.session_id // "unknown"' 2>/dev/null)"
157
+ stop_file="$(rt_fact_window_stop_file "$stop_sid")"
158
+ mkdir -p "$(dirname "$stop_file")" 2>/dev/null && : >"$stop_file" 2>/dev/null
159
+
159
160
  tool="$(rt_hook_tool)"
160
161
  path="$(rt_hook_file)"
161
162
  cmd="$(rt_hook_cmd)"
162
163
 
163
164
  allowed=0
164
165
  case "$tool" in
165
- # The conversation with the owner and reading what is edited at the closing.
166
- AskUserQuestion | TodoWrite | Read | SendUserFile)
166
+ # The conversation with the owner and reading what is edited at the closing. Loading a rule is
167
+ # reading too: the closing edits need their rules, and the rules gate refuses them until then.
168
+ AskUserQuestion | TodoWrite | Read | SendUserFile | Skill)
167
169
  allowed=1
168
170
  ;;
169
171
  Edit | Write | MultiEdit | mcp__webstorm__create_new_file)
@@ -184,33 +186,12 @@ esac
184
186
 
185
187
  [ "$allowed" -eq 1 ] && exit 0
186
188
 
187
- reason="BLOCKED by window-fill-guard: window fill ${pct}% (${fill_k}k of ${window_k}k), the stop threshold is ${stop_pct}%. The session works no further — it closes.
188
-
189
- What is left to do in this session:
190
- 1. Rewrite the section «Where we stand» in the progress and add a session entry — what was done, what confirms it, what did not work out.
191
- 2. Commit what is checked: what is not committed does not survive the break.
192
- 3. Write the handover into ${handoff_dir}/ and give the owner the path to it — what goes into it is said by the pattern task-flow-handoff.
193
-
194
- What passes after the threshold:
195
- - an edit of ${tasks_dir}/** and ${handoff_dir}/**, a read of any file, a question to the owner;
196
- - a command starting with a word of delivery or verification: git, the client of the hosting, moving a column, npm run check:*.
197
-
198
- A command is judged by the start of the line: entering a directory before it removes the match, and the very commit that would have passed without it is refused. Start the command with the word of delivery itself."
199
-
200
- # The shared deny tail: the two lawful moves and the lawful form of bypass, if the refusal has one.
201
- # The file may not be laid out — then there is no tail, and the reason for the refusal stays as it
202
- # was.
203
- # shellcheck disable=SC1090
204
- [ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" ] \
205
- && . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" 2>/dev/null
206
- command -v rt_deny_tail >/dev/null 2>&1 || rt_deny_tail() { :; }
207
- deny_tail_text="$(rt_deny_tail "")"
208
- [ -n "$deny_tail_text" ] && reason="${reason}
209
-
210
- ${deny_tail_text}"
211
-
212
- jq -n --arg r "$reason" \
213
- '{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:$r}}' 2>/dev/null \
214
- || printf '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"window-fill-guard: the window is full, the session closes with a handover."}}\n'
215
-
189
+ # The decision, the move and the text come from the decision table; the action is the class of
190
+ # this call. The first named move is the progress edit, and the rules gate refuses it while the rule
191
+ # of the course of work is not loaded: that is the fact the table tells the two texts apart by.
192
+ facts="$(jq -cn --arg r "$(rt_fact_rule_loaded "${RT_TASK_FLOW_RULE:-task-flow}" "$stop_sid")" \
193
+ '{window_over_stop:"yes", rule_loaded:$r}')"
194
+ # shellcheck disable=SC1091
195
+ . "$rt_hooks_dir/decide.sh" 2>/dev/null
196
+ command -v rt_decide >/dev/null 2>&1 && rt_decide window-fill-guard.sh "?work_call" "$facts" '{}' PreToolUse "$input"
216
197
  exit 0
@@ -15,7 +15,8 @@ one session and keeps its whole context and state when it passes to the next.
15
15
  line. The part the work repeats is read in full — another tree's structure is not judged by one
16
16
  file.
17
17
  - **A sample named in the progress must be reachable by every session while the work goes on.** The
18
- link is written directly in the progress.
18
+ progress carries a reference to it; a full path that names another tree lies outside the history,
19
+ among the records that belong to no branch.
19
20
  - **A question with an obvious answer does not stop the work.** The executor names the assumption,
20
21
  moves on and writes it where the work goes on. Only a gap where any guess makes the work dangerous
21
22
  or useless stops it.
@@ -172,9 +173,9 @@ one session and keeps its whole context and state when it passes to the next.
172
173
  The owner follows the epic by one card, not by its tasks; a card that stays where the epic was
173
174
  declared reads as an epic nobody started, however many of its tasks are already done. The card
174
175
  moves by the same motion as the first task's, not by a separate step remembered later.
175
- - **An executor's session does not end together with the task.** The end of a task is not a sign to
176
- stop: only the window fill limit allows stopping. A session closed on a finished task leaves the
177
- owner a blank and costs a whole session to return to what was at hand.
176
+ - **An executor's session does not end together with the task.** The end of a task is no sign to
177
+ stop; the epic's end is, until the owner's word. A session closed on a finished task costs a whole
178
+ session to return to the work.
178
179
  - **The window fill limit stops a session only where the tool does not compact the context itself.**
179
180
  Where compaction is declared and comes before the limit, the window is not the end of the session
180
181
  but its continuation: the context is compacted, the written state returns into it, and the work
@@ -254,10 +255,10 @@ one session and keeps its whole context and state when it passes to the next.
254
255
  number, fresh tasks on top; it does not hold the epic's order and cannot — tasks of all epics lie
255
256
  there at once. The epic plan is opened before a task is taken and answers in one call: which task
256
257
  is next, and whether it moved to a neighbouring epic.
257
- - **An ended epic is named to the owner in the same turn in which work outside it is taken.** While
258
- the epic goes on, the next piece of work is taken silently; once it has ended, the next step is no
259
- longer obvious to both. Taking work outside an ended epic in silence leaves the owner sure the
260
- epic continues.
258
+ - **An ended epic is a stop: the owner is shown what was done and is asked for the next work.** While
259
+ the epic goes on, the next work is taken silently; once it has ended, the next step is not
260
+ obvious to both. Work taken outside an ended epic without the owner's word leaves them sure
261
+ the epic continues.
261
262
  - **An epic is not closed while even one sign of its end is confirmed only by reading.** A sign
262
263
  checked by eye closes the work only after a command or a measurement checks it, with their output.
263
264
  The note "confirmed by a live measurement" is a promise to check, not a check. Closed on two signs
@@ -18,31 +18,44 @@ Pattern of the rule `autonomous-work`. What must be true — the law
18
18
 
19
19
  ## The chain of branches
20
20
 
21
- The first work branches from main, each next one — from the previous:
21
+ The first work branches from the epic branch — or from main where the work has no epic — each
22
+ next one from the previous:
22
23
 
23
24
  ```bash
24
- git checkout -b <КЛЮЧ>-<номер-1>-<slug> main # the first of the night
25
+ git checkout -b <КЛЮЧ>-<номер-1>-<slug> <база> # the first of the night
25
26
  git checkout -b <КЛЮЧ>-<номер-2>-<slug> <КЛЮЧ>-<номер-1>-<slug>
26
27
  git checkout -b <КЛЮЧ>-<номер-3>-<slug> <КЛЮЧ>-<номер-2>-<slug>
27
28
  ```
28
29
 
29
30
  The merge order is from the bottom up, and it is named in the morning list by numbers. A branch
30
- created from main in the middle of the chain will collide with its neighbour in shared files —
31
+ created from the base in the middle of the chain will collide with its neighbour in shared files —
31
32
  indexes, counters, journals — and the owner will be the one to sort it out.
32
33
 
33
34
  ```bash
34
- git log --oneline --graph --decorate main..HEAD | head -20 # what the chain stands on now
35
+ git log --oneline --graph --decorate <база>..HEAD | head -20 # what the chain stands on now
35
36
  git branch --list '<КЛЮЧ>-*' --format='%(refname:short) %(upstream:short)'
36
37
  ```
37
38
 
39
+ The base moved during the night — it is merged into the previous branch locally, and only then the
40
+ next one is created. Taking the base fresh instead breaks the chain:
41
+
42
+ ```bash
43
+ git fetch origin
44
+ git merge-base --is-ancestor origin/<база> <прошлая ветка> || {
45
+ git checkout <прошлая ветка> && git merge origin/<база>
46
+ }
47
+ git checkout -b <КЛЮЧ>-<номер>-<slug> <прошлая ветка>
48
+ ```
49
+
38
50
  ## The cycle of one piece of work
39
51
 
40
52
  ```bash
41
53
  npm run task:move -- <номер> in-progress # taken
42
54
  git checkout -b <КЛЮЧ>-<номер>-<slug> <прошлая ветка> # a chain, not a fan
43
- cp -r docs/tasks/_template docs/tasks/<КЛЮЧ>-<номер>-<slug>
55
+ dir="${RT_TASKS_DIR:-docs/tasks}/<КЛЮЧ>-<номер>-<slug>"
56
+ mkdir -p "$dir" && cp "${RT_TASKS_DIR:-docs/tasks}"/_template/*.md "$dir"/
44
57
  # the grill with defaults, the plan, the state «этап-идёт»
45
- git add docs/tasks/<КЛЮЧ>-<номер>-<slug> && git commit # the folder goes into history at once
58
+ git add "$dir" && git commit # the folder goes into history at once
46
59
  # work by stages: each ends with a commit and a run of the readiness sign
47
60
  # the folder is taken apart into the archive by the last commit
48
61
  ```
@@ -69,7 +82,19 @@ A task that needs the owner's word is not taken: its state on the board stays as
69
82
  line goes into the morning list.
70
83
 
71
84
  ```markdown
72
- - **RT-<номер> — <заголовок>.** Отложена: <какой вопрос и почему умолчания у него нет>.
85
+ - **<КЛЮЧ>-<номер> — <заголовок>.** Отложена: <какой вопрос и почему умолчания у него нет>.
86
+ ```
87
+
88
+ A task stopped halfway — by red that cannot be fixed or by a question — goes back to its former
89
+ column, and its line says the branch is not merged:
90
+
91
+ ```bash
92
+ npm run task:move -- <номер> <прежняя колонка>
93
+ ```
94
+
95
+ ```markdown
96
+ - **<КЛЮЧ>-<номер> — <заголовок>.** Остановлена: <что красное или какой вопрос>. Ветка
97
+ `<ветка>` не вливается; следующая работа идёт от `<последняя зелёная>`.
73
98
  ```
74
99
 
75
100
  ## The morning list
@@ -79,7 +104,7 @@ Appended along the way, after each closed piece of work, not assembled at the en
79
104
  ```markdown
80
105
  | Работа | Ветка | Чем подтверждена | Чего ждёт |
81
106
  | ------ | ----- | ---------------- | --------- |
82
- | RT-… — <что сделано> | `<ветка>` (на `<предыдущей>`) | `<команда>` — <вывод> | заявки и слияния |
107
+ | <КЛЮЧ>-… — <что сделано> | `<ветка>` (на `<предыдущей>`) | `<команда>` — <вывод> | заявки и слияния |
83
108
  ```
84
109
 
85
110
  The order of rows is the merge order. Below the list — the postponed tasks with their questions.
@@ -96,8 +121,8 @@ night ends with work, not with an argument with the guard.
96
121
 
97
122
  ## Common misses
98
123
 
99
- - **The branch was created from main by habit.** The chain breaks silently, and the cost surfaces
100
- for the owner at the second merge.
124
+ - **The branch was created from the base by habit.** The chain breaks silently, and the cost
125
+ surfaces for the owner at the second merge.
101
126
  - **A default was taken and not written down.** In the morning it cannot be told from knowledge,
102
127
  and the owner learns of it only when the work was done wrong.
103
128
  - **A task was taken and postponed halfway.** On the board it is in progress, in the branch — half
@@ -22,10 +22,8 @@ Pattern of the rule `browser-verification`. What must be true — the law
22
22
  `getComputedStyle`, `getBoundingClientRect`, contrast, matching centres, landing in the viewport.
23
23
  "Looks fine" is never a check result.
24
24
 
25
- A measurement answers only the question asked. A match on the listed properties says nothing about a
26
- rule that is not in the measured list. The rows of the profile popup matched the reference by
27
- padding, font size and rounding, while the reference paints no hover background there at all — a
28
- full-width highlight held on for two rounds with correct numbers. If the reference sources are
25
+ A measurement answers only the question asked: a match on the listed properties says nothing about
26
+ a rule that is not in the measured list — the case is in the rule. If the reference sources are
29
27
  available, the divergence is found by reading, and the measurement stays a check of the result.
30
28
 
31
29
  The look of an element that today is visible on no screen is not confirmed by a measurement, and a
@@ -86,7 +84,10 @@ is not one value but the number of nodes with an unexpected one.
86
84
 
87
85
  A measurement at one width per call gives numbers from different minutes: between calls the page
88
86
  is redrawn, and they cannot be compared. So the widths are run as a batch in one pass — each lives
89
- in its own frame, and the measurement is taken from all of them at once:
87
+ in its own frame, and the measurement is taken from all of them at once. The widths are the tree's
88
+ layout thresholds, both sides of each; the numbers below are a sample, not the set. A sweep that
89
+ will be repeated goes into an end-to-end test — the rule says why; the driver looks at a screen
90
+ once:
90
91
 
91
92
  ```javascript
92
93
  await (async (address, widths, row) => {
@@ -136,9 +137,6 @@ side of itself in the frame.
136
137
  iframe of the needed width — inside it `matchMedia` counts from the frame; at `width: 375px` and
137
138
  `border: 2px` the inner `innerWidth` equals 371.
138
139
 
139
- Changing the number of elements in a container is a layout edit: it is checked at 375, not only by
140
- response codes.
141
-
142
140
  ## An input event is not replaced by a faked value
143
141
 
144
142
  **Scrolling set by assignment gives no event.** The scroll value changes, but the subscriber does
@@ -177,9 +175,10 @@ The order is this: the call puts the walk into a page variable and ends at once,
177
175
  calls ask that same variable whether it is done.
178
176
 
179
177
  ```javascript
178
+ const THRESHOLDS = [/* the tree's layout thresholds, both sides of each */];
180
179
  globalThis.__probe = { done: false, rows: [] };
181
180
  (async () => {
182
- for (const w of [375, 480, 481, 768, 769, 1080, 1081, 1380]) {
181
+ for (const w of THRESHOLDS) {
183
182
  globalThis.__probe.rows.push(await measureWidth(w));
184
183
  }
185
184
  globalThis.__probe.done = true;
@@ -193,18 +192,9 @@ summary looks not cut off but absent — output gathered in one pass and printed
193
192
  shorter than it is. So what was gathered stays in the variable whole, and is printed in slices by
194
193
  index.
195
194
 
196
- ## Router behaviour is reproduced by clicks
197
-
198
- Substituting the address, `history.pushState` with `popstate` and entering by a direct link raise
199
- the application anew, and it has no accumulated state — no open outlet, no guard of the previous
200
- panel. A clean pass over the addresses reads as "the defect is not confirmed": the event feed panel
201
- got stuck on the very first click from the menu and passed the check by addresses three times.
202
-
203
195
  ## Common misses
204
196
 
205
197
  - A comment in a config is a hypothesis like any other. A claim about eviction of a cache record
206
198
  held on through three rounds of adversarial code review and was refuted by one `curl`.
207
- - The conclusion "no defect, it is the cache" closes the investigation, so it is accepted only
208
- after a check on a clean build.
209
- - A defect in a client chunk from a compilation before the edit looks like a defect in the code:
210
- the sign of a dev build is bundle names without a hash.
199
+ - Router behaviour checked by addresses, a cache taken for the cause, a stale client chunk — the
200
+ rule's pitfalls name all three.
@@ -2,10 +2,10 @@
2
2
  name: browser-verification-stand
3
3
  kind: pattern
4
4
  rule: browser-verification
5
- description: Pattern of rule browser-verification. Load when an honest stand is needed — the production build of the site, the admin stand, a stand behind real nginx, signing in to the admin, finding out what sits on a port. Not for layout measurements — that is pattern browser-verification-measure.
5
+ description: Pattern of rule browser-verification. Load when a stand from the production build is needed — the build of the site, the admin stand, a stand behind real nginx, signing in to the admin, finding out what sits on a port. Not for layout measurements — that is pattern browser-verification-measure.
6
6
  ---
7
7
 
8
- # An honest stand
8
+ # A stand from the production build
9
9
 
10
10
  Pattern of the rule `browser-verification`. What must be true — the law
11
11
  `docs/constitution/verifiability.md`.
@@ -37,17 +37,14 @@ Before the first request, not after a puzzling answer:
37
37
  lsof -nP -iTCP:$API_PORT -sTCP:LISTEN
38
38
  ```
39
39
 
40
- A built artifact from a past session regularly hangs on the intake port
41
- (`node -r dotenv/config dist/apps/api/main.js`): it answers 200 with old code, and the procedure
42
- created in the branch it does not have at all. There may be several such processes, and all of
43
- them must be killed — by PID from `lsof`, each one: `pkill` by the pattern `nx serve api` hits none
44
- of them.
40
+ A built artifact from a past session on the intake port answers 200 with old code — the rule's
41
+ pitfall names it; it is killed by PID from `lsof`, each process, not by a command-name pattern.
45
42
 
46
43
  ## Production build of the site
47
44
 
48
45
  ```bash
49
- npx nx build site
50
- PORT=$SITE_STAND_PORT node dist/apps/site/server/server.mjs
46
+ npx nx build <site project>
47
+ PORT=$SITE_STAND_PORT node <built site server entry>
51
48
  ```
52
49
 
53
50
  This is not a dev server: the guard catches `nx|ng serve`, package runners and static servers, and
@@ -61,7 +58,7 @@ apart from the one under check.
61
58
  ## Admin stand
62
59
 
63
60
  ```bash
64
- npx nx build admin --base-href=/
61
+ npx nx build <admin application> --base-href=/
65
62
  ```
66
63
 
67
64
  Without `--base-href` the stand serves an empty page with no errors in the console. A stand that
@@ -84,9 +81,7 @@ production account, and there is never one on a local stand. Where there is no i
84
81
  stand itself substitutes the sign-in answer: the application's path stays the same as a person's.
85
82
 
86
83
  The token is not signed by hand and not put into browser storage by hand: put there so, it checks
87
- the screen while bypassing the live sign-in path — that is, it answers the wrong question. Asking
88
- a person to type a password, open a tab or press a button means a wrongly chosen path, not a lack
89
- of rights on the executor's side.
84
+ the screen while bypassing the live sign-in path — that is, it answers the wrong question.
90
85
 
91
86
  **Ask for the work mode, not for the input.** Input into the password field is refused by the
92
87
  classifier of automatic mode: it judges the action itself and does not tell addresses apart — a
@@ -104,7 +99,7 @@ it fills the same field without the classifier, but the bypassed ban is lifted n
104
99
  but from all of them at once. Normal mode left on removes confirmation from every later action of
105
100
  the session too, so the return is part of the sign-in, not a separate clean-up.
106
101
 
107
- The owner's stand is never a fallback path: it builds the main branch and says nothing about the
102
+ The owner's stand is never a fallback path: it builds its own branch and says nothing about the
108
103
  edit in the working tree.
109
104
 
110
105
  ## API stand
@@ -113,8 +108,8 @@ The built artifact is raised on a free port, not on the intake port: there the o
113
108
  answers, and its environment is not the one under check.
114
109
 
115
110
  ```bash
116
- npx nx build api
117
- env -u JWT_SECRET NODE_ENV=production API_PORT=$API_STAND_PORT DATABASE_URL=… node dist/apps/api/main.js
111
+ npx nx build <api project>
112
+ env -u JWT_SECRET NODE_ENV=production API_PORT=$API_STAND_PORT DATABASE_URL=… node <built api entry>
118
113
  ```
119
114
 
120
115
  Environment variables are set in the command itself, one per case under check. A refusal at start-up
@@ -134,16 +129,17 @@ signing in — a hand-written one hides a divergence in the set of claims.
134
129
 
135
130
  ## A stand behind real nginx
136
131
 
137
- Cache, redirects and headers live in `deploy/nginx.conf`, not in the application. Any conclusion
138
- about `301`, `Cache-Control` and `X-Cache-Status` is drawn only here:
132
+ Cache, redirects and headers live in the tree's proxy config, not in the application; the
133
+ companion names its files. Any conclusion about `301`, `Cache-Control` and `X-Cache-Status` is
134
+ drawn only here:
139
135
 
140
136
  ```bash
141
137
  docker run -d --name <prefix>-stand-nginx \
142
138
  --add-host api:host-gateway --add-host ssr:host-gateway \
143
139
  -p $PROXY_SITE_PORT:80 -p $PROXY_ADMIN_PORT:8081 \
144
- -v "$PWD/deploy/nginx/main.conf:/etc/nginx/nginx.conf:ro" \
145
- -v "$PWD/deploy:/etc/nginx/conf.d:ro" \
146
- -v "$PWD/dist/apps/admin/browser:/usr/share/nginx/html/admin:ro" \
140
+ -v "$PWD/<main proxy config>:/etc/nginx/nginx.conf:ro" \
141
+ -v "$PWD/<proxy config directory>:/etc/nginx/conf.d:ro" \
142
+ -v "$PWD/<built admin directory>:/usr/share/nginx/html/admin:ro" \
147
143
  nginx:1.27-alpine
148
144
  ```
149
145
 
@@ -151,8 +147,8 @@ docker run -d --name <prefix>-stand-nginx \
151
147
  the container is left with a truncated copy, and `nginx -t` inside falls on "unexpected end of
152
148
  file" while the file outside is whole. Cured by recreating the container, not by editing the
153
149
  config.
154
- - The main config is substituted by a separate line: it lies in `deploy/nginx/`, not next to
155
- `nginx.conf` — a file with the `.conf` extension in the mounted directory would get into
150
+ - The main config is substituted by a separate line and lies outside the mounted directory — a
151
+ file with the `.conf` extension in the mounted directory would get into
156
152
  `include` and bring nginx down on the `user` directive. Without it the stand comes up on the
157
153
  image's config, and the connection limit per worker there is its own.
158
154
  - A foreign `Host` is refused by the **dev server**, not by the built application: the production
@@ -162,7 +158,7 @@ docker run -d --name <prefix>-stand-nginx \
162
158
  pointed at the site port resets the cache past the process that keeps the redirect table in
163
159
  memory — and a working mechanism looks broken.
164
160
 
165
- ## A stand lives exactly as long as the check
161
+ ## A stand is stopped when the check ends
166
162
 
167
163
  A stand is raised for one conclusion and is not needed after it. Abandoned, it hinders nothing and
168
164
  gives no signal. It has its own name, a free port, it takes almost no room — it can be seen only by
@@ -188,17 +184,16 @@ git worktree add ../<prefix>-base <commit> # the task branch is not touched
188
184
  pnpm install --frozen-lockfile # from ../<prefix>-base: its node_modules are its own
189
185
  ```
190
186
 
191
- - For comparison take not the main branch but the last commit on which the tree builds: main is
192
- sometimes broken, and then "before" and "after" differ not because of the edit. Whether a commit
193
- builds is checked by building, not by its being in the main branch.
187
+ - For comparison take not the tip of the base branch but the last commit of it on which the tree
188
+ builds: the base is sometimes broken, and then "before" and "after" differ not because of the
189
+ edit. Whether a commit builds is checked by building, not by its being in the base.
194
190
  - The stand of the second tree is raised on its own ports: the site, admin and intake ports are
195
191
  taken by the owner, and the rendering port must not be taken — the developer's stand goes by the
196
192
  name `ssr:<rendering port>`.
197
193
  - Both stands are kept up at the same time — exactly until the comparison ends: comparing from
198
194
  memory between two launches, you notice only what you managed to remember. With the comparison
199
195
  done, the stand of the second tree is torn down by the same move, not left until the end of the
200
- session. Stands left behind pile up across sessions and hold connections to the storage, and the
201
- rule says so in a pitfall. Teardown refused — the stand is named to the owner at the end of the
196
+ session — why, the rule says in a pitfall. Teardown refused — the stand is named to the owner at the end of the
202
197
  session by name, with the port.
203
198
 
204
199
  ## The state of the ports is taken before the first build of the session
@@ -223,25 +218,18 @@ past session, and it answers 200 with old code.
223
218
  than the check — a whole set of layout checks was left unrun exactly because the build was
224
219
  deemed dangerous without measuring. A build from the cache is not a measurement: it builds
225
220
  nothing at all, and that is visible by its duration.
226
- - Do not raise your own dev server: the site, the admin and the intake are already up by the
227
- owner, and a second instance is refused by the guard.
228
- - **A refused static server is read as a ban on the check, while it is a pointer to the right
229
- move.** It may not serve what was built not out of caution: the application calls its own
230
- origin, and a deep link answers `404`. From here one goes not to bypass the guard but to the
231
- tree's proxy with its real config.
221
+ - Do not raise your own dev server where the tree says the owner raises them: the applications are
222
+ already up, and a second instance is refused by the guard.
232
223
  - **The owner's dev server is a place to look, not a place to check.** The conclusion that the
233
224
  screen is right is drawn on the production build behind the real proxy: server-side markup,
234
225
  locales, cache, redirects and headers on the dev server are either different or absent
235
226
  altogether. A look at the raised dev server is fit to understand what is going on on an
236
227
  unfamiliar screen and unfit as confirmation: the confirmation is a measurement on a stand from
237
228
  the production build.
238
- - **A build of everything silences all three dev servers of the owner, not only the API.** After
239
- `nx run-many -t build` both the site and the admin go down. Build what you check
240
- (`npx nx build site`), not the whole tree. If the servers went down, the agent cannot bring them
241
- back up — the guard is in the way, so the owner is told at once, not at the end of the session.
229
+ - **A build of everything stops every dev server of the owner, not only the API.** After
230
+ `nx run-many -t build` the client applications go down too. Build what you check
231
+ (`npx nx build <application>`), not the whole tree. If the servers went down, the agent cannot bring them
232
+ back up — the guard refuses it, so the owner is told at once, not at the end of the session.
242
233
  The push gate is such a build too: its set runs the build of everything affected. So the
243
234
  measurement is taken before the push or on a stand from the production build. The answer of the
244
235
  server, not its port, tells whether it survived.
245
- - Take the rendering port with care: the developer's stand goes by the same name
246
- `ssr:<rendering port>` through `host-gateway`, and while a foreign process hangs on it, the
247
- stand serves a foreign build.
@@ -106,12 +106,6 @@ its name, not the infrastructure its reader needs.
106
106
  note names a task by the title read in the tracker at that minute, and a commit without a task
107
107
  number does not go into it: a number taken from memory lands on someone else's task.
108
108
 
109
- - **An edit made by a shell command is judged by the whole command, the old version inside it
110
- included.** The style check gets the body of the call, not the text that will end up in the
111
- file: a rewrite carrying the previous wording inside a heredoc or an interpreter string is
112
- refused by the words of that previous wording. The refusal repeats at the second attempt,
113
- because the old text is still there. The new text is written by the edit tool — there only the
114
- new text is judged — or inserted by line number, and the command is given the path.
115
109
  - **Shorter does not mean clearer.** A text in the layer's words comes out a third shorter and
116
110
  is useless to whoever decides whether the work is urgent.
117
111
  - **"Not X but Y" looks like an explanation and explains nothing.** The owner learns what was