@rt-tools/agent-kit 0.37.0 → 0.37.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/assets/checks/board-pull-state.github.mjs +82 -13
  2. package/assets/checks/board.github.mjs +1 -1
  3. package/assets/checks/check-board.github.mjs +20 -12
  4. package/assets/checks/check-specs.mjs +2 -2
  5. package/assets/checks/epic-table.github.mjs +4 -3
  6. package/assets/checks/lib-common.mjs +10 -2
  7. package/assets/checks/lib-domains.mjs +1 -1
  8. package/assets/checks/lib-manifests.mjs +34 -2
  9. package/assets/checks/push-inputs.mjs +401 -0
  10. package/assets/checks/push-trace.mjs +108 -0
  11. package/assets/checks/rt-kit-checks.config.mjs +17 -2
  12. package/assets/checks/spec-anchors.mjs +4 -4
  13. package/assets/checks/spec-contract.mjs +5 -5
  14. package/assets/commands/next-session.md +3 -1
  15. package/assets/commands/night.md +28 -18
  16. package/assets/defaults/project.sh +37 -8
  17. package/assets/defaults/push.sh +23 -0
  18. package/assets/defaults/turn-map.md +10 -6
  19. package/assets/docs/GLOSSARY.md +1 -1
  20. package/assets/hooks/epic-stop-guard.sh +62 -15
  21. package/assets/hooks/git-guard-push-ahead.sh +31 -1
  22. package/assets/hooks/git-guard-push-marks.sh +173 -29
  23. package/assets/hooks/git-guard-push-tests.sh +22 -3
  24. package/assets/hooks/handoff-entry-guard.sh +2 -2
  25. package/assets/hooks/pre-push.sh +6 -0
  26. package/assets/hooks/push-set.sh +29 -4
  27. package/assets/hooks/task-flow-context.sh +15 -4
  28. package/assets/hooks/task-flow-guard.sh +4 -3
  29. package/assets/hooks/turn-exit-epic.sh +1 -1
  30. package/assets/hooks/turn-exit-guard.sh +8 -8
  31. package/assets/hooks/turn-exit-role.sh +45 -0
  32. package/assets/laws/work-conduct.md +9 -8
  33. package/assets/patterns/autonomous-work-run.md +35 -10
  34. package/assets/patterns/browser-verification-measure.md +10 -20
  35. package/assets/patterns/browser-verification-stand.md +30 -42
  36. package/assets/patterns/doc-style-human.md +0 -6
  37. package/assets/patterns/doc-style-sweep.md +7 -7
  38. package/assets/patterns/doc-style-trace.md +5 -4
  39. package/assets/patterns/doc-style-write.md +7 -7
  40. package/assets/patterns/epic-flow-declare.md +15 -8
  41. package/assets/patterns/git-workflow-commit.github.md +1 -1
  42. package/assets/patterns/git-workflow-freshness.md +12 -11
  43. package/assets/patterns/git-workflow-merge.md +14 -11
  44. package/assets/patterns/git-workflow-migration.md +4 -2
  45. package/assets/patterns/git-workflow-pr-body.github.md +1 -1
  46. package/assets/patterns/git-workflow-pr-ready.md +5 -4
  47. package/assets/patterns/git-workflow-pr.azure.md +91 -25
  48. package/assets/patterns/git-workflow-pr.github.md +17 -19
  49. package/assets/patterns/git-workflow-pr.gitlab.md +75 -29
  50. package/assets/patterns/git-workflow-restart.md +3 -2
  51. package/assets/patterns/git-workflow-stack.md +25 -21
  52. package/assets/patterns/lib-layers-new.md +7 -3
  53. package/assets/patterns/queue-audit-read.github.md +9 -3
  54. package/assets/patterns/spec-driven-domain.md +50 -48
  55. package/assets/patterns/spec-driven-rule.md +18 -19
  56. package/assets/patterns/status-report-table.github.md +1 -1
  57. package/assets/patterns/task-flow-archive.md +14 -34
  58. package/assets/patterns/task-flow-close.md +3 -2
  59. package/assets/patterns/task-flow-graph.needs-graph.md +4 -0
  60. package/assets/patterns/task-flow-handoff.md +4 -4
  61. package/assets/patterns/task-flow-resume.md +56 -20
  62. package/assets/patterns/task-flow-start.md +3 -4
  63. package/assets/patterns/testing-e2e.md +14 -18
  64. package/assets/patterns/testing-unit.md +9 -13
  65. package/assets/patterns/turn-entry-map.md +13 -3
  66. package/assets/pitfalls/autonomous-work.md +15 -0
  67. package/assets/pitfalls/doc-style.md +3 -3
  68. package/assets/pitfalls/git-workflow.github.md +5 -9
  69. package/assets/pitfalls/spec-driven.md +9 -7
  70. package/assets/pitfalls/task-flow.md +14 -25
  71. package/assets/pitfalls/testing.md +11 -12
  72. package/assets/pitfalls/turn-conduct.md +6 -6
  73. package/assets/rules/autonomous-work.md +37 -29
  74. package/assets/rules/browser-verification.md +27 -22
  75. package/assets/rules/dependencies.md +3 -3
  76. package/assets/rules/deploy-flow.azure.md +35 -12
  77. package/assets/rules/deploy-flow.github.md +10 -6
  78. package/assets/rules/deploy-flow.gitlab.md +40 -17
  79. package/assets/rules/doc-style.md +21 -17
  80. package/assets/rules/epic-flow.md +5 -3
  81. package/assets/rules/git-workflow.azure.md +140 -122
  82. package/assets/rules/git-workflow.github.md +7 -8
  83. package/assets/rules/git-workflow.gitlab.md +128 -117
  84. package/assets/rules/queue-audit.github.md +5 -3
  85. package/assets/rules/spec-driven.md +17 -25
  86. package/assets/rules/status-report.md +5 -3
  87. package/assets/rules/task-flow.md +26 -15
  88. package/assets/rules/testing.md +35 -32
  89. package/assets/rules/turn-conduct.md +26 -24
  90. package/assets/templates/rule.md +2 -2
  91. package/lib/cargo-prose.d.ts +2 -1
  92. package/lib/cargo-prose.d.ts.map +1 -1
  93. package/lib/cargo-prose.js.map +1 -1
  94. package/lib/companion.d.ts +0 -5
  95. package/lib/companion.d.ts.map +1 -1
  96. package/lib/companion.js +1 -1
  97. package/lib/companion.js.map +1 -1
  98. package/lib/cost.d.ts +0 -8
  99. package/lib/cost.d.ts.map +1 -1
  100. package/lib/cost.js +4 -4
  101. package/lib/cost.js.map +1 -1
  102. package/lib/hooks-map.d.ts +0 -12
  103. package/lib/hooks-map.d.ts.map +1 -1
  104. package/lib/hooks-map.js +2 -25
  105. package/lib/hooks-map.js.map +1 -1
  106. package/lib/observations-cargo.d.ts +1 -5
  107. package/lib/observations-cargo.d.ts.map +1 -1
  108. package/lib/observations-cargo.js +2 -2
  109. package/lib/observations-cargo.js.map +1 -1
  110. package/lib/observations.d.ts +0 -2
  111. package/lib/observations.d.ts.map +1 -1
  112. package/lib/observations.js.map +1 -1
  113. package/lib/order.d.ts +0 -2
  114. package/lib/order.d.ts.map +1 -1
  115. package/lib/order.js +0 -4
  116. package/lib/order.js.map +1 -1
  117. package/lib/outcomes.d.ts +2 -7
  118. package/lib/outcomes.d.ts.map +1 -1
  119. package/lib/outcomes.js +3 -3
  120. package/lib/outcomes.js.map +1 -1
  121. package/lib/proposals.d.ts +0 -1
  122. package/lib/proposals.d.ts.map +1 -1
  123. package/lib/proposals.js +1 -1
  124. package/lib/proposals.js.map +1 -1
  125. package/lib/shipment.d.ts +2 -11
  126. package/lib/shipment.d.ts.map +1 -1
  127. package/lib/shipment.fixture.d.ts +0 -3
  128. package/lib/shipment.fixture.d.ts.map +1 -1
  129. package/lib/shipment.fixture.js +3 -3
  130. package/lib/shipment.fixture.js.map +1 -1
  131. package/lib/shipment.js +2 -2
  132. package/lib/shipment.js.map +1 -1
  133. package/lib/traits.d.ts +0 -3
  134. package/lib/traits.d.ts.map +1 -1
  135. package/lib/traits.js +2 -2
  136. package/lib/traits.js.map +1 -1
  137. package/lib/variants.d.ts +0 -1
  138. package/lib/variants.d.ts.map +1 -1
  139. package/lib/variants.js +1 -1
  140. package/lib/variants.js.map +1 -1
  141. package/package.json +1 -1
  142. package/assets/checks/signals/ui-kit.json +0 -11
@@ -2,7 +2,7 @@
2
2
  name: git-workflow
3
3
  kind: rule
4
4
  law: delivery
5
- description: Rule under the delivery law for a tree in Azure DevOps. Load for creating a work item and a branch, commit, push, opening a PR and merging. Names the one-to-one match of item and branch, the names, the machine account and the delivery guards. Patterns git-workflow-commit, -pr, -merge.
5
+ description: Rule under the delivery law for a tree in Azure DevOps. Load for creating a work item and a branch, commit, push, opening a PR and merging. Names the one-to-one match of item and branch, the names, the machine account and the delivery guards. Patterns git-workflow-commit, -pr, -merge, -stack.
6
6
  ---
7
7
 
8
8
  # Delivery — how it works here
@@ -20,7 +20,10 @@ with the rule.
20
20
  | In the law | Here |
21
21
  | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
22
22
  | main branch | `main` |
23
- | separate branch | `<номер рабочего элемента>-<короткий-slug>`; the form — in `implementation.md`. A name without a number (`feat/…`, `fix/…`) is legitimate locally: no PR opens from it |
23
+ | epic | a work item of kind `Epic`, title `[<номер>] <Возможность>`, its work items are linked to it as children; a plan next to it: the order of tasks and how the branches stand |
24
+ | epic branch | `<номер эпика>-<короткий-slug>`, taken from `main`. Branches of its work items are taken from it, and their PRs go into it |
25
+ | PR of an epic | PR into `main` from the epic branch; opens after all its work items are merged and their folders taken apart |
26
+ | separate branch | `<номер рабочего элемента>-<короткий-slug>`, taken from the epic branch; the form — in `implementation.md`. A name without a number (`feat/…`, `fix/…`) is legitimate locally: no PR opens from it |
24
27
  | task | a work item of kind `Task` or `Bug`, title `[<номер>] <Что не так>`, assignee the machine account; the PR attaches at creation by the `--work-items` flag, a commit by the line `AB#<номер>` |
25
28
  | work queue | the project's Azure Boards. A work item lands on the board by being created: the board shows the items of its area and iteration |
26
29
  | task state in the work queue | the work item's `State` field: `New` when created, `Active` in progress, `Resolved` in review. The state set depends on the project process and is named in `implementation.md`; a closed task leaves the queue by merge |
@@ -42,20 +45,26 @@ work ends.
42
45
 
43
46
  ```mermaid
44
47
  flowchart TD
45
- A[Work begins] --> B[A command creates the task and it enters the work queue]
46
- B --> C[The branch is named by the task number; the column moves in the same motion]
48
+ A[Work begins] --> Z{The epic of this work is named}
49
+ Z -->|No| Y[The epic is created together with its work items, and its branch is taken from main]
50
+ Z -->|Yes| B[A command creates the work item and it enters the work queue]
51
+ Y --> B
52
+ B --> C[The branch is named by the work item number and taken from the epic branch; the state moves in the same motion — the epic card too, on its first work item]
47
53
  C --> D{The edit is ready}
48
54
  D -->|No| C
49
- D -->|Yes| E[Main is merged in, the gate set is run whole]
50
- E --> F{The branch carries a task number}
55
+ D -->|Yes| E[The base is merged in, the last commit takes the task folder apart, the gate set is run whole]
56
+ E --> F{The branch carries a work item number}
51
57
  F -->|No| G[The delivery guard refuses the opening: nothing in the queue stands behind the edit]
52
- F -->|Yes| H[The PR opens; what is not ready to merge goes as a draft]
53
- H --> I[The task column moves to review, the executor takes the next task]
54
- I --> J{The run and the review are over}
58
+ F -->|Yes| H[The PR opens ready where only the run is waited for; a draft for a rework is lifted before the run]
59
+ H --> I[The state moves to review, the executor takes the next work item]
60
+ I --> J{The run, where one comes, and the review are over}
55
61
  J -->|Run red| K[Fixed in the same branch]
56
62
  K --> J
57
- J -->|Green| L[The last commit takes the task folder apart, the draft is lifted]
58
- L --> M[A person presses the merge: the executor asks and names the number]
63
+ J -->|Green| L[The description says no step is left]
64
+ L --> M[A person presses the merge into the epic branch: the executor asks and names the number]
65
+ M --> N{Work items of the epic are left}
66
+ N -->|Yes| B
67
+ N -->|No| O[The PR of the epic into main opens: all the folders are taken apart, and the main branch takes the epic whole]
59
68
  G --> B
60
69
  ```
61
70
 
@@ -68,41 +77,64 @@ flowchart TD
68
77
  create` from such a branch: locally it is legitimate, but an edit from it is a rollout with
69
78
  nothing behind it in the work queue. A work item is created, and the work moves to a branch with
70
79
  its number.
71
- - **The main branch is merged into the work item branch before the PR opens.** The delivery guard
72
- refuses the opening until main's tip is an ancestor of the current branch, and names the
73
- divergence as a commit count. A PR from a diverged branch shows the reviewer the edit mixed with
74
- someone else's, and everything the author checked before publishing was checked from a base that
75
- main no longer has.
76
- - **Unmet delivery conditions are named in one refusal, not one by one.** The guard collects them
77
- all and prints them at once. An executor refused on the first miss fixes the base, repeats the
78
- call, hits the title, fixes the title, hits the work item — and every round costs one more call,
79
- though everything unmet was known on the first.
80
+ - **Work begins with the epic, and the branch of a work item is taken from the epic branch.** `git
81
+ checkout -b <номер элемента>-<slug> <ветка эпика>`; from `main` only the epic branch itself is
82
+ taken — a branch taken from `main` carries into it what the epic has not finished.
83
+ - **The PR of a work item has the epic branch as its base — `az repos pr create --target-branch
84
+ <ветка эпика>`.** Opened into `main`, it leaves the epic branch a copy nobody merges. In a chain
85
+ the base is the previous branch, lawful while it carries the epic branch.
86
+ - **The PR of an epic into the main branch opens after all its work items are merged and their
87
+ folders are taken apart.** The merge button there means the whole epic, and there is nothing to
88
+ press it for while one of them is still written.
89
+ - **The epic branch carries the plan of the epic and the merges of its work items, and no edits of
90
+ its own.** An edit made in it goes into `main` unreviewed: nobody opens a PR from that branch to
91
+ it.
92
+ - **The main branch is merged into the epic branch, and the epic branch into the branches of its
93
+ work items — while the work runs, not before the hand-over.** The delivery guard refuses the
94
+ opening until the tip of the base is an ancestor of the branch, and names the divergence as a
95
+ commit count: otherwise the reviewer sees the edit mixed with someone else's, checked from a base
96
+ that is gone.
97
+ - **A wave of branches off one epic branch is checked by a trial merge, not one by one:** each is
98
+ green on its own, and they collide on what one branch cannot show.
99
+ - **The next work's branch is taken from the previous one while the chain is unbroken.** `git
100
+ checkout -b <номер>-<slug> <предыдущая ветка>`; from the epic branch — only the chain's first
101
+ work.
102
+ - **A PR in a chain has the previous branch as its base, not main.** `az repos pr create
103
+ --target-branch <предыдущая ветка>` — otherwise the review shows the edit mixed with all under it.
104
+ The base is retargeted before the lower one is completed — the calls are in the pattern `git-workflow-pr`.
105
+ - **A chain is merged bottom-up, and the order stands in every PR description.** Branch kinship is
106
+ invisible in the list, and the line "stands on !<number>" is the only place it is read.
107
+ - **The lower branch of a chain does not rewrite history — neither `rebase` nor a force push.** The
108
+ upper PR loses its diff with it. A lagging branch is fixed by merging its base in.
109
+ - **A divergence inside a chain is resolved by the one who branches.** Both edits are theirs; the
110
+ owner resolving the same at merge time owns neither.
111
+ - **Unmet delivery conditions are named in one refusal.** The guard collects and prints them at
112
+ once: everything unmet is known on the first call.
80
113
  - **A condition known at the start of work is asked at the start.** Creating a branch refuses a base
81
- without main's tip, and a working copy that signs commits with an email other than the one the
82
- tree declared. At push and at PR opening the same checks stay as a second line, but there they
83
- cost more: the base is fixed by a merge with conflict resolution, the signature by rewriting the
84
- whole branch.
114
+ without the tip of the branch it stands on and a foreign signature email: at push time the fix
115
+ costs more.
85
116
  - **The base judged is the one named by the command, not the tip of the working copy.** A branch is
86
- also created straight from main's tip — that very command takes the base fresh — and a guard
87
- reading only the current tip would refuse it like a branch off yesterday's tree. A base the tree
88
- knows nothing of is not judged at all.
117
+ also created straight from `origin/main`, and that command takes the base fresh; a base the tree
118
+ knows nothing of is not judged.
89
119
  - **A branch without a work item number gets no delivery conditions.** A local trial branch is
90
- legitimate, and demanding a fresh base of it would refuse work that will not go to main: no PR
91
- opens from such a branch.
120
+ legitimate, and it will not go to main.
92
121
  - **A commit lands with its final content, and a later commit of the same branch does not correct
93
122
  it.** It is made after the check against the mockup, the sample and the measurement; what is not
94
123
  checked stays in the working tree. A third commit fixing the first shows the reviewer the miss
95
124
  instead of the work, and rewriting history hides the trace, not the cause.
96
- - **A code edit is handed to a person by an open PR, not by a pushed branch.** A branch is not shown
97
- to them in the branch list, reaches no to-do list of theirs and has no discussion: before the PR
98
- opens there is no edit for a person. It opens in the turn in which the executor says the work is
99
- handed over, and the reply names it by number.
125
+ - **A code edit is handed to a person by an open PR, not by a pushed branch.** A branch reaches no
126
+ inbox; the PR opens in the turn the work is said handed over, and the reply names its number.
100
127
  - **What is not ready to merge opens as a draft — `az repos pr create --draft true`.** The host
101
- itself locks a draft's complete button, so the state "put up for viewing" and the state "may be
102
- merged" stop looking alike. Everything waiting for a pipeline run, a rework or an answer goes as a
103
- draft; the question is asked in the PR itself. The check pipeline does not run on a draft by
104
- default — until the draft is lifted it stays silent, and that silence is not taken for a green
105
- run.
128
+ itself locks a draft's complete button. A rework or an unanswered question goes as a draft, and
129
+ the question is asked in the PR itself. The check pipeline does not start on a draft by default: a
130
+ PR that waits only for the run opens ready, and a draft's silence is not taken for a green run.
131
+ - **A PR the pipeline does not wake for opens ready, without the draft flag.** Which target branches
132
+ carry a build validation policy is read from the branch policies: where no run comes, a draft
133
+ waits for nothing and costs a locked button and a second turn. The reviewer is set in the same
134
+ turn.
135
+ - **What checks a PR whose base is not the main branch is asked before the first PR of an epic
136
+ opens.** The pipeline either wakes for it as for one into main, or does not, and then the push
137
+ gate is the only check behind the work — pattern `git-workflow-stack`.
106
138
  - **`--hard` is not taken to drop a commit — that is `--soft`.** `reset --hard`, `checkout --
107
139
  <path>`, `restore <path>` and `clean -f` erase what is not committed. On a dirty tree the guard
108
140
  refuses and names the files; the bypass is `# discard: <reason>` in the command.
@@ -117,38 +149,41 @@ flowchart TD
117
149
  gets an answer.** Edits alone leave the discussion silent, and the person reads the whole diff
118
150
  again. The word holds for that PR, not for the next.
119
151
  - **The draft is lifted by a separate call — `az repos pr update --id <номер> --draft false`.** With
120
- it the executor answers for readiness: checks passed, no rework left, the work matches the work
121
- item. Lifting the draft and asking to merge are one turn, not two days.
152
+ it the executor answers for readiness: the push gate passed, no rework left, the work matches the
153
+ work item. Where a build validation stands on the target, the merge is asked after the green run,
154
+ not in the lifting turn; where none stands, lifting and asking are one turn. A PR opened ready
155
+ needs no such call.
156
+ - **The PR merge is pressed by a person, not by the work's executor.** The Complete button, `az
157
+ repos pr update --status completed` and auto-complete set by the executor are equal. The executor
158
+ merges their own PR only when a person said so about this PR; said about one, it does not carry to
159
+ the next.
122
160
  - **A created work item is confirmed by the work queue's answer, not by the creation command's
123
- output.** The command answers for its calls: it can create an item and not bring it to the board,
124
- and its own error handling names that case. A printed number means "the call went through", not
125
- "the work is visible to whoever comes by it". The queue is asked — by number, in one call — and
126
- the answer is read from the item's presence on the board, its state and its assignee.
127
- - **The branch number and the PR title number are checked on the spot, the state — by the board.**
128
- The format is read from the command text and works offline; the work item's existence, its state,
129
- assignee and that it is still open — only with something to ask with. No network or no token — the
130
- second tier is skipped silently: a check that fails on a plane stops meaning anything.
131
- - **The work item's state moves in the same motion as the work.** Branch created — the item is moved
132
- to `Active`, PR opened — to `Resolved`; the move command does it, not a set of calls from memory.
133
- The move follows the step that caused it at once: the work queue is read between steps, not after.
134
- - **A work item left in the initial state opens no PR.** The delivery guard names that state and the
135
- move command: by the work queue such an item reads as not taken, though the work on it is done and
136
- published. At branch creation the state is not asked — nothing has moved it yet, and the
137
- requirement would refuse the first command of the work together with the one that lifts it. The
138
- tree names the initial state itself; unnamed — the state is not judged at all.
139
- - **The board holds work items, not PRs about them.** The board shows what is done and what is left;
140
- a PR answers another question — how exactly it was done — and opens from the item, where the link
141
- to it stands by itself. Here that link is set at PR creation, so a separate card is not needed at
142
- all, and one created lives its own life: there is no state for it, it never leaves the queue and
143
- stays in it after the merge forever. The queue audit finds such cards, a line each.
161
+ output.** A work item can be created and never reach the board: the queue is asked by number, and
162
+ the answer is read from its presence on the board, its state and its assignee.
163
+ - **The branch number and the PR title number are checked on the spot, the work item state — by the
164
+ board.** The format is read from the command text and works offline; the second tier needs
165
+ something to ask with, and without network or token it is skipped silently.
166
+ - **The state of a work item moves in the same motion as the work.** Branch created — the work item
167
+ is in progress, PR opened — awaiting review; the move command does it, not a set of calls from
168
+ memory.
169
+ - **The epic card moves by the same command, on the epic number, at two moments.** First work item
170
+ taken — the epic is in progress; the PR of the epic into `main` opens — the epic awaits review.
171
+ `npm run task:move -- <номер эпика> in-progress`. Left in the initial state while its work items
172
+ merge, the epic reads as never started. The states of an `Epic` are its own and are named in
173
+ `implementation.md` apart from the work item's.
174
+ - **A work item left in the initial state opens no PR.** By the work queue it reads as not taken,
175
+ though the work is done and published. The tree names the initial state itself; unnamed — not
176
+ judged.
177
+ - **The board holds work items, not PRs about them.** The link to the item is set at PR creation; a
178
+ PR card has no state and never leaves the queue. The queue audit finds such cards, a line each.
144
179
  - **A lagging state is found by the queue audit, not by eye.** The audit judges the state by the PR
145
180
  both ways: an open PR with the item not in review, and review with no open PR — both
146
- discrepancies. The moment a task is taken into work it cannot see: the branch is not on the board.
147
- - **A branch with an open PR lags behind main silently.** The guard judges the base once — at
148
- opening; what merged into main during the run a green run never sees, and a PR merged from there
149
- brings main a combination nobody checked. The lag is found by the work queue audit: it asks the
150
- repository how many commits each open PR's branch is behind main, and names the number.
151
- - **Tasks fixed by one edit are merged before the branch merge.** The second is closed as a
181
+ discrepancies. The moment a work item is taken into work it cannot see: the branch is not on the
182
+ board.
183
+ - **A branch with an open PR lags behind its base silently.** The guard judges the base once — at
184
+ opening; what merged into the base later a green run never sees. The lag is found by the work
185
+ queue audit, which names it as a commit count.
186
+ - **Work items fixed by one edit are merged before the branch merge.** The second is closed as a
152
187
  duplicate, and the missing from it is added to the first. The law orders the second erased, and
153
188
  this is the second declared deviation: a work item here has a native "duplicate" link, deletion
154
189
  takes the edit history and attachments with it, and the number is not reused after it — a link to
@@ -166,24 +201,14 @@ flowchart TD
166
201
  - **Before a push all linters are run, not one.** The code linter usually does not read style files
167
202
  at all; without a second run nothing checks the styling rules.
168
203
  - **The build is in the set on a par with lint and unit tests.** The linter does not read types, and
169
- unit tests read only what a test imports: a type error in uncovered code lives until the image
170
- build — that is, the merge. Four merges in a row went into main that way, breaking the rollout.
171
- - **On a machine with several runners, any path from the home directory is shared.** A ready-made
172
- step's default is dangerous precisely because it is shared: a neighbouring run rewrites it to its
173
- own version while ours stands between steps. Install directory, container name and builder name
174
- are therefore per project and fixed, and a temporary directory is never the answer — the package
175
- store lives there.
176
- - **The push gate set is never narrower than the pipeline set.** The gate is a promise that the push
177
- will not arrive red; a set with the build and the snapshots thrown out promises what it does not
178
- check. A pipeline step with neither a line in the gate set nor a declared exclusion with a reason
179
- refuses the push instead of printing next to it: a printed warning the executor reads as
180
- permission. Twice in a row an edit that passed the gate whole was refused by the pipeline — and
181
- both times the green gate was read as "all green locally".
182
- - **The final set before a push is read from the state review, not assembled in the head.** It is
183
- assembled from the package default and the tree's override, and there was nothing to read the
184
- assembly with: the "set before push" section prints it whole, one command per line, and names
185
- beside it what the default printed and the set did not take. A tree writing its override blind
186
- added a repeat to it.
204
+ a type error in uncovered code lives until the merge.
205
+ - **On a machine with several runners, any path from the home directory is shared.** Install
206
+ directory, container name, builder name and published port are per project. A temporary directory
207
+ is not the answer: the package store lives there.
208
+ - **The push gate set is never narrower than the pipeline set.** A pipeline step with neither a line
209
+ in the set nor a declared exclusion refuses the push: a warning reads as permission.
210
+ - **The final set before a push is read from the state review, not assembled in the head.** The "set
211
+ before push" section prints it whole, naming what the default gave and the set did not take.
187
212
  - **A push is sent only by the path the push guard stands on.** A terminal, a process or a script
188
213
  started outside the session carries the same command past the gate, unless the tree wired the
189
214
  git hook `pre-push`: then git runs the set there too. A send cut off by the session's end is
@@ -192,35 +217,19 @@ flowchart TD
192
217
  what the set judges by the whole tree: a word, a file limit. A check that stands only on an edit,
193
218
  such as the wording one, is run over the changed texts apart. The output goes into the review,
194
219
  and a later push into that branch is run again.
195
- - **Where neither the session's push guard nor the git hook fires, the set is run whole, as read
196
- at the minute of the run.** It is read from the state review or from the tree profile together with the package
197
- default it calls. A list from memory, from a copy made earlier or from the profile alone drops
198
- checks: the profile names the set, the task names only the work.
199
- - **An exclusion reason naming a task is judged on whether that task is alive.** A deferral with a
200
- term and one without look the same until someone asks the number; a dead number in the reason
201
- makes the exclusion perpetual without saying a line about it. Asked by the same tier as the task
202
- state at the delivery guard: something to ask with — it asks, no network or access — it skips
203
- silently.
204
- - **The layout audit stands in the push gate set on a par with lint and the build.** An edit put
205
- into the laid-out copy past the source breaks nothing on the day it is made: the tree works, the
206
- checks are green, and the discrepancy is visible only to whoever calls the audit themselves. It
207
- piles up silently and surfaces on someone else's work — the layout refuses the edited file whole
208
- and lays out no other, so the price is paid by whoever edited a neighbouring resource. The article
209
- above does not cover this line: the audit is not in the pipeline, so there is no step it would
210
- close — it is put into the set directly, not derived from the set's completeness.
211
- - **After merging main in, the check set is revised by what the branch now carries.** The merge
212
- changes the makeup of the edit: checking by what the author edited means checking half, and the
213
- branch answers whole. A branch that touched no line of the showcase runs showcase snapshots from
214
- the moment the merge brought someone else's styling edit.
215
- - **A statement about the main branch is made by the remote ref, not the local one.** The local one
216
- goes stale the minute it was last pulled, and says nothing about it: it is not empty and not
217
- broken, it describes yesterday. A branch comparison is written from `origin/main` whole — mixing
218
- the remote ref for one side and the local one for the other in one command, the miss looks right
219
- from inside.
220
- - **The remote ref is taken not only by words but by actions.** A new branch's base, the count of
221
- the merged and pulling main are judged by it too: the local one is a snapshot of the last pull,
222
- and work started from it starts from a base main no longer has. A merged branch counts as unmerged
223
- by it, and cleanup ends with a list of unmerged that is not there.
220
+ - **Where neither the session's push guard nor the git hook fires, the set is run whole, as read at
221
+ the minute of the run.** It is read from the state review or from the tree profile together with
222
+ the package default it calls. A list from memory, from a copy made earlier or from the profile
223
+ alone drops checks: the profile names the set, the task names only the work.
224
+ - **An exclusion reason naming a work item is judged on whether that work item is alive.** A dead
225
+ number silently makes the exclusion perpetual.
226
+ - **The layout audit stands in the push gate set on a par with lint and the build.** An edit past
227
+ the source piles up silently, and the audit is not in the pipeline.
228
+ - **After merging the base in, the check set is revised by what the branch now carries.** Checking
229
+ by what the author edited means checking half: the branch answers whole.
230
+ - **The main branch is taken by the remote ref — in words and in actions.** The local one is
231
+ yesterday's snapshot and silent about it: by it a merged branch counts as unmerged. Both sides of
232
+ a comparison are taken from `origin/`.
224
233
  - **A work item is bound to the PR at creation, not after.** `az repos pr create` takes
225
234
  `--work-items`; binding by a second command is bypassed silently when the token has no right to
226
235
  edit someone else's item, and the PR stays bound to nothing.
@@ -229,11 +238,9 @@ flowchart TD
229
238
  looks ready for review.
230
239
  - **The state set is taken from the project process, not assigned by the rule.** Agile, Scrum and
231
240
  Basic name the same three steps differently, and a move to a state the process lacks answers with
232
- a refusal on every task in a row.
233
- - **Guard scenarios set the git settings themselves, not take them from the machine.** A commit in
234
- the scenario's temporary repository inherits the shared config: with signing on, git goes to the
235
- key agent, and a locked agent brings the whole set down — from outside it looks like a broken
236
- guard. Author, email and signature are passed as `-c` flags straight into the command.
241
+ a refusal on every work item in a row.
242
+ - **Guard scenarios set the git settings themselves, not take them from the machine.** Author, email
243
+ and signature go as `-c` flags.
237
244
 
238
245
  ## What of the law is not here
239
246
 
@@ -253,22 +260,33 @@ The guard does not move a work item to in progress: it does not edit the board
253
260
  command review would fall with the connection and refuse the work instead of the miss. The move is
254
261
  held by memory and by the hint the creation command prints. An item left in the initial state the
255
262
  guard names at PR opening — that is, after it should have been moved; other state discrepancies the
256
- queue audit finds.
263
+ queue audit finds. The epic card is held by memory alone: no guard reads its state at branch
264
+ creation, and the queue audit does not judge it.
257
265
 
258
266
  The guard does not ask for a reviewer here: lifting the draft is an edit of the PR itself — the same
259
267
  call as its other fields — and to a machine it cannot be told from other edits. This is held by the
260
268
  vocabulary above, where the PR review is led by the reviewer, and by the memory of whoever lifts the
261
269
  draft.
262
270
 
263
- The freshness of main's tip itself the guard asks by the second tier — the same technique as the
271
+ The freshness of the tip of the base the guard asks by the second tier — the same technique as the
264
272
  task state: something to ask with — it asks; no network or access — it skips silently. The first
265
273
  tier stays and works offline: the local ref answers the question "has the base lagged what already
266
274
  lies in the tree", the remote one — "has the ref itself gone stale". Without the second tier the
267
275
  guard's silence meant only the first and was read as the second.
268
276
 
277
+ The delivery guard reads the base of a PR from `--base` alone; here the flag is `--target-branch`.
278
+ Without a queue helper it judges the branch by `main`, with one it refuses a lawful PR into the epic
279
+ branch. Until the package reads the flag, the base and the draft-or-ready choice are the executor's.
280
+
281
+ A PR that waits only for the run opens ready, and the law keeps such work under a draft: a declared
282
+ deviation, the run does not start on a draft. Complete is then held only by a required build
283
+ validation.
284
+
269
285
  ## Patterns
270
286
 
271
287
  - `git-workflow-commit` — work item, branch, commit and push as the machine account.
272
288
  - `git-workflow-pr` — opening a PR, the draft and lifting it, the body, reviewer, binding to the
273
289
  item.
274
- - `git-workflow-merge` — main merged into the task branch, the conflict resolved.
290
+ - `git-workflow-merge` — the base merged into the branch standing on it, the conflict resolved.
291
+ - `git-workflow-stack` — a chain of branches: branching from the previous, the base, the hand-over
292
+ order.
@@ -53,7 +53,7 @@ flowchart TD
53
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
- D -->|Yes| E[Main is merged in, the gate set is run whole]
56
+ D -->|Yes| E[The base is merged in, the last commit takes the task folder apart, the gate set is run whole]
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
59
  F -->|Yes| H[The PR opens: a draft where a run is waited for, ready where the pipeline does not wake]
@@ -61,7 +61,7 @@ flowchart TD
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, and the draft, if there was one, is lifted]
64
+ J -->|Green| L[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
@@ -105,8 +105,8 @@ flowchart TD
105
105
  <path>`, `restore <path>` and `clean -f` erase what is not committed. On a dirty tree the guard
106
106
  refuses and names the files; the bypass is `# discard: <reason>` in the command.
107
107
  - **The lower branch of a chain does not rewrite history — neither `rebase` nor a force push.** The
108
- host closes the upper PR as merged once its diff goes empty. A lagging branch is fixed by merging
109
- main in.
108
+ host closes the upper PR as merged once its diff goes empty. Before its PR opens a branch
109
+ takes its base in; with the PR open — only on a conflict.
110
110
  - **A divergence inside a chain is resolved by the one who branches.** Both edits are theirs; the
111
111
  owner resolving the same at merge time owns neither.
112
112
  - **Unmet delivery conditions are named in one refusal.** The guard collects and prints them at
@@ -165,9 +165,8 @@ flowchart TD
165
165
  opens.** The trigger either wakes for it as for one into main, or does not, and then the push
166
166
  gate is the only check behind the work — pattern `git-workflow-stack`.
167
167
  - **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 folder taken apart; a folder still there means ongoing work.
169
- - **Opening a PR is refused while the branch carries its task folder.** Opening is the last point
170
- where the executor still sees the refusal.
168
+ green run on the tip and a folder taken apart. A folder stands in a draft only one opened past
169
+ the folder refusal, and there it means ongoing work.
171
170
  - **One's own open PRs are reread in three places: before a push, on taking a task and after every
172
171
  known merge.** A neighbouring merge stales the rest that second. Technique —
173
172
  `git-workflow-freshness`.
@@ -221,7 +220,7 @@ flowchart TD
221
220
  host's `mergeable` field; a local merge does not derive it.
222
221
  - **An index that branches only append lines to is declared a union of both sides.** A conflict there
223
222
  is no dispute: both additions are needed whole. The declaration does **not** clear the mergeability
224
- mark — it clears when the branch has absorbed main and that reached the host.
223
+ mark — it clears when the branch has absorbed its base and that reached the host.
225
224
  - **An edit brought to a commit is brought to the host in the same turn.** The owner sees the old
226
225
  state and reads it as "nothing done". What stays in the tree is named with a reason — in the
227
226
  owner's words, not a list of leftovers.