@rt-tools/agent-kit 0.31.0 → 0.33.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 (46) hide show
  1. package/assets/checks/board.github.mjs +27 -0
  2. package/assets/checks/spec-anchors.mjs +13 -0
  3. package/assets/checks/task-new.github.mjs +24 -0
  4. package/assets/checks/tree-assignment.mjs +11 -3
  5. package/assets/defaults/gate-map.sh +4 -0
  6. package/assets/defaults/shell.sh +18 -5
  7. package/assets/hooks/dispatch.sh +8 -4
  8. package/assets/hooks/epic-stop-guard.sh +1 -1
  9. package/assets/hooks/git-guard-delivery-epic.sh +21 -0
  10. package/assets/hooks/git-guard-delivery-merged.sh +65 -0
  11. package/assets/hooks/git-guard-delivery.sh +8 -1
  12. package/assets/hooks/git-guard-tree-assignment.sh +1 -1
  13. package/assets/hooks/grill-gate-options.sh +50 -0
  14. package/assets/hooks/grill-gate.sh +9 -1
  15. package/assets/hooks/skill-gate-rearm.sh +18 -2
  16. package/assets/hooks/skill-gate.sh +10 -5
  17. package/assets/laws/mockups.needs-mockups.md +28 -0
  18. package/assets/patterns/dependencies-upgrade.md +5 -1
  19. package/assets/patterns/git-workflow-commit.azure.md +5 -1
  20. package/assets/patterns/git-workflow-commit.github.md +8 -1
  21. package/assets/patterns/git-workflow-commit.gitlab.md +5 -1
  22. package/assets/patterns/git-workflow-merge.md +12 -0
  23. package/assets/patterns/git-workflow-pr.azure.md +2 -0
  24. package/assets/patterns/git-workflow-pr.github.md +4 -0
  25. package/assets/patterns/git-workflow-pr.gitlab.md +2 -0
  26. package/assets/patterns/lib-layers-new.md +4 -0
  27. package/assets/patterns/mockups-measure.needs-mockups.md +28 -0
  28. package/assets/patterns/reuse-first-extend.md +5 -0
  29. package/assets/patterns/spec-driven-domain.md +4 -0
  30. package/assets/patterns/task-flow-archive.md +4 -1
  31. package/assets/patterns/task-flow-resume.md +6 -0
  32. package/assets/patterns/task-flow-start.md +32 -31
  33. package/assets/patterns/testing-e2e.md +15 -1
  34. package/assets/pitfalls/task-flow.md +4 -0
  35. package/assets/rules/component-structure.md +3 -0
  36. package/assets/rules/dependencies.md +3 -1
  37. package/assets/rules/deploy-flow.azure.md +4 -0
  38. package/assets/rules/deploy-flow.github.md +4 -0
  39. package/assets/rules/deploy-flow.gitlab.md +4 -0
  40. package/assets/rules/mockups.needs-mockups.md +80 -0
  41. package/assets/rules/reuse-first.md +3 -0
  42. package/assets/rules/task-flow.md +11 -12
  43. package/assets/rules/testing.md +5 -0
  44. package/assets/rules/typescript-conventions.md +9 -0
  45. package/assets/traits.json +15 -12
  46. package/package.json +1 -1
@@ -149,7 +149,7 @@ GIT_COMMITTER_NAME="<бот>" GIT_COMMITTER_EMAIL="<почта бота>" \
149
149
 
150
150
  The subject — `type(scope): description`. Types: `feat`, `fix`, `refactor`, `docs`, `style`,
151
151
  `test`, `chore`, `perf`. Scopes are the tree's own, listed in `implementation.md`. A full stop
152
- at the end of the subject is not accepted.
152
+ at the end of the subject is not accepted. The letter case is checked as well, by the `subject-case` rule of the commit check: a word in capitals, such as a file name, can trip it, so the allowed case is read in the commit check settings before the subject is written.
153
153
 
154
154
  ```
155
155
  feat(site): availability calendar with season prices
@@ -166,6 +166,10 @@ is mandatory:
166
166
  Docs-skip: правка только в тестах хука, зеркала у него нет
167
167
  ```
168
168
 
169
+ The guard looks for the `Docs-skip` line in the command text only. A message read from a file by
170
+ `git commit -F <file>` is invisible to it and the commit is refused; the body goes inside the command,
171
+ as in `git commit -F -` with the text after it.
172
+
169
173
  ## Common misses
170
174
 
171
175
  - **An audit right after adding answers "no" when the card already stands.** The work queue gives
@@ -113,6 +113,18 @@ npm run check:docs && npm run check:specs && npm run check:dupes && npm run chec
113
113
  bash .claude/hooks/tests/run.sh # if the conflict touched the hooks
114
114
  ```
115
115
 
116
+ A merge without conflicts is not exempt: two branches can declare the same value apart, and the
117
+ merge joins them silently — the duplicate check turns red only at the push. After every merge of the
118
+ base, a conflict-free one included, the duplicate and the styles checks run (`npm run check:dupes`
119
+ and `npm run check:styles`), and the value moves to its one shared place; no line goes into the
120
+ known list.
121
+
122
+ **After a merge of the base, the migrations it brought are read.** Those that set the rights of a
123
+ role are opened. A branch migration that writes a role's full set of rights drops any right the base
124
+ added meanwhile; git sees two different files and marks no conflict, and the fall shows later as a
125
+ failing test on the count of rights, easy to take for a test error. The lost right returns by a new
126
+ migration of the branch.
127
+
116
128
  The merge commit is signed by the bot the same way as any other — pattern
117
129
  `git-workflow-commit`. After the push the state is read from the PR itself, not from one's own
118
130
  tree — more on this in pattern `git-workflow-pr`:
@@ -79,6 +79,8 @@ AZURE_DEVOPS_EXT_PAT="$TOKEN" az repos pr create \
79
79
  --description 'Закрывает рабочий элемент 86.'
80
80
  ```
81
81
 
82
+ Before the target branch is named, its presence on the host is checked: `git ls-remote --heads origin <ветка>`. An empty answer means the base was merged and removed; the request then takes the next branch up the chain as its base.
83
+
82
84
  The reviewer is always the owner: without a review request the PR does not show in their queue.
83
85
  One PR closes the work item whole — half a task is not rolled out by one PR: a task has one
84
86
  branch, and work that does not fit it is split into tasks before the branch is created.
@@ -81,6 +81,10 @@ the repository's default branch: the request then carries the task past the epic
81
81
  branch stays a copy nobody merges. The epic's own request is the only one based on the main branch,
82
82
  and it opens when the last folder of its tasks is taken apart.
83
83
 
84
+ Before `gh pr create --base <ветка>` the base is checked on the host by `git ls-remote --heads origin
85
+ <ветка>`. An empty answer means the base was merged and removed: the request then takes the next
86
+ branch up the chain as its base, not the removed one.
87
+
84
88
  Everything waiting for a pipeline run, a rework or an answer goes as a draft, and the question is
85
89
  asked in the PR itself: a person reads the PR, not the session's conversation.
86
90
 
@@ -82,6 +82,8 @@ GITLAB_TOKEN="$TOKEN" glab mr create \
82
82
  …'
83
83
  ```
84
84
 
85
+ Before the target branch is named, its presence on the host is checked: `git ls-remote --heads origin <ветка>`. An empty answer means the base was merged and removed; the request then takes the next branch up the chain as its base.
86
+
85
87
  The reviewer is always the owner: without a review request the MR does not show in their queue.
86
88
  The assignee is the same account the machine work goes from. Labels are read from the task, not
87
89
  picked from memory:
@@ -94,3 +94,7 @@ rename or removal.
94
94
  - **A lib nobody imports is checked by nothing.** `nx lint` and `nx test` check the lib itself,
95
95
  not its contract with the consumer. The first importer is the first check: the models layer is
96
96
  accepted after `nx build` and a live run of the scenario, not by a green `lint test`.
97
+ - **A lib's own `sourceTag` is written as a string literal.** The layout check finds the
98
+ description of a lib by the text `sourceTag: '<tag>'`, not by evaluating the module. A tag taken
99
+ from a constant passes the lint and is reported as "described in no file". Constants are for the
100
+ tags in `onlyDependOnLibsWithTags` only.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: mockups-measure
3
+ kind: pattern
4
+ rule: mockups
5
+ description: Pattern of rule mockups. Load before the frames of a mockup are shown to the owner — reading the bounds of the sheet's frames and of the buttons inside them in one call, overlapping pairs and the distinct tops of a row. Not for checking a running page — that is the rule browser-verification.
6
+ ---
7
+
8
+ # Measuring a mockup
9
+
10
+ Pattern of the rule `mockups`. What must be true — the law `docs/constitution/mockups.md`.
11
+
12
+ ## When to use
13
+
14
+ - The frames of a sheet are about to be shown to the owner.
15
+ - A row of cards, a toolbar or a form is drawn at a width other than the desktop one.
16
+
17
+ ## A mockup is measured by node coordinates
18
+
19
+ A frame in a design tool makes a layout claim, just like a page. A look at its screenshot misses the
20
+ same things: the buttons of a card row are off one line, or frames on the sheet overlap. Before the
21
+ frames are shown to the owner, one call reads the bounds of the sheet's top-level frames and of the
22
+ buttons inside them. It prints the overlapping pairs and each row's distinct button tops. Two
23
+ values in one row are the defect.
24
+
25
+ ## Common misses
26
+
27
+ - **At the tablet width the buttons of a card row stood at different heights, and frames on the
28
+ sheet overlapped.** The owner found both; one call reading node bounds would have shown them.
@@ -43,6 +43,11 @@ A clone written next to it takes the edits onto itself and diverges from the ori
43
43
  first one. A renamed file and a "similar but own" component are the same departure, only
44
44
  undeclared.
45
45
 
46
+ Before the kit PR is merged, the tree that ordered the edit runs its end-to-end suite against the
47
+ packed build of that branch. The build is unpacked over the installed package without touching the
48
+ declaration. The kit's own tests do not know the screen it stands on — a dialog over a side panel, a
49
+ button whose state the consumer binds — and a defect found after the merge costs a second release.
50
+
46
51
  ## One's own primitive — only with the owner's approval
47
52
 
48
53
  Asked before the first file is written. The same goes for one's own base and one's own inline
@@ -222,3 +222,7 @@ statement.
222
222
  author sees their edit, not what the subject will grow into: a domain created along the way
223
223
  turns out a month later to be half of its neighbour, and parting them means parting the scenario
224
224
  numbers too.
225
+ - **A changed or removed scenario is edited in the live spec, not restated in `proposed/`.** The
226
+ spec audit refuses a second heading with a taken number. A changed promise or a removed
227
+ scenario goes into the domain's `scenarios.md` by the commit that changes the code and the test
228
+ title; the agreement names such scenarios by number in prose.
@@ -54,7 +54,7 @@ pick.
54
54
 
55
55
  | File | Where |
56
56
  | --- | --- |
57
- | `grill.md` | to `docs/archive/` — the owner's answers cannot be recovered, and this is the only record of why the task was set this way |
57
+ | `grill.md` | to `docs/archive/` in the owner's language — the owner's answers cannot be recovered, and this is the only record of why the task was set this way. A grill in the layer's language is rewritten at the move; the quoted request stays verbatim |
58
58
  | `progress.md` | to `docs/archive/` if it holds decisions along the way with reasons; otherwise deleted |
59
59
  | `plan.md` | deleted — after the rollout its question is answered by the code, and "how it works" by the domain spec |
60
60
  | review findings | written straight next to the epic plan — they do not move from here; work outside an epic shows them to the owner in the same turn |
@@ -262,6 +262,9 @@ indistinguishable from a sent one.
262
262
  apart, and the owner's words are written only there, with nowhere to recover them from. So the
263
263
  guard demands that the branch add a record to the archive. What exactly was moved it does not
264
264
  check — the owner looks at that in review.
265
+ - **The folder of a task created after the work enters by a commit of its own.** The next commit
266
+ takes it apart. A folder assembled and removed between two commits leaves no trace: the owner may
267
+ merge the PR in that minute, and the grill is gone.
265
268
  - **The closing steps are not agreed with the owner — they are listed here.** The rules review of
266
269
  the work is part of closing, as are merging the agreement and taking the folder apart. The owner
267
270
  decides not whether to launch it but what to do with the findings. A turn that ended with such a
@@ -144,6 +144,12 @@ A stage revision — to the same place, not by editing the plan:
144
144
  прежний этап в замысле оставлен видимым.
145
145
  ```
146
146
 
147
+ A new request of the owner inside the same task goes into the grill, not only into the progress.
148
+ The grill leaves for the archive, the progress only when it holds decisions. The request is quoted
149
+ verbatim under "The owner request"; under "Decisions" goes the answer, or the line "closed by
150
+ assumption: <what is taken>" when the question was not put. Otherwise the archive keeps the first
151
+ answer while the code carries the second.
152
+
147
153
  The session entry marks what was done and what confirms it:
148
154
 
149
155
  ```markdown
@@ -40,9 +40,7 @@ is found is written into the tree in the same turn — into the epic plan if it
40
40
  progress if it concerns one.
41
41
 
42
42
  Exploration that found nothing is no permission to ask: the epic plan, the archive and past sessions
43
- are reached first, and the question names where the search went.
44
-
45
- Exploration ends with command output, not with a feeling: the root memo, `ls` of the directory at
43
+ are reached first, and the question names where the search went. Exploration ends with command output, not with a feeling: the root memo, `ls` of the directory at
46
44
  hand, a search over the documentation and the rules.
47
45
 
48
46
  A member added beside a list, not into it, is named at every reader of that list: each place that
@@ -58,6 +56,10 @@ before questions about techniques: one folder generalised into a map leaves out
58
56
 
59
57
  What was inferred is marked right in the list, together with what confirms it.
60
58
 
59
+ Removing an identifier that lives outside the code starts with a search for its value: a client of
60
+ the authorization server, a key, an environment variable — over the code, the environment samples
61
+ and the composition files. The plan names what uses the identifier now, not what it was created for.
62
+
61
63
  **A ready-made module of the same kind is looked for before the first question** — in this tree and
62
64
  in the trees recorded as samples of its layout. The one found is read whole: it closes the questions
63
65
  about the structure — the source of the numbers, the rows, the screen, the storage.
@@ -86,10 +88,9 @@ All six questions are closed, and those the exploration did not answer are asked
86
88
 
87
89
  The list of six is the set of what is closed by the start of work, not a set of lines to be said. A
88
90
  question the owner has already answered is marked closed together with what closed it: the answer is
89
- sought in the documentation and in what was said in this same session, the original request
90
- included. It can be closed by an assumption too, when the answer is obvious — by the line "question
91
- closed by assumption: <what is taken>": a wrong assumption costs an edit, a question about the
92
- obvious costs a session.
91
+ sought in the documentation and in this session, the original request included. An obvious answer
92
+ closes by the line "question closed by assumption: <what is taken>": a wrong assumption costs an
93
+ edit, a question about the obvious costs a session.
93
94
 
94
95
  **Two answers «recommended» in a row close the remaining questions by assumption.** An owner who took
95
96
  the recommended option twice running has shown that the decisions are not theirs. From the second
@@ -117,12 +118,9 @@ The message with which the executor stops begins with what they wait for:
117
118
  <Вопрос>
118
119
  ```
119
120
 
120
- Under the question goes the table of the epic's position — the same as in the handover. Under, not
121
- above: the stop is named by the first line, and the epic's position is what the owner decides from.
122
- Work outside an epic carries no table.
123
-
124
- Measurements, role findings and the list of decisions are by then written in the progress and are
125
- superfluous in the message: a report with a question at its end drowns the question.
121
+ Under the question goes the table of the epic's position — the same as in the handover; work outside
122
+ an epic carries no table. Measurements, role findings and the list of decisions are already in the
123
+ progress and are left out of the message: a report with a question at its end drowns the question.
126
124
 
127
125
  The answers are written into `docs/tasks/_draft-<slug>/grill.md` — the folder is still a draft,
128
126
  there is no number.
@@ -132,6 +130,10 @@ mkdir -p docs/tasks/_draft-<slug>
132
130
  cp docs/tasks/_template/grill.md docs/tasks/_draft-<slug>/grill.md
133
131
  ```
134
132
 
133
+ An answer chosen from a menu is written with the options it was chosen from: the label alone does
134
+ not show whether the owner took a ready option or wrote their own. A task that stands only on a
135
+ chosen option says so in its body.
136
+
135
137
  **Next move:** the owner's answer is appended to the grill, and the next question follows. The
136
138
  answers are over — in the same turn the work goes into the roles pipeline.
137
139
 
@@ -151,7 +153,9 @@ The agreement that came out of the pipeline is checked against `grill.md` line b
151
153
  by it. The role writes the text without seeing the owner and can turn their answer into its
152
154
  opposite: the order of stages came out reversed, and included items moved to "not included". A
153
155
  critic's finding that diverges from the owner's answer is carried to the owner, not carried out in
154
- silence.
156
+ silence. The same check holds for the executor's own decision on an open question of the agreement:
157
+ it is compared with the grill before it goes to the writer — an open question lists the owner's
158
+ answer among its variants without a mark, and is decided anew.
155
159
 
156
160
  The turn does not end on this boundary. A closed grill looks like a finished piece — the answers are
157
161
  on disk, the file is committed, there is something to report — and the report takes the place of the
@@ -174,7 +178,8 @@ npm run task:new -- --epic --title '<Возможность, которая ра
174
178
  The call puts the epic label on the card, lays a draft of the plan in the tree's directory of plans
175
179
  and writes the path to it into the body: the audit reads the plan by that path, and a card without
176
180
  it points into emptiness. Everything the epic cannot be created without is asked before the card is
177
- made — an administrator alone can take a made one off the board.
181
+ made — an administrator alone can take a made one off the board. What the call does not write — a
182
+ file of epics, an index of plans — the tree lists as hand steps of the same commit as the plan.
178
183
 
179
184
  The draft is filled in by hand, and three things in it are derived from nothing: the opportunity in
180
185
  one phrase, the makeup of the tasks in order, and how the branches of the tasks stand. A set without
@@ -182,9 +187,9 @@ an order is no order: two tasks whose order rested on understanding went into wo
182
187
  round, and the second was redone under the first. The assigned order holds to the end of the epic; a
183
188
  revision is the owner's decision.
184
189
 
185
- The cards are created for all the tasks at once, right here — by the same call with `--epic-of`, for
186
- every row of the makeup. The issued numbers return to the same table, and from this minute "take the
187
- next" answers with a number, not a name.
190
+ The cards for all the tasks are created at once, right here — by the same call with `--epic-of`, for
191
+ every row of the makeup. The issued numbers return to the same table: "take the next" answers with a
192
+ number from now on.
188
193
 
189
194
  **Next move:** the declared epic is committed together with the task numbers, and in the same turn
190
195
  its branch is taken.
@@ -202,7 +207,7 @@ The plan of the epic is committed into it and the branch is pushed at once — t
202
207
  tasks are taken from it, and one that exists only on the machine is a base nobody else has. The card
203
208
  names the branch: the reader comes to the epic from the queue, and the queue holds no branches.
204
209
 
205
- Nothing else is committed into the epic branch: it carries the plan and the merges of the tasks. An
210
+ Nothing else is committed into the epic branch: it carries the plan and the merges of the tasks; an
206
211
  edit made in it directly reaches the main branch unreviewed.
207
212
 
208
213
  **Next move:** the first task of the epic is taken — the branch of the task from the branch of the
@@ -229,10 +234,9 @@ call with `--outside-epic '<слово владельца>'` — a refusal witho
229
234
  branch is created by a second call: a compound "create and commit at once" is refused by the
230
235
  main-branch guard whole.
231
236
 
232
- The number is already issued — there is no draft and none is created: the folder opens straight
233
- under the branch name. Half of all work starts this way: the number comes from a past session, a
234
- noticed defect or a neighbouring task, and there is nothing to rename. The pitfall "the number never
235
- comes first" does not apply here — it is about not creating the task before the grill.
237
+ The number is already issued — there is no draft: the folder opens straight under the branch name.
238
+ Half of all work starts this way (a past session, a noticed defect, a neighbouring task). The pitfall
239
+ "the number never comes first" does not apply: it is about not creating the task before the grill.
236
240
 
237
241
  The other two files are written, not laid down as templates for later: an empty `plan.md` cannot be
238
242
  told from a plan without stages, and the next session trusts the task folder. The template is opened
@@ -297,14 +301,11 @@ state line is rewritten to `этап-идёт`, and from there the work is led b
297
301
  - **Stage:** 1 из 3 — <название первого этапа из замысла>
298
302
  ```
299
303
 
300
- The turn does not end on this boundary. A written plan looks like a finished piece: the stages are
301
- laid out, the file is committed, there is something to report — and the report takes exactly the
302
- place the work should have taken. The owner reads it as done, and nothing is done: on 21 August a
303
- session ended with the line "next step — such-and-such" at a window fill of about two percent.
304
-
305
- Four things end a turn, and they are the same as for the other states: the window fill limit, a
306
- guard's refusal, a question to the owner and handed-in work with the next begun. A pattern read to
307
- the end is not among them — the text ended, the work did not.
304
+ The turn does not end on this boundary. A written plan looks like a finished piece — the file is
305
+ committed, there is something to report — and the report takes the place of the work: a session
306
+ ended with "next step — such-and-such" at a window fill of about two percent. A turn ends by the
307
+ window fill limit, a guard's refusal, a question to the owner or handed-in work with the next
308
+ begun; a pattern read to the end is not among them.
308
309
 
309
310
  **Next move:** the first stage is done in the same turn, and it is declared closed after its command
310
311
  from the "Checked by" line has passed.
@@ -134,6 +134,10 @@ comes from the template and is drawn before the request answers. A check or a fr
134
134
  it reads an empty grid. The wait names a node that exists only with data: a row, a booking, a
135
135
  selected record.
136
136
 
137
+ After a change of the window width, layout values come from different sources at different
138
+ moments: a media query applies at once, a breakpoint signal on the next frame. The test awaits by
139
+ polling the very value it measures; a wait for one value proves nothing about another.
140
+
137
141
  ## Common misses
138
142
 
139
143
  - **A search on the stand matches by substring, and older seeds stay.** `editor@example.com` also
@@ -158,7 +162,17 @@ selected record.
158
162
  - **Not only what the screen requests is substituted, but also what the header requests.** The
159
163
  unread counter is requested on every screen under the header. Without a substitution the real
160
164
  server answers that request, refuses the fake sign-in, the interceptor drops the session, and
161
- fifty-nine tests fail on the vanished header — it looks like a screen defect.
165
+ fifty-nine tests fail on the vanished header — it looks like a screen defect. The same holds for a
166
+ call the task itself adds to a screen: the list of substituted calls is read against the calls
167
+ the screen makes after the edit, and the new one is substituted in every end-to-end test of that
168
+ screen. Unsubstituted, it goes to the real server, which refuses the fake sign-in; the screen
169
+ turns into the sign-in form, and the test fails by its time limit with no visible cause.
170
+ - **A default that matches the first option proves nothing.** A form that opens with a value taken
171
+ from context, such as the record of the card it was opened from, is checked with that value
172
+ standing anywhere but first in the substituted list. A form that ignored the context and took the
173
+ first option shows the same value, and the test stays green on the very defect it was written to
174
+ catch. A comment saying the test tells the two apart does not make it so; the order of the
175
+ substitution does.
162
176
  - **State that lives only during an operation is not checked by a test.** The upload list under the
163
177
  button is visible while the files are in flight: on substituted answers they land before the test
164
178
  manages to read it, and the test turns red every other run. What is checked is either the final
@@ -7,6 +7,10 @@ The rule is `task-flow`; the articles that hold the law stand there.
7
7
 
8
8
  ## Pitfalls
9
9
 
10
+ - **A suspicion of a defect put off "until later" is postponed work, and the promise in the reply is
11
+ no record of it.** It goes into the queue as a task, or as a line «not checked» in the record of
12
+ the task where it was noticed. Each turn writes its summary anew: within three tasks the suspicion
13
+ about a menu turned into a remark about its look.
10
14
  - **A task picked into an epic by its body can be closed before the work starts.** Weeks pass
11
15
  between creating a task and taking it, and all that time the tree is edited by neighbouring work:
12
16
  two tasks of one epic had three parts out of four already done — the body described the tree of a
@@ -98,3 +98,6 @@ environment either — that is `Q-FA-1` in the law.
98
98
  draws the frame of an icon it did not find and says nothing. The build, the lint and the tests
99
99
  stay green, and the owner sees an empty square. Before the edit the name is looked up among the
100
100
  kit icon files: some names carry the `ico-` prefix and most do not.
101
+ - **A component that grew past the file limit is split, not squeezed.** An edit of a component does
102
+ not load the rule of plain TypeScript files, where the 500-line article lives, so it is repeated
103
+ in one line here: what the component does on its own moves out into a file next to it.
@@ -65,7 +65,9 @@ flowchart TD
65
65
  neither the linter, nor the build, nor the tests read styling properties, and the person at the
66
66
  screen sees the breakage. Gone into a shared update, such a raise is reverted only together with
67
67
  the others, and tying the breakage to it costs a separate investigation; its own branch is
68
- reverted alone.
68
+ reverted alone. A feature that needs a component several releases ahead raises the skipped ones
69
+ first, by that task of its own, and its branch takes only the last step: each skipped release
70
+ brings changes of its own, and in the feature branch they read as the feature's breakage.
69
71
 
70
72
  ## What of the law is not here
71
73
 
@@ -98,6 +98,10 @@ flowchart TD
98
98
  - **The migration chain is run from an empty storage before the merge.** The apply order is
99
99
  lexicographic by directory name, and the timestamp is set at creation: a migration from a branch
100
100
  started earlier lands before the one it depends on.
101
+ - **A migration without a reverse is merged only after a copy of the production storage, and the PR
102
+ body names the copy.** Rolling back the image does not bring a dropped column or table back. When
103
+ the executor cannot reach the server, the owner is told which step is blocked and what opens it:
104
+ the owner's word replaces a check only when the owner was told the check did not run.
101
105
  - **The divergence of migrations from the schema is measured on a shadow storage, not on the one
102
106
  the pusher works with.** That one lawfully carries the trace of any unfinished branch, and a
103
107
  check against it would hold up someone else's edit. The gate and the rollout call one and the
@@ -157,6 +157,10 @@ flowchart TD
157
157
  - **The migration chain is run from an empty storage before the merge.** The apply order is
158
158
  lexicographic by directory name, and the timestamp is set at creation: a migration from a branch
159
159
  started earlier lands before the one it depends on.
160
+ - **A migration without a reverse is merged only after a copy of the production storage, and the PR
161
+ body names the copy.** Rolling back the image does not bring a dropped column or table back. When
162
+ the executor cannot reach the server, the owner is told which step is blocked and what opens it:
163
+ the owner's word replaces a check only when the owner was told the check did not run.
160
164
  - **The divergence of migrations from the schema is measured on a shadow storage, not on the one
161
165
  the pusher works with.** That one lawfully carries the trace of any unfinished branch, and a
162
166
  check against it would hold up someone else's edit. The gate and the rollout call one and the
@@ -100,6 +100,10 @@ flowchart TD
100
100
  - **The migration chain is run from an empty storage before the merge.** The apply order is
101
101
  lexicographic by directory name, and the timestamp is set at creation: a migration from a branch
102
102
  started earlier lands before the one it depends on.
103
+ - **A migration without a reverse is merged only after a copy of the production storage, and the PR
104
+ body names the copy.** Rolling back the image does not bring a dropped column or table back. When
105
+ the executor cannot reach the server, the owner is told which step is blocked and what opens it:
106
+ the owner's word replaces a check only when the owner was told the check did not run.
103
107
  - **The divergence of migrations from the schema is measured on a shadow storage, not on the one
104
108
  the pusher works with.** That one lawfully carries the trace of any unfinished branch, and a
105
109
  check against it would hold up someone else's edit. The gate and the rollout call one and the
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: mockups
3
+ kind: rule
4
+ law: mockups
5
+ description: Rule under the mockups law. Load when a screen is drawn or changed in a design tool, before the first frame and before the mockups are shown to the owner. Names the kit copy, the spec read before drawing, the agreement checked against mockups. Pattern mockups-measure.
6
+ ---
7
+
8
+ # Mockups — how it works here
9
+
10
+ Rule under the law `docs/constitution/mockups.md`. The law says what the owner must see before
11
+ the code is written; here — what it is called in this tree, where it lives and what is not checked.
12
+
13
+ ## What it is called here
14
+
15
+ | In the law | Here |
16
+ | ----------------------------------- | ---------------------------------------------------------------------------- |
17
+ | mockup | a frame on a sheet of the design tool |
18
+ | the screen the mockup draws | the page or panel in the application that carries the same name |
19
+ | the description of the behaviour | the domain spec in `docs/specs/<domain>/` |
20
+ | the agreement | the product agreement of the task, `docs/specs/<domain>/proposed/<feature>/` |
21
+ | approved | shown to the owner and accepted in their words |
22
+
23
+ ## Where it lives
24
+
25
+ In this tree — the table in `implementation.md` next to it. Paths live there, not here: the rule
26
+ travels between repositories, the layout does not, and a path named in the rule lies in the
27
+ first tree that keeps its code differently.
28
+
29
+ ## Flow
30
+
31
+ The flow of a mockup from the first frame to the code: what is read before drawing, what is
32
+ measured before showing, and what is checked before work starts by the agreement.
33
+
34
+ ```mermaid
35
+ flowchart TD
36
+ A[A screen is to be drawn or changed] --> B{The behaviour already exists in the tree}
37
+ B -->|Yes| C[The spec of its domain is read before the first frame]
38
+ B -->|No| D[A sample is asked per screen]
39
+ C --> E{A component of the kit goes on the sheet}
40
+ D --> E
41
+ E -->|Yes| F[Its lines and spacing are checked against the kit styles in code]
42
+ E -->|No| G[The frames are drawn]
43
+ F --> G
44
+ G --> H[The coordinates of the frames are measured]
45
+ H --> I[The owner approves the mockups]
46
+ I --> J{The agreement has visual rules}
47
+ J -->|Yes| K[Each rule is found on the mockup of every width; a rule the mockups do not show goes to the owner]
48
+ J -->|No| L[The code is written]
49
+ K --> L
50
+ ```
51
+
52
+ ## How the law applies here
53
+
54
+ - **A kit component on a design-tool sheet is a copy of the kit, and the copy drifts.** The source
55
+ of look is the kit's styles in code. Before a component from the sheet goes into a mockup, its
56
+ visible lines and spacing are checked against the kit's styles. A divergence is a question to the
57
+ owner, and the answer is fixed once in the copy.
58
+ - **A mockup of behaviour the tree already has starts with reading the spec of its domain.** A
59
+ screen in a design tool looks like work without code, so exploration stops at the sheet of earlier
60
+ mockups. How a payment is taken, what a window asks and which fields a form holds are already
61
+ described by the spec and carried out by code. The spec is read before the first frame, and the
62
+ sample question is asked per screen: one sheet named as the sample of the whole set leaves the
63
+ other screens without one.
64
+ - **The agreement is checked against the approved mockups before work by it.** Every visual rule of
65
+ the agreement is found on the mockup of each width. A rule the mockups do not show goes to the
66
+ owner as a question. Found after the code, it costs a code edit and an agreement edit together.
67
+ - **A mockup is measured by node coordinates before it is shown.** The technique is the pattern
68
+ `mockups-measure`.
69
+ - **A design-tool call asks the rules gate for this rule,** like the browser driver does for its
70
+ own: without that the measurement pattern stays unread for the whole mockup task.
71
+
72
+ ## What of the law is not here
73
+
74
+ Nothing checks that a mockup matches the screen it draws or that the owner approved it: both live
75
+ outside the tree, in the design tool and in the owner's words. The checks above are held by reading.
76
+
77
+ ## Patterns
78
+
79
+ - `mockups-measure` — reading the bounds of frames and buttons in one call and what the numbers
80
+ mean.
@@ -116,6 +116,9 @@ flowchart TD
116
116
  when the tree has no such kind at all. A hardcoded value is refused by neither linter, build nor
117
117
  test: it is syntactically valid and simply does not belong to this tree — that is how a demo
118
118
  value from the vendor's documentation leaves for the production build.
119
+ - **A logo of a foreign service is taken, not drawn.** It is taken from the owner of the mark or
120
+ from an open icon set, in a mockup the same as in code. A drawn mark next to the service name
121
+ reads as that service's logo, and a person at the screen does not recognise it.
119
122
 
120
123
  ## What of the law is not here
121
124
 
@@ -149,15 +149,12 @@ flowchart TD
149
149
  justification under someone else's accepted decision reads as its appraisal. One exception:
150
150
  execution stopped by an obstacle — then the obstacle is named.
151
151
  - **The last run of the main branch is read first thing in a session and after every known
152
- merge.** A red main branch after a merge lives until the owner notices; a red or pushed-out run is
153
- fixed before new work is taken.
152
+ merge.** A red main branch lives until the owner notices; a red run is fixed before new work is taken.
154
153
  - **A session does not start work by itself.** The handover, the state from the startup hook and an
155
154
  assigned epic say what to do, not whether to work: a start needs the owner's word in the same
156
155
  session. An empty message, one word or one path order no work.
157
156
  - **A refusal by an external limiter removes the way, not the task.** It names no exit: the way is
158
157
  taken from the guard that already described this fix, and the task stays the same.
159
- - **An instruction to work by the progress covers all its steps, including those that change
160
- history.** Questions are asked about what the progress lacks.
161
158
  - **A question written by a past session does not become a question to the owner.** It is addressed
162
159
  to the handover's author, and some are closed by a work step.
163
160
  - **The owner's instruction holds until they cancel it, and a new fact against it is a line in the
@@ -176,8 +173,7 @@ flowchart TD
176
173
  - **The task folder is taken apart by the last commit before the PR opens, not after approval.** A
177
174
  person merges as soon as they see green, and no room is left for a closing commit.
178
175
  - **After opening the PR, the executor tells the owner the number, what it waits for and what comes
179
- next.** A draft waits for the run and is lifted after it; a PR opened ready waits for the owner's
180
- hand, and that is said in the same words.
176
+ next.** A draft waits for the run, a PR opened ready waits for the owner's hand, and that is said.
181
177
  - **A request to merge never comes before the work is checked.** Where the pipeline wakes for this
182
178
  base: folder taken apart and pushed → PR as a draft → run green → draft lifted → the request to
183
179
  merge, naming the number. Where it does not wake, the green push gate is the check, and opening
@@ -186,22 +182,25 @@ flowchart TD
186
182
  open PR reads as an invitation to merge. Which of the two applies is decided by the bases the pipeline wakes for, and that is read from its file.
187
183
  - **The plan guard is the lower bound of the requirement, not its limit.** It demands a folder only
188
184
  for an edit of application code; the article above — for any work.
189
- - **An instruction to work by a rule is an instruction to do its steps, including those that change
190
- history.** Marking a stage, a commit, a push and opening a PR are prescribed by the rule.
185
+ - **An instruction to work by a rule or by the progress is an instruction to do all its steps,
186
+ including those that change history.** Marking a stage, a commit, a push and opening a PR are
187
+ prescribed by the rule; questions are asked about what the progress lacks.
191
188
  - **A taken task does not end a turn.** Creating the task, the branch, the column and the folder is
192
- preparation: the work moves to the written-plan state, where the action is different. The
193
- turn-exit guard names the first stage in its refusal.
189
+ preparation; the turn-exit guard names the first stage in its refusal.
194
190
  - **The stages of a plan cover its done-sign whole.** Otherwise every stage closes, the run is
195
191
  green, and half the order is not done. Either the stages are written up to the sign, or the sign
196
192
  is narrowed to what the stages give.
193
+ - **Every rule of the product agreement becomes a step of some stage.** The plan names, per rule,
194
+ the stage that writes its code and the check that proves it, and is compared with the agreement
195
+ rule by rule before the first stage: a rule with no stage is found at the merge review, when the
196
+ code is written.
197
197
  - **A stage's readiness sign is taken from the output of a command run while the plan is written.**
198
198
  Written by a guess, it is checked at the stage itself — latest of everything that depended on it.
199
199
  - **A plan for work that ports a technique from outside is written by a measurement of one's own
200
200
  code.** Reading the sample says how it is built; what is needed here is said by a count over
201
201
  one's own files.
202
202
  - **A count that becomes the measure of the work is bounded by the declaration, not by the file.**
203
- A file holds neighbouring sets too: a count over it took a neighbour's suite and came out twice
204
- the real measure.
203
+ A file holds neighbouring sets too: a count over it came out twice the real measure.
205
204
  - **Waiting for one part of a stage is never a stop of the stage.** The parts independent of what is
206
205
  awaited are done in the same turn; the owner is told what is done and what is left for their step.
207
206
  - **A finding made mid-stage is checked against the plan's exit conditions before the first edit.**
@@ -105,6 +105,11 @@ flowchart TD
105
105
  settings — contacts, sender address, keys of external services — the seed does not create
106
106
  either: they are entered in the application. What is needed rarely is switched on by a sign in
107
107
  the environment, not seeded for all.
108
+ - **An edit of a build step or of the pipeline is checked from scratch, and its PR waits for the run
109
+ on itself.** A cached build answers from what an earlier build left, and the edit looks green
110
+ while a clean runner fails on it. So the build runs twice past the cache with its output removed
111
+ between the runs, and its time is compared with the wait limit of whoever calls it. The request to
112
+ merge names the run on the PR itself: a fix of the pipeline merged unrun broke it a second time.
108
113
  - **A created check goes into the push gate or the pipeline, not only into the umbrella target.**
109
114
  The umbrella target is run by hand, and a check that lives only there answers whoever
110
115
  remembered it: such a check's silence reads as its green answer. Three checks stood outside the
@@ -141,6 +141,15 @@ not belong there: that is NestJS with constructor DI.
141
141
  console.log(n, JSON.stringify(s.rules[n].meta.defaultOptions));'
142
142
  ```
143
143
 
144
+ - **A decision is moved into a pure function of the util layer before the handler is written.** A
145
+ choice over a closed set becomes a table keyed by the enumeration, and a chain of field checks
146
+ becomes a list of checks. The handler calls them and keeps its branchings for its own flow: the
147
+ complexity linter refused one file twice because both lay right in the handler and spent its limit.
148
+ - **A file an edit pushed past the 500-line limit is split, not squeezed.** Joining comments or
149
+ dropping blank lines lowers the count and leaves the file just as long to read, and the next
150
+ edit hits the limit again. What the file does on its own moves out next to it: a mapping, a set of
151
+ derived values.
152
+
144
153
  - A cast through `as Type` in a mapper is forbidden but watched by nothing: it accepts any value
145
154
  and compiles. Instead — `this.typeCast`.
146
155
  - An unused parameter is removed, not renamed: an underscore before the name hides the finding,