@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,94 @@
1
+ # Admin navigation — how it works here — cold part
2
+
3
+ What the rule `navigation` handed over when cut to its statements, every article whole.
4
+
5
+ Rule under the law `docs/constitution/navigation.md`. The law says how the user finds a section and
6
+ gets into it; here — what the menu is assembled from in this tree and how it looks. The look is
7
+ spoken of by the rule: the law is silent about it on purpose.
8
+
9
+ ## What it is called here
10
+
11
+ | In the law | Here |
12
+ | ------------------------ | ------------------------------------------------------------------------------- |
13
+ | menu item | an entry in the `admin-nav.items.ts` declaration |
14
+ | section with a panel | an item with columns; has no address of its own |
15
+ | second-level panel | the `rt-page-header` popup from the kit package, laid out in columns and groups |
16
+ | unread sign | a dot, comes as a predicate by the item id |
17
+ | the "no screen yet" flag | `disabled` in the declaration |
18
+
19
+ ## Where it lives
20
+
21
+ In this tree — the table in `implementation.md` next to it. Paths live there, not here: the rule
22
+ travels between repositories, the layout does not, and a path named in the rule lies in the first
23
+ tree that keeps its code differently.
24
+
25
+ ## Flow
26
+
27
+ The flow of creating a section: one declaration per item and route, two layers of gating and the
28
+ data path into the header.
29
+
30
+ ```mermaid
31
+ flowchart TD
32
+ A[A section is created] --> B[The item is declared once: it is the source of both the menu and route gating]
33
+ B --> C{What closes the section}
34
+ C -->|A user right| D[The right stands in the item declaration]
35
+ C -->|A section flag| E[The item is declared without a screen of its own, with a hint why]
36
+ C -->|Nothing| F[The item is open to everyone signed in]
37
+ D --> G[The route is closed by the same declaration, not by a list of its own]
38
+ E --> G
39
+ F --> G
40
+ G --> H{The header needs domain data}
41
+ H -->|Yes| I[It comes by a token: the declaration does not import the application shell]
42
+ H -->|No| J[Done]
43
+ I --> J
44
+ ```
45
+
46
+ ## How the law applies here
47
+
48
+ - **An item is declared once and serves as the source of both the menu and route gating.** A second
49
+ declaration next to the routes would drift from the first, and the result would be "the item is
50
+ not visible, but the page opens".
51
+ - **The declaration imports no `shell`.** Otherwise the graph `shell → container/feature → shell`
52
+ closes into a cycle and the layout check stops.
53
+ - **Gating has two layers: the user right and the section flag.** An item with a flag is declared
54
+ without rights and without an address — a right opens the screen, and there is no screen; it is
55
+ visible to everyone all the while.
56
+ - **Domain data comes into the header by a token, not by an import.** The interface and the
57
+ `InjectionToken` live in `container/util`; the composition root ties them to the implementation.
58
+
59
+ ## What of the law is not here
60
+
61
+ The menu holds seventeen second-level items and the "Finance" section that have no screen yet: they
62
+ are rolled out as unavailable, because a vanished item cannot be told from one that never existed.
63
+
64
+ The rendering of the header itself lives in `rt-page-header` from `@rt-tools/ui-kit-v2`. The project
65
+ does not write it and cannot break it: it declares the items, and the kit draws them. The kit sets:
66
+
67
+ - the hint on an unavailable item and `aria-disabled` instead of the native `disabled`;
68
+ - section highlighting by address prefix;
69
+ - opening the second-level panel on hover, and on touch — by a tap;
70
+ - the panel layout in columns, inside a column — in groups with a caption; if the first group in a
71
+ column has no heading, its items start from the top of the panel;
72
+ - the panel width by the number of columns, not by the length of captions, and its fit from its own
73
+ section to the right edge of the screen;
74
+ - the expand pointer on a section with a panel and its absence on a section without one;
75
+ - a separate mobile layout: the menu collapses into a button, expands with the same sections and
76
+ groups and scrolls when the items do not fit in height.
77
+
78
+ None of this the rule binds to project code: there is nothing to bind.
79
+
80
+ ## Patterns
81
+
82
+ - `admin-nav-item` — create a menu item and its route: the declaration, rights, the flag, address
83
+ nesting, the caption in all locales.
84
+
85
+ ## Pitfalls
86
+
87
+ - An unavailable item has no click handler at all: `aria-disabled` does not refuse a click.
88
+ - A branch where the ro-route constant was not merged in differs only in that the button in the
89
+ header opens nothing on it.
90
+ - Groups inside an expanded section on a narrow screen do not collapse separately, so the set of
91
+ expanded ones holds only section ids.
92
+ - The panel width is computed by the number of columns, not by the content; the numbers are set by
93
+ `--rt-*` tokens, raw values are forbidden by the styling rule.
94
+ - An address move touches links and the e2e specs — they walk by addresses.
@@ -0,0 +1,201 @@
1
+ # Uniformity — how it works here — cold part
2
+
3
+ What the rule `reuse-first` handed over when cut to its statements, every article whole.
4
+
5
+ Rule under the law `docs/constitution/reuse-first.md`. The law says that the same things behave
6
+ the same; here — what that stands on in this tree and what it is called.
7
+
8
+ ## What it is called here
9
+
10
+ | In the law | Here |
11
+ | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
12
+ | the ready-made | the kit components of `@rt-tools/ui-kit-v2` with the `rt-` prefix and selectorless base classes inherited in a screen's `@Component` |
13
+ | the layout of pages, forms and windows | `apps/<app>/src/styles/`, applied with the BEM directives |
14
+ | styling of a part of the application | the `.scss` file next to the component |
15
+ | a departure decided by the owner | the `native-ok` marker with an explanation — a comment on the line above or in the line itself |
16
+
17
+ ## Where it lives
18
+
19
+ In this tree — the table in `implementation.md` next to it. Paths live there, not here: the rule
20
+ travels between repositories, the layout does not, and a path named in the rule lies in the
21
+ first tree that keeps its code differently.
22
+
23
+ ## Flow
24
+
25
+ The flow of creating something new: where the work starts, where the border runs between
26
+ extending the ready-made and writing one's own, and what holds that border.
27
+
28
+ ```mermaid
29
+ flowchart TD
30
+ A[A new screen, component or field is needed] --> B[The ready-made is read: the application's kit, the shared bases, a neighbouring screen]
31
+ B --> C{The ready-made fits}
32
+ C -->|Yes| D[Taken as is]
33
+ C -->|Almost| E[Extended where it lives, not cloned next to it]
34
+ C -->|No| F{The owner approved one's own}
35
+ F -->|Yes| G[One's own is created, and that is recorded as a decision]
36
+ F -->|No| H[Asked: one's own primitive is not created without the owner's word]
37
+ E --> I[The component is declared in three files, messages go through the shared bus]
38
+ D --> I
39
+ G --> I
40
+ H --> I
41
+ ```
42
+
43
+ ## How the law applies here
44
+
45
+ - **The source of look is chosen by application, not by habit.** Every application of the tree
46
+ has its own base: the public site — its design system, the rest — the kit. A mixed-up source
47
+ brings to the screen a shape that exists nowhere else in this application. Which application
48
+ rests on what is named in the tree's names.
49
+ - **Work starts with reading the ready-made, not with a blank file.** First the base is found — a
50
+ kit component, a base class, a sample in a neighbouring domain — then one's own is written on
51
+ top of it.
52
+ - **A sample is taken whole, and every departure from it is a decision written before the code.**
53
+ A sample read for one side of it — the data flow, the store, the columns — is not a sample: its
54
+ layout, its waiting state and its empty states are part of it as much as the markup of the table.
55
+ The executor lists what the sample holds, copies it, and names each departure in the progress
56
+ with its reason; a departure that appears in the code without a line in the progress is a miss,
57
+ not a choice. The check before showing the work is a measurement of one's own screen against the
58
+ sample's, node by node, not of one's own screen alone.
59
+ - **A restriction invented on the spot is checked by a search over the tree before it becomes an
60
+ argument.** "This is not allowed" is a statement about the tree like any other, and a tree
61
+ where the technique is already applied answers it with one command. Named to the owner before
62
+ the search, it closes a road the tree uses every day and sets off a walk through needless
63
+ options: the decision "a class of a foreign kit cannot be edited from the application" went
64
+ unchecked while a sample of exactly that edit lay in the same file — with the argument on the
65
+ next line.
66
+ - **A value of an integration is taken the same way as the neighbouring value of the same
67
+ integration.** The half of the integration done properly is a ready-made sample, and it stands
68
+ not in a foreign domain but one line above: next to a map id hardcoded in the code lived that
69
+ map's own key, arriving by injection. A divergence between neighbours is the question "why is
70
+ one parameter done and the other not", not a choice between three ways to fix the second.
71
+ Nothing catches it: the value is syntactically valid, lint and build are green, and the
72
+ duplicate audit does not take a pair of constants under its signs.
73
+ - **One's own primitive and one's own base are created only with the owner's explicit approval.**
74
+ This is asked before the first file is written.
75
+ - **The record edit panel inherits the shared base, not its own markup.** Then it opens, closes
76
+ and asks about unsaved edits the same way in every section.
77
+ - **Success and failure are reported by the shared bus, not by one's own markup on the screen.**
78
+ One's own message diverges from the neighbouring one in look, place and time of showing. A
79
+ ready-made kit message placed on the screen is the same own markup: the rule speaks of the
80
+ place of showing, not the tag, and replacing one's own paragraph with a ready-made component
81
+ does not lift the violation — it lifts the sign.
82
+ - **An inline message is lawful where the record edit panel stays open after a failure.** The
83
+ panel base holds it; a screen, a list and a public page have no claim to that place.
84
+ - **The departure marker is set after reading the inventory of the ready-made, and what was read
85
+ is named next to it.** The explanation at the marker names the kit component and what it
86
+ lacks. A marker without that is not a departure but a silencer: it lifts the sign having proved
87
+ nothing.
88
+ - **A check is not taken off the gate so that the push goes through.** A divergence is closed by
89
+ the ready-made or declared as a departure in the code itself; a profile override is no means
90
+ for that.
91
+ - **A component is declared in three files: `.ts`, `.html`, `.scss`.** `template:` and `styles:`
92
+ in the decorator, the `style=` attribute and resizing through `[ngStyle]` are styles that
93
+ neither the kit nor `stylelint` reaches.
94
+ - **A screen component outside the kit has an empty styles file by default.** The layout is
95
+ declared once in the shared layer of the application, and the screen only applies it with the
96
+ same BEM directives.
97
+ - **The ready-made is extended, not cloned next to it.** The missing variant is created in the kit
98
+ or in the base class, and the other screens see it.
99
+ - **What accumulated before the guard is counted by the full check, and the list may only not
100
+ grow.** Its signs are the same as the guard's, because both read the same declared sets, but it
101
+ looks at the whole file: the gate falls on a new place, the old stays a number in the digest.
102
+ - **Signs are declared by the tree, not hardcoded in the check.** The tree does not take
103
+ everything from rt-tools, and a sign about the ready-made of a package that is not here answers
104
+ falsely exactly like the name of a foreign application.
105
+ - **The second value of the same integration follows its own kind, not its neighbour in the
106
+ file.** An external service rarely has one parameter: next to the key stands an id, next to the
107
+ address — a scope, and the first is usually done properly while the second stays hardcoded.
108
+ What is asked is not the neighbour but the kind: where values of this kind are created, who
109
+ edits them, by what road they reach the build. The neighbour may itself be unmoved, and
110
+ repeating it spreads the stale way further; the nearest neighbour is taken as the sample only
111
+ when the tree has no such kind at all. A hardcoded value is refused by neither linter, build nor
112
+ test: it is syntactically valid and simply does not belong to this tree — that is how a demo
113
+ value from the vendor's documentation leaves for the production build.
114
+ - **A logo of a foreign service is taken, not drawn.** It is taken from the owner of the mark or
115
+ from an open icon set, in a mockup the same as in code. A drawn mark next to the service name
116
+ reads as that service's logo, and a person at the screen does not recognise it.
117
+
118
+ ## What of the law is not here
119
+
120
+ Two articles of the law are counted by no check, and each of them is a number about a tree.
121
+ Whether a field of the application answers an error the way the ready-made one does; how many
122
+ places report a success or a failure by their own markup instead of the shared bus. A template or
123
+ styles inside the decorator is not a third of them: the package set carries a sign for that, and a
124
+ tree that declared the set gets a refusal on such an edit.
125
+
126
+ A number like that is not written into a text at all: it goes stale by itself, with no edit in the
127
+ tree, and a stale number reads as a current one. The companion of the rule writes the way to ask
128
+ it — the command, and what the answer of that command is a measurement of — and the answer stays
129
+ where it is true, in the tree.
130
+
131
+ The law's article about stopping a departure before the file is written is held in part, and the
132
+ part that is missing is named below, where the signs are described.
133
+
134
+ ## Patterns
135
+
136
+ - `reuse-first-extend` — what to do when the ready-made was not enough: extend the kit, declare a
137
+ departure with the marker, remove it.
138
+
139
+ ## Signs by which it is visible that the ready-made was bypassed
140
+
141
+ They are not listed here: a sign is a record in a file, not the text of the rule and not the code
142
+ of the check. The sets live with the package, one file per rt-tools package, and each holds only
143
+ what that package ships. The tree names the sets it needs with the key `reuse.bundles` in the
144
+ checks settings and appends its own signs in a file named by the key `reuse.signals`; a matching
145
+ key replaces the package one, a new one is appended. There the tree also names the directives of
146
+ its design system — with the key `reuse.kitDirectives`: a native tag carrying such a directive is
147
+ cut out of the signs, because the source of look in a tree is not always one. The guard on an
148
+ edit and the full check both read from here — they have nothing to diverge by.
149
+
150
+ What counts as a sign:
151
+
152
+ - a native control in a template where the kit ships its own;
153
+ - a failure, a warning or a wait assembled by hand instead of the ready-made — the sign names the
154
+ tag, and the decision is made by the place of showing: a ready-made message on the screen
155
+ closes the sign without closing the violation;
156
+ - an overlay above the page declared with one's own styles — backdrop, layer order, rotation;
157
+ - a layout declared in the screen's styles file instead of applied with directives from the
158
+ shared layer;
159
+ - one's own implementation of what the kit base gives, instead of inheritance;
160
+ - a file name repeating the name of a kit primitive, outside the kit.
161
+
162
+ A sign names its scope: inheriting a base and a class decorator do not land in a spot edit, and a
163
+ sign judging them by the added text is always silent. A sign also names its cancel — a sample
164
+ under which it does not fire: the base is already inherited, the ready-made is already called.
165
+
166
+ The boundary of a sign is the text by which it is recognised. A whole piece drawn by hand in place
167
+ of a ready-made component is assembled from ordinary markup nodes, and no sign names it: a screen
168
+ that drew its own feed of messages instead of the kit's passes the guard and the full check alike.
169
+ A declared set closes native controls, overlays and layout, and not that.
170
+
171
+ ## Pitfalls
172
+
173
+ - **A sample is searched for by the kit's names, not by what the kit is written on.** A search by
174
+ the names of the library the kit is built on finds not one file: the overlay, the portal and the
175
+ window are covered by the kit and called by its names. The reverse happens too: the library is a
176
+ direct dependency, and what the kit does not cover is called in the tree by the library's own
177
+ name. Before deciding that a name is not in the tree, it is searched for — this costs two
178
+ reworks per technique.
179
+ - A move does not count as reinvention: a line already lying in a file is struck out of the
180
+ checked text by the guard, and the comparison goes without indentation — on a move a block
181
+ changes its indent while staying the same code.
182
+ - An answer given before reading the sample is overruled by the sample: the agreed shape of a list
183
+ query was replayed together with the contract two questions after it was accepted.
184
+ - **A set is declared by what the tree consumes, and a tree that consumes what it writes declares
185
+ it with an area.** A tree in which the kit is written, not called, having declared its set, gets
186
+ advice to call the kit on the kit's own files: the sign is right but pointed the wrong way. That
187
+ is no reason to leave the set undeclared where the same tree is also its consumer: undeclared, it
188
+ leaves the consumer's screens unjudged, and the silence there is read as order. The area stands
189
+ next to the name — in place of the bare name a pair of the name and the roots it holds over.
190
+
191
+ ```json
192
+ { "reuse": { "bundles": ["angular", { "name": "kit", "roots": ["apps/admin", "libs/admin"] }] } }
193
+ ```
194
+
195
+ - **A guard that received no sign is indistinguishable from a guard with nothing to refuse.** It
196
+ says so itself, and the first edit in a tree without declared sets shows it. Silence of the
197
+ check does not count as a sign of order — first one looks whether it has anything to judge by.
198
+ - **A newly declared set lights up the code written before it, and none of that is new debt.**
199
+ Every place the set names arrives at once and as fresh, so the gate refuses a push for code
200
+ nobody touched. Either those places are closed by the same work, or the snapshot of what
201
+ accumulated is re-taken: the full check takes the key `--baseline` for exactly that.
@@ -0,0 +1,318 @@
1
+ # Project documentation — cold part, second file
2
+
3
+ The sections the rule `spec-driven` handed over when it was cut to its statements: its names,
4
+ its flow and every article whole, with its reasons. Read on demand, the same as `pitfalls.md`.
5
+
6
+ ## How the rule reads
7
+
8
+ Rule under the law `docs/constitution/project-documentation.md`. The law says what must be true
9
+ about texts; here — which layers they are built from in this tree and what the machine checks.
10
+ Wording is the rule `doc-style` under the same law.
11
+
12
+ **Cold part:** `pitfalls.md` next to it — traps already stepped on. Loaded on demand, not together
13
+ with the rule.
14
+
15
+ ## What it is called here
16
+
17
+ ```
18
+ LAW docs/constitution/<law>.md — true for any application of this class
19
+ docs/constitution/application/<law>.md — an application law: payments, locales, access
20
+ knows nothing of the project: no paths, no file names, no bindings
21
+
22
+ ├─ RULE .claude/skills/<rule>/SKILL.md (kind: rule, law: <law>)
23
+ │ binds the law to this project; several rules per law
24
+ │ .claude/skills/<rule>/implementation.md — binding to code
25
+ │ .claude/skills/<rule>/pitfalls.md — cold part: loaded on demand
26
+ │
27
+ │ └─ PATTERN .claude/skills/<rule>-<what>/SKILL.md (kind: pattern, rule: <rule>)
28
+ │ ready-made code and concrete techniques; at least one per rule
29
+ │
30
+ └─ DOMAIN SPEC docs/specs/<domain>/
31
+ how the domain works; declares the laws it applies
32
+
33
+ SKILL WITHOUT A LAW .claude/skills/<name>/SKILL.md (neither kind: rule nor kind: pattern)
34
+ stands next to the ladder, not in it: not about what must be true
35
+ in the product, but about how work is done here
36
+ ```
37
+
38
+ Links go only upward: a law refers neither to a rule, nor to a spec, nor to a file.
39
+
40
+ A skill without a law is the third case, and it is legitimate. The showcase, a generator, work with
41
+ a third-party service, creating the skill itself: there is no statement about the product above such
42
+ a thing, so there is no law either. Inventing a law for it to fit the ladder is not allowed — a law
43
+ with one rule and not a single article about the product drifts from the rest at the first edit. How
44
+ such a skill is created — skill `write-a-skill`.
45
+
46
+ | In the law | Here |
47
+ | --------------------------------- | ---------------------------------------------------------------------------------------------------- |
48
+ | set of sections | `REQUIRED_HEADINGS` for a spec, "Articles" for a law |
49
+ | a statement of a document | an item of `## Rules` in a spec, `## Articles` in a law, `## How the law applies here` in a rule |
50
+ | the place where it is carried out | a line in `implementation.md` next to it: `` `file:symbol` `` |
51
+ | promised behaviour | scenario `SC-<PREFIX>-<NUMBER>` in `docs/specs/<domain>/scenarios.md` |
52
+ | open question | `Q-<law letters>-<number>` in a law's "Open questions", `Q-<number>` in a spec's; tasks and commits refer to it, and the number is not reused after closing |
53
+ | laws a domain applies | the `**Laws:**` line in the spec header, names in backticks; `**Законы:**` is the former form |
54
+
55
+ ## Where it lives
56
+
57
+ In this tree — the table in `implementation.md` next to it. Paths live there, not here: the rule
58
+ travels between repositories, the layout does not, and a path named in the rule lies in the first
59
+ tree that keeps its code differently.
60
+
61
+ ## Flow
62
+
63
+ The flow of creating a text: which layer is written, how a statement is bound to code and how a
64
+ scenario keeps its number.
65
+
66
+ ```mermaid
67
+ flowchart TD
68
+ A[A text about the product or the work is written] --> B{What it is about}
69
+ B -->|What must be true, without names| C[Law: the articles section is mandatory, no paths in it]
70
+ B -->|By which technique it is kept here| D[Rule: declares its law, names in the companion next to it]
71
+ B -->|Ready-made code and technique| E[Pattern: declares its rule]
72
+ B -->|How a domain works| F[Domain spec: declares the laws it applies]
73
+ D --> G{The statement has a place in code}
74
+ F --> G
75
+ G -->|Yes| H[A binding line is placed; the link is checked both ways]
76
+ G -->|No| I[A rule article: a verdict line, held by nobody — a law question; a spec rule: the spec's open questions]
77
+ H --> J{A scenario is created}
78
+ J -->|Yes| K[The number is issued new and never reused; the test title is edited by the same change]
79
+ J -->|No| L[Done]
80
+ C --> L
81
+ E --> L
82
+ K --> L
83
+ I --> L
84
+ ```
85
+
86
+ ## The articles whole, with their reasons
87
+
88
+ - **The set of spec sections is fixed in advance, and a missing section is a refusal.** "Not
89
+ applicable" is a legitimate answer, a missing section is not: cross-cutting requirements get
90
+ remembered after the fact exactly when no place was made for them.
91
+ - **Every statement is bound to a place in code, and the link is checked both ways.** The key of the
92
+ link is the statement text itself, so it cannot be reworded with the binding forgotten.
93
+ - **The first column of the companion is the article text copied, not retold.** The key of the link
94
+ is the text itself: a line written by meaning breaks the link while looking filled in. The check
95
+ counts articles without an address and knows nothing of an article with a wrong address.
96
+ - **A binding does not lead into code nobody calls, and a test is not a call.** A function written
97
+ test-first, before the first call from the application, is an intention: the test calls it
98
+ itself, and by that call a live symbol cannot be told from a forgotten one. The exception is a
99
+ symbol declared in the suite harness itself or published outward by a package — there the caller
100
+ is the test or the consumer by the very purpose of the file.
101
+ - **A verdict is put by substance, not by the form of the address.** To the check two reasons for
102
+ a verdict look alike, and to the reader of the companion they do not: the first says "nothing
103
+ here holds the requirement", the second "it holds, but there is nothing to write it with". The
104
+ second verdict names the form itself as the reason and lives
105
+ until the form is fixed; the article under it stays carried out and is not removed.
106
+ - **A "not carried out" binding moves together with its article.** Otherwise the companion line
107
+ keeps in the hot part an article with nothing behind it: removed alone, it leaves the binding
108
+ without an item, and the audit turns red. Both sides move at once.
109
+ - **The procedure table is checked against the decorators both ways, the permission together with
110
+ the name.** Otherwise a procedure the domain serves but forgot to describe is visible only in the
111
+ decorator, and a permission that drifted from the spec — nowhere.
112
+ - **A refusal code is accepted only if the domain throws it.** Codes were written out from the
113
+ design, and on one path nobody threw the promised refusal.
114
+ - **A spec has one scenario prefix, and across the whole tree it is taken by that spec alone.** A
115
+ second prefix inside a spec means the subject is described twice; a prefix taken by another means
116
+ the number does not show whose scenario it is. A product agreement is numbered together with the
117
+ spec it will merge into, and the prefix does not become taken by it.
118
+ - **A scenario number is issued once and never reused.** A new one takes the next free number; it is
119
+ not inserted in the middle and does not take a deleted one — the deleted number's place stays
120
+ empty. The number ties the scenario to its test, and issued a second time it leaves the old
121
+ reference right on the surface; renumbering in sequence is deceptively cheap — the tests are green
122
+ both before and after. The free number is asked of the tree's command before the scenario heading
123
+ is written, and the companion names that command: the main branch alone does not show numbers
124
+ neighbouring work holds on disk.
125
+ - **A scenario and the title of its test are edited by one change.** The promise changed — the
126
+ number stays, and the test title is edited by the same commit; the scenario deleted — the test is
127
+ deleted too. Having drifted apart, they leave the run green while it checks something else.
128
+ - **A subdomain is asked the same as a domain.** The same mandatory sections, the same companion
129
+ next to it, the same link between scenarios and tests. A domain with half its subdomains described
130
+ and half created as empty directories is never green.
131
+ - **A law has a mandatory "Articles" section, and beyond it holds only open questions.** A law
132
+ carries no history of edits and no arguments for an option chosen once: version control holds the
133
+ history, and an argument with a rejected alternative is a trait of the work, and its place is the
134
+ rule's cold part, `pitfalls.md`. A closed question leaves the law, and an empty section kept for its heading
135
+ passed the check anyway.
136
+ - **A proposed law requires no rule.** An agreement written down before the code has nothing to bind
137
+ to, and demanding a rule would force creating one with anchors into places that do not exist. The
138
+ sign stands as a status line in the law itself, not in an exceptions list next to the check.
139
+ - **A law that names a project file is a refusal.** Paths and bindings belong in a rule; otherwise
140
+ the law can neither be read without knowing the tree nor applied to another application.
141
+ - **A rule description is no longer than three hundred characters and answers one question — load
142
+ this rule or not.** The description goes whole into the system prompt of every session, and the
143
+ session pays for it whatever it works on: that is what tells it from the rule body, which the
144
+ executor reads by itself. It grows on its own — it is written after the rule and retells its
145
+ content — and the retelling arrives a second time together with the rule itself. The descriptions
146
+ check counts the length; what is left longer than the limit is named in the accepted-debt list by
147
+ name, with a reason.
148
+
149
+ - **A rule declares the law it is written under.** A rule without a law is a set of techniques that
150
+ does not show what exactly must be true.
151
+ - **There are two layers of laws, and a law name is one for both.** The shared one lies in the
152
+ constitution root, an application law in `application/`; neither `law:` nor `**Laws:**` names
153
+ the layer, so law names are unique across the whole constitution tree.
154
+ - **A divergence between a rule and its companion is resolved in favour of the rule.** The companion
155
+ names the tree's names and the bindings of the articles; it does not cancel them: read above the
156
+ rule, it becomes the place where a requirement is lifted silently and without review. Concreteness
157
+ is no argument here — the companion is always more concrete, that is what it is for. A divergence
158
+ found is named to the owner and fixed in the text that fell behind, and until then the work goes
159
+ by the rule.
160
+ - **A companion's statement about the state of an external service is checked by the command the
161
+ companion itself names.** A neighbour's limit is lifted together with someone else's setting,
162
+ while the text about it stays in the present tense and looks right after the lifting: only a call
163
+ tells the current from the lifted. So the companion writes the way to ask, not a snapshot of the
164
+ answer — and it has no right to order, on such a snapshot, the opposite of what the rule says.
165
+ - **A rule may have a third file, and what is not read when deciding goes there.** Pitfalls and
166
+ behaviour from incident analyses are needed not by whoever makes an ordinary decision but by
167
+ whoever reviews a miss or argues with a guard — yet they load with the rule every time and grow
168
+ faster than the articles. Such text leaves for `pitfalls.md` next to it, the rule names it with a
169
+ line in its header, and it loads on demand. The gate refusal is silent about the cold part: it
170
+ calls the rule, and the rule itself speaks of the third file.
171
+
172
+ - **A spec declares the laws it applies, and the link is checked both ways.** A law named in the
173
+ spec text must stand in the header: otherwise the law gives no way to learn which domains stand on
174
+ it.
175
+ - **Portable text speaks of a neighbouring resource conditionally and names it by name.** What is
176
+ laid out in the tree and what is not is known to the layout list, not to the resource text. Said
177
+ unconditionally — "a guard refuses a code edit before that" — it enters the context of every
178
+ session and lies about a tree where that guard was not laid out; the tree has no way to fix that
179
+ if the resource has no override. A resource's requirement of a resource is declared by a line in
180
+ the header, not derived from such a phrase.
181
+ - **An article of a rule speaks of its own applicability itself, by a sign line at its side.** A
182
+ gate refusal calls the whole rule, while one of its articles covers the specific edit: paying the
183
+ rule's full price for a decision means teaching to skip reading, that is to work worse than what
184
+ was explored. The sign stands at the article, not in the gate map: the map knows the path and the
185
+ rule, not which of two dozen articles is about that path.
186
+
187
+ ```markdown
188
+ - **Article title.** Article text, as usual.
189
+ <!-- rt-when: *.scss *.css -->
190
+ ```
191
+
192
+ The globs are separated by a space and matched against the edit path as shell globs, not by
193
+ word search: a word search names the wrong article and stays silent about it. A glob without
194
+ a directory is also matched against the file name, and the comment is invisible in the
195
+ assembled markup.
196
+
197
+ - **An article without a sign is legitimate, and so is a rule without a single sign.** A sign is
198
+ given to the articles whose rule refuses on a file edit; the rest are marked as their refusals
199
+ reach the digest. A missing sign means "this article is not selected by the edit path", not a
200
+ miss: demanding it from all would mean marking at random.
201
+
202
+ - **A pattern is found by the `rule:` field, not by the name prefix.** Not every pattern carries the
203
+ name prefix, and a search by rule name does not see those: the audit finds them by the field, a
204
+ person by the rule's own "Patterns" section. A count of patterns gathered by prefixes comes out
205
+ below the true one, and the number then goes into splitting the work.
206
+ - **A decision from a spec goes to the layer, not to the archive.** What a spec is checked against
207
+ the machine knows; where an accepted decision goes it does not know and will not: only whoever
208
+ asks "will this still be true tomorrow" can tell a current requirement from an account of what
209
+ happened. Where the pattern `task-flow-archive` is laid out, its step holds this, with the
210
+ selection sign written there in advance.
211
+ - **A name in an anchor is written as declared in code.** A private class field stands with a hash,
212
+ and the name written without it names the wrong symbol: the check stays green, and the reader
213
+ cannot tell from the binding line whether this is the private method or the ordinary one next to
214
+ it. The former form stays legitimate — the name without the hash is remembered alongside the name
215
+ itself.
216
+ - **An anchor is checked against the raw text of the file, and a comment counts the same as code.**
217
+ The check looks for the symbol's existence by word across the whole file without stripping
218
+ comments, and counts liveness only for what is declared in code. A name standing in an explanation
219
+ alone slips past both sides: the statement's anchor turns out to be a word from a comment, while
220
+ the declaration next to it is called differently.
221
+
222
+ - **A check nailed to a resource name breaks when the resource is split, and this has to be known
223
+ before the edit.** A rule name and a pattern name stand not only in texts but in the tree's
224
+ checks, in the probes of their suites and in the state tables. So a split starts with a search for
225
+ the name across the whole tree: otherwise red arrives one check per run — that is how splitting
226
+ one rule took down three.
227
+
228
+ - **The spec speaking of a resource is found by a command, not by walking the subdomains.** A domain
229
+ grows into dozens of subdomains, and the one needed is told from the rest only by reading: whoever
230
+ takes apart a complaint about a file pays the whole window for that and therefore judges by memory.
231
+ The command reads the bindings of the companions — the very ones the audit keeps fresh — and,
232
+ called without a name, names the resources no spec speaks of. It knows only what the package
233
+ lays out; for an application file it answers that the package carries no such name, and the
234
+ product spec is found by the file path in the bindings of the domain specs.
235
+ <!-- rt-when: *.md -->
236
+
237
+ ## The shape of a compressed article
238
+
239
+ A rule loads whole into a session and pays for it every session, whatever the session works on. A
240
+ one-off measurement named where the weight was: 289 440 characters in twenty-nine rules, the articles
241
+ section is 45% of them, and inside the section statements take 19%, their arguments 81%. So the
242
+ argument is cut, not the statement: a removed statement changes the rule, a removed argument only
243
+ its price. Room is measured before an article is added, not after the commit is refused: the size
244
+ check judges lines and characters apart, and a rule near either limit is compressed in the same
245
+ edit. The measurement is two numbers from `wc -lc` against the limits the check prints.
246
+
247
+ A paragraph at an article has three outcomes, chosen by one question: **what is this text needed for
248
+ — to make a decision, to keep it from being reversed, or to review a miss?**
249
+
250
+ | The text is needed to… | Outcome |
251
+ | --------------------------------------------------------------- | ------------------------------ |
252
+ | decide on the edit: what counts as right, where the boundary is | stays at the article verbatim |
253
+ | not reverse the decision in a month: why exactly so | folds to one line |
254
+ | review a miss or argue with a guard | leaves for the cold part whole |
255
+
256
+ - **What stays at the article is the statement and what it reads wrong without.** The boundary, the
257
+ exception, the applicability sign, the name of whoever guards it. Tested by subtraction: a removed
258
+ piece changes the answer to "do it this way or not" — then it is not surplus.
259
+ - **An argument folds to one line: the price of the miss, not its history.** "Otherwise the run is
260
+ green while it checks something else" is an argument. When it happened, how many times in a row
261
+ and in which branch is history, and its place is the cold part.
262
+ - **An incident analysis leaves for the cold part whole, with its numbers and rejected options.**
263
+ The cold part loads on demand and grows freely: one session in a hundred pays for it.
264
+ - **The cold part holds explanation, not requirement.** A statement absent from the rule never lives
265
+ there: a rule whose requirement lives in the cold part promises what the session loading it will
266
+ not see. Tested by the same question reversed — no decision can be made by the cold part that
267
+ cannot be made by the rule.
268
+ - **Compression is judged by retelling, not in the source.** An article compressed right is retold
269
+ by the same decision: whoever read only it edits the same way as whoever read the former one. They
270
+ diverged — surplus was removed, and it comes back at the article, not to the cold part.
271
+ - **A rule without a cold part is legitimate, and the first paragraph that leaves creates one.** An
272
+ empty `pitfalls.md` next to it is a promise, not a mechanism.
273
+
274
+ ## What of the law is not here
275
+
276
+ A law no spec applies does not count as a refusal: the laws on code structure, delivery and
277
+ verifiability do not touch domains at all. The order "description first, code second" is held by
278
+ agreement: the project-documentation law carries no such requirement, and no open question for it is
279
+ opened there.
280
+
281
+ Screen state tables are checked by nothing. `check:specs` knows scenarios against test titles, rules
282
+ against anchors, procedures against decorators and refusal codes against throws — a state table row
283
+ is bound to nothing and passes green even when the code never reaches the named state. The state
284
+ "the check did not load" stood in the tables of two domains before the code learned to reach it, and
285
+ all that time read as a description of something working.
286
+
287
+ The meaning of a scenario is checked against its neighbour by nothing: the check judges the number.
288
+ Two scenarios promising the same thing in different words are different to it, and the second counts
289
+ as unverifiable for as long as it lives.
290
+
291
+ The completeness of marking articles with an applicability sign is counted by nothing. A rule with a
292
+ sign on none of its articles refuses with the old text — and differs from a marked one only in that
293
+ the executor reads it whole; no check says so. The observations digest judges it: the rule that
294
+ refuses on a file edit more often than the others is the first to be marked.
295
+
296
+ Section completeness of the law, the rule and the pattern themselves is checked by nothing here. The
297
+ articles saying that a text is judged no more leniently than its copy, that an unchosen edition is
298
+ judged the same as the chosen one, that the set of sections is declared apart from the sample and
299
+ that a requirement nobody formulated stays silent are carried out where these texts are written — in the suite of the package that ships them. A consumer
300
+ tree holds laid-out copies, and its check must not turn red on someone else's miss. Agreement of two
301
+ texts is looked for by reading.
302
+
303
+ The shape of a compressed article is checked by nothing, and there will be no check for it: the
304
+ machine sees the character count, not whether the compressed article still yields the former
305
+ decision. An argument cut out together with the statement's boundary is shorter than the right one
306
+ and passes any character count. One thing guards this — the text length limit: it says the rule has
307
+ outgrown, and is silent about what to cut. Compression is judged by retelling — by whoever edits by
308
+ the compressed article next.
309
+
310
+ The share of argument in a rule is counted by nothing. The measurement the shape stands on was made
311
+ in a one-off pass and did not go into the tree: it answers "where the weight is", not "does it add
312
+ up".
313
+
314
+ ## Patterns
315
+
316
+ - `spec-driven-domain` — creating and editing a domain spec, scenarios, binding.
317
+ - `spec-driven-rule` — creating a law, a rule and a pattern.
318
+ - `spec-driven-sweep` — a full review of a domain's binding, passes and their review.
@@ -7,12 +7,13 @@ The rule is `spec-driven`; the articles that hold the law stand there.
7
7
 
8
8
  ## Pitfalls
9
9
 
10
- - **Do not create `tasks.md` in a spec.** Steps are a session artefact; their place is the branch
11
- or the PR description. As soon as "steps" appear in the directory, the spec becomes a plan
12
- again and dies after the merge.
10
+ - **Do not create `tasks.md` in a spec.** Steps are a session artefact; their place is the plan in
11
+ the task folder. As soon as "steps" appear in the directory, the spec becomes a plan
12
+ again and is out of date after the merge.
13
13
  - **A spec describes what is settled, not what is coming.** The only place where it speaks of the
14
- future is `proposed/<feature>/`. After the rollout its text merges into the domain spec, the
15
- directory is removed, the scenario identifiers do not change.
14
+ future is `proposed/<feature>/`. Its text merges into the domain spec by one of the last
15
+ commits of the branch, before the PR opens; the directory is removed, the scenario identifiers
16
+ do not change.
16
17
  - **Nothing checks the semantics of fields.** The check knows procedure names, failure codes and
17
18
  the link between scenarios and tests; what an empty field means, it does not know. So a
18
19
  `.proto` edit pulls in the specs of every domain whose procedures it touched, in the same
@@ -21,8 +22,9 @@ The rule is `spec-driven`; the articles that hold the law stand there.
21
22
  mention anywhere is enough for the symbol — in someone else's field with the same name, in a
22
23
  markup attribute. The place where the rule is actually carried out is confirmed only by
23
24
  reading the code.
24
- - **An anchor in `tools/*.mjs` is checked by almost nothing:** liveness is counted only for
25
- `.ts`, and the sources are walked over `apps`, `libs` and `prisma`. So a rule bound to a check
25
+ - **An anchor in `tools/*.mjs` is checked by almost nothing:** liveness is judged only for
26
+ a symbol declared in `.ts`; callers are looked for in `.ts` and `.html` under the roots the tree
27
+ names. So a rule bound to a check
26
28
  is read together with the check's body.
27
29
  - **A green check does not mean the structure is right.** Sidecars with bindings first lay next
28
30
  to the laws, and the check was green precisely because the structure matched what the check