@rt-tools/agent-kit 0.26.0 → 0.27.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 (100) hide show
  1. package/assets/agents/cargo-writer.md +54 -0
  2. package/assets/checks/board-epic-link.github.mjs +29 -0
  3. package/assets/checks/board-epics.github.mjs +239 -36
  4. package/assets/checks/board-long-work.github.mjs +5 -1
  5. package/assets/checks/board-pull-state.github.mjs +168 -0
  6. package/assets/checks/board-task-dirs.github.mjs +98 -0
  7. package/assets/checks/board.github.mjs +8 -91
  8. package/assets/checks/check-board.github.mjs +25 -165
  9. package/assets/checks/check-prose-style.mjs +19 -3
  10. package/assets/checks/check-schema-drift.mjs +19 -3
  11. package/assets/checks/epic-table.github.mjs +268 -0
  12. package/assets/checks/rt-kit-checks.config.mjs +13 -0
  13. package/assets/checks/specs-for.mjs +214 -0
  14. package/assets/checks/task-new.github.mjs +231 -6
  15. package/assets/commands/night.md +115 -0
  16. package/assets/defaults/project.sh +7 -0
  17. package/assets/defaults/turn-map.md +3 -1
  18. package/assets/docs/GLOSSARY.md +22 -22
  19. package/assets/hooks/browser-device-id.sh +4 -0
  20. package/assets/hooks/browser-guard-device-id.sh +4 -0
  21. package/assets/hooks/commit-msg.sh +3 -0
  22. package/assets/hooks/dev-server-guard.sh +4 -0
  23. package/assets/hooks/epic-over.sh +49 -0
  24. package/assets/hooks/epic-stop-guard.sh +108 -0
  25. package/assets/hooks/git-guard-delivery-conflict.sh +3 -0
  26. package/assets/hooks/git-guard-delivery-draft.sh +3 -0
  27. package/assets/hooks/git-guard-delivery-epic.sh +167 -0
  28. package/assets/hooks/git-guard-delivery-signature.sh +32 -2
  29. package/assets/hooks/git-guard-delivery.sh +28 -4
  30. package/assets/hooks/handoff-entry-guard.sh +20 -2
  31. package/assets/hooks/prose-style-guard.sh +31 -8
  32. package/assets/hooks/qa-dataid-guard.sh +33 -11
  33. package/assets/hooks/rule-article.sh +3 -0
  34. package/assets/hooks/skill-gate-layers.sh +4 -0
  35. package/assets/hooks/skill-loaded.sh +4 -0
  36. package/assets/hooks/sql-guard-parse.sh +3 -0
  37. package/assets/hooks/sql-guard-request.sh +3 -0
  38. package/assets/hooks/sql-guard-target.sh +3 -0
  39. package/assets/hooks/sql-guard-write.sh +3 -0
  40. package/assets/hooks/stand-login-guard.sh +3 -0
  41. package/assets/hooks/turn-exit-guard.sh +5 -1
  42. package/assets/hooks/turn-exit-patterns.sh +10 -0
  43. package/assets/hooks/utf8.sh +3 -0
  44. package/assets/hooks/waiting-turn-guard.sh +11 -1
  45. package/assets/hooks/write-targets.sh +3 -0
  46. package/assets/laws/delivery.md +23 -1
  47. package/assets/patterns/git-workflow-commit.azure.md +1 -1
  48. package/assets/patterns/git-workflow-commit.github.md +9 -2
  49. package/assets/patterns/git-workflow-commit.gitlab.md +1 -1
  50. package/assets/patterns/git-workflow-merge.md +8 -5
  51. package/assets/patterns/git-workflow-pr.azure.md +1 -1
  52. package/assets/patterns/git-workflow-pr.github.md +8 -3
  53. package/assets/patterns/git-workflow-pr.gitlab.md +1 -1
  54. package/assets/patterns/git-workflow-stack.md +13 -9
  55. package/assets/patterns/status-report-table.github.md +11 -0
  56. package/assets/patterns/task-flow-close.md +40 -21
  57. package/assets/patterns/task-flow-start.md +40 -26
  58. package/assets/pitfalls/agent-kit.md +19 -0
  59. package/assets/pitfalls/git-workflow.github.md +6 -0
  60. package/assets/rules/autonomous-work.md +15 -3
  61. package/assets/rules/doc-style.md +7 -4
  62. package/assets/rules/git-workflow.github.md +41 -23
  63. package/assets/rules/spec-driven.md +7 -0
  64. package/assets/rules/status-report.md +7 -0
  65. package/assets/rules/task-flow.md +31 -10
  66. package/assets/rules/turn-conduct.md +7 -0
  67. package/assets/skills/agent-kit.md +23 -21
  68. package/bin/agent-kit.d.ts.map +1 -1
  69. package/bin/agent-kit.js +8 -1
  70. package/bin/agent-kit.js.map +1 -1
  71. package/lib/cargo-prose.d.ts +41 -0
  72. package/lib/cargo-prose.d.ts.map +1 -0
  73. package/lib/cargo-prose.js +88 -0
  74. package/lib/cargo-prose.js.map +1 -0
  75. package/lib/cargo.d.ts +12 -1
  76. package/lib/cargo.d.ts.map +1 -1
  77. package/lib/cargo.js +8 -2
  78. package/lib/cargo.js.map +1 -1
  79. package/lib/fate.d.ts +29 -0
  80. package/lib/fate.d.ts.map +1 -0
  81. package/lib/fate.js +147 -0
  82. package/lib/fate.js.map +1 -0
  83. package/lib/override-marks.d.ts +7 -0
  84. package/lib/override-marks.d.ts.map +1 -1
  85. package/lib/override-marks.js +14 -0
  86. package/lib/override-marks.js.map +1 -1
  87. package/lib/ship.d.ts +29 -2
  88. package/lib/ship.d.ts.map +1 -1
  89. package/lib/ship.js +34 -0
  90. package/lib/ship.js.map +1 -1
  91. package/lib/shipment.d.ts.map +1 -1
  92. package/lib/shipment.fixture.d.ts +8 -1
  93. package/lib/shipment.fixture.d.ts.map +1 -1
  94. package/lib/shipment.fixture.js +9 -0
  95. package/lib/shipment.fixture.js.map +1 -1
  96. package/lib/shipment.js +32 -3
  97. package/lib/shipment.js.map +1 -1
  98. package/package.json +1 -1
  99. package/rt-tools-agent-kit-0.27.0.tgz +0 -0
  100. package/rt-tools-agent-kit-0.26.0.tgz +0 -0
@@ -1,6 +1,10 @@
1
1
  #!/usr/bin/env bash
2
2
  # Layers of the rules gate: requirements that come ON TOP of the domain one.
3
3
  #
4
+ # NOT a guard: it has no `rt-hook:` declaration and hooks into no agent event. The rules gate
5
+ # sources it: the layers over the domain rule are a dozen and a half, and together they do not fit
6
+ # into a map read whole.
7
+ #
4
8
  # The domain rule is chosen once by the file path — an edit has one subject, and there is one
5
9
  # rule for it. There are a dozen and a half layers on top of it: access to the runtime is visible
6
10
  # only in the text of the edit, observability comes together with the domain rather than instead
@@ -6,6 +6,10 @@
6
6
  # tell about its past calls. So the load is recorded here, per session.
7
7
  #
8
8
  # The hook only observes: it always passes and refuses nothing.
9
+ #
10
+ # FAIL-OPEN: no input, no name of the rule, no way to write the record — the call goes through. The
11
+ # record is a note for the gate, not a permission: a rule not written down is demanded a second
12
+ # time, and that costs one refusal, not the work.
9
13
 
10
14
  . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/utf8.sh" 2>/dev/null || true
11
15
  . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/hook-input.sh" 2>/dev/null || true
@@ -2,6 +2,9 @@
2
2
  # Parsing a command for the storage guard: bringing it to one shape, cutting it into segments and
3
3
  # answering the question whether the segment delivers SQL to the server.
4
4
  #
5
+ # NOT a guard: it has no `rt-hook:` declaration and hooks into no agent event. The storage guard
6
+ # sources it — the parsing of the request, moved out when the guard reached its length limit.
7
+ #
5
8
  # There is deliberately no `# rt-hook:` line here: the event and the call pattern are declared by the
6
9
  # guard itself, and a helper next to it is not registered as a hook and decides nothing alone.
7
10
 
@@ -2,6 +2,9 @@
2
2
  # The request from the input of the storage guard: what exactly will go to the server and through
3
3
  # what.
4
4
  #
5
+ # NOT a guard: it has no `rt-hook:` declaration and hooks into no agent event. The storage guard
6
+ # sources it — one tier of its verdict, moved out when the guard reached its length limit.
7
+ #
5
8
  # There is deliberately no `# rt-hook:` line here: the event and the call pattern are declared by the
6
9
  # guard itself, and a helper next to it is not registered as a hook and decides nothing alone.
7
10
  #
@@ -2,6 +2,9 @@
2
2
  # The request's target for the storage guard: the production database, a throwaway check
3
3
  # database or something else — and what is allowed on production.
4
4
  #
5
+ # NOT a guard: it has no `rt-hook:` declaration and hooks into no agent event. The storage guard
6
+ # sources it — one tier of its verdict, moved out when the guard reached its length limit.
7
+ #
5
8
  # There is no `# rt-hook:` line here on purpose: the event and the call sample are declared by the
6
9
  # guard itself, and the helper next to it is not registered as a hook and decides nothing alone.
7
10
 
@@ -2,6 +2,9 @@
2
2
  # The write part of the storage guard: what counts as a write, what in it is destructive for
3
3
  # certain, where migrations go and by what a query addresses rows.
4
4
  #
5
+ # NOT a guard: it has no `rt-hook:` declaration and hooks into no agent event. The storage guard
6
+ # sources it — one tier of its verdict, moved out when the guard reached its length limit.
7
+ #
5
8
  # There is deliberately no `# rt-hook:` line here: the event and the call pattern are declared by
6
9
  # the guard itself, while a helper next to it registers no hook and decides nothing on its own.
7
10
 
@@ -24,6 +24,9 @@
24
24
  #
25
25
  # On an error the guard passes: on a failure, a missing turn record and a repeated call the turn is
26
26
  # ALLOWED. A broken guard must not block the conversation.
27
+ #
28
+ # FAIL-OPEN: no input, no jq, an already active turn — the turn ends as it did. A guard of the end
29
+ # of a turn that refuses on doubt leaves the session with no lawful end at all.
27
30
 
28
31
  # The guard's name for the observations: it is written by the shared deny tail.
29
32
  RT_GUARD_NAME=stand-login-guard
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # rt-hook: Stop
3
- # Requires: hooks/deny-tail.sh, hooks/turn-exit-patterns.sh
3
+ # Requires: hooks/deny-tail.sh, hooks/epic-over.sh, hooks/turn-exit-patterns.sh
4
4
  # Turn exit guard: a turn in which nothing was done on the work does not end until the work is
5
5
  # handed over. Stop.
6
6
  #
@@ -261,6 +261,10 @@ fi
261
261
  # Incident analysis — the record
262
262
  # "2026-09-04-hod-konchalsya-ozhidaniem-pri-deystvuyushchem-ukazanii" in the intake.
263
263
  awaits_word="$(printf '%s' "$verdict" | jq -r '.awaits_word // false' 2>/dev/null)"
264
+ # At the end of an epic waiting for the word of the owner is the work itself: the reading of that
265
+ # lies with the patterns and is shared with the guard of the stop.
266
+ [ "$awaits_word" = "true" ] && rt_te_epic_over && awaits_word=false
267
+
264
268
  if [ "$awaits_word" = "true" ]; then
265
269
  rt_te_deny "BLOCKED by turn-exit-guard: the turn ended with words about waiting for the word of the owner, and the word about stopping the guard reads from the owner: in this turn they announced no stop, and no question was put to them by the tool.
266
270
 
@@ -51,3 +51,13 @@ wait_re='gh[[:space:]]+(run[[:space:]]+watch|pr[[:space:]]+checks[^|]*--watch)|u
51
51
  # but on a condition: the next one is started, and an ACTION has been done on it, not spoken.
52
52
  handover_re='gh[[:space:]]+pr[[:space:]]+create'
53
53
  started_re='task:new|task:move|board\.mjs[[:space:]]+move|git[[:space:]]+checkout([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-b|git[[:space:]]+switch([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-c'
54
+
55
+ # The end of an epic: there waiting for the word of the owner is the work itself, and the guard of
56
+ # the stop refuses taking the next task. The reading lies apart and is shared by the three guards;
57
+ # it goes to the hosting, so the guard asks it right before a refusal, not on every turn.
58
+ rt_te_epic_over() {
59
+ # shellcheck disable=SC1090
60
+ . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/epic-over.sh" 2>/dev/null || return 1
61
+ command -v rt_epic_over >/dev/null 2>&1 || return 1
62
+ rt_epic_over
63
+ }
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env bash
2
2
  # The locale a guard runs in. Sourced as the first line of the body: `. "<guards directory>/utf8.sh"`.
3
3
  #
4
+ # NOT a guard: it has no `rt-hook:` declaration and hooks into no agent event. The guards source it
5
+ # as the first line of their body: the locale is one for all of them.
6
+ #
4
7
  # Guard patterns are written in the words of the language the tree speaks, and matching against
5
8
  # them depends on the process locale. In the C locale case folding works only for Latin letters:
6
9
  # «В дереве этого нет» is not found under the pattern `(в дереве|здесь)…` at all, the guard exits
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # rt-hook: Stop
3
- # Requires: hooks/deny-tail.sh
3
+ # Requires: hooks/deny-tail.sh, hooks/epic-over.sh
4
4
  # Waiting guard: a turn that tells the owner about someone else's step does not end until it holds
5
5
  # at least one action on the next task. Stop.
6
6
  #
@@ -223,6 +223,16 @@ case "$verdict" in
223
223
  *) exit 0 ;;
224
224
  esac
225
225
 
226
+ # The end of an epic: there the next task is exactly what is not taken — the guard of the stop
227
+ # refuses taking it — and demanding it here would leave the turn with no lawful end. The reading is
228
+ # shared with that guard and is asked right before the refusal: it goes to the hosting, and every
229
+ # turn must not pay for it.
230
+ # shellcheck disable=SC1090
231
+ . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/epic-over.sh" 2>/dev/null || true
232
+ if command -v rt_epic_over >/dev/null 2>&1 && rt_epic_over; then
233
+ exit 0
234
+ fi
235
+
226
236
  reason="BLOCKED by waiting-turn-guard: ${said}, and there is not a single action about the next task in it. Waiting for someone else's step is not what a session is spent on: the run, the review and the merge go on elsewhere and do not get faster from being watched.
227
237
 
228
238
  Saying «беру следующую задачу» is not the same as taking it: the phrase lives to the end of the turn while the work does not move, and only the owner can notice that.
@@ -2,6 +2,9 @@
2
2
  # Write targets named by the shell command outright: redirection, `tee`, an in-place edit, a copy
3
3
  # over the top, and for an interpreter — the paths from its body. Prints one per line.
4
4
  #
5
+ # NOT a guard: it has no `rt-hook:` declaration and hooks into no agent event. The guards that judge
6
+ # a shell command source it: the paths a command writes to are read one way by all of them.
7
+ #
5
8
  # There is deliberately no `# rt-hook:` line here: this is a helper, not a hook. It decides nothing
6
9
  # by itself and is called from where an edit of a file is judged — by the guard of the place of the
7
10
  # edit and by the exam guard. It is shared because the sign of a write is one and the same for both:
@@ -9,6 +9,27 @@ application stops responding, and the reason is found from the history.
9
9
  did not reach the queue is seen by no one, and no work was planned behind it.
10
10
  - **A change reaches the main branch only through a separate branch.** A direct write to main takes
11
11
  away both the discussion and the chance to roll the change back in one move.
12
+ - **A change belongs to an epic, and the epic is the unit of delivery.** One task changes the
13
+ application no less than a series of them, and merged on its own it reaches the main branch as
14
+ half of a thought: the rest of the series arrives later, or never, and the main branch holds a
15
+ state nobody planned. An epic names what the whole is, so that the main branch takes it whole or
16
+ does not take it. Work outside an epic exists only by the owner's word about that work.
17
+ - **An epic has a branch of its own, and it is taken from the main branch.** Without it the epic
18
+ lives as a plan alone, and a plan is not merged: its tasks stand on the main branch apart from one
19
+ another, half a finished epic is already rolled out while the rest is being written, and a
20
+ rollback goes task by task.
21
+ - **The branch of a task is taken from the branch of its epic, and the PR of the task goes there.**
22
+ Taken from the main branch, a task branch carries into the main branch what the epic has not
23
+ finished; opened into the main branch, its PR makes the epic branch a copy nobody merges.
24
+ - **The PR of an epic into the main branch opens after the folders of all its tasks are taken
25
+ apart.** What lies in them explains the decisions of one piece of work and dies with it: what is
26
+ worth keeping leaves for the description of the past by that same moment. An epic branch that
27
+ reaches the main branch with those folders in it carries into the whole tree what one branch
28
+ needed.
29
+ - **The main branch is merged into the branch of the epic, and the branch of the epic into the
30
+ branches of its tasks.** An epic outlives one task, and by its end its branch has fallen behind
31
+ everything the neighbours merged; a task branch that took the epic branch before that never sees
32
+ the lag. Both merges go while the work runs, not before the hand-over.
12
33
  - **The work queue holds tasks, not PRs about them.** A task and its PR share one number and one
13
34
  fate, so a second card about the same work adds nothing — it doubles the queue and lies about its
14
35
  length. The queue is read to see what is done and what remains; a PR answers a different question
@@ -35,7 +56,8 @@ application stops responding, and the reason is found from the history.
35
56
  the more surely, the closer the work is by subject. It is not the changes that diverge but the
36
57
  lines both wrote to. The cost does not vanish but moves: the one who branches pays it once,
37
58
  instead of the one who merges paying it as many times as there are open PRs. The first work of a
38
- series branches from main, and so does any work not connected to the previous one.
59
+ series branches from the branch of its epic, and so does any work not connected to the previous
60
+ one.
39
61
  - **A series of branches is handed over bottom up, and the order is named to the owner.** The PR of
40
62
  each stands on the previous one, not on main, so one merged out of order drags along everything
41
63
  beneath it. The order is known to the one who branched and invisible to the one who merges:
@@ -96,7 +96,7 @@ command is rejected whole — the branch does not exist in it yet:
96
96
 
97
97
  ```bash
98
98
  ✗ git checkout -b 85-guest-token && git commit -m 'feat(admin): …'
99
- ✓ git checkout -b 85-guest-token
99
+ ✓ git checkout -b 85-guest-token <ветка эпика>
100
100
  ✓ git commit -F -
101
101
  ```
102
102
 
@@ -63,12 +63,15 @@ and merging two tasks into one afterwards is done by hand.
63
63
 
64
64
 
65
65
  ```bash
66
- npm run task:new -- --title 'Письма владельцу не уходят молча' \
66
+ npm run task:new -- --epic-of <номер эпика> --title 'Письма владельцу не уходят молча' \
67
67
  --label bug --label area:api --slug mail-owner-silence < описание.md
68
68
  ```
69
69
 
70
70
  The body is read from standard input, `--slug` is optional and goes only into the hint with the
71
- branch name. Author and assignee — the machine account; the command reads the token itself, from
71
+ branch name. The epic is named by `--epic-of`, and the command writes the line about it into the
72
+ body itself and prints the branch line from the branch of the epic; work outside an epic goes by
73
+ `--outside-epic '<слово владельца>'`, and without either of the two the call is refused before the
74
+ card is created. The epic itself is created by the same command with `--epic`. Author and assignee — the machine account; the command reads the token itself, from
72
75
  a file outside the repository.
73
76
 
74
77
  The script under this command is created by the project — the package does not ship it. What it
@@ -147,6 +150,10 @@ command is rejected whole — the branch does not exist in it yet:
147
150
  ✓ git commit -F -
148
151
  ```
149
152
 
153
+ The base is the epic branch, not the main branch — `git checkout -b <КЛЮЧ>-85-guest-token
154
+ <ветка эпика>`. From the main branch only the epic branch itself is taken: a task branched from it
155
+ carries into it what the epic has not finished.
156
+
150
157
  The name — `<КЛЮЧ>-<номер задачи>-<короткий-slug>`, the slug in lowercase Latin letters joined by
151
158
  hyphens. The delivery guard parses it on the spot and refuses a miss in the form before the first
152
159
  commit, and by the number it asks the board: the task must exist, be open, stand in the queue and
@@ -99,7 +99,7 @@ command is rejected whole — the branch does not exist in it yet:
99
99
 
100
100
  ```bash
101
101
  ✗ git checkout -b <КЛЮЧ>-85-guest-token && git commit -m 'feat(admin): …'
102
- ✓ git checkout -b <КЛЮЧ>-85-guest-token
102
+ ✓ git checkout -b <КЛЮЧ>-85-guest-token <ветка эпика>
103
103
  ✓ git commit -F -
104
104
  ```
105
105
 
@@ -2,10 +2,10 @@
2
2
  name: git-workflow-merge
3
3
  kind: pattern
4
4
  rule: git-workflow
5
- description: Pattern of rule git-workflow. Load when the main branch is merged into a task branch and a conflict is resolved — the merge order, handling by file kind, checking what was appended against the work queue, re-reading the body of the open PR. Branch and commit — pattern git-workflow-commit.
5
+ description: Pattern of rule git-workflow. Load when the base of a branch is merged into it and a conflict is resolved — the merge order, handling by file kind, checking what was appended against the work queue, re-reading the body of the open request. Branch and commit — pattern git-workflow-commit.
6
6
  ---
7
7
 
8
- # Merging the main branch into the task branch
8
+ # Merging the base of a branch into it
9
9
 
10
10
  Pattern of the rule `git-workflow`. What must be true — the law
11
11
  `docs/constitution/delivery.md`.
@@ -18,7 +18,10 @@ out in that tree.
18
18
  ## When to use
19
19
 
20
20
  - The PR is marked conflicting, and it must be brought back to a mergeable state.
21
- - The main branch moved ahead, and the task branch must be caught up before the checks.
21
+ - The base of the branch moved ahead, and the branch must be caught up before the checks: for a
22
+ task branch the base is the branch of its epic, for an epic branch the main one.
23
+ - The main branch moved ahead, and the whole epic must be caught up: the main branch is merged
24
+ into the epic branch, and the epic branch into the branches of its unfinished tasks.
22
25
  - A commit is carried over by a cherry-pick.
23
26
 
24
27
  ## Order
@@ -27,7 +30,7 @@ out in that tree.
27
30
  git fetch origin
28
31
  GIT_AUTHOR_NAME="<бот>" GIT_AUTHOR_EMAIL="<номер>+<бот>@users.noreply.github.com" \
29
32
  GIT_COMMITTER_NAME="<бот>" GIT_COMMITTER_EMAIL="<номер>+<бот>@users.noreply.github.com" \
30
- git merge origin/main --no-edit
33
+ git merge origin/<база> --no-edit
31
34
  git diff --name-only --diff-filter=U # what ended up in conflict
32
35
  ```
33
36
 
@@ -89,7 +92,7 @@ The task carries the same content — the branch's side is not carried over:
89
92
  git checkout --theirs docs/BACKLOG.md && git add docs/BACKLOG.md
90
93
  ```
91
94
 
92
- In a merge `--theirs` is the merged-in main branch and `--ours` is the task branch; in a rebase
95
+ In a merge `--theirs` is the merged-in base and `--ours` is the branch standing on it; in a rebase
93
96
  the sides swap. The wrong side taken erases work silently.
94
97
 
95
98
  ## Checks after the resolution
@@ -74,7 +74,7 @@ else's work item, and the second command goes by silently, leaving the PR bound
74
74
  ```bash
75
75
  AZURE_DEVOPS_EXT_PAT="$TOKEN" az repos pr create \
76
76
  --title '[86] Письмо владельцу с незаполненным адресом попадает в логи' \
77
- --source-branch 86-mail-owner-silence --target-branch main \
77
+ --source-branch 86-mail-owner-silence --target-branch <ветка эпика> \
78
78
  --work-items 86 --reviewers <владелец> --delete-source-branch true \
79
79
  --description 'Закрывает рабочий элемент 86.'
80
80
  ```
@@ -55,9 +55,14 @@ open PR reads as an invitation to merge, so unfinished work opens it as a draft
55
55
  a draft's merge button itself:
56
56
 
57
57
  ```bash
58
- GH_TOKEN="$TOKEN" gh pr create --draft --title '[<КЛЮЧ>-86] …' --body-file тело.md
58
+ GH_TOKEN="$TOKEN" gh pr create --draft --base <ветка эпика> --title '[<КЛЮЧ>-86] …' --body-file тело.md
59
59
  ```
60
60
 
61
+ **The base is the epic branch, and it is named by the command.** Without `--base` the host takes
62
+ the default branch of the repository, that is the main branch: the request then carries the task
63
+ past the epic, and the epic branch stays a copy nobody merges. The epic's own request is the only
64
+ one whose base is the main branch, and it opens when the last folder of its tasks is taken apart.
65
+
61
66
  Everything waiting for a pipeline run, a rework or an answer to a question goes as a draft. The
62
67
  question is asked in the PR itself, not kept in the executor's head: a person reads the PR, not
63
68
  the session's conversation.
@@ -79,7 +84,7 @@ The body starts with the link line — by it the board fills the linked PRs fiel
79
84
  assignee and labels are set by the same command, and a PR does not open without them:
80
85
 
81
86
  ```bash
82
- GH_TOKEN="$TOKEN" gh pr create --title '[<КЛЮЧ>-86] Письмо владельцу с незаполненным адресом попадает в логи' \
87
+ GH_TOKEN="$TOKEN" gh pr create --base <ветка эпика> --title '[<КЛЮЧ>-86] Письмо владельцу с незаполненным адресом попадает в логи' \
83
88
  --reviewer <владелец> --assignee <бот> --label bug --label area:api \
84
89
  --body 'Closes #86
85
90
 
@@ -223,7 +228,7 @@ There are no checks on the PR itself: the rollout starts with a push into the ma
223
228
  before the merge nobody runs anything. Linters, unit tests and hook scenarios are taken by the
224
229
  push gate — below is what it does not know.
225
230
 
226
- 1. **The main branch is merged into this branch** — `git fetch origin && git merge origin/main`.
231
+ 1. **The base is merged into this branch** — for a task branch that is the epic branch, for an epic branch the main one: `git fetch origin && git merge origin/<база>`.
227
232
  Base freshness is not inherited between branches of one session: the second and the third
228
233
  are taken after their own `fetch`, not from the ref under the first. While work goes on, main
229
234
  moves ahead — most often by the same executor's own PR. Everything checked below is checked
@@ -76,7 +76,7 @@ command, and an MR does not open without them:
76
76
  GITLAB_TOKEN="$TOKEN" glab mr create \
77
77
  --title '[<КЛЮЧ>-86] Письмо владельцу с незаполненным адресом попадает в логи' \
78
78
  --assignee <бот> --reviewer <владелец> --label bug --label area:api \
79
- --target-branch main --remove-source-branch \
79
+ --target-branch <ветка эпика> --remove-source-branch \
80
80
  --description 'Closes #86
81
81
 
82
82
  …'
@@ -22,25 +22,28 @@ out in that tree.
22
22
  - Several works were done in one session, and they lie in the tree unpublished.
23
23
  - It is decided in which order to hand the accumulated over to the owner.
24
24
 
25
- ## A chain: branch from the previous one, not from main
25
+ ## A chain: branch from the previous one, not from the epic branch
26
26
 
27
27
  A stack from one base is what to avoid. Works that go one after another branch one after
28
28
  another:
29
29
 
30
30
  ```bash
31
- # the first work of the chain — from main, as usual
32
- git checkout -b <КЛЮЧ>-<номер>-<slug> origin/main
31
+ # the first work of the chain — from the epic branch, as usual
32
+ git checkout -b <КЛЮЧ>-<номер>-<slug> <ветка эпика>
33
33
 
34
- # each next one — from the previous branch, not from origin/main
34
+ # each next one — from the previous branch, not from the epic branch
35
35
  git checkout -b <КЛЮЧ>-<следующий>-<slug> <КЛЮЧ>-<номер>-<slug>
36
36
  ```
37
37
 
38
+ A chain lives inside one epic: every branch of it stands, directly or through its neighbours, on
39
+ the epic branch, and the lowest request of the chain has that branch as its base.
40
+
38
41
  The previous edit then lies in the common ancestor, and two different changes of one file never
39
42
  have to be reconciled at all. The divergence surfaces at branching — at the one who has both
40
43
  edits as their own and at hand — not at the merge, at the owner, who has neither.
41
44
 
42
- From main branch the first work of the chain and any work that does not touch the previous one:
43
- a chain is about neighbouring works, not about all in a row.
45
+ From the epic branch the first work of the chain and any work that does not touch the previous
46
+ one: a chain is about neighbouring works, not about all in a row.
44
47
 
45
48
  ## A chain PR stands on the previous branch
46
49
 
@@ -48,15 +51,16 @@ a chain is about neighbouring works, not about all in a row.
48
51
  gh pr create --base <предыдущая ветка> --title '[<КЛЮЧ>-<номер>] <что сделано>' --body-file <файл>
49
52
  ```
50
53
 
51
- Main is not set as the base: the review then shows the own edit mixed with all under it. The
52
- host retargets a merged lower one itself — its heir PR's base becomes main.
54
+ Neither the main branch nor the epic branch is set as the base here: the review then shows the own
55
+ edit mixed with all under it. The host retargets a merged lower one itself — the base of its heir
56
+ becomes the base of the merged one, that is, the epic branch.
53
57
 
54
58
  The merge order stands in every PR body as the line "stands on #<number>, merge after it": the
55
59
  owner merges by the list, and branch kinship is invisible in the list.
56
60
 
57
61
  **The tree's pipeline is checked for whether it listens to a PR with such a base.** The host
58
62
  sends the PR event with a base filter, and a tree that left only the main branch in the filter
59
- gives the whole chain no runs at all: the PR stands green-and-empty, and there is nothing to
63
+ gives neither the chain nor a single task of an epic any run at all: the PR stands green-and-empty, and there is nothing to
60
64
  bring the event back — neither a new commit nor reclosing the PR changes the base. This is asked
61
65
  before the chain is created: from the pipeline settings, not from the PR page, where a missing
62
66
  run looks the same as waiting for one.
@@ -18,6 +18,17 @@ Pattern of the rule `status-report`. What must be true — the work-conduct law.
18
18
 
19
19
  ## Calls
20
20
 
21
+ The whole table at once — the command of the checks layer: it takes the order of the tasks from the
22
+ epic plan, the state of each of them from the hosting, and prints the paragraph and the table ready
23
+ to be carried to the owner. The tree names the call in the companion of the rule.
24
+
25
+ ```bash
26
+ <the command of the tree> [<the number of the epic>]
27
+ ```
28
+
29
+ Everything below is what the command is assembled from: it is asked by hand where the answer is not
30
+ about an epic — one task, one branch, one run.
31
+
21
32
  The branch, its commits beyond main, what is uncommitted and the tip:
22
33
 
23
34
  ```bash
@@ -123,11 +123,10 @@ The folder is taken apart and pushed, the work is cleaned up behind — the PR o
123
123
  this minute the work waits for the owner, not for the machine, and the session does not end on it:
124
124
  the next task is taken by the same move, pattern `task-flow-resume`.
125
125
 
126
- **Readiness is measured by what is told, not by what has passed.** The list of what is done by the
127
- opening reads as a list of mandatory checks, and its boundary is not visible. It exists: a check the
128
- executor cannot pass for a reason outside the work — a refused permission, an unreachable
129
- environment, a key held by a person — does not cancel readiness. It goes into "Not run" and into
130
- "Remaining step", named together with the reason; silence about it reads as passed.
126
+ **Readiness is measured by what is told, not by what has passed.** A check the executor cannot pass
127
+ for a reason outside the work — a refused permission, an unreachable environment, a key held by a
128
+ person — does not cancel readiness: it goes into "Not run" and into "Remaining step" with the
129
+ reason. Silence about it reads as passed.
131
130
 
132
131
  There is no state on disk any more — the progress left with the folder. This is the price of the
133
132
  cleanup standing before the PR. The tail of four steps — open the PR, wait for the run, lift the
@@ -254,11 +253,9 @@ what was opened are different things, and the second is checked only from the re
254
253
  invisible PR gives itself away by nothing — it is in the answer to its author, it carries labels,
255
254
  and the owner's review queue is simply empty.
256
255
 
257
- There is nothing to check this by machine, and there will be no check: no audit reads the PR body,
258
- and the host asks about nothing but the title. The requirement is held by the same thing as the
259
- spoken word — by whoever writes the body. The difference between them is one, and it is all. The
260
- owner reads a message only if they return to the conversation, and the section they see where they
261
- look when pressing the button.
256
+ There is nothing to check this by machine: no audit reads the request body, and the host asks about
257
+ nothing but the title. The owner reads a message only if they return to the conversation, and the
258
+ section they see where they look when pressing the button.
262
259
 
263
260
  ### An edit after remarks goes without a plan on disk
264
261
 
@@ -266,20 +263,43 @@ The review returned remarks, or the run went red — it is fixed in the same bra
266
263
  longer there, and the folder is not assembled again: the progress guard lets the edit through on the
267
264
  sign from the branch history. What exactly is fixed is taken from the remark, not from the plan.
268
265
 
269
- Main merged in to look at something is the same edit as main merged in for the work, and it leaves
270
- by the same turn. A merge left in the working copy is either pushed in the same turn or not made —
271
- otherwise the owner sees the old state and decides by it.
266
+ A merge left in the working copy is either pushed in the same turn or not made — otherwise the owner
267
+ sees the old state and decides by it.
272
268
 
273
269
  **Next move:** the run is green and there are no remarks — the draft is lifted, and the owner is
274
270
  told the work is ready.
275
271
 
272
+ ## State `задачи-эпика-кончились`: the epic is handed in by a request into the main branch
273
+
274
+ Every task of the epic is merged into its branch and every folder is taken apart — only then does
275
+ the epic branch get a request of its own, and its base is the main branch. Until that minute the
276
+ branch is not offered to a person at all: the merge button on it means the whole epic, and there is
277
+ nothing to press it for while a task is still being written.
278
+
279
+ Before opening, three things are checked by a command rather than by memory:
280
+
281
+ ```bash
282
+ gh pr list --base <ветка эпика> --state open # no task of the epic is left unmerged
283
+ git ls-tree -r --name-only HEAD -- docs/tasks/ # no folder of a task of this epic is left
284
+ git fetch origin && git merge origin/main # the main branch is merged into the epic branch
285
+ ```
286
+
287
+ A folder left in the epic branch reaches the main branch with it: what one branch needed becomes the
288
+ tree's for good. A foreign folder, arrived with a merge of the main branch, is not touched.
289
+
290
+ The body is written the same way as a task's, and its "Что сделано" is the list of the tasks by
291
+ number: the reviewer opens one page instead of five. The plan of the epic stays in the tree — it
292
+ outlives the branch.
293
+
294
+ **Next move:** the request is open as a draft, the run is awaited, the draft is lifted, and the
295
+ owner is asked to merge — by the number, in one turn.
296
+
276
297
  ## Common misses
277
298
 
278
299
  - **The texts are edited before the folder is taken apart:** the list of what to re-read lies in the
279
300
  plan, and the taking-apart deletes it.
280
- - **A decisions entry repeating a rule's article word for word is no reason next to it.** The rule
281
- comes into the context by itself, the spec — only when opened; the pair diverges in silence. Such
282
- an entry leaves whole, even if the section goes empty; a reason the article does not state is
301
+ - **A decisions entry repeating a rule's article word for word is no reason next to it.** Such an
302
+ entry leaves whole, even if the section goes empty; a reason the article does not state is
283
303
  appended to the article.
284
304
  - **The PR body stays older than the taking-apart.** The taking-apart is the last commit of the
285
305
  branch, and it makes untrue everything the body promised to do before the merge. The reviewer
@@ -292,12 +312,11 @@ told the work is ready.
292
312
  - **"Audited" cannot be said without opening the file.** The rule is read whole: a stale statement
293
313
  stands among true ones and differs from them by nothing.
294
314
  - **The merge is not done after the merge into main.** Main then holds a "proposed, not yet rolled
295
- out" section with what has been working for a month: a silent lie, the more convincing the older.
296
- - **Scenario numbers are not renumbered at the merge.** The id is the key of the link to the tests,
297
- and a shift breaks the audit for the neighbours.
315
+ out" section with what has been working for a month.
316
+ - **Scenario numbers are not renumbered at the merge.** The id is the key of the link to the tests.
298
317
  - **"What is not included" is read whole after the merge, not appended to.** The feature's
299
- boundaries land next to the domain's. Half repeat what stood there in other words, and the line
300
- "this section does not exist yet" becomes a lie by the very work that merges it. The spec audit
318
+ boundaries land next to the domain's, and the line "this section does not exist yet" becomes a lie
319
+ by the very work that merges it. The spec audit
301
320
  does not look there.
302
321
  - **One's own line of the work queue audit is found by name** — by the task number and the branch
303
322
  name. The audit answers for the whole tree, and one closing had eight of someone else's folders
@@ -167,50 +167,64 @@ The grill ended with one task — the step is skipped. Several came out, and the
167
167
  matters — the epic is declared here, before the first of them, and twice. As a card in the work
168
168
  queue with the epic label, and as a plan next to it.
169
169
 
170
- The epic plan names three things, and none is derived from the others:
170
+ ```bash
171
+ npm run task:new -- --epic --title '<Возможность, которая разрабатывается>' --slug <slug> < тело.md
172
+ ```
171
173
 
172
- ```markdown
173
- # <Возможность, которая разрабатывается>
174
+ The call puts the epic label on the card, lays a draft of the plan in the tree's directory of plans
175
+ and writes the path to it into the body: the audit reads the plan by that path, and a card without
176
+ it points into emptiness. Everything the epic cannot be created without is asked before the card is
177
+ made — an administrator alone can take a made one off the board.
174
178
 
175
- Одной фразой: что у владельца появится, когда эпик кончится.
179
+ The draft is filled in by hand, and three things in it are derived from nothing: the opportunity in
180
+ one phrase, the makeup of the tasks in order, and how the branches of the tasks stand. A set without
181
+ an order is no order: two tasks whose order rested on understanding went into work the other way
182
+ round, and the second was redone under the first. The assigned order holds to the end of the epic; a
183
+ revision is the owner's decision.
176
184
 
177
- | № | Задача | Почему здесь |
178
- | --- | ------------ | ------------------------ |
179
- | 1 | <что делает> | <на чём стоят следующие> |
180
- | 2 | <что делает> | <что из первой ей нужно> |
181
- ```
185
+ The cards are created for all the tasks at once, right here — by the same call with `--epic-of`, for
186
+ every row of the makeup. The issued numbers return to the same table, and from this minute "take the
187
+ next" answers with a number, not a name.
182
188
 
183
- A set without an order is no order: two tasks whose order rested on understanding went into work the
184
- other way round, and the second was redone under the first. The assigned order holds to the end of
185
- the epic; a revision is the owner's decision, and it is written into the progress of the task that
186
- caused it.
189
+ **Next move:** the declared epic is committed together with the task numbers, and in the same turn
190
+ its branch is taken.
187
191
 
188
- The plan lies outside the task folder: that one dies with the very first merge. The directory for it
189
- is named by the rule's companion — the package has no path of its own.
192
+ ### State `эпик-заведён`: the branch of the epic
190
193
 
191
- The cards are created for all the tasks at once, right here: by the task creation call for every row
192
- of the table, with the epic label. The issued numbers return to the same table — as a column or a
193
- prefix to the name — and from this minute "take the next" answers with a number, not a name.
194
+ ```bash
195
+ git checkout -b <КЛЮЧ>-<номер эпика>-<slug> origin/main
196
+ ```
194
197
 
195
- A task under an epic names it in its body — the card number and the path to the plan in one line —
196
- and the plan names the task from its side. A one-sided binding looks as whole as a two-sided one:
197
- the reader comes now from the epic, now from the card, and the second side exists for only one of
198
- them.
198
+ The branch is taken before the first task of the epic, not with it: taken later, it leaves the first
199
+ task standing on the main branch, and the epic starts as half of itself already merged.
199
200
 
200
- **Next move:** the declared epic is committed together with the task numbers, and in the same turn
201
- its first task is taken — by creating the branch and the folder.
201
+ The plan of the epic is committed into it and the branch is pushed at once — the branches of the
202
+ tasks are taken from it, and one that exists only on the machine is a base nobody else has. The card
203
+ names the branch: the reader comes to the epic from the queue, and the queue holds no branches.
204
+
205
+ Nothing else is committed into the epic branch: it carries the plan and the merges of the tasks. An
206
+ edit made in it directly reaches the main branch unreviewed.
207
+
208
+ **Next move:** the first task of the epic is taken — the branch of the task from the branch of the
209
+ epic, and the folder.
202
210
 
203
211
  ### State `договорённость-записана`: the task, the branch, the folder
204
212
 
205
213
  ```bash
206
- npm run task:new -- --title '<Что не так>' --slug <slug> --label documentation --label area:tooling < тело.md
207
- git checkout -b <КЛЮЧ>-<номер>-<slug>
214
+ npm run task:new -- --epic-of <номер эпика> --title '<Что не так>' --slug <slug> --label area:tooling < тело.md
215
+ git checkout -b <КЛЮЧ>-<номер>-<slug> <ветка эпика>
208
216
  npm run task:move -- <номер> in-progress
209
217
  ```
210
218
 
211
219
  The body comes as a file and is never empty: an empty task tells nothing to the executor or the
212
220
  owner, and it can be filled in later only on the owner's word.
213
221
 
222
+ The call writes the line about the epic into the body itself and prints the branch line with the
223
+ branch of the epic as its base: the shape of that line is read by a machine from both sides, and by
224
+ hand it comes out in a shape of its own once out of three. Work outside an epic goes by the same
225
+ call with `--outside-epic '<слово владельца>'` — a refusal without that second way out is read as
226
+ "there is no way" and gets bypassed by a call to the hosting past this command.
227
+
214
228
  `task:new` renames `_draft-<slug>` to `<КЛЮЧ>-<номер>-<slug>` and fills in the plan header. The
215
229
  branch is created by a second call: a compound "create and commit at once" is refused by the
216
230
  main-branch guard whole.