@rt-tools/agent-kit 0.27.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/assets/checks/board-epic-plan.github.mjs +86 -0
  2. package/assets/checks/board-epics.github.mjs +12 -67
  3. package/assets/checks/board-pull-state.github.mjs +6 -11
  4. package/assets/checks/check-glossary.mjs +10 -2
  5. package/assets/checks/check-lib-layers.mjs +24 -1
  6. package/assets/checks/check-reuse.mjs +26 -2
  7. package/assets/checks/check-specs.mjs +8 -1
  8. package/assets/checks/lib-boundaries.mjs +2 -2
  9. package/assets/checks/lib-common.mjs +46 -0
  10. package/assets/checks/lib-manifests.mjs +18 -13
  11. package/assets/checks/rt-kit-checks.config.mjs +6 -0
  12. package/assets/checks/signals.mjs +39 -5
  13. package/assets/checks/spec-anchors.mjs +48 -4
  14. package/assets/checks/spec-common.mjs +40 -6
  15. package/assets/checks/spec-contract.mjs +33 -7
  16. package/assets/checks/spec-scenarios.mjs +24 -1
  17. package/assets/checks/task-new.github.mjs +9 -3
  18. package/assets/defaults/gate-map.sh +20 -5
  19. package/assets/defaults/project.sh +6 -0
  20. package/assets/hooks/dev-server-guard.sh +61 -32
  21. package/assets/hooks/exam-guard.sh +10 -10
  22. package/assets/hooks/git-guard-delivery-conflict.sh +53 -1
  23. package/assets/hooks/git-guard-delivery-draft.sh +7 -6
  24. package/assets/hooks/git-guard-delivery-tree.sh +50 -0
  25. package/assets/hooks/git-guard-delivery.sh +43 -23
  26. package/assets/hooks/git-guard-discard.sh +144 -0
  27. package/assets/hooks/git-guard-push-tests.sh +36 -16
  28. package/assets/hooks/reuse-first-guard.sh +29 -4
  29. package/assets/hooks/rule-source-guard.sh +17 -2
  30. package/assets/hooks/skill-gate.sh +7 -0
  31. package/assets/hooks/sql-guard-write.sh +18 -2
  32. package/assets/hooks/turn-exit-guard.sh +50 -66
  33. package/assets/hooks/turn-exit-patterns.sh +18 -1
  34. package/assets/hooks/turn-exit-verdict.sh +84 -0
  35. package/assets/laws/delivery.md +14 -6
  36. package/assets/laws/verifiability.md +22 -4
  37. package/assets/patterns/git-workflow-pr.github.md +39 -18
  38. package/assets/patterns/git-workflow-stack.md +21 -2
  39. package/assets/patterns/task-flow-close.md +65 -78
  40. package/assets/patterns/ts-procedure.md +6 -0
  41. package/assets/pitfalls/git-workflow.github.md +38 -0
  42. package/assets/pitfalls/task-flow.md +25 -23
  43. package/assets/rules/browser-verification.md +8 -0
  44. package/assets/rules/deploy-flow.github.md +6 -0
  45. package/assets/rules/doc-style.md +6 -0
  46. package/assets/rules/git-workflow.azure.md +10 -0
  47. package/assets/rules/git-workflow.github.md +119 -119
  48. package/assets/rules/git-workflow.gitlab.md +10 -0
  49. package/assets/rules/lib-layers.md +11 -0
  50. package/assets/rules/spec-driven.md +10 -1
  51. package/assets/rules/task-flow.md +59 -56
  52. package/assets/rules/testing.md +7 -0
  53. package/assets/rules/turn-conduct.md +23 -3
  54. package/assets/samples/tasks/_template/plan.md +4 -1
  55. package/assets/skills/agent-kit.md +17 -4
  56. package/bin/agent-kit.js +1 -1
  57. package/bin/agent-kit.js.map +1 -1
  58. package/lib/commands.d.ts +1 -1
  59. package/lib/commands.d.ts.map +1 -1
  60. package/lib/commands.js +59 -2
  61. package/lib/commands.js.map +1 -1
  62. package/lib/hooks-map.d.ts +5 -0
  63. package/lib/hooks-map.d.ts.map +1 -1
  64. package/lib/hooks-map.js +9 -3
  65. package/lib/hooks-map.js.map +1 -1
  66. package/lib/plan.d.ts +2 -0
  67. package/lib/plan.d.ts.map +1 -1
  68. package/lib/plan.js +8 -0
  69. package/lib/plan.js.map +1 -1
  70. package/lib/proposals.d.ts +25 -0
  71. package/lib/proposals.d.ts.map +1 -1
  72. package/lib/proposals.js +43 -1
  73. package/lib/proposals.js.map +1 -1
  74. package/lib/shipment.d.ts.map +1 -1
  75. package/lib/shipment.js +8 -11
  76. package/lib/shipment.js.map +1 -1
  77. package/package.json +1 -1
  78. package/rt-tools-agent-kit-0.28.0.tgz +0 -0
  79. package/rt-tools-agent-kit-0.27.0.tgz +0 -0
@@ -56,12 +56,12 @@ flowchart TD
56
56
  D -->|Yes| E[Main is merged in, the gate set is run whole]
57
57
  E --> F{The branch carries a task number}
58
58
  F -->|No| G[The delivery guard refuses the opening: nothing in the queue stands behind the edit]
59
- F -->|Yes| H[The PR opens; what is not ready to merge goes as a draft]
59
+ F -->|Yes| H[The PR opens: a draft where a run is waited for, ready where the pipeline does not wake]
60
60
  H --> I[The task column moves to review, the executor takes the next task]
61
61
  I --> J{The run and the review are over}
62
62
  J -->|Run red| K[Fixed in the same branch]
63
63
  K --> J
64
- J -->|Green| L[The last commit takes the task folder apart, the draft is lifted]
64
+ J -->|Green| L[The last commit takes the task folder apart, and the draft, if there was one, is lifted]
65
65
  L --> M[A person presses the merge into the epic branch: the executor asks and names the number]
66
66
  M --> N{Tasks of the epic are left}
67
67
  N -->|Yes| B
@@ -71,38 +71,38 @@ flowchart TD
71
71
 
72
72
  ## How the law applies here
73
73
 
74
- - **A commit into the main branch is refused by the guard.** The guard looks for a commit call
75
- anywhere in the command and reads the current branch at launch: a compound "create a branch and
76
- commit at once" is rejected whole — the branch does not exist yet at review.
77
- - **A branch without a task number opens no PR.** Locally it is legitimate, but an edit from it is a
78
- rollout with nothing behind it in the queue. A task is created, and the work moves to a branch
79
- with its number.
74
+ - **A commit into the main branch is refused by the guard.** It finds a commit call anywhere in the
75
+ command and reads the branch at launch: a compound "branch and commit at once" is rejected whole
76
+ — the branch does not exist yet at review.
77
+ - **A branch without a task number opens no PR.** Locally it is legitimate; an edit from it is a
78
+ rollout with nothing behind it in the queue. The work moves to a branch with a number.
80
79
  - **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 task branched from `main` carries into it what the epic has not finished.
83
- - **The PR of a task has the epic branch as its base — `gh pr create --base <ветка эпика>`.**
84
- Opened into `main`, it leaves the epic branch a copy nobody merges: half the epic is rolled out
85
- while the rest is being written.
80
+ checkout -b <КЛЮЧ>-<номер задачи>-<slug> <ветка эпика>`; from `main` only the epic branch itself is
81
+ taken — a task branched from `main` carries into it what the epic has not finished.
82
+ - **The PR of a task has the epic branch as its base — `gh pr create --base <ветка эпика>`.** Opened
83
+ into `main`, it leaves the epic branch a copy nobody merges.
86
84
  - **The PR of an epic into the main branch opens after all its tasks are merged and their folders
87
- are taken apart.** The merge button on the epic branch means the whole epic, and there is nothing
88
- to press it for while a task of it is still being written.
85
+ are taken apart.** The merge button there means the whole epic, and there is nothing to press it
86
+ for while a task of it is still written.
89
87
  - **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 directly goes into `main` unreviewed: nobody opens a PR about the epic
91
- branch to the epic branch.
88
+ own.** An edit made in it goes into `main` unreviewed: nobody opens a PR from that branch to it.
92
89
  - **The main branch is merged into the epic branch, and the epic branch into the branches of its
93
- tasks — while the work runs, not before the hand-over.** Otherwise the reviewer sees the edit
94
- mixed with someone else's, and everything was checked from a base that is gone.
90
+ tasks — while the work runs, not before the hand-over.** Otherwise the reviewer sees the edit mixed
91
+ with someone else's, checked from a base that is gone.
95
92
  - **A wave of branches off one epic branch is checked by a trial merge, not one by one:** each is
96
93
  green on its own, and they collide on what one branch cannot show.
97
94
  - **The next work's branch is taken from the previous one while the chain is unbroken.** `git
98
95
  checkout -b <КЛЮЧ>-<номер>-<slug> <предыдущая ветка>`; from the epic branch — only the chain's
99
- first work, otherwise the first merge diverges the rest at once. A chain is set up inside one
100
- epic and only where the next task edits what the previous one wrote.
96
+ first work. A chain stands inside one epic, where the next task edits what the previous wrote.
101
97
  - **A PR in a chain has the previous branch as its base, not main.** `gh pr create --base
102
98
  <предыдущая ветка>` — otherwise the review shows the edit mixed with all under it. The host
103
- retargets the base of a merged lower one itself.
99
+ retargets a merged lower base only when its branch is deleted, so the base is retargeted by the
100
+ same motion that merges the lower one — the call is in the pattern.
104
101
  - **A chain is merged bottom-up, and the order stands in every PR body.** Branch kinship is
105
- invisible in the list: the line "stands on #<number>" is the only place the owner reads it.
102
+ invisible in the list, and the line "stands on #<number>" is the only place it is read.
103
+ - **`--hard` is not taken to drop a commit — that is `--soft`.** `reset --hard`, `checkout --
104
+ <path>`, `restore <path>` and `clean -f` erase what is not committed. On a dirty tree the guard
105
+ refuses and names the files; the bypass is `# discard: <reason>` in the command.
106
106
  - **The lower branch of a chain does not rewrite history — neither `rebase` nor a force push.** The
107
107
  host closes the upper PR as merged once its diff goes empty. A lagging branch is fixed by merging
108
108
  main in.
@@ -110,178 +110,178 @@ flowchart TD
110
110
  owner resolving the same at merge time owns neither.
111
111
  - **Unmet delivery conditions are named in one refusal.** The guard collects and prints them at
112
112
  once: everything unmet is known on the first call.
113
- - **A condition known at the start of work is asked at the start.** Creating a branch — also with a
114
- flag between the verb and `-b` — refuses a base without main's tip and a foreign email in the
115
- signature: at push time the fix costs more.
113
+ - **A condition known at the start of work is asked at the start.** Creating a branch refuses a base
114
+ without main's tip and a foreign signature email: at push time the fix costs more.
115
+ - **The form of a branch name is judged by the tree the command runs in.** A session works in a
116
+ neighbouring tree by the owner's word, and the task key there is its own; a tree with no profile
117
+ is not judged at all. A refusal on a lawful name has no bypass and stops the work whole.
116
118
  - **The base judged is the one named by the command, not the tip of the working copy.** A branch is
117
- also created straight from `origin/main` — that very command takes the base fresh. A base the tree
118
- knows nothing of is not judged at all.
119
+ also created straight from `origin/main`, and that command takes the base fresh; a base the tree
120
+ knows nothing of is not judged.
119
121
  - **A branch without a task number gets no delivery conditions.** A local trial branch is
120
122
  legitimate, and it will not go to main.
121
123
  - **The task key is set once, and all three name forms derive from it.** The task title is assembled
122
- from it, the branch number is read by it, and so is the PR title by the audit. The tree profile
123
- writes the branch form with the same pair `<КЛЮЧ>-<номер>`.
124
+ from it, and by it the audit reads the branch number and the PR title. The tree profile writes the
125
+ branch form with the same pair `<КЛЮЧ>-<номер>`.
124
126
  - **An unset key refuses work with the queue on the spot.** No default on purpose: a title from an
125
127
  empty value matches nothing, and a real discrepancy drowns among false lines.
126
128
  - **A created task is confirmed by the work queue's answer, not by the creation command's output.**
127
- A printed number means "the call went through": a task can be created and never reach the board.
129
+ A task can be created and never reach the board.
128
130
  - **The visibility of what was created is checked by the side it is meant for.** A PR is read by a
129
- person, a task by the work queue, and both read with a token other than the creating one. Whose
130
- eyes took the answer, its `viewer` field says.
131
+ person, a task by the work queue, and both read with a token other than the creating one.
131
132
  - **A refusal is read before it is bypassed by a second way.** It can be an early sign of a write
132
133
  limit, and a bypass by another call carries the sign away: the discrepancy surfaces at the owner.
133
- A limit is told from exhaustion by the limits answer — there it is zero.
134
134
  - **The branch number and the PR title number are checked on the spot, the task state — by the
135
- board.** The format is read from the command text and works offline; task, column, assignee and
136
- review — only with something to ask with. No network or token — the second tier is skipped
137
- silently.
135
+ board.** The format is read from the command text and works offline; the second tier needs
136
+ something to ask with.
138
137
  - **The task column moves in the same motion as the work.** Branch created — the task is in
139
138
  progress, PR opened — awaiting review; the move command does it, not GraphQL calls from memory.
140
- The move follows the step at once: the queue is read between steps, not after.
141
139
  - **A task left in the first column opens no PR.** By the work queue it reads as not taken, though
142
- the work is done and published. At branch creation the column is not asked — nothing has moved it
143
- yet. The tree names the first column itself; unnamed — not judged.
140
+ the work is done and published. The tree names the first column itself; unnamed — not judged.
144
141
  - **The board holds tasks, not PRs about them.** A PR card has no column and never leaves the queue.
145
142
  The queue audit finds such cards, a line each.
146
143
  - **A lagging column is found by the queue audit, not by eye.** It judges the column by the PR both
147
144
  ways: an open PR with the task not in review, and review with no open PR.
148
145
  - **A branch with an open PR lags behind its base silently.** The guard judges the base once, at
149
- opening, and the run does not see what merged after either. The work queue audit counts the lag.
146
+ opening, and the run does not see what merged after. The work queue audit counts the lag.
150
147
  - **The link between a task and an epic is read by the audit both ways.** A one-sided binding looks
151
- as whole as a two-sided one: the reader comes now from the epic plan, now from the card.
148
+ as whole as a two-sided one.
152
149
  - **Tasks fixed by one edit are merged before the merge.** The second is erased with its number, and
153
150
  the missing is added to the first: after the merge the branch went in whole.
154
- - **Work that one session cannot close is marked in two places, and they are audited.** The label on
155
- the board and the sessions line in the epic plan say the same to two readers. Only what
156
- legitimately does not split is marked.
157
- - **The tip of an open PR without a run is seen by the work queue audit.** A page without a run
158
- looks the same as with a green one: no colour in either. The audit asks the tip, counts the fact
159
- of a run, not the colour, and gives a fresh tip time.
160
- - **A PR whose base is not the main branch is checked by the same set as a PR into main.** The
161
- pipeline trigger reads the base, and an empty checks field reads as waiting in the queue. Asked
162
- before the first PR of an epic opens — pattern `git-workflow-stack`.
151
+ - **Work that one session cannot close is marked in two places, and they are audited.** The board
152
+ label and the sessions line in the epic plan say the same to two readers; only what legitimately
153
+ does not split is marked.
154
+ - **The tip of an open PR without a run is seen by the work queue audit, unless the pipeline does
155
+ not wake for its base.** A page without a run looks the same as with a green one; where no run
156
+ comes at all, its absence tells nothing and the audit is silent about that PR.
157
+ - **What checks a PR whose base is not the main branch is asked before the first PR of an epic
158
+ opens.** The trigger either wakes for it as for one into main, or does not, and then the push
159
+ gate is the only check behind the work — pattern `git-workflow-stack`.
163
160
  - **A run pushed out of the pipeline queue gets a separate audit line.** It looks failed though it
164
- never checked the branch; the step count tells them apart — it has zero.
161
+ never checked the branch, and the step count tells them apart.
165
162
  - **A draft with a green run on its tip is an audit discrepancy.** A green page permits nothing: the
166
- host locks the button. Within a turn the guard closes this, between turns — the audit.
163
+ host locks the button.
167
164
  - **One's own drafts are judged all at once, not only the checked-out branch's.** Two signs — a
168
- green run on the tip and a task folder taken apart in the branch; a folder still there means
169
- ongoing work.
165
+ green run on the tip and a folder taken apart; a folder still there means ongoing work.
170
166
  - **Opening a PR is refused while the branch carries its task folder.** Opening is the last point
171
167
  where the executor still sees the refusal.
172
168
  - **One's own open PRs are reread in three places: before a push, on taking a task and after every
173
- known merge.** A PR goes stale with no action by its author: a neighbouring work merged — the rest
174
- lagged that second. Technique — `git-workflow-freshness`.
169
+ known merge.** A PR goes stale with no action by its author: a neighbouring work merged, and the
170
+ rest lagged that second. Technique — `git-workflow-freshness`.
175
171
  - **One's own conflicting PR is fixed by the turn's first action, and no new work is taken before
176
- that.** While the handed-over conflicts, a person cannot merge it. Work here means creating a task
177
- or a branch, moving the column to in progress and opening a PR; what fixes the conflict goes as
178
- before.
172
+ that.** Work here means creating a task or a branch, moving the column and opening a PR.
173
+ - **A conflicting PR of a neighbouring session is not one's own.** One's own branch is the one this
174
+ working copy led — the machine account is shared and tells nothing apart. A neighbour's PR is
175
+ named to the owner, and work is taken as usual.
179
176
  - **A conflicting open PR is a work queue audit discrepancy.** The conflict arrives with someone
180
- else's merge and is invisible in the list: the host shows the mark only inside the PR.
177
+ else's merge, and the host shows the mark only inside the PR.
181
178
  - **A document goes in the same commit as the edit.** The bypass is the line `Docs-skip: <reason>`
182
179
  in the commit body; an empty reason is not accepted.
183
180
  - **The commit subject is checked against the format on the spot.** A subject parsed by type and
184
181
  scope is read as a list, free text — only whole.
185
182
  - **Before a push all linters are run, not one.** The code linter usually does not read style files
186
183
  at all; without a second run nothing checks the styling rules.
187
- - **The build is in the set on a par with lint and unit tests.** The linter does not read types, and
188
- unit tests read only what a test imports: a type error in uncovered code lives until the image
189
- build — that is, the merge.
190
- - **On a machine with several runners, any path from the home directory is shared.** A neighbouring
191
- run rewrites a ready-made step's default to its own version. Install directory, container name and
192
- builder name are per project and fixed; a temporary directory will not do — the package store
193
- lives there.
194
- - **The push gate set is never narrower than the pipeline set.** A pipeline step with neither a line
195
- in the set nor a declared exclusion with a reason refuses the push instead of printing next to it:
196
- a warning reads as permission.
197
- - **The gate set calls the package default instead of listing it line by line.** Rewritten as lines,
198
- it leaves tomorrow's hole: a check the package adds never reaches the tree. Sifting out of the
199
- default is legitimate, by name and with a reason.
184
+ - **The build is in the set on a par with lint and unit tests.** The linter does not read types,
185
+ and a type error in uncovered code lives until the merge.
186
+ - **On a machine with several runners, any path from the home directory is shared.** Install
187
+ directory, container name and builder name are per project.
188
+ - **The push gate set is never narrower than the pipeline set.** A pipeline step with neither a
189
+ line in the set nor a declared exclusion refuses the push: a warning reads as permission.
190
+ - **The gate set calls the package default instead of listing it line by line.** Rewritten as
191
+ lines, it leaves tomorrow's hole: a check the package adds never reaches the tree. Sifting out is
192
+ legitimate, by name and with a reason.
200
193
  - **The final set before a push is read from the state review, not assembled in the head.** The "set
201
- before push" section prints it whole and names next to it what the default printed and the set did
202
- not take.
194
+ before push" section prints it whole, naming what the default gave and the set did not take.
203
195
  - **An exclusion reason naming a task is judged on whether that task is alive.** A dead number
204
- silently makes the exclusion perpetual. Asked by the same tier as the task state at the guard.
205
- - **The layout audit stands in the push gate set on a par with lint and the build.** An edit past
206
- the source piles up silently, and the audit is not in the pipeline.
196
+ silently makes the exclusion perpetual.
197
+ - **The layout audit stands in the push gate set on a par with lint and the build.** An edit past the
198
+ source piles up silently, and the audit is not in the pipeline.
207
199
  - **After merging the base in, the check set is revised by what the branch now carries.** Checking by
208
200
  what the author edited means checking half: the branch answers whole.
209
201
  - **The main branch is taken by the remote ref — in words and in actions.** The local one is
210
- yesterday's snapshot and silent about it: by it a merged branch counts as unmerged, and cleanup
211
- ends with a list of unmerged that does not exist.
202
+ yesterday's snapshot and silent about it: by it a merged branch counts as unmerged.
212
203
  - **A code edit is handed to a person by an open PR, not by a pushed branch.** A branch reaches no
213
- inbox and has no discussion: before the PR opens there is no edit for a person. It opens in the
214
- turn in which the executor says the work is handed over.
204
+ inbox and has no discussion, and the PR opens in the turn the executor says the work is handed
205
+ over.
215
206
  - **What is not ready to merge opens as a draft — `gh pr create --draft`.** The host locks a draft's
216
- merge button, so "put up for viewing" and "may be merged" stop looking alike. Everything waiting
217
- for a run, a rework or an answer goes as a draft.
207
+ merge button: everything waiting for a run, a rework or an answer goes as a draft.
208
+ - **A PR the pipeline does not wake for opens ready, without `--draft`.** Which bases it wakes for
209
+ is read from the pipeline file: where no run comes, a draft waits for nothing and costs a locked
210
+ button and a second turn. The reviewer is set in the same turn.
218
211
  - **The PR body is written in the turn the PR opens, and next to the sample.** A blank from the day
219
- before diverged from it by two sections and the link line: nobody reads a ready-looking text
220
- twice, and the guards judge the title, the branch number and the task folder.
212
+ before diverges from it, and nobody reads a ready-looking text twice.
221
213
  - **The draft is lifted by a separate call — `gh pr ready <номер>`.** With it the executor answers
222
214
  for readiness: checks passed, no rework left, the work matches the task. Lifting the draft and
223
- asking to merge are one turn, not two days.
215
+ asking to merge are one turn, and a PR opened ready needs no such call.
224
216
  - **The draft is not lifted from a branch that does not merge.** A green run says "not broken",
225
217
  mergeability says "the button can be pressed", and the owner needs the second. Asked from the
226
218
  host's `mergeable` field; a local merge does not derive it.
227
- - **An index that branches only append lines to is declared a union of both sides.** A conflict
228
- there is no dispute: both additions are needed whole. The declaration does **not** clear the
229
- mergeability mark — it clears when the branch has absorbed main and that reached the host.
219
+ - **An index that branches only append lines to is declared a union of both sides.** A conflict there
220
+ is no dispute: both additions are needed whole. The declaration does **not** clear the mergeability
221
+ mark — it clears when the branch has absorbed main and that reached the host.
230
222
  - **An edit brought to a commit is brought to the host in the same turn.** The owner sees the old
231
- state and reads it as "nothing done", while the done lies where nobody sees it. What stays in the
232
- tree is named with a reason — in the owner's words, not a list of leftovers.
223
+ state and reads it as "nothing done". What stays in the tree is named with a reason — in the
224
+ owner's words, not a list of leftovers.
225
+ - **The working tree is emptied before the PR opens, not after.** `git status --porcelain` is asked
226
+ in the same turn as the opening: what is uncommitted goes to the host by a commit before it, or
227
+ is named. A push after the opening moves the tip past the green run the body names, and for that
228
+ stretch the PR invites merging a tip nothing has checked.
229
+ - **A push into a branch that has an open PR is followed by rereading its body.** The statement
230
+ about a green run names the tip by its sha, and moving the tip makes it false in silence: no check
231
+ reads a PR body.
233
232
  - **The draft is not lifted while the PR has no review.** The guard reads the requested reviewer and
234
233
  the review left: a lifted draft reads as "may be merged", and there is nobody to merge. A call
235
- without a number is judged too — the client then takes the PR of the current branch.
234
+ without a number is judged too — the client takes the PR of the current branch.
236
235
  - **The PR merge is pressed by a person, not by the work's executor.** Button and merge call are
237
- equal: one ban covers both. The executor merges their own PR only when a person said so directly
238
- and about this PR; said about one, it does not carry to the next, and silence is never permission.
236
+ equal: one ban covers both. The executor merges their own PR only when a person said so about this
237
+ PR; said about one, it does not carry to the next, and silence is never permission.
239
238
  - **The identity of the call opening a PR is guarded by the delivery guard, not by the executor's
240
- memory.** It comes from the environment and shows in the command text only by an explicit token
241
- substitution. The guard asks the host about the author at draft lifting: a merged PR cannot be
242
- reopened.
239
+ memory.** It shows in the command text only by an explicit token substitution. Judged is the clash
240
+ with the reviewer, not the account name; where the author cannot be learnt, the substitution is
241
+ demanded outright.
243
242
  - **The host client's active account is chosen per machine, not per tree; the machine account is
244
243
  substituted per call, never made active.** A login as the machine account hijacks every
245
244
  neighbouring session on the machine. Substitution is mandatory even with an active account.
246
245
 
247
246
  - **The PR author cannot be its reviewer.** GitHub accepts a self review request and silently does
248
247
  not create it. Only a request and a review not from the author count.
249
- - **The host client call goes from the tree, and a command chain does not check the outcome.**
250
- Outside the tree the client refuses, and the next link carries the rest to the host.
248
+ - **The host client call goes from the tree, and a command chain does not check the outcome.** Outside
249
+ the tree the client refuses, and the next link carries the rest to the host.
251
250
  - **PR labels, assignee and reviewer are set by `gh api` calls, not by `gh pr edit`:** that one
252
251
  refuses about Projects.
253
252
  - **The board is edited by a GraphQL query by the board id, not by the owner's name.**
254
253
  - **The machine commit's email is copied from the companion, not typed from memory.** The address
255
254
  `<число>+<логин>@users.noreply.github.com` matches by the number: with a foreign one the commit
256
- leaves signed by a stranger. The tree profile holds the same line, and the guard refuses the push.
257
- - **The identity of the machine account is confirmed by the host's answer, not by recognising a
258
- string:** asked with the token, login and number come together.
259
- - **Guard scenarios set the git settings themselves, not take them from the machine.** A machine
260
- signature sends git to the key agent, and a locked agent brings the set down; author, email and
261
- signature go as `-c` flags.
255
+ leaves signed by a stranger. The guard refuses the push over it.
256
+ - **The identity of the machine account is confirmed by the host's answer:** asked with the token,
257
+ login and number come together.
258
+ - **Guard scenarios set the git settings themselves, not take them from the machine.** Author, email
259
+ and signature go as `-c` flags.
262
260
 
263
261
  - **Every commit of the branch's contribution is signed by the machine account, and the push set
264
- checks it.** The guard judges a commit that named itself as it; one signed by a person passes by.
262
+ checks it.** The guard judges a commit that named itself as it; a person's passes by.
265
263
  - **The PR state is reread from the host right after publishing.** Opening and setting a reviewer
266
264
  answer zero even having done nothing.
267
- - **The author of an open PR and whether it has a reviewer are audited by the work queue.** Before
268
- the merge neither miss shows: a PR opened by a person never gets a reviewer.
269
- - **Reviewers are asked by a REST call, not by the client's selection.** Its fields come from
270
- GraphQL, which the account has no rights to: "matched" cannot be told from "nothing to ask with".
265
+ - **The author of an open PR and whether it has a reviewer are audited by the work queue.** Before the
266
+ merge neither miss shows: a PR opened by a person never gets a reviewer.
267
+ - **Reviewers are asked by a REST call, not by the client's selection.** Its fields come from GraphQL,
268
+ which the account has no rights to: "matched" is not told from "nothing to ask with".
271
269
 
270
+ - **A second working copy is for reading, and the call goes from the copy the session stands in.**
271
+ The gate runs its set where the session was started: someone else's uncommitted work refuses the
272
+ call, and its own contribution passes unchecked.
272
273
  - **The working tree is not emptied for a tool run.** The comparison goes on a second copy: stashing
273
274
  takes uncommitted work where neither the tree state nor the audit sees it.
274
275
 
275
276
  ## What of the law is not here
276
277
 
277
- The delivery guard stands on the agent's commands, so it does not see a branch created by hand in
278
- the editor: its name is held by memory. No separate check is made for it — work is recognised by the
279
- task title and the PR. The queue audit never judges the branch name.
278
+ The delivery guard stands on the agent's commands, so a branch created by hand in the editor it does
279
+ not see: its name is held by memory. Work is recognised by the task title and the PR, and the queue
280
+ audit never judges the branch name.
280
281
 
281
- The guard does not move a task to in progress: it does not edit the board — a board edit during
282
- command review would fall with the connection. The move is held by memory and the task creation
283
- command's hint; a task left in the first column the guard names at PR opening, other column
284
- discrepancies the queue audit finds.
282
+ The guard does not move a task to in progress: it does not edit the board at all. The move is held
283
+ by memory and the task creation command's hint; a task left in the first column the guard names at
284
+ PR opening, other column discrepancies the queue audit finds.
285
285
 
286
286
  The freshness of main's tip the guard asks by the second tier — the same technique as the task
287
287
  state. The first tier works offline: the local ref answers whether the branch lags what lies in the
@@ -98,6 +98,16 @@ flowchart TD
98
98
  looking alike. Everything waiting for a pipeline run, a rework or an answer goes as a draft; the
99
99
  question is asked in the MR itself. The draft sign here is the `Draft:` prefix in the title, and
100
100
  it is edited together with it.
101
+ - **`--hard` is not taken to drop a commit — that is `--soft`.** `reset --hard`, `checkout --
102
+ <path>`, `restore <path>` and `clean -f` erase what is not committed. On a dirty tree the guard
103
+ refuses and names the files; the bypass is `# discard: <reason>` in the command.
104
+ - **The working tree is emptied before the PR opens, not after.** `git status --porcelain` is asked
105
+ in the same turn as the opening: what is uncommitted goes to the host by a commit before it, or
106
+ is named. A push after the opening moves the tip past the green run the body names, and for that
107
+ stretch the PR invites merging a tip nothing has checked.
108
+ - **A push into a branch that has an open PR is followed by rereading its body.** The statement
109
+ about a green run names the tip by its sha, and moving the tip makes it false in silence: no check
110
+ reads a PR body.
101
111
  - **The draft is lifted by a separate call — `glab mr update <номер> --ready`.** With it the
102
112
  executor answers for readiness: checks passed, no rework left, the work matches the task. Lifting
103
113
  the draft and asking to merge are one turn, not two days.
@@ -77,6 +77,10 @@ flowchart TD
77
77
  - **A domain is started for a subject, not for mechanics.** Mechanics shared by several domains ride
78
78
  into the lib that already sees them. On the frontend that is the family base, on the backend the
79
79
  `util` layer listed with every domain.
80
+ - **The name of a lib is what its manifest declares, and the path only suggests it.** The tag and
81
+ the import alias are derived from that name, and the audit reads all three from the manifest and
82
+ the list of paths instead of assembling them from the directory. Where the manifest declares no
83
+ name, the path says what the name must become.
80
84
  - **A domain with exactly one non-empty layer is listed as a line with a reason.** Otherwise it
81
85
  cannot be told from a slot: both have empty layers, and a barrel lies in both.
82
86
 
@@ -100,6 +104,13 @@ layer; such a domain is usually one, and it stands in the exceptions list with a
100
104
  its contract with the consumer: a lost field in `*.State` is not an error while there is no
101
105
  calling code. The first importer is the first check — the models layer is accepted after `nx
102
106
  build` and a live run of the scenario, not by a green `lint test`.
107
+ - **A configuration a target does not declare is a default, not a refusal.** The builder drops an
108
+ unknown name silently: the exit code is zero, the artefact is built by the default, and only the
109
+ line of the build output, where the target is named without a configuration, tells this from a
110
+ real build. Hence the reading rule: what is built with is said by the build output, not by the
111
+ list of configurations in the target manifest — that one says what may be called, not what is
112
+ called. A rollout pipeline called a server build with a production setting the target did not
113
+ have, and for half a year the line promised what it did not do.
103
114
  - **A check is accepted on a violation, not on a green run.** The violation is introduced by hand,
104
115
  the run turns red, the edit is reverted. The checks in `tools/` have no tests, and this is the
105
116
  only acceptance.
@@ -95,7 +95,16 @@ flowchart TD
95
95
  - **The first column of the companion is the article text copied, not retold.** The key of the link
96
96
  is the text itself: a line written by meaning breaks the link while looking filled in. The check
97
97
  counts articles without an address and knows nothing of an article with a wrong address.
98
- - **A binding does not lead into code nobody calls:** a symbol called nowhere is not a place.
98
+ - **A binding does not lead into code nobody calls, and a test is not a call.** A function written
99
+ test-first, before the first call from the application, is an intention: the test calls it
100
+ itself, and by that call a live symbol cannot be told from a forgotten one. The exception is a
101
+ symbol declared in the suite harness itself or published outward by a package — there the caller
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
107
+ until the form is fixed; the article under it stays carried out and is not removed.
99
108
  - **A "not carried out" binding moves together with its article.** Otherwise the companion line
100
109
  keeps in the hot part an article with nothing behind it: removed alone, it leaves the binding
101
110
  without an item, and the audit turns red. Both sides move at once.