@rt-tools/agent-kit 0.36.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.
- package/assets/checks/board-pull-state.github.mjs +82 -13
- package/assets/checks/board.github.mjs +1 -1
- package/assets/checks/check-board.github.mjs +20 -12
- package/assets/checks/check-specs.mjs +2 -2
- package/assets/checks/epic-table.github.mjs +4 -3
- package/assets/checks/lib-common.mjs +10 -2
- package/assets/checks/lib-domains.mjs +1 -1
- package/assets/checks/lib-manifests.mjs +34 -2
- package/assets/checks/push-inputs.mjs +401 -0
- package/assets/checks/push-trace.mjs +108 -0
- package/assets/checks/rt-kit-checks.config.mjs +17 -2
- package/assets/checks/spec-anchors.mjs +4 -4
- package/assets/checks/spec-contract.mjs +5 -5
- package/assets/commands/next-session.md +3 -1
- package/assets/commands/night.md +28 -18
- package/assets/defaults/project.sh +37 -8
- package/assets/defaults/push.sh +23 -0
- package/assets/defaults/turn-map.md +10 -6
- package/assets/docs/GLOSSARY.md +3 -1
- package/assets/hooks/epic-stop-guard.sh +62 -15
- package/assets/hooks/git-guard-push-ahead.sh +31 -1
- package/assets/hooks/git-guard-push-marks.sh +173 -29
- package/assets/hooks/git-guard-push-tests.sh +22 -3
- package/assets/hooks/handoff-entry-guard.sh +2 -2
- package/assets/hooks/pre-push.sh +6 -0
- package/assets/hooks/push-set.sh +29 -4
- package/assets/hooks/task-flow-context.sh +15 -4
- package/assets/hooks/task-flow-guard.sh +4 -3
- package/assets/hooks/turn-exit-epic.sh +1 -1
- package/assets/hooks/turn-exit-guard.sh +8 -8
- package/assets/hooks/turn-exit-role.sh +45 -0
- package/assets/laws/work-conduct.md +9 -8
- package/assets/patterns/autonomous-work-run.md +35 -10
- package/assets/patterns/browser-verification-measure.md +10 -20
- package/assets/patterns/browser-verification-stand.md +30 -42
- package/assets/patterns/doc-style-human.md +0 -6
- package/assets/patterns/doc-style-sweep.md +7 -7
- package/assets/patterns/doc-style-trace.md +5 -4
- package/assets/patterns/doc-style-write.md +7 -7
- package/assets/patterns/epic-flow-declare.md +15 -8
- package/assets/patterns/git-workflow-commit.github.md +1 -1
- package/assets/patterns/git-workflow-freshness.md +12 -11
- package/assets/patterns/git-workflow-merge.md +14 -11
- package/assets/patterns/git-workflow-migration.md +4 -2
- package/assets/patterns/git-workflow-pr-body.github.md +1 -1
- package/assets/patterns/git-workflow-pr-ready.md +5 -4
- package/assets/patterns/git-workflow-pr.azure.md +91 -25
- package/assets/patterns/git-workflow-pr.github.md +17 -19
- package/assets/patterns/git-workflow-pr.gitlab.md +75 -29
- package/assets/patterns/git-workflow-restart.md +3 -2
- package/assets/patterns/git-workflow-stack.md +25 -21
- package/assets/patterns/lib-layers-new.md +7 -3
- package/assets/patterns/queue-audit-read.github.md +9 -3
- package/assets/patterns/spec-driven-domain.md +50 -48
- package/assets/patterns/spec-driven-rule.md +18 -19
- package/assets/patterns/status-report-table.github.md +1 -1
- package/assets/patterns/task-flow-archive.md +14 -34
- package/assets/patterns/task-flow-close.md +3 -2
- package/assets/patterns/task-flow-graph.needs-graph.md +98 -0
- package/assets/patterns/task-flow-handoff.md +4 -4
- package/assets/patterns/task-flow-resume.md +56 -20
- package/assets/patterns/task-flow-start.md +3 -4
- package/assets/patterns/testing-e2e.md +14 -18
- package/assets/patterns/testing-unit.md +9 -13
- package/assets/patterns/turn-entry-map.md +13 -3
- package/assets/pitfalls/autonomous-work.md +15 -0
- package/assets/pitfalls/doc-style.md +3 -3
- package/assets/pitfalls/git-workflow.github.md +5 -9
- package/assets/pitfalls/spec-driven.md +9 -7
- package/assets/pitfalls/task-flow.md +14 -25
- package/assets/pitfalls/testing.md +11 -12
- package/assets/pitfalls/turn-conduct.md +6 -6
- package/assets/rules/autonomous-work.md +37 -29
- package/assets/rules/browser-verification.md +27 -22
- package/assets/rules/dependencies.md +3 -3
- package/assets/rules/deploy-flow.azure.md +35 -12
- package/assets/rules/deploy-flow.github.md +10 -6
- package/assets/rules/deploy-flow.gitlab.md +40 -17
- package/assets/rules/doc-style.md +21 -17
- package/assets/rules/epic-flow.md +5 -3
- package/assets/rules/git-workflow.azure.md +140 -122
- package/assets/rules/git-workflow.github.md +7 -8
- package/assets/rules/git-workflow.gitlab.md +128 -117
- package/assets/rules/queue-audit.github.md +5 -3
- package/assets/rules/spec-driven.md +17 -25
- package/assets/rules/status-report.md +5 -3
- package/assets/rules/task-flow.md +33 -15
- package/assets/rules/testing.md +35 -32
- package/assets/rules/turn-conduct.md +26 -24
- package/assets/templates/rule.md +2 -2
- package/assets/traits.json +3 -0
- package/lib/cargo-prose.d.ts +2 -1
- package/lib/cargo-prose.d.ts.map +1 -1
- package/lib/cargo-prose.js.map +1 -1
- package/lib/companion.d.ts +0 -5
- package/lib/companion.d.ts.map +1 -1
- package/lib/companion.js +1 -1
- package/lib/companion.js.map +1 -1
- package/lib/cost.d.ts +0 -8
- package/lib/cost.d.ts.map +1 -1
- package/lib/cost.js +4 -4
- package/lib/cost.js.map +1 -1
- package/lib/hooks-map.d.ts +0 -12
- package/lib/hooks-map.d.ts.map +1 -1
- package/lib/hooks-map.js +2 -25
- package/lib/hooks-map.js.map +1 -1
- package/lib/observations-cargo.d.ts +1 -5
- package/lib/observations-cargo.d.ts.map +1 -1
- package/lib/observations-cargo.js +2 -2
- package/lib/observations-cargo.js.map +1 -1
- package/lib/observations.d.ts +0 -2
- package/lib/observations.d.ts.map +1 -1
- package/lib/observations.js.map +1 -1
- package/lib/order.d.ts +0 -2
- package/lib/order.d.ts.map +1 -1
- package/lib/order.js +0 -4
- package/lib/order.js.map +1 -1
- package/lib/outcomes.d.ts +2 -7
- package/lib/outcomes.d.ts.map +1 -1
- package/lib/outcomes.js +3 -3
- package/lib/outcomes.js.map +1 -1
- package/lib/proposals.d.ts +0 -1
- package/lib/proposals.d.ts.map +1 -1
- package/lib/proposals.js +1 -1
- package/lib/proposals.js.map +1 -1
- package/lib/shipment.d.ts +2 -11
- package/lib/shipment.d.ts.map +1 -1
- package/lib/shipment.fixture.d.ts +0 -3
- package/lib/shipment.fixture.d.ts.map +1 -1
- package/lib/shipment.fixture.js +3 -3
- package/lib/shipment.fixture.js.map +1 -1
- package/lib/shipment.js +2 -2
- package/lib/shipment.js.map +1 -1
- package/lib/traits.d.ts +0 -3
- package/lib/traits.d.ts.map +1 -1
- package/lib/traits.js +2 -2
- package/lib/traits.js.map +1 -1
- package/lib/variants.d.ts +0 -1
- package/lib/variants.d.ts.map +1 -1
- package/lib/variants.js +1 -1
- package/lib/variants.js.map +1 -1
- package/package.json +1 -1
- package/assets/checks/signals/ui-kit.json +0 -11
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: task-flow-graph
|
|
3
|
+
kind: pattern
|
|
4
|
+
rule: task-flow
|
|
5
|
+
description: Pattern of rule task-flow. Load when the tree holds a code graph and a domain is explored or a shared symbol is about to be edited. Not for a claim about behaviour, a number or a rule text — those are read from the code and the documents.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Working with the tree's code graph
|
|
9
|
+
|
|
10
|
+
Pattern of the rule `task-flow`. What must be true meanwhile — the law
|
|
11
|
+
`docs/constitution/work-conduct.md`.
|
|
12
|
+
|
|
13
|
+
The graph is a build artefact of the tool `graphify`: it lies next to the tree and is rebuilt from
|
|
14
|
+
the code. It answers relations, not behaviour. The tool is not part of the package, and the pattern
|
|
15
|
+
is laid out only to a tree that names the trait `graph`. A copy that names the trait and has no
|
|
16
|
+
artefact on disk — a fresh clone, a new working tree — builds it by `graphify update .` before the
|
|
17
|
+
first exploration of the turn, or the turn names that there is no graph, and none of the steps below
|
|
18
|
+
applies.
|
|
19
|
+
|
|
20
|
+
## When to use
|
|
21
|
+
|
|
22
|
+
- The first exploration of a domain in a turn, before reading files one by one.
|
|
23
|
+
- Before an edit of a shared symbol: who calls, imports or re-exports it.
|
|
24
|
+
- A question of the shape of the tree: which files belong to a domain, where the procedures of a
|
|
25
|
+
service lie.
|
|
26
|
+
|
|
27
|
+
## Freshness
|
|
28
|
+
|
|
29
|
+
The build records the commit it was made from. It is compared with the head in every turn, before
|
|
30
|
+
the first exploration:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
python3 -c "import json;print(json.load(open('graphify-out/graph.json'))['built_at_commit'])"
|
|
34
|
+
git rev-parse HEAD
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Equal — the graph describes the head. Behind — the graph is stale, and the difference is read before
|
|
38
|
+
anything else: it names the files whose relations the graph no longer knows.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
git log --oneline --stat <built_at_commit>..HEAD
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
A tree that keeps the graph in history is always one commit behind: the graph comes in the commit
|
|
45
|
+
after the one it was built from. A difference that holds only graph files is that commit, and the
|
|
46
|
+
graph describes the head; the graph is stale when the difference holds a code file.
|
|
47
|
+
|
|
48
|
+
A rebuild re-extracts code files and calls no model:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
graphify update .
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
A stale graph not rebuilt is not a source: the turn names why it was not rebuilt, and no answer
|
|
55
|
+
cites it. A turn where the graph exists and was not used names one of two reasons: the answer is
|
|
56
|
+
about behaviour, numbers or texts, or the graph is stale and was not rebuilt.
|
|
57
|
+
|
|
58
|
+
## The inventory
|
|
59
|
+
|
|
60
|
+
Nodes carry the file they came from. Listing them shows a domain whole: files, classes, procedures,
|
|
61
|
+
functions.
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
python3 -c "import json,collections;g=json.load(open('graphify-out/graph.json'));c=collections.Counter(n.get('source_file','') for n in g['nodes'] if '<domain>' in n.get('source_file',''));print('\n'.join(f'{v:5d} {k}' for k,v in c.most_common()))"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## The relations
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
graphify explain "<node>" # a node and its neighbours
|
|
71
|
+
graphify affected "<symbol>" --depth 2 # who depends on it, reverse traversal
|
|
72
|
+
graphify path "<caller>" "<callee>" # the chain between two nodes
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
A node is named by a file name or a symbol, not by a path: `board.mjs` is found, `tools/board.mjs`
|
|
76
|
+
is not. `explain` answers with `imports`, `imports_from`, `calls`, `contains` and `re_exports`;
|
|
77
|
+
`affected` is the reverse traversal an edit of a shared symbol needs.
|
|
78
|
+
|
|
79
|
+
## What the graph never answers
|
|
80
|
+
|
|
81
|
+
- A constant, a limit, a number: values are not nodes.
|
|
82
|
+
- The body of an `async function*`: the extraction may leave it out, and a function absent from the
|
|
83
|
+
graph is not absent from the code.
|
|
84
|
+
- A template, a style sheet, a generated file: often outside the extraction.
|
|
85
|
+
- The meaning of a document: document nodes are headings, not the text under them.
|
|
86
|
+
- A permission or an enum value: names are nodes, strings are not.
|
|
87
|
+
|
|
88
|
+
## Common misses
|
|
89
|
+
|
|
90
|
+
- **A free-text query looks like the entry point and is not.** `graphify query` walks breadth-first
|
|
91
|
+
over the words of the question and starts from whatever token it matched: it answers with
|
|
92
|
+
neighbours of a word, not with the domain. `explain` is asked by a file name or a symbol.
|
|
93
|
+
- **A barrel file distorts a path.** `index.ts` nodes stand between a caller and a callee, and
|
|
94
|
+
`graphify path` returns a chain through re-exports that no reader would walk. `affected` on the
|
|
95
|
+
symbol is used instead, and the relations are read.
|
|
96
|
+
- **A rebuild after deleted code keeps the old graph.** `graphify update` does not overwrite
|
|
97
|
+
`graph.json` when the rebuild has fewer nodes, and `built_at_commit` stays old: after an edit that
|
|
98
|
+
removes code it is run with `--force`, and the commit is compared again.
|
|
@@ -172,9 +172,9 @@ session that did not launch one, the section would stand empty.
|
|
|
172
172
|
|
|
173
173
|
### The path to the owner
|
|
174
174
|
|
|
175
|
-
The last
|
|
176
|
-
|
|
177
|
-
needed: the owner will read it anyway, and the room for it is already spent.
|
|
175
|
+
The last line to the owner names where the handover lies. They paste nothing: the entry hook serves
|
|
176
|
+
it to the next session on the same branch by itself. Retelling the content of the handover in the
|
|
177
|
+
reply is not needed: the owner will read it anyway, and the room for it is already spent.
|
|
178
178
|
|
|
179
179
|
## Common misses
|
|
180
180
|
|
|
@@ -190,7 +190,7 @@ needed: the owner will read it anyway, and the room for it is already spent.
|
|
|
190
190
|
so there is no parent either" is an inference, not a measurement. Nothing to ask with — then it is
|
|
191
191
|
written as a question: "the parent is not checked, check before the PR".
|
|
192
192
|
- **The work state does not move into the handover.** Done work is marked in the progress — by one
|
|
193
|
-
entry; the handover retells it but does not replace it
|
|
193
|
+
entry; the handover retells it but does not replace it.
|
|
194
194
|
- **The handover records a state that lives for hours.** Lag behind main, the course of the run and
|
|
195
195
|
"checks green" the new session reads as true today. What goes into the handover is what does not
|
|
196
196
|
change without the executor: the tree, the branch, the PR number, what is not committed.
|
|
@@ -57,7 +57,7 @@ gathered by reading. A list is good for knowing where to look; a stage is closed
|
|
|
57
57
|
|
|
58
58
|
## Entry from a session handover
|
|
59
59
|
|
|
60
|
-
The handover was written by a past session and
|
|
60
|
+
The handover was written by a past session, and no check reads it. It is read as an assignment —
|
|
61
61
|
and the work is taken up past the rule: the state is not checked, the rule is not loaded, the
|
|
62
62
|
numbers are taken on trust. The entry from a handover differs from an ordinary session in one thing:
|
|
63
63
|
everything written in it is checked against the tree, because it was written yesterday.
|
|
@@ -72,7 +72,7 @@ The order is short, four steps:
|
|
|
72
72
|
3. **The numbers from the handover are recounted** on the current commit. The estimate "twice as
|
|
73
73
|
much work" was never confirmed by a recount.
|
|
74
74
|
4. **The next step is taken from the progress**, not from the handover's section about it: the
|
|
75
|
-
progress
|
|
75
|
+
handover retells the progress as it stood at its minute, and the two diverge within one session.
|
|
76
76
|
|
|
77
77
|
What is not in the handover and never will be: the owner's words — they are in the grill; decisions
|
|
78
78
|
with reasons — they are in the progress; the plan — it is on disk. The handover retells, it does not
|
|
@@ -94,6 +94,20 @@ the code edit.
|
|
|
94
94
|
|
|
95
95
|
## State `этап-идёт`: the stage is done and marked in the progress
|
|
96
96
|
|
|
97
|
+
A large edit that crosses several layers — the contract, the storage, the applications — may be led
|
|
98
|
+
by the role pipeline:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
Workflow(name: "feature", args: { task: "<the plan stage>", grill: "docs/tasks/<ветка>/grill.md" })
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The pipeline makes a plan of its own, up to six steps: its points role reads the task and epic plans,
|
|
105
|
+
but its own steps do not come from `plan.md`. So it is given one stage of the plan, not the task,
|
|
106
|
+
and its steps are not new stages: the progress marks the steps of the plan as before, and the
|
|
107
|
+
pipeline's acceptance is the readiness sign of that stage. Its goal phase compares the result with
|
|
108
|
+
the whole request of the grill, so for one stage its verdict "goal not met" is expected and is not
|
|
109
|
+
the readiness sign.
|
|
110
|
+
|
|
97
111
|
The "Where we stand" section is **rewritten**, not appended — it is the first thing the next session
|
|
98
112
|
reads, and the only thing that survives trimming by size:
|
|
99
113
|
|
|
@@ -109,13 +123,13 @@ reads, and the only thing that survives trimming by size:
|
|
|
109
123
|
- **PR:** not opened yet
|
|
110
124
|
```
|
|
111
125
|
|
|
112
|
-
The PR line is mandatory from the minute the stages are over
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
126
|
+
The PR line is mandatory from the minute the stages are over and lives while the folder does. The
|
|
127
|
+
folder leaves by the commit before the PR opens, so the line names what the closing still has to do;
|
|
128
|
+
after the opening the PR state is read from the host by its number, and the number is asked of the
|
|
129
|
+
host by the branch. A PR reopened for remarks after the folder left keeps its state in the PR itself:
|
|
116
130
|
|
|
117
131
|
```markdown
|
|
118
|
-
- **PR:**
|
|
132
|
+
- **PR:** не открыт · осталось: разбор папки, сверка очереди
|
|
119
133
|
```
|
|
120
134
|
|
|
121
135
|
The waiting line carries the owner's standing word about a stop, quoted in « », when they gave
|
|
@@ -172,36 +186,58 @@ taken at once, by the same move with which the previous one went to review.
|
|
|
172
186
|
Taken, not chosen: the order was assigned at planning and lies in the epic plan. A choice offered to
|
|
173
187
|
the owner under an assigned order is a request to assign it anew.
|
|
174
188
|
|
|
175
|
-
Work outside an epic has no plan with an order, and the next
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
by command output.
|
|
189
|
+
Work outside an epic has no plan with an order, and the next work after it is named by the owner:
|
|
190
|
+
the turn asks them, it does not take a card. The queue is asked by a command, not by memory of what
|
|
191
|
+
the executor created themselves, and what it holds goes into the question. An empty queue is a
|
|
192
|
+
statement about the tree, and it is backed by command output.
|
|
179
193
|
|
|
180
194
|
```bash
|
|
181
195
|
# what is assigned next — read in the epic plan, not asked
|
|
182
196
|
# the state of the tasks — in the work queue: the plan does not know what is closed
|
|
183
197
|
```
|
|
184
198
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
owner
|
|
188
|
-
|
|
199
|
+
Two things stop the session. The window fill limit — then comes the handover, pattern
|
|
200
|
+
`task-flow-handoff`. And the end of the epic: the turn shows the table of its tasks and waits for
|
|
201
|
+
the owner's word, rule `turn-conduct`. A card of the work queue outside the epic is not an order.
|
|
202
|
+
While the epic is assigned and open, no check refuses taking such a card — this article holds it;
|
|
203
|
+
after the epic's end the epic-end guard refuses it until the owner names the work.
|
|
189
204
|
|
|
190
205
|
**Next move:** an action is done on the next task — a task, a branch or a folder is created. The
|
|
191
206
|
turn ends after it, not after words about it.
|
|
192
207
|
|
|
208
|
+
## State `влито`: the epic plan learns of the merge
|
|
209
|
+
|
|
210
|
+
A person merged the PR, and the epic plan still names the task as in work. The row moves to merged
|
|
211
|
+
in the branch of the next task, by its first commit: the epic branch carries no edits of its own. A
|
|
212
|
+
lesson the task left for the following ones goes into the section of the plan about what was learned
|
|
213
|
+
along the way, in the same commit. The last task of the epic has no next branch, and the epic branch
|
|
214
|
+
takes no edit of its own: its row stays "handed over", and the body of the epic PR into the main
|
|
215
|
+
branch names its merge.
|
|
216
|
+
|
|
217
|
+
Work begun from cargo that arrived moves its records to "done" in the turn that learns of the merge,
|
|
218
|
+
not at the folder's taking-apart: before the merge the edit is not in the tree, and the mark would
|
|
219
|
+
claim what does not yet lie in main. The keys are taken from the archive and passed whole, as the
|
|
220
|
+
intake read prints them:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
npm run cargo:mark -- --state fixed \
|
|
224
|
+
--proposal <полный ключ> --proposal <полный ключ> \
|
|
225
|
+
--fix '<чем исправлено: статья правила, гард, проверка, правка кода>'
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
One fix per call, so the records go in batches by what closed them. The reply is read: "moved 0"
|
|
229
|
+
means nothing moved.
|
|
230
|
+
|
|
231
|
+
**Next move:** the work of the next task goes on — the merge needs no turn of its own.
|
|
232
|
+
|
|
193
233
|
## Common misses
|
|
194
234
|
|
|
195
|
-
- **A session that ended in nothing is recorded too.** Otherwise the next one walks the same road:
|
|
196
|
-
"we tried this — it did not work, because" costs one line and saves a whole session.
|
|
197
|
-
- **The uncommitted is named outright.** Work lives in the tree for weeks; the line "what lies
|
|
198
|
-
unsaved and why" is the only thing that makes it visible while there is no PR.
|
|
199
235
|
- **Confirmation is command output or a measurement, not a retelling.** "Checked, it works" a
|
|
200
236
|
session later cannot be told from "it seemed to work".
|
|
201
237
|
- **A number from the handover and from "Where we stand" is recounted before it gets into any new
|
|
202
238
|
text.** Not only before splitting the work. Carried into the grill or the progress, it is read by
|
|
203
239
|
the next sessions as a measurement and checked by nobody else. The handover describes the day it
|
|
204
|
-
was written,
|
|
240
|
+
was written, and no check reads it. A count taken unrecounted diverged from
|
|
205
241
|
the tree by eight and was found by a counting script, not by reading. The estimate "twice as much
|
|
206
242
|
work as the previous" costs the same — on the current commit the volumes were almost equal. A
|
|
207
243
|
recount costs one command, and the text gets its own number.
|
|
@@ -167,7 +167,8 @@ first.
|
|
|
167
167
|
|
|
168
168
|
### State `договорённость-записана`: a series of tasks is declared an epic
|
|
169
169
|
|
|
170
|
-
The grill ended with one task —
|
|
170
|
+
The grill ended with one task — no epic is declared for it: it goes into the epic in work, or, by the
|
|
171
|
+
owner's word, outside any epic with `--outside-epic`. Several came out, and the order between them
|
|
171
172
|
matters — the epic is declared and its branch is taken by the pattern `epic-flow-declare`, and the
|
|
172
173
|
work comes back here with its first task.
|
|
173
174
|
|
|
@@ -269,7 +270,7 @@ window fill limit, a guard's refusal, a question to the owner or handed-in work
|
|
|
269
270
|
begun; a pattern read to the end is not among them.
|
|
270
271
|
|
|
271
272
|
**Next move:** the first stage is done in the same turn, and it is declared closed after its command
|
|
272
|
-
from the "
|
|
273
|
+
from the "Verified by" line has passed.
|
|
273
274
|
|
|
274
275
|
## Common misses
|
|
275
276
|
|
|
@@ -281,8 +282,6 @@ from the "Checked by" line has passed.
|
|
|
281
282
|
- **One grill produced several tasks — the common part leaves for the epic plan.** The task folder
|
|
282
283
|
dies with the merge, and the task order outlives it; the directory is named by the rule's
|
|
283
284
|
companion.
|
|
284
|
-
- **The task is created by a command, not by four calls in a row.** The board is not bound to the
|
|
285
|
-
repository, and the task gets onto it only by an explicit addition.
|
|
286
285
|
- **The branch slug is taken from the terminology of the agreement, not from the words of the
|
|
287
286
|
request.** The agreement is written before the branch, and that is exactly where it drops the
|
|
288
287
|
owner's word. The task title and the PR title can be fixed; the branch name after the PR opens —
|
|
@@ -12,7 +12,7 @@ Pattern of the rule `testing`. What must be true — the law
|
|
|
12
12
|
|
|
13
13
|
## When to use
|
|
14
14
|
|
|
15
|
-
- A test file
|
|
15
|
+
- A test file of an end-to-end suite of the tree is being written or edited.
|
|
16
16
|
- A defect visible only on the production configuration needs reproducing.
|
|
17
17
|
- A stand is being prepared for a run against nginx.
|
|
18
18
|
|
|
@@ -65,23 +65,22 @@ such a stand the run goes with `BASE_URL`, and with it the locale redirect check
|
|
|
65
65
|
|
|
66
66
|
```typescript
|
|
67
67
|
const ALLOW_RENAME: boolean = process.env['E2E_ALLOW_SLUG_RENAME'] === '1';
|
|
68
|
-
test.skip(!ALLOW_RENAME, '
|
|
68
|
+
test.skip(!ALLOW_RENAME, 'changes the live address of a record: switched on by E2E_ALLOW_SLUG_RENAME=1');
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
Switches come in two kinds, and only the first counts as coverage. **A switch by stand state**
|
|
72
72
|
skips a case the stand never has by design — the scenario is closed, and it needs no mark. **A
|
|
73
|
-
switch by environment variable** leaves the test unrun: the scenario behind
|
|
74
|
-
|
|
73
|
+
switch by environment variable** leaves the test unrun: nothing checks the scenario behind
|
|
74
|
+
it, and such a scenario carries a partial-coverage mark with a
|
|
75
75
|
reason. Of the three below not one belongs to the first kind: all three are driven by a variable.
|
|
76
76
|
|
|
77
77
|
- A test that irreversibly changes stand data is skipped by default and switched on by its own
|
|
78
78
|
variable.
|
|
79
|
-
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
- `
|
|
83
|
-
|
|
84
|
-
technique, not a forgotten `test.skip`.
|
|
79
|
+
- A behind-the-proxy switch is `!!process.env['BASE_URL']`: with it the redirect checks wake. A
|
|
80
|
+
bare page-serving server does not pass them, and the failures look like a regression.
|
|
81
|
+
- A session switch reads the pair of sign-in variables of the stand account.
|
|
82
|
+
- `playwright/no-skipped-test` is switched off in the linter config: the test switch here is a
|
|
83
|
+
technique, not a forgotten `test.skip`. The companion names the tree's switches.
|
|
85
84
|
|
|
86
85
|
## A redirect code is checked by the answer, not by following it
|
|
87
86
|
|
|
@@ -131,7 +130,7 @@ been pressed at all. The popup is closed and its absence awaited by the same pai
|
|
|
131
130
|
|
|
132
131
|
A screen is ready when its data is, not when its heading is. A heading, a month title or a toolbar
|
|
133
132
|
comes from the template and is drawn before the request answers. A check or a frame that waits for
|
|
134
|
-
it reads an empty grid. The wait names a node that exists only with data: a row, a
|
|
133
|
+
it reads an empty grid. The wait names a node that exists only with data: a row, a record, a
|
|
135
134
|
selected record.
|
|
136
135
|
|
|
137
136
|
After a change of the window width, layout values come from different sources at different
|
|
@@ -149,16 +148,13 @@ polling the very value it measures; a wait for one value proves nothing about an
|
|
|
149
148
|
of them. Adding tests pushes old ones into refusal (429): a run of one spec stays green, and only
|
|
150
149
|
the full set shows it. Each test that opens a new record gets its own client address; the limit
|
|
151
150
|
itself is not raised for the suite.
|
|
152
|
-
-
|
|
153
|
-
`
|
|
154
|
-
serves a foreign build.
|
|
151
|
+
- The rendering port and the proxy config mount have their traps — the pattern
|
|
152
|
+
`browser-verification-stand` names them.
|
|
155
153
|
- There is one browser — chromium; narrow screen — `--project=mobile-chrome`. The error "Executable
|
|
156
|
-
doesn't exist" is taken apart in the rule `testing`: the same one comes after a
|
|
157
|
-
change.
|
|
154
|
+
doesn't exist" is taken apart in the cold part of the rule `testing`: the same one comes after a
|
|
155
|
+
Playwright version change.
|
|
158
156
|
- Admin tests without a session are skipped silently — the run looks successful, while less than
|
|
159
157
|
half was checked.
|
|
160
|
-
- The nginx config is mounted as a directory, not as a single file: the editor recreates the file,
|
|
161
|
-
and the container is left with a truncated copy.
|
|
162
158
|
- **Not only what the screen requests is substituted, but also what the header requests.** The
|
|
163
159
|
unread counter is requested on every screen under the header. Without a substitution the real
|
|
164
160
|
server answers that request, refuses the fake sign-in, the interceptor drops the session, and
|
|
@@ -27,12 +27,12 @@ import { describe, expect, it } from 'vitest';
|
|
|
27
27
|
|
|
28
28
|
## One `describe` per function
|
|
29
29
|
|
|
30
|
-
The block name matches the function name word for word; the `it` titles are sentences in
|
|
31
|
-
present tense, about behaviour, not about the internals:
|
|
30
|
+
The block name matches the function name word for word; the `it` titles are sentences in the tree's
|
|
31
|
+
language, present tense, about behaviour, not about the internals:
|
|
32
32
|
|
|
33
33
|
```typescript
|
|
34
34
|
describe('applyDayClick', () => {
|
|
35
|
-
it('SC-BK-19 —
|
|
35
|
+
it('SC-BK-19 — a click on a taken day changes nothing', () => {
|
|
36
36
|
expect(applyDayClick(day('2026-08-12'), selection)).toEqual(selection);
|
|
37
37
|
});
|
|
38
38
|
});
|
|
@@ -63,16 +63,14 @@ Shared constants (`PRICING`, `BUSY`) lie at the top of the file, at module scope
|
|
|
63
63
|
|
|
64
64
|
## A decision is moved into a pure function
|
|
65
65
|
|
|
66
|
-
The dominant form
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
`libs/api/<quote domain>/util/src/lib/quote.calculator.ts`.
|
|
66
|
+
The dominant form: the logic moves into `*.logic.ts`, `*.util.ts` or `*.calculator.ts` and is
|
|
67
|
+
checked by a call — without `TestBed`, without substituting dependencies. The tree's samples are
|
|
68
|
+
named by the companion.
|
|
70
69
|
|
|
71
70
|
## A procedure is called directly
|
|
72
71
|
|
|
73
72
|
The handler is the `handle` method of the procedure class in the `feature` layer of its domain. The
|
|
74
|
-
database double is written by hand; the sample is
|
|
75
|
-
`libs/api/<booking domain>/feature/src/lib/link-booking.procedure.spec.ts`:
|
|
73
|
+
database double is written by hand; the tree's sample is named by the companion:
|
|
76
74
|
|
|
77
75
|
```typescript
|
|
78
76
|
const prisma: FakePrismaClient = new FakePrismaClient();
|
|
@@ -127,8 +125,8 @@ nothing.
|
|
|
127
125
|
|
|
128
126
|
## Common misses
|
|
129
127
|
|
|
130
|
-
-
|
|
131
|
-
|
|
128
|
+
- Before writing the first test in a lib, check that its run config is next to it — why, the cold
|
|
129
|
+
part of the rule `testing` says.
|
|
132
130
|
- **The compiler import goes into the harness file, not into the spec.** A lib that renders nothing
|
|
133
131
|
still pulls the framework when its test imports a barrel with a framework service, and the first
|
|
134
132
|
import fails on JIT. The import goes into the file named in `setupFiles` of the lib's run config:
|
|
@@ -137,5 +135,3 @@ nothing.
|
|
|
137
135
|
the database and in what order. The double is written by hand.
|
|
138
136
|
- Do not create your own helpers for assertions: `expect(...).toBe(...)` and `.toEqual(...)`
|
|
139
137
|
directly.
|
|
140
|
-
- A title with a scenario id that does not exist takes `npm run check:specs` down, while the tests
|
|
141
|
-
themselves stay green.
|
|
@@ -39,9 +39,19 @@ done in such a place in general. Read first, the map answers a question the sess
|
|
|
39
39
|
yet.
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
# the handover — by the name of the current branch, not by picking from the directory
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
# the handover — by the name of the current branch, not by picking from the directory:
|
|
43
|
+
# first the section of the progress, the file outside the tree only where there is no section
|
|
44
|
+
branch="$(git branch --show-current)"
|
|
45
|
+
progress="$ROOT/${RT_TASKS_DIR:-docs/tasks}/$branch/progress.md"
|
|
46
|
+
handoff="$ROOT/${RT_HANDOFF_DIR:-.claude/handoff}/$branch.md"
|
|
47
|
+
section="$([ -r "$progress" ] && LC_ALL=C awk '$0 == "## Handover of the session" ||
|
|
48
|
+
$0 == "## Передача захода" { on = 1; next }
|
|
49
|
+
on && /^## / { on = 0 } on' "$progress")"
|
|
50
|
+
if [ -n "$section" ]; then
|
|
51
|
+
printf 'HANDOVER OF THE PAST SESSION\n\n%s\n' "$section"
|
|
52
|
+
elif [ -r "$handoff" ]; then
|
|
53
|
+
printf 'HANDOVER OF THE PAST SESSION\n\n'; cat "$handoff"
|
|
54
|
+
fi
|
|
45
55
|
|
|
46
56
|
# the map — as its own file, not parsed out of the rule
|
|
47
57
|
[ -r "$map" ] && { printf 'TURN MAP\n\n'; cat "$map"; }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Autonomous work — cold part
|
|
2
|
+
|
|
3
|
+
Pitfalls: traps already stepped on. Loaded not with the rule but on demand — an ordinary
|
|
4
|
+
decision does not need it.
|
|
5
|
+
|
|
6
|
+
The rule is `autonomous-work`; the articles that hold the law stand there.
|
|
7
|
+
|
|
8
|
+
## Pitfalls
|
|
9
|
+
|
|
10
|
+
- **A branch created from the base by habit is fixed by re-creating it while the work has not
|
|
11
|
+
gone far.** The pattern names the miss; later the branches collide in shared files.
|
|
12
|
+
- **A task postponed without a line in the list is lost.** In the morning it is seen neither on the
|
|
13
|
+
board nor in the branches: it looks simply not taken.
|
|
14
|
+
- **A default written in the commit body does not reach the owner.** They read the list and the task
|
|
15
|
+
folder, not the branch history.
|
|
@@ -12,8 +12,8 @@ The rule is `doc-style`; the articles that hold the law stand there.
|
|
|
12
12
|
matches, and the executor names the difference — one line: "did it not the way you said, here
|
|
13
13
|
is how and why". Silence holds exactly until the request has to be repeated, and the price is
|
|
14
14
|
trust in the whole report.
|
|
15
|
-
- **Remaining work is not written into a document; it is filed as a task.**
|
|
16
|
-
keeps only what never becomes a task: agreements and decisions that were decided not to change.
|
|
15
|
+
- **Remaining work is not written into a document; it is filed as a task.** A backlog file, where
|
|
16
|
+
the tree keeps one, holds only what never becomes a task: agreements and decisions that were decided not to change.
|
|
17
17
|
The test — the statement stays if nobody intends to change it. "Do later" in a plan, a README or
|
|
18
18
|
a spec is a second work list: it drifts from the board silently, and sorting it out later costs
|
|
19
19
|
more than filing a task right away. Of a 1411-line document, 71 lines turned out to be current,
|
|
@@ -34,7 +34,7 @@ The rule is `doc-style`; the articles that hold the law stand there.
|
|
|
34
34
|
written here" table is purged by grep over the whole tree, not by proofreading. The form is set precisely: "spec" — the
|
|
35
35
|
document — also inflects into the other forms, and legitimate matches by the stem outnumber the
|
|
36
36
|
violations; the search is for phrases ("no spec for …", "the spec checks"), not the stem.
|
|
37
|
-
- **A dropped name is purged by one grep over the whole tree:** rules, their
|
|
37
|
+
- **A dropped name is purged by one grep over the whole tree:** rules, their companions,
|
|
38
38
|
documents and comments. A description of what the code no longer has reads as a current
|
|
39
39
|
instruction.
|
|
40
40
|
- **A dropped word's second meaning is restored after the blanket replacement, not worked around
|
|
@@ -104,9 +104,9 @@ The rule is `git-workflow`; the articles that hold the law stand there.
|
|
|
104
104
|
one was not checked by a single line: it has zero steps because it never started. Restarting
|
|
105
105
|
such a run is refused by the guard until the step's output has been read in the same turn —
|
|
106
106
|
which is why the audit line names reading the run first.
|
|
107
|
-
- **The same merge of the
|
|
107
|
+
- **The same merge of the base done a third time in one session stops the work.**
|
|
108
108
|
Branches that append a line to the same list drop each other into a conflict at every merge,
|
|
109
|
-
and merging
|
|
109
|
+
and merging the base round after round is a fix of the symptom. On the third round the cause is
|
|
110
110
|
named and the owner is asked, instead of a fourth round.
|
|
111
111
|
- **An empty file sent as the PR body wipes the description of the work whole.** That is how an
|
|
112
112
|
edit of the body assembled by a chain went: a change into the temporary files directory took
|
|
@@ -215,7 +215,7 @@ a guard.
|
|
|
215
215
|
- **A set rewritten as lines looks complete.** In one tree six checks lay next to the ones being
|
|
216
216
|
run and were run by neither the gate nor the pipeline: eight lines out of fourteen read as the
|
|
217
217
|
whole set, and the difference showed only by comparison with the package default.
|
|
218
|
-
- **
|
|
218
|
+
- **A green gate read as "everything is green locally".** Twice in a row an edit that passed the
|
|
219
219
|
gate whole was refused by the pipeline — and both times a green gate was read as "everything is
|
|
220
220
|
green locally". Hence the requirement to refuse the push on a step missing from the set, rather
|
|
221
221
|
than print a warning next to it.
|
|
@@ -225,8 +225,8 @@ a guard.
|
|
|
225
225
|
not by memory.
|
|
226
226
|
- **Union of the sides on the shared index file.** Before the declaration the same line was
|
|
227
227
|
resolved six times in six branches in one session. One cannot promise "no more conflicts" by
|
|
228
|
-
the declaration: there will be no manual work, but
|
|
229
|
-
merge
|
|
228
|
+
the declaration: there will be no manual work, but the host still marks such a branch conflicting. Whether
|
|
229
|
+
the dispute is real is checked by a merge without the driver — pattern `git-workflow-stack`.
|
|
230
230
|
- **What was created is visible only to its creator.** Sixteen tasks were created twice this way,
|
|
231
231
|
and a PR was named to the owner by a number that did not exist for him: the restricted account
|
|
232
232
|
saw its own, and the hosting answered "not found" to everyone else.
|
|
@@ -261,10 +261,6 @@ a guard.
|
|
|
261
261
|
package default loses exactly the checks the package will add in its next edition. One's own
|
|
262
262
|
line instead of the default is lawful where it covers the same thing more strictly or calls the
|
|
263
263
|
named script.
|
|
264
|
-
- **A draft whose branch carries the task folder means work in progress, not abandoned work.**
|
|
265
|
-
Both signs are needed together: a green run on the tip without the folder taken apart says the
|
|
266
|
-
work is not handed over yet. A tree that named no machine account does not get this audit at
|
|
267
|
-
all.
|
|
268
264
|
- **The mergeability mark is not cleared even by a declared union of both sides.** The hosting
|
|
269
265
|
counts the union as its own device and reads no merge settings: until the branch has absorbed
|
|
270
266
|
main and that has reached the hosting, the PR stands conflicting with the divergence resolved
|
|
@@ -7,12 +7,13 @@ The rule is `spec-driven`; the articles that hold the law stand there.
|
|
|
7
7
|
|
|
8
8
|
## Pitfalls
|
|
9
9
|
|
|
10
|
-
- **Do not create `tasks.md` in a spec.** Steps are a session artefact; their place is the
|
|
11
|
-
|
|
12
|
-
again and
|
|
10
|
+
- **Do not create `tasks.md` in a spec.** Steps are a session artefact; their place is the plan in
|
|
11
|
+
the task folder. As soon as "steps" appear in the directory, the spec becomes a plan
|
|
12
|
+
again and is out of date after the merge.
|
|
13
13
|
- **A spec describes what is settled, not what is coming.** The only place where it speaks of the
|
|
14
|
-
future is `proposed/<feature>/`.
|
|
15
|
-
directory is removed, the scenario identifiers
|
|
14
|
+
future is `proposed/<feature>/`. Its text merges into the domain spec by one of the last
|
|
15
|
+
commits of the branch, before the PR opens; the directory is removed, the scenario identifiers
|
|
16
|
+
do not change.
|
|
16
17
|
- **Nothing checks the semantics of fields.** The check knows procedure names, failure codes and
|
|
17
18
|
the link between scenarios and tests; what an empty field means, it does not know. So a
|
|
18
19
|
`.proto` edit pulls in the specs of every domain whose procedures it touched, in the same
|
|
@@ -21,8 +22,9 @@ The rule is `spec-driven`; the articles that hold the law stand there.
|
|
|
21
22
|
mention anywhere is enough for the symbol — in someone else's field with the same name, in a
|
|
22
23
|
markup attribute. The place where the rule is actually carried out is confirmed only by
|
|
23
24
|
reading the code.
|
|
24
|
-
- **An anchor in `tools/*.mjs` is checked by almost nothing:** liveness is
|
|
25
|
-
`.ts
|
|
25
|
+
- **An anchor in `tools/*.mjs` is checked by almost nothing:** liveness is judged only for
|
|
26
|
+
a symbol declared in `.ts`; callers are looked for in `.ts` and `.html` under the roots the tree
|
|
27
|
+
names. So a rule bound to a check
|
|
26
28
|
is read together with the check's body.
|
|
27
29
|
- **A green check does not mean the structure is right.** Sidecars with bindings first lay next
|
|
28
30
|
to the laws, and the check was green precisely because the structure matched what the check
|