@rt-tools/agent-kit 0.27.0 → 0.29.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 (112) hide show
  1. package/assets/checks/board-epic-link.github.mjs +13 -1
  2. package/assets/checks/board-epic-plan.github.mjs +86 -0
  3. package/assets/checks/board-epics.github.mjs +12 -67
  4. package/assets/checks/board-pull-state.github.mjs +6 -11
  5. package/assets/checks/board-runs.github.mjs +102 -2
  6. package/assets/checks/check-board.github.mjs +63 -3
  7. package/assets/checks/check-glossary.mjs +10 -2
  8. package/assets/checks/check-lib-layers.mjs +24 -1
  9. package/assets/checks/check-reuse.mjs +26 -2
  10. package/assets/checks/check-specs.mjs +8 -1
  11. package/assets/checks/lib-boundaries.mjs +2 -2
  12. package/assets/checks/lib-common.mjs +46 -0
  13. package/assets/checks/lib-manifests.mjs +18 -13
  14. package/assets/checks/main-run.github.mjs +69 -0
  15. package/assets/checks/rt-kit-checks.config.mjs +21 -0
  16. package/assets/checks/signals.mjs +39 -5
  17. package/assets/checks/spec-anchors.mjs +48 -4
  18. package/assets/checks/spec-common.mjs +40 -6
  19. package/assets/checks/spec-contract.mjs +33 -7
  20. package/assets/checks/spec-scenarios.mjs +24 -1
  21. package/assets/checks/task-new.github.mjs +9 -3
  22. package/assets/checks/tree-assignment.mjs +169 -0
  23. package/assets/defaults/gate-map.sh +20 -5
  24. package/assets/defaults/project.sh +6 -0
  25. package/assets/hooks/dev-server-guard.sh +61 -32
  26. package/assets/hooks/end-conversation-guard.sh +59 -0
  27. package/assets/hooks/epic-over.sh +11 -2
  28. package/assets/hooks/exam-guard.sh +10 -10
  29. package/assets/hooks/git-guard-delivery-conflict.sh +53 -1
  30. package/assets/hooks/git-guard-delivery-draft.sh +7 -6
  31. package/assets/hooks/git-guard-delivery-epic.sh +7 -0
  32. package/assets/hooks/git-guard-delivery-tree.sh +50 -0
  33. package/assets/hooks/git-guard-delivery.sh +45 -24
  34. package/assets/hooks/git-guard-discard.sh +144 -0
  35. package/assets/hooks/git-guard-push-tests.sh +36 -16
  36. package/assets/hooks/git-guard-tree-assignment.sh +77 -0
  37. package/assets/hooks/hook-input.sh +8 -1
  38. package/assets/hooks/main-run-context.sh +45 -0
  39. package/assets/hooks/reuse-first-guard.sh +29 -4
  40. package/assets/hooks/rule-source-guard.sh +17 -2
  41. package/assets/hooks/skill-gate.sh +7 -0
  42. package/assets/hooks/sql-guard-write.sh +18 -2
  43. package/assets/hooks/tree-assignment-guard.sh +101 -0
  44. package/assets/hooks/turn-exit-epic.sh +110 -0
  45. package/assets/hooks/turn-exit-guard.sh +80 -82
  46. package/assets/hooks/turn-exit-patterns.sh +18 -10
  47. package/assets/hooks/turn-exit-verdict.sh +96 -0
  48. package/assets/laws/delivery.md +20 -6
  49. package/assets/laws/verifiability.md +22 -4
  50. package/assets/laws/work-conduct.md +4 -0
  51. package/assets/patterns/git-workflow-merge.md +13 -0
  52. package/assets/patterns/git-workflow-pr-body.github.md +156 -0
  53. package/assets/patterns/git-workflow-pr.github.md +42 -119
  54. package/assets/patterns/git-workflow-stack.md +38 -2
  55. package/assets/patterns/task-flow-close.md +66 -79
  56. package/assets/patterns/task-flow-resume.md +8 -0
  57. package/assets/patterns/ts-procedure.md +6 -0
  58. package/assets/pitfalls/git-workflow.github.md +44 -0
  59. package/assets/pitfalls/task-flow.md +25 -23
  60. package/assets/pitfalls/turn-conduct.md +18 -0
  61. package/assets/rules/browser-verification.md +8 -0
  62. package/assets/rules/deploy-flow.github.md +6 -0
  63. package/assets/rules/doc-style.md +9 -2
  64. package/assets/rules/git-workflow.azure.md +10 -0
  65. package/assets/rules/git-workflow.github.md +128 -130
  66. package/assets/rules/git-workflow.gitlab.md +10 -0
  67. package/assets/rules/lib-layers.md +11 -0
  68. package/assets/rules/spec-driven.md +10 -1
  69. package/assets/rules/task-flow.md +82 -79
  70. package/assets/rules/testing.md +7 -0
  71. package/assets/rules/turn-conduct.md +47 -28
  72. package/assets/samples/tasks/_template/plan.md +4 -1
  73. package/assets/samples/tasks/_template/progress.md +1 -1
  74. package/assets/skills/agent-kit.md +17 -4
  75. package/bin/agent-kit.d.ts.map +1 -1
  76. package/bin/agent-kit.js +3 -2
  77. package/bin/agent-kit.js.map +1 -1
  78. package/lib/cargo.d.ts +49 -1
  79. package/lib/cargo.d.ts.map +1 -1
  80. package/lib/cargo.js +9 -2
  81. package/lib/cargo.js.map +1 -1
  82. package/lib/commands.d.ts +1 -1
  83. package/lib/commands.d.ts.map +1 -1
  84. package/lib/commands.js +59 -2
  85. package/lib/commands.js.map +1 -1
  86. package/lib/hooks-map.d.ts +5 -0
  87. package/lib/hooks-map.d.ts.map +1 -1
  88. package/lib/hooks-map.js +9 -3
  89. package/lib/hooks-map.js.map +1 -1
  90. package/lib/observations-cargo.d.ts +20 -0
  91. package/lib/observations-cargo.d.ts.map +1 -0
  92. package/lib/observations-cargo.js +88 -0
  93. package/lib/observations-cargo.js.map +1 -0
  94. package/lib/plan.d.ts +2 -0
  95. package/lib/plan.d.ts.map +1 -1
  96. package/lib/plan.js +8 -0
  97. package/lib/plan.js.map +1 -1
  98. package/lib/proposals.d.ts +25 -0
  99. package/lib/proposals.d.ts.map +1 -1
  100. package/lib/proposals.js +43 -1
  101. package/lib/proposals.js.map +1 -1
  102. package/lib/shipment.d.ts +8 -20
  103. package/lib/shipment.d.ts.map +1 -1
  104. package/lib/shipment.js +30 -50
  105. package/lib/shipment.js.map +1 -1
  106. package/lib/tree-mark.d.ts +17 -0
  107. package/lib/tree-mark.d.ts.map +1 -0
  108. package/lib/tree-mark.js +41 -0
  109. package/lib/tree-mark.js.map +1 -0
  110. package/package.json +1 -1
  111. package/rt-tools-agent-kit-0.29.0.tgz +0 -0
  112. package/rt-tools-agent-kit-0.27.0.tgz +0 -0
@@ -27,7 +27,7 @@ with the rule.
27
27
  | separate branch | `<КЛЮЧ>-<номер задачи>-<короткий-slug>`, taken from the epic branch. A name without a number (`feat/…`, `fix/…`) is legitimate locally: no PR opens from it |
28
28
  | task | a repository issue `[<КЛЮЧ>-<номер>] <Что не так>`, assignee the machine account; attached PR: `Closes #<номер>` in its body |
29
29
  | work queue | a GitHub Projects board, not bound to the repository: its `projectsV2` is empty, and a task lands on it only when added |
30
- | task state in the work queue | a board column ("Status"): created, in progress, in review; names in `implementation.md`. A closed task leaves by merge, not by column |
30
+ | task state in the work queue | a board column ("Status"): created, in progress, in review; names in `implementation.md`. A closed task leaves by merge, not by column. The epic card stands in the same columns and moves with its first task and its own PR |
31
31
  | PR about a task | PR title `[<КЛЮЧ>-<номер>] <Что сделано>` — the task's number and title turned into the done; commit type and scope stay out |
32
32
  | discussion of an edit | PR review: reviewer — the repository owner, assignee — the machine account, labels — the same as on the task |
33
33
  | record of an edit | `type(scope): description`, types `feat`, `fix`, `refactor`, `docs`, `style`, `test`, `chore`, `perf`; scopes: `implementation.md` |
@@ -50,18 +50,18 @@ flowchart TD
50
50
  Z -->|No| Y[The epic is created together with its tasks, and its branch is taken from main]
51
51
  Z -->|Yes| B[A command creates the task and it enters the work queue]
52
52
  Y --> B
53
- B --> C[The branch is named by the task number and taken from the epic branch; the column moves in the same motion]
53
+ B --> C[The branch is named by the task number and taken from the epic branch; the column moves in the same motion — the epic card too, on its first task]
54
54
  C --> D{The edit is ready}
55
55
  D -->|No| C
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,37 @@ 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.
101
97
  - **A PR in a chain has the previous branch as its base, not main.** `gh pr create --base
102
- <предыдущая ветка>` — otherwise the review shows the edit mixed with all under it. The host
103
- retargets the base of a merged lower one itself.
98
+ <предыдущая ветка>` — otherwise the review shows the edit mixed with all under it. The base is
99
+ retargeted by the same motion that merges the lower one — the call is in the pattern.
104
100
  - **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.
101
+ invisible in the list, and the line "stands on #<number>" is the only place it is read.
102
+ - **`--hard` is not taken to drop a commit — that is `--soft`.** `reset --hard`, `checkout --
103
+ <path>`, `restore <path>` and `clean -f` erase what is not committed. On a dirty tree the guard
104
+ refuses and names the files; the bypass is `# discard: <reason>` in the command.
106
105
  - **The lower branch of a chain does not rewrite history — neither `rebase` nor a force push.** The
107
106
  host closes the upper PR as merged once its diff goes empty. A lagging branch is fixed by merging
108
107
  main in.
@@ -110,187 +109,186 @@ flowchart TD
110
109
  owner resolving the same at merge time owns neither.
111
110
  - **Unmet delivery conditions are named in one refusal.** The guard collects and prints them at
112
111
  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.
112
+ - **A condition known at the start of work is asked at the start.** Creating a branch refuses a base
113
+ without main's tip and a foreign signature email: at push time the fix costs more.
114
+ - **The form of a branch name is judged by the tree the command runs in.** The task key of a
115
+ neighbouring tree is its own; a tree with no profile is not judged at all.
116
116
  - **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.
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.
119
119
  - **A branch without a task number gets no delivery conditions.** A local trial branch is
120
120
  legitimate, and it will not go to main.
121
121
  - **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 `<КЛЮЧ>-<номер>`.
122
+ from it, and by it the audit reads the branch number and the PR title. The tree profile writes the
123
+ branch form with the same pair `<КЛЮЧ>-<номер>`.
124
124
  - **An unset key refuses work with the queue on the spot.** No default on purpose: a title from an
125
125
  empty value matches nothing, and a real discrepancy drowns among false lines.
126
126
  - **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.
127
+ A task can be created and never reach the board.
128
128
  - **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.
129
+ person, a task by the work queue, and both read with a token other than the creating one.
131
130
  - **A refusal is read before it is bypassed by a second way.** It can be an early sign of a write
132
131
  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
132
  - **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.
133
+ board.** The format is read from the command text and works offline; the second tier needs
134
+ something to ask with.
138
135
  - **The task column moves in the same motion as the work.** Branch created — the task is in
139
136
  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.
137
+ - **The epic card moves by the same command, on the epic number, at two moments.** First task
138
+ taken — the epic is in progress; the PR of the epic into `main` opens — the epic awaits review.
139
+ `npm run task:move -- <номер эпика> in-progress`. Left in the first column while its tasks merge,
140
+ the epic reads as never started.
141
141
  - **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.
142
+ the work is done and published. The tree names the first column itself; unnamed — not judged.
143
+ - **An open task standing in a closing column is a discrepancy.** That column says the work is
144
+ merged, and a merge closes the task itself: by the board such work reads as finished. The tree
145
+ names its closing columns itself; unnamed — not judged.
144
146
  - **The board holds tasks, not PRs about them.** A PR card has no column and never leaves the queue.
145
147
  The queue audit finds such cards, a line each.
146
148
  - **A lagging column is found by the queue audit, not by eye.** It judges the column by the PR both
147
149
  ways: an open PR with the task not in review, and review with no open PR.
148
150
  - **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.
151
+ opening, and the run does not see what merged after. The work queue audit counts the lag.
150
152
  - **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.
153
+ as whole as a two-sided one.
152
154
  - **Tasks fixed by one edit are merged before the merge.** The second is erased with its number, and
153
155
  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`.
156
+ - **Work that one session cannot close is marked in two places, and they are audited.** The board
157
+ label and the sessions line in the epic plan say the same to two readers; only what legitimately
158
+ does not split is marked.
159
+ - **The tip of an open PR without a run is seen by the work queue audit, unless the pipeline does
160
+ not wake for its base.** A page without a run looks the same as with a green one; where no run
161
+ comes at all, the audit is silent about that PR.
162
+ - **What checks a PR whose base is not the main branch is asked before the first PR of an epic
163
+ opens.** The trigger either wakes for it as for one into main, or does not, and then the push
164
+ gate is the only check behind the work — pattern `git-workflow-stack`.
163
165
  - **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.
166
+ never checked the branch, and the step count tells them apart.
167
+ - **The last run of the main branch is judged by the audit too: red and pushed out get lines of
168
+ their own.** The merge itself is checked by nobody; a pipeline asleep on a push to main is named.
165
169
  - **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.
170
+ host locks the button.
167
171
  - **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.
172
+ green run on the tip and a folder taken apart; a folder still there means ongoing work.
170
173
  - **Opening a PR is refused while the branch carries its task folder.** Opening is the last point
171
174
  where the executor still sees the refusal.
172
175
  - **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`.
176
+ known merge.** A neighbouring merge stales the rest that second. Technique —
177
+ `git-workflow-freshness`.
175
178
  - **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.
179
+ that.** Work here means creating a task or a branch, moving the column and opening a PR.
180
+ - **A conflicting PR of a neighbouring session is not one's own.** One's own branch is the one this
181
+ working copy led; a neighbour's PR is named to the owner, and work is taken as usual.
179
182
  - **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.
183
+ else's merge, and the host shows the mark only inside the PR.
181
184
  - **A document goes in the same commit as the edit.** The bypass is the line `Docs-skip: <reason>`
182
185
  in the commit body; an empty reason is not accepted.
183
186
  - **The commit subject is checked against the format on the spot.** A subject parsed by type and
184
187
  scope is read as a list, free text — only whole.
185
188
  - **Before a push all linters are run, not one.** The code linter usually does not read style files
186
189
  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.
190
+ - **The build is in the set on a par with lint and unit tests.** The linter does not read types,
191
+ and a type error in uncovered code lives until the merge.
192
+ - **On a machine with several runners, any path from the home directory is shared.** Install
193
+ directory, container name and builder name are per project.
194
+ - **The push gate set is never narrower than the pipeline set.** A pipeline step with neither a
195
+ line in the set nor a declared exclusion refuses the push: a warning reads as permission.
196
+ - **The gate set calls the package default instead of listing it line by line.** Rewritten as
197
+ lines, it leaves tomorrow's hole: a check the package adds never reaches the tree. Sifting out is
198
+ legitimate, by name and with a reason.
200
199
  - **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.
200
+ before push" section prints it whole, naming what the default gave and the set did not take.
203
201
  - **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.
202
+ silently makes the exclusion perpetual.
203
+ - **The layout audit stands in the push gate set on a par with lint and the build.** An edit past the
204
+ source piles up silently, and the audit is not in the pipeline.
207
205
  - **After merging the base in, the check set is revised by what the branch now carries.** Checking by
208
206
  what the author edited means checking half: the branch answers whole.
209
207
  - **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.
208
+ yesterday's snapshot and silent about it: by it a merged branch counts as unmerged.
212
209
  - **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.
210
+ inbox; the PR opens in the turn the work is said handed over.
215
211
  - **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.
212
+ merge button: everything waiting for a run, a rework or an answer goes as a draft.
213
+ - **A PR the pipeline does not wake for opens ready, without `--draft`.** Which bases it wakes for
214
+ is read from the pipeline file: where no run comes, a draft waits for nothing and costs a locked
215
+ button and a second turn. The reviewer is set in the same turn.
218
216
  - **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.
217
+ before diverges from it, and nobody reads a ready-looking text twice.
221
218
  - **The draft is lifted by a separate call — `gh pr ready <номер>`.** With it the executor answers
222
219
  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.
220
+ asking to merge are one turn, and a PR opened ready needs no such call.
224
221
  - **The draft is not lifted from a branch that does not merge.** A green run says "not broken",
225
222
  mergeability says "the button can be pressed", and the owner needs the second. Asked from the
226
223
  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.
224
+ - **An index that branches only append lines to is declared a union of both sides.** A conflict there
225
+ is no dispute: both additions are needed whole. The declaration does **not** clear the mergeability
226
+ mark — it clears when the branch has absorbed main and that reached the host.
230
227
  - **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.
228
+ state and reads it as "nothing done". What stays in the tree is named with a reason — in the
229
+ owner's words, not a list of leftovers.
230
+ - **The working tree is emptied before the PR opens, not after.** `git status --porcelain` is asked
231
+ in the same turn as the opening: what is uncommitted goes to the host by a commit before it, or
232
+ is named. A push after the opening moves the tip past the green run the body names.
233
+ - **A push into a branch that has an open PR is followed by rereading its body.** The statement
234
+ about a green run names the tip by its sha, and moving the tip makes it false in silence: no check
235
+ reads a PR body.
233
236
  - **The draft is not lifted while the PR has no review.** The guard reads the requested reviewer and
234
- 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.
237
+ the review left: a lifted draft reads as "may be merged", and there is nobody to merge.
236
238
  - **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.
239
+ equal. The executor merges their own PR only when a person said so about this PR; said about
240
+ one, it does not carry to the next.
239
241
  - **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.
242
+ memory.** It shows in the command text only by an explicit token substitution; judged is the
243
+ clash with the reviewer, not the account name.
243
244
  - **The host client's active account is chosen per machine, not per tree; the machine account is
244
- substituted per call, never made active.** A login as the machine account hijacks every
245
- neighbouring session on the machine. Substitution is mandatory even with an active account.
245
+ substituted per call, never made active.** A login as it hijacks every neighbouring session.
246
246
 
247
247
  - **The PR author cannot be its reviewer.** GitHub accepts a self review request and silently does
248
248
  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.
249
+ - **The host client call goes from the tree, and a command chain does not check the outcome.** Outside
250
+ the tree the client refuses, and the next link carries the rest to the host.
251
251
  - **PR labels, assignee and reviewer are set by `gh api` calls, not by `gh pr edit`:** that one
252
252
  refuses about Projects.
253
253
  - **The board is edited by a GraphQL query by the board id, not by the owner's name.**
254
254
  - **The machine commit's email is copied from the companion, not typed from memory.** The address
255
255
  `<число>+<логин>@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.
256
+ leaves signed by a stranger.
257
+ - **The identity of the machine account is confirmed by the host's answer:** asked with the token,
258
+ login and number come together.
259
+ - **Guard scenarios set the git settings themselves, not take them from the machine.** Author, email
260
+ and signature go as `-c` flags.
262
261
 
263
262
  - **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.
263
+ checks it.** The guard judges a commit that named itself as it; a person's passes by.
265
264
  - **The PR state is reread from the host right after publishing.** Opening and setting a reviewer
266
265
  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".
266
+ - **The author of an open PR and whether it has a reviewer are audited by the work queue.** Before the
267
+ merge neither miss shows: a PR opened by a person never gets a reviewer.
268
+ - **Reviewers are asked by a REST call, not by the client's selection.** Its fields come from GraphQL,
269
+ where the account has no rights.
271
270
 
271
+ - **A second working copy is for reading, and the call goes from the copy the session stands in.**
272
+ The gate runs its set where the session was started, and a neighbour's uncommitted work refuses it.
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.
285
-
286
- The freshness of main's tip the guard asks by the second tier — the same technique as the task
287
- state. The first tier works offline: the local ref answers whether the branch lags what lies in the
288
- tree, the remote one — whether the ref itself went stale.
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. The epic card is held by memory
285
+ alone: no guard reads its column at branch creation, and the queue audit does not judge it.
289
286
 
290
287
  ## Patterns
291
288
 
292
289
  - `git-workflow-commit` — task, branch, commit and push as the machine account.
293
- - `git-workflow-pr` — opening a PR, the draft and lifting it, the body, reviewer, labels, state.
290
+ - `git-workflow-pr` — opening a PR, the draft and lifting it, state, the checklist.
291
+ - `git-workflow-pr-body` — the link to the task, the body sample, how the task closes off main.
294
292
  - `git-workflow-merge` — the base merged into the branch standing on it, the conflict resolved.
295
293
  - `git-workflow-stack` — a chain of branches: branching from the previous, the PR base, the handover
296
294
  order.
@@ -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.