@rt-tools/agent-kit 0.36.0 → 0.37.1

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 (143) hide show
  1. package/assets/checks/board-pull-state.github.mjs +82 -13
  2. package/assets/checks/board.github.mjs +1 -1
  3. package/assets/checks/check-board.github.mjs +20 -12
  4. package/assets/checks/check-specs.mjs +2 -2
  5. package/assets/checks/epic-table.github.mjs +4 -3
  6. package/assets/checks/lib-common.mjs +10 -2
  7. package/assets/checks/lib-domains.mjs +1 -1
  8. package/assets/checks/lib-manifests.mjs +34 -2
  9. package/assets/checks/push-inputs.mjs +401 -0
  10. package/assets/checks/push-trace.mjs +108 -0
  11. package/assets/checks/rt-kit-checks.config.mjs +17 -2
  12. package/assets/checks/spec-anchors.mjs +4 -4
  13. package/assets/checks/spec-contract.mjs +5 -5
  14. package/assets/commands/next-session.md +3 -1
  15. package/assets/commands/night.md +28 -18
  16. package/assets/defaults/project.sh +37 -8
  17. package/assets/defaults/push.sh +23 -0
  18. package/assets/defaults/turn-map.md +10 -6
  19. package/assets/docs/GLOSSARY.md +3 -1
  20. package/assets/hooks/epic-stop-guard.sh +62 -15
  21. package/assets/hooks/git-guard-push-ahead.sh +31 -1
  22. package/assets/hooks/git-guard-push-marks.sh +173 -29
  23. package/assets/hooks/git-guard-push-tests.sh +22 -3
  24. package/assets/hooks/handoff-entry-guard.sh +2 -2
  25. package/assets/hooks/pre-push.sh +6 -0
  26. package/assets/hooks/push-set.sh +29 -4
  27. package/assets/hooks/task-flow-context.sh +15 -4
  28. package/assets/hooks/task-flow-guard.sh +4 -3
  29. package/assets/hooks/turn-exit-epic.sh +1 -1
  30. package/assets/hooks/turn-exit-guard.sh +8 -8
  31. package/assets/hooks/turn-exit-role.sh +45 -0
  32. package/assets/laws/work-conduct.md +9 -8
  33. package/assets/patterns/autonomous-work-run.md +35 -10
  34. package/assets/patterns/browser-verification-measure.md +10 -20
  35. package/assets/patterns/browser-verification-stand.md +30 -42
  36. package/assets/patterns/doc-style-human.md +0 -6
  37. package/assets/patterns/doc-style-sweep.md +7 -7
  38. package/assets/patterns/doc-style-trace.md +5 -4
  39. package/assets/patterns/doc-style-write.md +7 -7
  40. package/assets/patterns/epic-flow-declare.md +15 -8
  41. package/assets/patterns/git-workflow-commit.github.md +1 -1
  42. package/assets/patterns/git-workflow-freshness.md +12 -11
  43. package/assets/patterns/git-workflow-merge.md +14 -11
  44. package/assets/patterns/git-workflow-migration.md +4 -2
  45. package/assets/patterns/git-workflow-pr-body.github.md +1 -1
  46. package/assets/patterns/git-workflow-pr-ready.md +5 -4
  47. package/assets/patterns/git-workflow-pr.azure.md +91 -25
  48. package/assets/patterns/git-workflow-pr.github.md +17 -19
  49. package/assets/patterns/git-workflow-pr.gitlab.md +75 -29
  50. package/assets/patterns/git-workflow-restart.md +3 -2
  51. package/assets/patterns/git-workflow-stack.md +25 -21
  52. package/assets/patterns/lib-layers-new.md +7 -3
  53. package/assets/patterns/queue-audit-read.github.md +9 -3
  54. package/assets/patterns/spec-driven-domain.md +50 -48
  55. package/assets/patterns/spec-driven-rule.md +18 -19
  56. package/assets/patterns/status-report-table.github.md +1 -1
  57. package/assets/patterns/task-flow-archive.md +14 -34
  58. package/assets/patterns/task-flow-close.md +3 -2
  59. package/assets/patterns/task-flow-graph.needs-graph.md +98 -0
  60. package/assets/patterns/task-flow-handoff.md +4 -4
  61. package/assets/patterns/task-flow-resume.md +56 -20
  62. package/assets/patterns/task-flow-start.md +3 -4
  63. package/assets/patterns/testing-e2e.md +14 -18
  64. package/assets/patterns/testing-unit.md +9 -13
  65. package/assets/patterns/turn-entry-map.md +13 -3
  66. package/assets/pitfalls/autonomous-work.md +15 -0
  67. package/assets/pitfalls/doc-style.md +3 -3
  68. package/assets/pitfalls/git-workflow.github.md +5 -9
  69. package/assets/pitfalls/spec-driven.md +9 -7
  70. package/assets/pitfalls/task-flow.md +14 -25
  71. package/assets/pitfalls/testing.md +11 -12
  72. package/assets/pitfalls/turn-conduct.md +6 -6
  73. package/assets/rules/autonomous-work.md +37 -29
  74. package/assets/rules/browser-verification.md +27 -22
  75. package/assets/rules/dependencies.md +3 -3
  76. package/assets/rules/deploy-flow.azure.md +35 -12
  77. package/assets/rules/deploy-flow.github.md +10 -6
  78. package/assets/rules/deploy-flow.gitlab.md +40 -17
  79. package/assets/rules/doc-style.md +21 -17
  80. package/assets/rules/epic-flow.md +5 -3
  81. package/assets/rules/git-workflow.azure.md +140 -122
  82. package/assets/rules/git-workflow.github.md +7 -8
  83. package/assets/rules/git-workflow.gitlab.md +128 -117
  84. package/assets/rules/queue-audit.github.md +5 -3
  85. package/assets/rules/spec-driven.md +17 -25
  86. package/assets/rules/status-report.md +5 -3
  87. package/assets/rules/task-flow.md +33 -15
  88. package/assets/rules/testing.md +35 -32
  89. package/assets/rules/turn-conduct.md +26 -24
  90. package/assets/templates/rule.md +2 -2
  91. package/assets/traits.json +3 -0
  92. package/lib/cargo-prose.d.ts +2 -1
  93. package/lib/cargo-prose.d.ts.map +1 -1
  94. package/lib/cargo-prose.js.map +1 -1
  95. package/lib/companion.d.ts +0 -5
  96. package/lib/companion.d.ts.map +1 -1
  97. package/lib/companion.js +1 -1
  98. package/lib/companion.js.map +1 -1
  99. package/lib/cost.d.ts +0 -8
  100. package/lib/cost.d.ts.map +1 -1
  101. package/lib/cost.js +4 -4
  102. package/lib/cost.js.map +1 -1
  103. package/lib/hooks-map.d.ts +0 -12
  104. package/lib/hooks-map.d.ts.map +1 -1
  105. package/lib/hooks-map.js +2 -25
  106. package/lib/hooks-map.js.map +1 -1
  107. package/lib/observations-cargo.d.ts +1 -5
  108. package/lib/observations-cargo.d.ts.map +1 -1
  109. package/lib/observations-cargo.js +2 -2
  110. package/lib/observations-cargo.js.map +1 -1
  111. package/lib/observations.d.ts +0 -2
  112. package/lib/observations.d.ts.map +1 -1
  113. package/lib/observations.js.map +1 -1
  114. package/lib/order.d.ts +0 -2
  115. package/lib/order.d.ts.map +1 -1
  116. package/lib/order.js +0 -4
  117. package/lib/order.js.map +1 -1
  118. package/lib/outcomes.d.ts +2 -7
  119. package/lib/outcomes.d.ts.map +1 -1
  120. package/lib/outcomes.js +3 -3
  121. package/lib/outcomes.js.map +1 -1
  122. package/lib/proposals.d.ts +0 -1
  123. package/lib/proposals.d.ts.map +1 -1
  124. package/lib/proposals.js +1 -1
  125. package/lib/proposals.js.map +1 -1
  126. package/lib/shipment.d.ts +2 -11
  127. package/lib/shipment.d.ts.map +1 -1
  128. package/lib/shipment.fixture.d.ts +0 -3
  129. package/lib/shipment.fixture.d.ts.map +1 -1
  130. package/lib/shipment.fixture.js +3 -3
  131. package/lib/shipment.fixture.js.map +1 -1
  132. package/lib/shipment.js +2 -2
  133. package/lib/shipment.js.map +1 -1
  134. package/lib/traits.d.ts +0 -3
  135. package/lib/traits.d.ts.map +1 -1
  136. package/lib/traits.js +2 -2
  137. package/lib/traits.js.map +1 -1
  138. package/lib/variants.d.ts +0 -1
  139. package/lib/variants.d.ts.map +1 -1
  140. package/lib/variants.js +1 -1
  141. package/lib/variants.js.map +1 -1
  142. package/package.json +1 -1
  143. package/assets/checks/signals/ui-kit.json +0 -11
@@ -2,7 +2,7 @@
2
2
  name: git-workflow
3
3
  kind: rule
4
4
  law: delivery
5
- description: Rule under the delivery law for a tree on GitLab. Load for creating a task and a branch, commit, push, opening an MR and merging. Names the one-to-one match of task and branch, the machine account and the delivery guards. Patterns git-workflow-commit, -pr, -merge. Rollout — rule deploy-flow.
5
+ description: Rule under the delivery law for a tree on GitLab. Load for creating a task and a branch, commit, push, opening an MR and merging. Names the one-to-one match of task and branch, the machine account and the delivery guards. Patterns git-workflow-commit, -pr, -merge, -stack. Rollout — rule deploy-flow.
6
6
  ---
7
7
 
8
8
  # Delivery — how it works here
@@ -20,7 +20,10 @@ with the rule.
20
20
  | In the law | Here |
21
21
  | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
22
22
  | main branch | `main` |
23
- | separate branch | `<КЛЮЧ>-<номер задачи>-<короткий-slug>`. A name without a number (`feat/…`, `fix/…`) is legitimate locally: no MR opens from it |
23
+ | epic | a project issue with the epic label, `[<КЛЮЧ>-<номер>] <Возможность>`, and a plan next to it: the order of tasks and how the branches stand |
24
+ | epic branch | `<КЛЮЧ>-<номер эпика>-<короткий-slug>`, taken from `main`. Task branches are taken from it, and their MRs go into it |
25
+ | PR of an epic | MR into `main` from the epic branch; opens after all its tasks are merged and their folders taken apart |
26
+ | separate branch | `<КЛЮЧ>-<номер задачи>-<короткий-slug>`, taken from the epic branch. A name without a number (`feat/…`, `fix/…`) is legitimate locally: no MR opens from it |
24
27
  | task key | the tree's word for its tasks: `board.taskKey` in `.claude/rt-kit/checks.json`, named in `implementation.md` for the reader |
25
28
  | task | a project issue `[<КЛЮЧ>-<номер>] <Что не так>`, assignee the machine account; attached MR: `Closes #<номер>` in its description |
26
29
  | work queue | the project's Issue Board. A task lands on it by a list label, not by being created: the board shows what carries a label it knows |
@@ -43,20 +46,26 @@ work ends.
43
46
 
44
47
  ```mermaid
45
48
  flowchart TD
46
- A[Work begins] --> B[A command creates the task and it enters the work queue]
47
- B --> C[The branch is named by the task number; the column moves in the same motion]
49
+ A[Work begins] --> Z{The epic of this work is named}
50
+ Z -->|No| Y[The epic is created together with its tasks, and its branch is taken from main]
51
+ Z -->|Yes| B[A command creates the task and it enters the work queue]
52
+ Y --> B
53
+ B --> C[The branch is named by the task number and taken from the epic branch; the list moves in the same motion — the epic card too, on its first task]
48
54
  C --> D{The edit is ready}
49
55
  D -->|No| C
50
- D -->|Yes| E[Main is merged in, the gate set is run whole]
56
+ D -->|Yes| E[The base is merged in, the last commit takes the task folder apart, the gate set is run whole]
51
57
  E --> F{The branch carries a task number}
52
58
  F -->|No| G[The delivery guard refuses the opening: nothing in the queue stands behind the edit]
53
- F -->|Yes| H[The PR opens; what is not ready to merge goes as a draft]
54
- H --> I[The task column moves to review, the executor takes the next task]
59
+ F -->|Yes| H[The MR opens: a draft where a run is waited for, ready where the pipeline does not wake]
60
+ H --> I[The list moves to review, the executor takes the next task]
55
61
  I --> J{The run and the review are over}
56
62
  J -->|Run red| K[Fixed in the same branch]
57
63
  K --> J
58
- J -->|Green| L[The last commit takes the task folder apart, the draft is lifted]
59
- L --> M[A person presses the merge: the executor asks and names the number]
64
+ J -->|Green| L[The draft, if there was one, is lifted]
65
+ L --> M[A person presses the merge into the epic branch: the executor asks and names the number]
66
+ M --> N{Tasks of the epic are left}
67
+ N -->|Yes| B
68
+ N -->|No| O[The MR of the epic into main opens: all the folders are taken apart, and the main branch takes the epic whole]
60
69
  G --> B
61
70
  ```
62
71
 
@@ -68,56 +77,83 @@ flowchart TD
68
77
  - **A branch without a task number opens no MR.** The delivery guard refuses `glab mr create` from
69
78
  such a branch: locally it is legitimate, but an edit from it is a rollout with nothing behind it
70
79
  in the work queue. A task is created, and the work moves to a branch with its number.
71
- - **The main branch is merged into the task branch before the MR opens.** The delivery guard refuses
72
- the opening until main's tip is an ancestor of the current branch, and names the divergence as a
73
- commit count. An MR from a diverged branch shows the reviewer the edit mixed with someone else's,
74
- and everything the author checked before publishing was checked from a base that main no longer
75
- has.
76
- - **Unmet delivery conditions are named in one refusal, not one by one.** The guard collects them
77
- all and prints them at once. An executor refused on the first miss fixes the base, repeats the
78
- call, hits the title, fixes the title, hits the task — and every round costs one more call, though
79
- everything unmet was known on the first.
80
+ - **Work begins with the epic, and the branch of a task is taken from the epic branch.** `git
81
+ checkout -b <КЛЮЧ>-<номер задачи>-<slug> <ветка эпика>`; from `main` only the epic branch itself
82
+ is taken — a branch taken from `main` carries into it what the epic has not finished.
83
+ - **The MR of a task has the epic branch as its base — `glab mr create --target-branch <ветка
84
+ эпика>`.** Opened into `main`, it leaves the epic branch a copy nobody merges. In a chain the base
85
+ is the previous branch, lawful while it carries the epic branch.
86
+ - **The MR of an epic into the main branch opens after all its tasks are merged and their folders
87
+ are taken apart.** The merge button there means the whole epic, and there is nothing to press it
88
+ for while one of them is still written.
89
+ - **The epic branch carries the plan of the epic and the merges of its tasks, and no edits of its
90
+ own.** An edit made in it goes into `main` unreviewed: nobody opens an MR from that branch to it.
91
+ - **The main branch is merged into the epic branch, and the epic branch into the branches of its
92
+ tasks — while the work runs, not before the hand-over.** The delivery guard refuses the opening
93
+ until the tip of the base is an ancestor of the branch, and names the divergence as a commit
94
+ count: otherwise the reviewer sees the edit mixed with someone else's, checked from a base that is
95
+ gone.
96
+ - **A wave of branches off one epic branch is checked by a trial merge, not one by one:** each is
97
+ green on its own, and they collide on what one branch cannot show.
98
+ - **The next work's branch is taken from the previous one while the chain is unbroken.** `git
99
+ checkout -b <КЛЮЧ>-<номер>-<slug> <предыдущая ветка>`; from the epic branch — only the chain's
100
+ first work.
101
+ - **An MR in a chain has the previous branch as its base, not main.** `glab mr create
102
+ --target-branch <предыдущая ветка>` — otherwise the review shows the edit mixed with all under it.
103
+ The base is retargeted by the same motion that merges the lower one — the pattern
104
+ `git-workflow-stack`.
105
+ - **A chain is merged bottom-up, and the order stands in every MR description.** Branch kinship is
106
+ invisible in the list, and the line "stands on !<number>" is the only place it is read.
107
+ - **The lower branch of a chain does not rewrite history — neither `rebase` nor a force push.** The
108
+ upper MR loses its diff with it. A lagging branch is fixed by merging its base in.
109
+ - **A divergence inside a chain is resolved by the one who branches.** Both edits are theirs; the
110
+ owner resolving the same at merge time owns neither.
111
+ - **Unmet delivery conditions are named in one refusal.** The guard collects and prints them at
112
+ once: everything unmet is known on the first call.
80
113
  - **A condition known at the start of work is asked at the start.** Creating a branch refuses a base
81
- without main's tip, and a working copy that signs commits with an email other than the one the
82
- tree declared. At push and at MR opening the same checks stay as a second line, but there they
83
- cost more: the base is fixed by a merge with conflict resolution, the signature by rewriting the
84
- whole branch.
114
+ without the tip of the branch it stands on and a foreign signature email: at push time the fix
115
+ costs more.
85
116
  - **The base judged is the one named by the command, not the tip of the working copy.** A branch is
86
- also created straight from main's tip — that very command takes the base fresh — and a guard
87
- reading only the current tip would refuse it like a branch off yesterday's tree. A base the tree
88
- knows nothing of is not judged at all.
117
+ also created straight from `origin/main`, and that command takes the base fresh; a base the tree
118
+ knows nothing of is not judged.
89
119
  - **A branch without a task number gets no delivery conditions.** A local trial branch is
90
- legitimate, and demanding a fresh base of it would refuse work that will not go to main: no MR
91
- opens from such a branch.
120
+ legitimate, and it will not go to main.
92
121
  - **A commit lands with its final content, and a later commit of the same branch does not correct
93
122
  it.** It is made after the check against the mockup, the sample and the measurement; what is not
94
123
  checked stays in the working tree. A third commit fixing the first shows the reviewer the miss
95
124
  instead of the work, and rewriting history hides the trace, not the cause.
96
- - **A code edit is handed to a person by an open MR, not by a pushed branch.** A branch is not shown
97
- to them in the branch list, reaches no to-do list and has no discussion: before the MR opens there
98
- is no edit for a person. It opens in the turn in which the executor says the work is handed over,
99
- and the reply names it by number.
125
+ - **A code edit is handed to a person by an open MR, not by a pushed branch.** A branch reaches no
126
+ inbox; the MR opens in the turn the work is said handed over, and the reply names its number.
100
127
  - **What is not ready to merge opens as a draft — `glab mr create --draft`.** The host itself locks
101
128
  a draft's merge button, so the state "put up for viewing" and the state "may be merged" stop
102
129
  looking alike. Everything waiting for a pipeline run, a rework or an answer goes as a draft; the
103
130
  question is asked in the MR itself. The draft sign here is the `Draft:` prefix in the title, and
104
131
  it is edited together with it.
132
+ - **An MR the pipeline does not wake for opens ready, without the draft flag.** Which target
133
+ branches it wakes for is read from the pipeline file: where no run comes, a draft waits for
134
+ nothing and costs a locked button and a second turn. The reviewer is set in the same turn.
135
+ - **What checks an MR whose base is not the main branch is asked before the first MR of an epic
136
+ opens.** The pipeline either wakes for it as for one into main, or does not, and then the push
137
+ gate is the only check behind the work — pattern `git-workflow-stack`.
105
138
  - **`--hard` is not taken to drop a commit — that is `--soft`.** `reset --hard`, `checkout --
106
139
  <path>`, `restore <path>` and `clean -f` erase what is not committed. On a dirty tree the guard
107
140
  refuses and names the files; the bypass is `# discard: <reason>` in the command.
108
- - **The working tree is emptied before the PR opens, not after.** `git status --porcelain` is asked
109
- in the same turn as the opening: what is uncommitted goes to the host by a commit before it, or
110
- is named. A push after the opening moves the tip past the green run the body names, and for that
111
- stretch the PR invites merging a tip nothing has checked.
112
- - **A push into a branch that has an open PR is followed by rereading its body.** The statement
113
- about a green run names the tip by its sha, and moving the tip makes it false in silence: no check
114
- reads a PR body.
115
- - **On remarks to a PR the person is asked whether to answer under them, and after a yes each one
141
+ - **The working tree is emptied before the MR opens, not after.** `git status --porcelain` is asked
142
+ in the same turn as the opening: what is uncommitted goes to the host by a commit before it, or is
143
+ named. A push after the opening moves the tip past the green run the description names, and for
144
+ that stretch the MR invites merging a tip nothing has checked.
145
+ - **A push into a branch that has an open MR is followed by rereading its description.** The
146
+ statement about a green run names the tip by its sha, and moving the tip makes it false in
147
+ silence: no check reads an MR description.
148
+ - **On remarks to an MR the person is asked whether to answer under them, and after a yes each one
116
149
  gets an answer.** Edits alone leave the discussion silent, and the person reads the whole diff
117
- again. The word holds for that PR, not for the next.
150
+ again. The word holds for that MR, not for the next.
118
151
  - **The draft is lifted by a separate call — `glab mr update <номер> --ready`.** With it the
119
152
  executor answers for readiness: checks passed, no rework left, the work matches the task. Lifting
120
- the draft and asking to merge are one turn, not two days.
153
+ the draft and asking to merge are one turn, and an MR opened ready needs no such call.
154
+ - **The MR merge is pressed by a person, not by the work's executor.** The button, `glab mr merge`
155
+ and "Merge when pipeline succeeds" set by the executor are equal. The executor merges their own MR
156
+ only when a person said so about this MR; said about one, it does not carry to the next.
121
157
  - **The draft is not lifted while the MR has no review.** The delivery guard reads the requested
122
158
  reviewer and the review left: a lifted draft reads as "may be merged", and there is nobody to
123
159
  merge. Earlier than this turn there is nowhere to ask — before the MR opens there is no reviewer
@@ -125,36 +161,31 @@ flowchart TD
125
161
  review. A call without a number is judged too — the client then takes the MR of the current
126
162
  branch, and one space would lift the requirement; returning an MR to draft gets no requirement.
127
163
  - **A created task is confirmed by the work queue's answer, not by the creation command's output.**
128
- The command answers for its calls: it can create a task and not bring it to the board, and its own
129
- error handling names that case. A printed number means "the call went through", not "the task is
130
- visible to whoever works by it". The queue is asked — by number, in one call — and the answer is
131
- read from the task's presence on the board, its list and its assignee.
164
+ A task can be created and never reach the board: the queue is asked by number, and the answer is
165
+ read from its presence on the board, its list and its assignee.
132
166
  - **The branch number and the MR title number are checked on the spot, the task state — by the
133
- board.** The format is read from the command text and works offline; the task's existence, its
134
- list label, assignee, that it is still open, and the MR review — only with something to ask with.
135
- No network or no token — the second tier is skipped silently: a check that fails on a plane stops
136
- meaning anything.
137
- - **The task's list moves in the same motion as the work.** Branch created — the task is moved to in
138
- progress, MR opened — to in review; the move command does it, not a set of calls from memory. The
139
- move follows the step that caused it at once: the work queue is read between steps, not after.
140
- - **A task left in the first list opens no MR.** The delivery guard names its list and the move
141
- command: by the work queue such a task reads as not taken, though the work on it is done and
142
- published. At branch creation the list is not asked — nothing has moved it yet, and the
143
- requirement would refuse the first command of the work together with the one that lifts it. The
144
- tree names the first list itself; unnamed — the list is not judged at all.
167
+ board.** The format is read from the command text and works offline; the second tier needs
168
+ something to ask with, and without network or token it is skipped silently.
169
+ - **The list of a task moves in the same motion as the work.** Branch created — the task is in
170
+ progress, MR opened — awaiting review; the move command does it, not a set of calls from memory.
171
+ - **The epic card moves by the same command, on the epic number, at two moments.** First task taken
172
+ — the epic is in progress; the MR of the epic into `main` opens — the epic awaits review. `npm run
173
+ task:move -- <номер эпика> in-progress`. Left in the first list while its tasks merge, the epic
174
+ reads as never started.
175
+ - **A task left in the first list opens no MR.** By the work queue it reads as not taken, though the
176
+ work is done and published. The tree names the first list itself; unnamed — not judged.
145
177
  - **The board holds tasks, not MRs about them.** The board shows what is done and what is left; an
146
178
  MR answers another question — how exactly it was done — and opens from the task, where the link to
147
179
  it stands by itself. An MR card lives its own life: it has no list label, never leaves the queue
148
180
  and stays in it after the merge forever. Here it is created more easily than anywhere: the board
149
181
  is assembled by labels, and a list label put on an MR makes it a card at once. The queue audit
150
182
  finds such cards, a line each.
151
- - **A lagging list is found by the queue audit, not by eye.** The audit judges the list by the PR
183
+ - **A lagging list is found by the queue audit, not by eye.** The audit judges the list by the MR
152
184
  both ways: an open MR with the task not in review, and review with no open MR — both
153
185
  discrepancies. The moment a task is taken into work it cannot see: the branch is not on the board.
154
- - **A branch with an open PR lags behind main silently.** The guard judges the base once — at
155
- opening; what merged into main during the run a green run never sees, and a PR merged from there
156
- brings main a combination nobody checked. The lag is found by the work queue audit: it asks the
157
- repository how many commits each open PR's branch is behind main, and names the number.
186
+ - **A branch with an open MR lags behind its base silently.** The guard judges the base once — at
187
+ opening; what merged into the base later a green run never sees. The lag is found by the work
188
+ queue audit, which names it as a commit count.
158
189
  - **Tasks fixed by one edit are merged before the branch merge.** The second is closed as a
159
190
  duplicate with a link to the one that absorbed it, and the missing from it is added to the first.
160
191
  The law orders the second erased — here that is a declared deviation: the host does not let a task
@@ -173,24 +204,14 @@ flowchart TD
173
204
  - **Before a push all linters are run, not one.** The code linter usually does not read style files
174
205
  at all; without a second run nothing checks the styling rules.
175
206
  - **The build is in the set on a par with lint and unit tests.** The linter does not read types, and
176
- unit tests read only what a test imports: a type error in uncovered code lives until the image
177
- build — that is, the merge. Four merges in a row went into main that way, breaking the rollout.
178
- - **On a machine with several runners, any path from the home directory is shared.** A ready-made
179
- step's default is dangerous precisely because it is shared: a neighbouring run rewrites it to its
180
- own version while ours stands between steps. Install directory, container name and builder name
181
- are therefore per project and fixed, and a temporary directory is never the answer — the package
182
- store lives there.
183
- - **The push gate set is never narrower than the pipeline set.** The gate is a promise that the push
184
- will not arrive red; a set with the build and the snapshots thrown out promises what it does not
185
- check. A pipeline step with neither a line in the gate set nor a declared exclusion with a reason
186
- refuses the push instead of printing next to it: a printed warning the executor reads as
187
- permission. Twice in a row an edit that passed the gate whole was refused by the pipeline — and
188
- both times the green gate was read as "all green locally".
189
- - **The final set before a push is read from the state review, not assembled in the head.** It is
190
- assembled from the package default and the tree's override, and there was nothing to read the
191
- assembly with: the "set before push" section prints it whole, one command per line, and names
192
- beside it what the default printed and the set did not take. A tree writing its override blind
193
- added a repeat to it.
207
+ a type error in uncovered code lives until the merge.
208
+ - **On a machine with several runners, any path from the home directory is shared.** Install
209
+ directory, container name, builder name and published port are per project. A temporary directory
210
+ is not the answer: the package store lives there.
211
+ - **The push gate set is never narrower than the pipeline set.** A pipeline step with neither a line
212
+ in the set nor a declared exclusion refuses the push: a warning reads as permission.
213
+ - **The final set before a push is read from the state review, not assembled in the head.** The "set
214
+ before push" section prints it whole, naming what the default gave and the set did not take.
194
215
  - **A push is sent only by the path the push guard stands on.** A terminal, a process or a script
195
216
  started outside the session carries the same command past the gate, unless the tree wired the
196
217
  git hook `pre-push`: then git runs the set there too. A send cut off by the session's end is
@@ -199,35 +220,19 @@ flowchart TD
199
220
  what the set judges by the whole tree: a word, a file limit. A check that stands only on an edit,
200
221
  such as the wording one, is run over the changed texts apart. The output goes into the review,
201
222
  and a later push into that branch is run again.
202
- - **Where neither the session's push guard nor the git hook fires, the set is run whole, as read
203
- at the minute of the run.** It is read from the state review or from the tree profile together with the package
204
- default it calls. A list from memory, from a copy made earlier or from the profile alone drops
205
- checks: the profile names the set, the task names only the work.
206
- - **An exclusion reason naming a task is judged on whether that task is alive.** A deferral with a
207
- term and one without look the same until someone asks the number; a dead number in the reason
208
- makes the exclusion perpetual without saying a line about it. Asked by the same tier as the task
209
- state at the delivery guard: something to ask with — it asks, no network or access — it skips
210
- silently.
211
- - **The layout audit stands in the push gate set on a par with lint and the build.** An edit put
212
- into the laid-out copy past the source breaks nothing on the day it is made: the tree works, the
213
- checks are green, and the discrepancy is visible only to whoever calls the audit themselves. It
214
- piles up silently and surfaces on someone else's work — the layout refuses the edited file whole
215
- and lays out no other, so the price is paid by whoever edited a neighbouring resource. The article
216
- above does not cover this line: the audit is not in the pipeline, so there is no step it would
217
- close — it is put into the set directly, not derived from the set's completeness.
218
- - **After merging main in, the check set is revised by what the branch now carries.** The merge
219
- changes the makeup of the edit: checking by what the author edited means checking half, and the
220
- branch answers whole. A branch that touched no line of the showcase runs showcase snapshots from
221
- the moment the merge brought someone else's styling edit.
222
- - **A statement about the main branch is made by the remote ref, not the local one.** The local one
223
- goes stale the minute it was last pulled, and says nothing about it: it is not empty and not
224
- broken, it describes yesterday. A branch comparison is written from `origin/main` whole — mixing
225
- the remote ref for one side and the local one for the other in one command, the miss looks right
226
- from inside.
227
- - **The remote ref is taken not only by words but by actions.** A new branch's base, the count of
228
- the merged and pulling main are judged by it too: the local one is a snapshot of the last pull,
229
- and work started from it starts from a base main no longer has. A merged branch counts as unmerged
230
- by it, and cleanup ends with a list of unmerged that is not there.
223
+ - **Where neither the session's push guard nor the git hook fires, the set is run whole, as read at
224
+ the minute of the run.** It is read from the state review or from the tree profile together with
225
+ the package default it calls. A list from memory, from a copy made earlier or from the profile
226
+ alone drops checks: the profile names the set, the task names only the work.
227
+ - **An exclusion reason naming a task is judged on whether that task is alive.** A dead number
228
+ silently makes the exclusion perpetual.
229
+ - **The layout audit stands in the push gate set on a par with lint and the build.** An edit past
230
+ the source piles up silently, and the audit is not in the pipeline.
231
+ - **After merging the base in, the check set is revised by what the branch now carries.** Checking
232
+ by what the author edited means checking half: the branch answers whole.
233
+ - **The main branch is taken by the remote ref — in words and in actions.** The local one is
234
+ yesterday's snapshot and silent about it: by it a merged branch counts as unmerged. Both sides of
235
+ a comparison are taken from `origin/`.
231
236
  - **A merge by the "Merge when pipeline succeeds" button does not replace the checks before a
232
237
  push.** The pipeline sees only what is already pushed, and a pushed red branch occupies the work
233
238
  queue and looks ready for review.
@@ -236,33 +241,39 @@ flowchart TD
236
241
  token does not see the project whole.
237
242
  - **A task is moved across lists by editing its labels.** The board's lists are labels: a move that
238
243
  did not remove the previous label leaves the task in two lists at once, and the queue reads wrong.
239
- - **Guard scenarios set the git settings themselves, not take them from the machine.** A commit in
240
- the scenario's temporary repository inherits the shared config: with signing on, git goes to the
241
- key agent, and a locked agent brings the whole set down — from outside it looks like a broken
242
- guard. Author, email and signature are passed as `-c` flags straight into the command.
244
+ - **Guard scenarios set the git settings themselves, not take them from the machine.** Author, email
245
+ and signature go as `-c` flags.
243
246
 
244
247
  ## What of the law is not here
245
248
 
246
249
  The delivery guard stands on the agent's commands, so it does not see a branch created by hand in
247
250
  the editor: its name is held by memory. The requirement is no weaker for that — only no separate
248
- check is made for it: work is recognised by the task title and the PR, and that is audited for
251
+ check is made for it: work is recognised by the task title and the MR, and that is audited for
249
252
  everyone. The queue audit never judges the branch name: an open MR's branch cannot be renamed.
250
253
 
251
254
  The guard does not move a task to in progress: it does not edit the board — a board edit during
252
255
  command review would fall with the connection and refuse the work instead of the miss. The move is
253
256
  held by memory and by the hint the task creation command prints. A task left in the first list the
254
257
  guard names at MR opening — that is, after it should have been moved; other list discrepancies the
255
- queue audit finds.
258
+ queue audit finds. The epic card is held by memory alone: no guard reads its list at branch
259
+ creation, and the queue audit does not judge it.
256
260
 
257
- The freshness of main's tip itself the guard asks by the second tier — the same technique as the
261
+ The freshness of the tip of the base the guard asks by the second tier — the same technique as the
258
262
  task state: something to ask with — it asks; no network or access — it skips silently. The first
259
263
  tier stays and works offline: the local ref answers the question "has the base lagged what already
260
264
  lies in the tree", the remote one — "has the ref itself gone stale". Without the second tier the
261
265
  guard's silence meant only the first and was read as the second.
262
266
 
267
+ The delivery guard reads the base of an MR from the flag `--base` alone, and here the flag is
268
+ `--target-branch`. Without a queue helper of the tree it judges the branch by `main`; with one it
269
+ refuses a lawful MR into the epic branch. Until the package reads this flag, the base from the epic
270
+ branch and the choice between a draft and a ready MR are held by the executor.
271
+
263
272
  ## Patterns
264
273
 
265
274
  - `git-workflow-commit` — task, branch, commit and push as the machine account.
266
275
  - `git-workflow-pr` — opening an MR, the draft and lifting it, the description, reviewer, labels,
267
276
  state.
268
- - `git-workflow-merge` — main merged into the task branch, the conflict resolved.
277
+ - `git-workflow-merge` — the base merged into the branch standing on it, the conflict resolved.
278
+ - `git-workflow-stack` — a chain of branches: branching from the previous, the base, the hand-over
279
+ order.
@@ -47,7 +47,8 @@ flowchart TD
47
47
  - **A lagging column is found by the queue audit, not by eye.** It judges the column by the PR both
48
48
  ways: an open PR with the task not in review, and review with no open PR.
49
49
  - **A branch with an open PR lags behind its base silently.** The guard judges the base once, at
50
- opening, and the run does not see what merged after. The work queue audit counts the lag.
50
+ opening, and the run does not see what merged after. The work queue audit counts the lag in a
51
+ summary line and refuses nothing by it: a lag without a conflict the host merges itself.
51
52
  - **The link between a task and an epic is read by the audit both ways.** A one-sided binding looks
52
53
  as whole as a two-sided one.
53
54
  - **Work that one session cannot close is marked in two places, and they are audited.** The board
@@ -64,8 +65,9 @@ flowchart TD
64
65
  host locks the button.
65
66
  - **A conflicting open PR is a work queue audit discrepancy.** The conflict arrives with someone
66
67
  else's merge, and the host shows the mark only inside the PR.
67
- - **The author of an open PR and whether it has a reviewer are audited by the work queue.** Before the
68
- merge neither miss shows: a PR opened by a person never gets a reviewer.
68
+ - **An open PR without a reviewer is a work queue audit discrepancy.** It reaches no inbox, and
69
+ before the merge the miss does not show. A request to the author does not count, so a PR opened
70
+ by a person shows here too; the author apart is not judged.
69
71
 
70
72
  ## What of the law is not here
71
73
 
@@ -48,11 +48,11 @@ such a skill is created — skill `write-a-skill`.
48
48
  | In the law | Here |
49
49
  | --------------------------------- | ---------------------------------------------------------------------------------------------------- |
50
50
  | set of sections | `REQUIRED_HEADINGS` for a spec, "Articles" for a law |
51
- | a statement of a document | an item of `## Правила` in a spec, `## Статьи` in a law, `## Как закон применяется здесь` in a rule |
51
+ | a statement of a document | an item of `## Rules` in a spec, `## Articles` in a law, `## How the law applies here` in a rule |
52
52
  | the place where it is carried out | a line in `implementation.md` next to it: `` `file:symbol` `` |
53
53
  | promised behaviour | scenario `SC-<PREFIX>-<NUMBER>` in `docs/specs/<domain>/scenarios.md` |
54
- | open question | `Q-<law letter>-<number>` in the law's "Open questions" section; tasks and commits refer to it, and the number is not reused after closing |
55
- | laws a domain applies | the `**Законы:**` line in the spec header, names in quotes |
54
+ | 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 |
55
+ | laws a domain applies | the `**Laws:**` line in the spec header, names in backticks; `**Законы:**` is the former form |
56
56
 
57
57
  ## Where it lives
58
58
 
@@ -62,8 +62,8 @@ tree that keeps its code differently.
62
62
 
63
63
  ## Flow
64
64
 
65
- The flow of creating a text: which layer is written, how a statement is bound to code and what
66
- happens to a scenario after the rollout.
65
+ The flow of creating a text: which layer is written, how a statement is bound to code and how a
66
+ scenario keeps its number.
67
67
 
68
68
  ```mermaid
69
69
  flowchart TD
@@ -75,7 +75,7 @@ flowchart TD
75
75
  D --> G{The statement has a place in code}
76
76
  F --> G
77
77
  G -->|Yes| H[A binding line is placed; the link is checked both ways]
78
- G -->|No| I[It is an intention: goes to open questions, not to rules]
78
+ G -->|No| I[A rule article: a verdict line, held by nobody — a law question; a spec rule: the spec's open questions]
79
79
  H --> J{A scenario is created}
80
80
  J -->|Yes| K[The number is issued new and never reused; the test title is edited by the same change]
81
81
  J -->|No| L[Done]
@@ -100,10 +100,10 @@ flowchart TD
100
100
  itself, and by that call a live symbol cannot be told from a forgotten one. The exception is a
101
101
  symbol declared in the suite harness itself or published outward by a package — there the caller
102
102
  is the test or the consumer by the very purpose of the file.
103
- - **A verdict is put by substance, not by the form of the address.** To the check these two look
104
- alike, and to the reader of the companion
105
- they do not: the first says "nothing here holds the requirement", the second "it holds, but there
106
- is nothing to write it with". The second verdict names the form itself as the reason and lives
103
+ - **A verdict is put by substance, not by the form of the address.** To the check two reasons for
104
+ a verdict look alike, and to the reader of the companion they do not: the first says "nothing
105
+ here holds the requirement", the second "it holds, but there is nothing to write it with". The
106
+ second verdict names the form itself as the reason and lives
107
107
  until the form is fixed; the article under it stays carried out and is not removed.
108
108
  - **A "not carried out" binding moves together with its article.** Otherwise the companion line
109
109
  keeps in the hot part an article with nothing behind it: removed alone, it leaves the binding
@@ -133,7 +133,7 @@ flowchart TD
133
133
  - **A law has a mandatory "Articles" section, and beyond it holds only open questions.** A law
134
134
  carries no history of edits and no arguments for an option chosen once: version control holds the
135
135
  history, and an argument with a rejected alternative is a trait of the work, and its place is the
136
- rule's "Pitfalls". A closed question leaves the law, and an empty section kept for its heading
136
+ rule's cold part, `pitfalls.md`. A closed question leaves the law, and an empty section kept for its heading
137
137
  passed the check anyway.
138
138
  - **A proposed law requires no rule.** An agreement written down before the code has nothing to bind
139
139
  to, and demanding a rule would force creating one with anchors into places that do not exist. The
@@ -151,7 +151,7 @@ flowchart TD
151
151
  - **A rule declares the law it is written under.** A rule without a law is a set of techniques that
152
152
  does not show what exactly must be true.
153
153
  - **There are two layers of laws, and a law name is one for both.** The shared one lies in the
154
- constitution root, an application law in `application/`; neither `law:` nor `**Законы:**` names
154
+ constitution root, an application law in `application/`; neither `law:` nor `**Laws:**` names
155
155
  the layer, so law names are unique across the whole constitution tree.
156
156
  - **A divergence between a rule and its companion is resolved in favour of the rule.** The companion
157
157
  names the tree's names and the bindings of the articles; it does not cancel them: read above the
@@ -208,8 +208,8 @@ flowchart TD
208
208
  - **A decision from a spec goes to the layer, not to the archive.** What a spec is checked against
209
209
  the machine knows; where an accepted decision goes it does not know and will not: only whoever
210
210
  asks "will this still be true tomorrow" can tell a current requirement from an account of what
211
- happened. This is held by the closed-work review step and the selection sign written there in
212
- advance.
211
+ happened. Where the pattern `task-flow-archive` is laid out, its step holds this, with the
212
+ selection sign written there in advance.
213
213
  - **A name in an anchor is written as declared in code.** A private class field stands with a hash,
214
214
  and the name written without it names the wrong symbol: the check stays green, and the reader
215
215
  cannot tell from the binding line whether this is the private method or the ordinary one next to
@@ -239,7 +239,7 @@ flowchart TD
239
239
  ## The shape of a compressed article
240
240
 
241
241
  A rule loads whole into a session and pays for it every session, whatever the session works on. A
242
- measurement names where the weight is: 289 440 characters in twenty-nine loaded rules, the articles
242
+ one-off measurement named where the weight was: 289 440 characters in twenty-nine rules, the articles
243
243
  section is 45% of them, and inside the section statements take 19%, their arguments 81%. So the
244
244
  argument is cut, not the statement: a removed statement changes the rule, a removed argument only
245
245
  its price. Room is measured before an article is added, not after the commit is refused: the size
@@ -297,8 +297,8 @@ refuses on a file edit more often than the others is the first to be marked.
297
297
 
298
298
  Section completeness of the law, the rule and the pattern themselves is checked by nothing here. The
299
299
  articles saying that a text is judged no more leniently than its copy, that an unchosen edition is
300
- judged the same as the chosen one and that the set of sections is declared apart from the sample are
301
- carried out where these texts are written — in the suite of the package that ships them. A consumer
300
+ judged the same as the chosen one, that the set of sections is declared apart from the sample and
301
+ 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
302
302
  tree holds laid-out copies, and its check must not turn red on someone else's miss. Agreement of two
303
303
  texts is looked for by reading.
304
304
 
@@ -318,11 +318,3 @@ up".
318
318
  - `spec-driven-domain` — creating and editing a domain spec, scenarios, binding.
319
319
  - `spec-driven-rule` — creating a law, a rule and a pattern.
320
320
  - `spec-driven-sweep` — a full review of a domain's binding, passes and their review.
321
-
322
- ## Pitfalls
323
-
324
- - **The line requiring a neighbouring resource is checked by nothing, and a miss in it shows only by
325
- counting.** A rule without it looks whole: sections in place, bindings match, the completeness
326
- suite green. It is counted by one command over the rules directory, and the divergence reads at
327
- once — how many rules declared requirements and how many refer to a neighbouring resource in
328
- prose.
@@ -98,9 +98,11 @@ flowchart TD
98
98
 
99
99
  ## What of the law is not here
100
100
 
101
- None of the agreements on the shape of the reply is checked by machine: the reply to the owner does
102
- not land in the tree, and there is nothing to read it. It is held by the memory of whoever replies,
103
- and a violation is visible only to the owner — by looking for a row in the text and not finding it.
101
+ One article is checked: a statement about the state of the tree needs a command of the same turn,
102
+ and the claim guard of rule `turn-conduct` reads the reply for it. The shape of the reply — the
103
+ paragraph, the table, all the tasks in the plan's order — is checked by nothing: it is held by the
104
+ memory of whoever replies, and a violation is visible only to the owner, by looking for a row in the
105
+ text and not finding it.
104
106
 
105
107
  ## Patterns
106
108