@rt-tools/agent-kit 0.31.0 → 0.32.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.
- package/assets/checks/spec-anchors.mjs +13 -0
- package/assets/checks/task-new.github.mjs +24 -0
- package/assets/defaults/gate-map.sh +4 -0
- package/assets/defaults/shell.sh +18 -5
- package/assets/hooks/dispatch.sh +8 -4
- package/assets/hooks/epic-stop-guard.sh +1 -1
- package/assets/hooks/git-guard-delivery-epic.sh +21 -0
- package/assets/hooks/skill-gate-rearm.sh +18 -2
- package/assets/hooks/skill-gate.sh +10 -5
- package/assets/laws/mockups.needs-mockups.md +28 -0
- package/assets/patterns/git-workflow-commit.azure.md +5 -1
- package/assets/patterns/git-workflow-commit.github.md +5 -1
- package/assets/patterns/git-workflow-commit.gitlab.md +5 -1
- package/assets/patterns/git-workflow-merge.md +12 -0
- package/assets/patterns/git-workflow-pr.azure.md +2 -0
- package/assets/patterns/git-workflow-pr.github.md +4 -0
- package/assets/patterns/git-workflow-pr.gitlab.md +2 -0
- package/assets/patterns/lib-layers-new.md +4 -0
- package/assets/patterns/mockups-measure.needs-mockups.md +28 -0
- package/assets/patterns/spec-driven-domain.md +4 -0
- package/assets/patterns/task-flow-archive.md +4 -1
- package/assets/patterns/task-flow-resume.md +6 -0
- package/assets/patterns/task-flow-start.md +30 -30
- package/assets/patterns/testing-e2e.md +15 -1
- package/assets/rules/component-structure.md +3 -0
- package/assets/rules/deploy-flow.azure.md +4 -0
- package/assets/rules/deploy-flow.github.md +4 -0
- package/assets/rules/deploy-flow.gitlab.md +4 -0
- package/assets/rules/mockups.needs-mockups.md +80 -0
- package/assets/rules/task-flow.md +11 -12
- package/assets/rules/typescript-conventions.md +9 -0
- package/assets/traits.json +15 -12
- package/package.json +1 -1
|
@@ -151,6 +151,11 @@ function checkRuleImplementation(specFile, text, mapFile, heading = ['## Rules',
|
|
|
151
151
|
const cell = cells[2].trim();
|
|
152
152
|
rows.set(head, {
|
|
153
153
|
anchors: [...cells[2].matchAll(ANCHOR)],
|
|
154
|
+
// A path-like token in backticks — a slash and an extension — whose symbol follows it
|
|
155
|
+
// without the colon inside the backticks: `file.ts` `symbol`, or `file.ts`:symbol. A
|
|
156
|
+
// bare path alone is lawful: prose names files in the same cell, and the whole tree
|
|
157
|
+
// turned red on such mentions when every one of them was judged.
|
|
158
|
+
bare: [...cells[2].matchAll(/`([\w./-]*\/[\w./-]*\.[A-Za-z]{2,10})`(?::[\p{L}_#]|\s*`#?[\p{L}_][\p{L}\p{N}_-]*`)/gu)],
|
|
154
159
|
verdict: VERDICT.test(cell) && cell.length >= VERDICT_MIN,
|
|
155
160
|
used: false,
|
|
156
161
|
});
|
|
@@ -179,6 +184,14 @@ function checkRuleImplementation(specFile, text, mapFile, heading = ['## Rules',
|
|
|
179
184
|
'or the verdict «Not carried out», «Not applicable», «Not checked» with a reason'
|
|
180
185
|
);
|
|
181
186
|
}
|
|
187
|
+
// A binding that lost the colon between the file and the symbol is not read as an anchor,
|
|
188
|
+
// and a row that still has other anchors passed in silence. Judged only in a row that has an
|
|
189
|
+
// anchor: a verdict row names files in prose, and there a bare path is lawful.
|
|
190
|
+
if (row.anchors.length) {
|
|
191
|
+
for (const [, token] of row.bare) {
|
|
192
|
+
report(mapFile, `the colon between the file and the symbol is lost: \`${token}\``);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
182
195
|
for (const [, path, symbol] of row.anchors) {
|
|
183
196
|
if (!exists(path)) {
|
|
184
197
|
report(mapFile, `the binding leads nowhere: there is no file \`${path}\``);
|
|
@@ -194,6 +194,30 @@ const labels = args.epic && !args.labels.includes(EPIC_LABEL) ? [...args.labels,
|
|
|
194
194
|
*/
|
|
195
195
|
const token = botToken() ?? undefined;
|
|
196
196
|
|
|
197
|
+
/**
|
|
198
|
+
* A label that is not in the repository breaks the creation whole: the hosting refuses the call
|
|
199
|
+
* with one line about a label that could not be added, and neither a card nor a number exists. The
|
|
200
|
+
* labels are asked before the creation, and the refusal names the missing ones, the existing ones
|
|
201
|
+
* and the fact that no task was created. The list that cannot be read — offline, no right — does
|
|
202
|
+
* not hold the creation: the hosting will refuse by itself if the label is really missing.
|
|
203
|
+
*/
|
|
204
|
+
if (labels.length > 0) {
|
|
205
|
+
let existing = null;
|
|
206
|
+
try {
|
|
207
|
+
existing = ghJson(['label', 'list', '--repo', `${OWNER}/${REPO}`, '--limit', '200', '--json', 'name'], { token }).map(
|
|
208
|
+
(label) => label.name
|
|
209
|
+
);
|
|
210
|
+
} catch {
|
|
211
|
+
existing = null;
|
|
212
|
+
}
|
|
213
|
+
const missing = existing === null ? [] : labels.filter((label) => !existing.includes(label));
|
|
214
|
+
if (missing.length > 0) {
|
|
215
|
+
fail(
|
|
216
|
+
`no task was created: the labels ${missing.map((label) => `«${label}»`).join(', ')} are not in the repository. Existing: ${existing.join(', ')}`
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
197
221
|
/**
|
|
198
222
|
* The plan of the epic and the line about it in the card body.
|
|
199
223
|
*
|
|
@@ -235,6 +235,10 @@ skill_for_default() {
|
|
|
235
235
|
# The check through the browser is the only area where the rule is needed not for a file
|
|
236
236
|
# edit but for a tool: what lies there is not the files but the stand and the coordinates.
|
|
237
237
|
browser) printf '%s\n' 'browser-verification' ;;
|
|
238
|
+
# A call of the design tool needs the rule of mockups for the same reason: what lies there
|
|
239
|
+
# is a sheet, not a file. A tree without the rule is not refused: the gate skips a missing
|
|
240
|
+
# one.
|
|
241
|
+
design) printf '%s\n' 'mockups' ;;
|
|
238
242
|
esac
|
|
239
243
|
|
|
240
244
|
return 0
|
package/assets/defaults/shell.sh
CHANGED
|
@@ -14,8 +14,11 @@
|
|
|
14
14
|
# from one laid down by the tool. The analysis — `2026-08-15-guard-denied-shell-wrote-anyway.md`.
|
|
15
15
|
#
|
|
16
16
|
# The list is wide on purpose, and the price of that is named: a read command that carries the name
|
|
17
|
-
# of an interpreter will be refused on a par with an edit command. A narrow
|
|
18
|
-
# missed form of writing brings back the whole bypass, and it can be found
|
|
17
|
+
# of an interpreter with a document on input will be refused on a par with an edit command. A narrow
|
|
18
|
+
# list would cost more — a missed form of writing brings back the whole bypass, and it can be found
|
|
19
|
+
# only by a miss. Code given to an interpreter as an argument is narrowed: it is a write only when
|
|
20
|
+
# it holds a call that writes, and the price there is the opposite one — a write by a rarer call
|
|
21
|
+
# passes unseen.
|
|
19
22
|
#
|
|
20
23
|
# Deletion and moving stand in the list on purpose, not by oversight. Removing a file is an edit
|
|
21
24
|
# more destructive than any write. What was written is visible in the tree and rolls back, while
|
|
@@ -56,11 +59,21 @@ rt_shell_writes_default() {
|
|
|
56
59
|
# demand for the shared-code rule without editing anything in it. Over two tasks such refusals
|
|
57
60
|
# came to about fifteen, and part of them fell on commands that wrote nothing.
|
|
58
61
|
#
|
|
59
|
-
# An interpreter's body comes in two kinds
|
|
60
|
-
#
|
|
62
|
+
# An interpreter's body comes in two kinds. A document on input stays a write: it is a script
|
|
63
|
+
# nobody has read. Code as an argument is a write only when the code holds a call that writes —
|
|
64
|
+
# `writeFile`, `appendFile`, `fs.write`, a stream opened for writing, an opening for `w` or `a`,
|
|
65
|
+
# `write_text`, `write_bytes`, a rename, a copy or a removal. Code without one is a read, and
|
|
66
|
+
# the paths it names are not judged as write targets: a read of one script from the package
|
|
67
|
+
# manifest by `node -e` demanded the dependencies rule. The price of this is named: a write by a
|
|
68
|
+
# call that is not in the list passes unseen, and the list can only grow by a miss.
|
|
61
69
|
interp='(^|[|;&(]|[[:space:]])(python3?|node|ruby|deno|bun|php|perl)'
|
|
70
|
+
if printf '%s' "$cleaned" | grep -Eq "${interp}([[:space:]][^|]*)?<<"; then
|
|
71
|
+
return 0
|
|
72
|
+
fi
|
|
62
73
|
if printf '%s' "$cleaned" | grep -Eq \
|
|
63
|
-
"${interp}([[:space:]]
|
|
74
|
+
"${interp}([[:space:]]+-[^[:space:]]*)*[[:space:]]+(-e|--eval|-c|-p|--print)([[:space:]]|\$)" \
|
|
75
|
+
&& printf '%s' "$cleaned" | grep -Eq \
|
|
76
|
+
'writeFile|appendFile|fs\.write|createWriteStream|\.write\(|write_text|write_bytes|open\([^)]*,[[:space:]]*["'"'"'][wa]|renameSync|copyFile|cpSync|unlinkSync|rmSync|os\.(rename|remove|unlink)|shutil\.|File\.(write|open)'; then
|
|
64
77
|
return 0
|
|
65
78
|
fi
|
|
66
79
|
|
package/assets/hooks/dispatch.sh
CHANGED
|
@@ -107,17 +107,21 @@ EOF
|
|
|
107
107
|
fi
|
|
108
108
|
if [ "$code" -ne 0 ]; then
|
|
109
109
|
if [ -n "$branch_out" ]; then
|
|
110
|
-
|
|
110
|
+
refusal="$branch_out"
|
|
111
111
|
elif [ -n "$said_err" ]; then
|
|
112
|
-
|
|
112
|
+
refusal="$said_err"
|
|
113
113
|
else
|
|
114
114
|
# The branch exited non-zero and said nothing by either stream. From the outside that
|
|
115
115
|
# is indistinguishable from a refusal on the merits, and there is nothing to fix: nobody
|
|
116
116
|
# knows which file is broken. So the dispatcher names it itself, otherwise nothing says
|
|
117
117
|
# anything about a broken branch.
|
|
118
|
-
printf 'The guard %s exited with code %s and printed nothing: the file looks broken
|
|
119
|
-
"$(basename "$branch")" "$code"
|
|
118
|
+
refusal="$(printf 'The guard %s exited with code %s and printed nothing: the file looks broken.' \
|
|
119
|
+
"$(basename "$branch")" "$code")"
|
|
120
120
|
fi
|
|
121
|
+
printf '%s\n' "$refusal"
|
|
122
|
+
# At code 2 the agent is given only the error stream, and the output stream is dropped:
|
|
123
|
+
# a refusal printed only above reached the executor empty. The text goes to both.
|
|
124
|
+
printf '%s\n' "$refusal" >&2
|
|
121
125
|
exit "$code"
|
|
122
126
|
fi
|
|
123
127
|
|
|
@@ -121,7 +121,7 @@ if [ -z "$checks" ] || [ "$checks" = null ]; then
|
|
|
121
121
|
checks=tools
|
|
122
122
|
fi
|
|
123
123
|
|
|
124
|
-
reason="Refused: the epic is over — every task of it is merged or handed over by a request, and this call takes new work. The end of an epic is a stop: print the table by «npm run epic:table» (or «node $checks/epic-table.mjs»), tell the owner what was done on each task and what confirms it, and say outright that the session waits for their orders. New work is taken by their word, not by the count of what is left: their message or their answer to a menu that names the number of this work releases the call."
|
|
124
|
+
reason="Refused: the epic is over — every task of it is merged or handed over by a request, and this call takes new work. The end of an epic is a stop: print the table by «npm run epic:table» (or «node $checks/epic-table.mjs»), tell the owner what was done on each task and what confirms it, and say outright that the session waits for their orders. New work is taken by their word, not by the count of what is left: their message or their answer to a menu that names the number of this work releases the call. A new epic the owner has declared needs the bypass line in the calls that create its card, its tasks and its branch; once the branch of the new epic is taken, the guard reads that epic and stops refusing."
|
|
125
125
|
|
|
126
126
|
# shellcheck disable=SC1090
|
|
127
127
|
[ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" ] \
|
|
@@ -36,6 +36,19 @@ rt_epic_branch() {
|
|
|
36
36
|
printf '%s' "$_found"
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
# Whether the epic is already merged into the main branch: a merge commit of the remote main branch
|
|
40
|
+
# names it by the key and the number (`RT-12`) — in the branch name of a merge of the host or in the
|
|
41
|
+
# title of the request. The number is matched whole, so `RT-1` does not match `RT-12`. Success — the
|
|
42
|
+
# epic is merged. No remote main branch, or no such commit, is not merged: the refusal that follows
|
|
43
|
+
# is the former one.
|
|
44
|
+
rt_epic_is_merged() {
|
|
45
|
+
_num="$1"
|
|
46
|
+
[ -n "$_num" ] || return 1
|
|
47
|
+
git rev-parse --verify --quiet "origin/${main_branch}" >/dev/null 2>&1 || return 1
|
|
48
|
+
[ -n "$(git log "origin/${main_branch}" --merges -n 1 -E \
|
|
49
|
+
--grep="(^|[^0-9A-Za-z])[A-Za-z]+-${_num}([^0-9]|\$)" --format=%H 2>/dev/null)" ]
|
|
50
|
+
}
|
|
51
|
+
|
|
39
52
|
# The base of a new task branch against the branch of its epic.
|
|
40
53
|
#
|
|
41
54
|
# The task branch is taken from the branch of the epic, and a branch taken from the main one leaves
|
|
@@ -58,6 +71,14 @@ rt_epic_base() {
|
|
|
58
71
|
_epic_branch="$(rt_epic_branch "$_epic")"
|
|
59
72
|
case "$_epic_branch" in
|
|
60
73
|
'')
|
|
74
|
+
# An epic that is already merged has no branch in the remote: the host deletes it on the
|
|
75
|
+
# merge, and a task left behind in it would be demanded a base nobody has — then a push
|
|
76
|
+
# recreates the branch with a merge nobody reviews. The merge of the epic is recognised
|
|
77
|
+
# by a merge commit of the main branch that names the epic; the task then grows from
|
|
78
|
+
# the main branch.
|
|
79
|
+
if rt_epic_is_merged "$_epic"; then
|
|
80
|
+
return 0
|
|
81
|
+
fi
|
|
61
82
|
fault "the task belongs to the epic #${_epic}, and no branch of that epic is in the remote. The branch of the epic is taken before the first of its tasks and sent at once — a branch that exists only on one machine is a base nobody else has."
|
|
62
83
|
return 0
|
|
63
84
|
;;
|
|
@@ -21,7 +21,18 @@ input="$RT_HOOK_INPUT"
|
|
|
21
21
|
sid="$(printf '%s' "$input" | jq -r '.session_id // empty' 2>/dev/null)"
|
|
22
22
|
[ -z "$sid" ] && exit 0
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
record="${TMPDIR:-/tmp}/claude-skill-gate/${sid}.loaded"
|
|
25
|
+
|
|
26
|
+
# The names the session had loaded are read before the record is removed. The gate asks for one rule
|
|
27
|
+
# per refusal, and a session that does not know which rules it had loaded meets them one refusal at
|
|
28
|
+
# a time: one edit after a compaction went through six refusals in a row. An empty or missing record
|
|
29
|
+
# gives no names, and the line stays as it was.
|
|
30
|
+
loaded=""
|
|
31
|
+
if [ -s "$record" ]; then
|
|
32
|
+
loaded="$(awk 'NF && !seen[$0]++ { printf "%s%s", (n++ ? ", " : ""), $0 }' "$record" 2>/dev/null)"
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
rm -f "$record" 2>/dev/null
|
|
25
36
|
|
|
26
37
|
# The re-arming is told to the session in words.
|
|
27
38
|
#
|
|
@@ -29,6 +40,11 @@ rm -f "${TMPDIR:-/tmp}/claude-skill-gate/${sid}.loaded" 2>/dev/null
|
|
|
29
40
|
# the gate answers that they were not — and the session spends a turn finding out which of the two
|
|
30
41
|
# is right. A turn was spent that way four times in one session. The line removes the contradiction:
|
|
31
42
|
# the rule text is no longer in the context, which is why it is asked for again.
|
|
32
|
-
|
|
43
|
+
context="The rules gate is armed anew: the compaction carried the text of the rules themselves out of the session, and every area will ask for its rule once more. The former loading does not count — load the rule and work on."
|
|
44
|
+
if [ -n "$loaded" ]; then
|
|
45
|
+
context="${context} Loaded before the compaction: ${loaded}. Load in one turn every one of them that the current stage touches, before the first edit."
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
jq -n --arg c "$context" '{hookSpecificOutput:{hookEventName:"SessionStart",additionalContext:$c}}' 2>/dev/null
|
|
33
49
|
|
|
34
50
|
exit 0
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# rt-hook: PreToolUse Edit|Write|MultiEdit|Bash|mcp__webstorm__create_new_file|mcp__webstorm__execute_terminal_command|mcp__webstorm__execute_tool|mcp__claude-in-chrome__
|
|
2
|
+
# rt-hook: PreToolUse Edit|Write|MultiEdit|Bash|mcp__webstorm__create_new_file|mcp__webstorm__execute_terminal_command|mcp__webstorm__execute_tool|mcp__claude-in-chrome__.*|mcp__figma__use_figma
|
|
3
3
|
# Requires: hooks/deny-tail.sh
|
|
4
4
|
# The rules gate: it does not let a file be edited until the rule it falls under has been loaded.
|
|
5
5
|
#
|
|
@@ -25,9 +25,10 @@
|
|
|
25
25
|
# override is loaded second and may call the default back — `skill_for_default`. There is neither
|
|
26
26
|
# — the gate passes everything: an empty gate is better than a gate that refuses at random.
|
|
27
27
|
#
|
|
28
|
-
# The call kind is `edit`, `bash` or `
|
|
29
|
-
# is needed not for a file edit but for a tool: what lies there is not
|
|
30
|
-
# the coordinates.
|
|
28
|
+
# The call kind is `edit`, `bash`, `browser` or `design`. Browser verification and the design tool
|
|
29
|
+
# are the areas where a rule is needed not for a file edit but for a tool: what lies there is not
|
|
30
|
+
# the files but the stand and the coordinates, or the sheet of mockups. A rule the tree lacks is not
|
|
31
|
+
# demanded, so the design kind costs a tree without mockups nothing.
|
|
31
32
|
#
|
|
32
33
|
# FAIL-OPEN: any error and any unrecognised path let the edit through (exit 0). A broken gate has
|
|
33
34
|
# no right to stop the work altogether.
|
|
@@ -137,6 +138,10 @@ EOF
|
|
|
137
138
|
req="$(skill_for browser "$tool" "" 2>/dev/null)"
|
|
138
139
|
kind="browser"
|
|
139
140
|
;;
|
|
141
|
+
mcp__figma__use_figma)
|
|
142
|
+
req="$(skill_for design "$tool" "" 2>/dev/null)"
|
|
143
|
+
kind="design"
|
|
144
|
+
;;
|
|
140
145
|
*) exit 0 ;;
|
|
141
146
|
esac
|
|
142
147
|
|
|
@@ -214,7 +219,7 @@ fi
|
|
|
214
219
|
# itself. The rule whole stays the second move — for whoever finds the article not enough.
|
|
215
220
|
# shellcheck disable=SC1090
|
|
216
221
|
[ -f "$rt_hooks_dir/rule-article.sh" ] && . "$rt_hooks_dir/rule-article.sh" 2>/dev/null
|
|
217
|
-
if [ "$kind" != "command" ] && [ "$kind" != "browser" ] && command -v rt_rule_article_heads >/dev/null 2>&1; then
|
|
222
|
+
if [ "$kind" != "command" ] && [ "$kind" != "browser" ] && [ "$kind" != "design" ] && command -v rt_rule_article_heads >/dev/null 2>&1; then
|
|
218
223
|
article="$(rt_rule_article_heads "$root/$rules_dir/${req}/SKILL.md" "$target" 2>/dev/null)"
|
|
219
224
|
if [ -n "$article" ]; then
|
|
220
225
|
reason="Refused by the rules gate. This edit falls under the articles of the rule «${req}»:
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Law on mockups
|
|
2
|
+
|
|
3
|
+
What the owner sees before the code is written. The owner reads a screen by its picture, and a
|
|
4
|
+
picture that does not match the screen makes every detail of the code read as broken layout.
|
|
5
|
+
|
|
6
|
+
**Revision:** 2026-10-15
|
|
7
|
+
|
|
8
|
+
## Articles
|
|
9
|
+
|
|
10
|
+
- **An approved mockup is the source of truth for how a screen looks.** Where mockups exist, a
|
|
11
|
+
change of the look starts with a change of the mockup. The changed mockup is shown to the owner,
|
|
12
|
+
and the code is written only after their approval. An agreement in words does not replace the
|
|
13
|
+
mockup: the owner reads the screen by the picture. A detail the code adds past the mockup reads to
|
|
14
|
+
the owner as broken layout, however correct the text behind it.
|
|
15
|
+
- **Mockups are kept in step with the screens they draw.** A mockup that lags behind the code no
|
|
16
|
+
longer says what is right, and the next change is checked against a wrong picture. A finding along
|
|
17
|
+
the way that changes the look goes to the mockup first, and only then into the code.
|
|
18
|
+
- **A mockup makes a layout claim, and the claim is measured.** A frame is checked by numbers, the
|
|
19
|
+
way a page is: what the eye misses on a screenshot — buttons of one row off one line, frames
|
|
20
|
+
overlapping on the sheet — is read from the node coordinates before the owner sees the frames.
|
|
21
|
+
- **A mockup of behaviour the product already has starts from the description of that behaviour.**
|
|
22
|
+
A screen on a sheet looks like work without code, but how a payment is taken or which fields a
|
|
23
|
+
form holds is already written down and carried out. The description is read before the first
|
|
24
|
+
frame.
|
|
25
|
+
|
|
26
|
+
## Open questions
|
|
27
|
+
|
|
28
|
+
None.
|
|
@@ -147,7 +147,7 @@ GIT_COMMITTER_NAME="<бот>" GIT_COMMITTER_EMAIL="<почта бота>" \
|
|
|
147
147
|
|
|
148
148
|
The subject — `type(scope): description`. Types: `feat`, `fix`, `refactor`, `docs`, `style`,
|
|
149
149
|
`test`, `chore`, `perf`. Scopes are the tree's own, listed in `implementation.md`. A full stop
|
|
150
|
-
at the end of the subject is not accepted.
|
|
150
|
+
at the end of the subject is not accepted. The letter case is checked as well, by the `subject-case` rule of the commit check: a word in capitals, such as a file name, can trip it, so the allowed case is read in the commit check settings before the subject is written.
|
|
151
151
|
|
|
152
152
|
The line `AB#<номер>` in the commit body attaches it to the work item. It does not replace the
|
|
153
153
|
attachment of the PR itself: the commit is linked to the item, and the work queue reads the PR's
|
|
@@ -162,6 +162,10 @@ is mandatory:
|
|
|
162
162
|
Docs-skip: правка только в тестах хука, зеркала у него нет
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
+
The guard looks for the `Docs-skip` line in the command text only. A message read from a file by
|
|
166
|
+
`git commit -F <file>` is invisible to it and the commit is refused; the body goes inside the command,
|
|
167
|
+
as in `git commit -F -` with the text after it.
|
|
168
|
+
|
|
165
169
|
## Common misses
|
|
166
170
|
|
|
167
171
|
- **An audit right after adding answers "no" when the card already stands.** The work queue gives
|
|
@@ -204,7 +204,7 @@ GIT_COMMITTER_NAME="<бот>" GIT_COMMITTER_EMAIL="<номер>+<бот>@users.n
|
|
|
204
204
|
|
|
205
205
|
The subject — `type(scope): description`. Types: `feat`, `fix`, `refactor`, `docs`, `style`,
|
|
206
206
|
`test`, `chore`, `perf`. Scopes: `site`, `admin`, `api`, `common`, `proto`, `deploy`. A full stop
|
|
207
|
-
at the end of the subject is not accepted; the length — up to 150 characters.
|
|
207
|
+
at the end of the subject is not accepted; the length — up to 150 characters. The letter case is checked as well, by the `subject-case` rule of the commit check: a word in capitals, such as a file name, can trip it, so the allowed case is read in the commit check settings before the subject is written.
|
|
208
208
|
|
|
209
209
|
```
|
|
210
210
|
feat(<область>): availability calendar with season prices
|
|
@@ -235,6 +235,10 @@ is mandatory:
|
|
|
235
235
|
Docs-skip: правка только в тестах хука, зеркала у него нет
|
|
236
236
|
```
|
|
237
237
|
|
|
238
|
+
The guard looks for the `Docs-skip` line in the command text only. A message read from a file by
|
|
239
|
+
`git commit -F <file>` is invisible to it and the commit is refused; the body goes inside the command,
|
|
240
|
+
as in `git commit -F -` with the text after it.
|
|
241
|
+
|
|
238
242
|
## Common misses
|
|
239
243
|
|
|
240
244
|
- **An amend goes through the same hooks as a commit.** The flag that skips the commit hooks is not
|
|
@@ -149,7 +149,7 @@ GIT_COMMITTER_NAME="<бот>" GIT_COMMITTER_EMAIL="<почта бота>" \
|
|
|
149
149
|
|
|
150
150
|
The subject — `type(scope): description`. Types: `feat`, `fix`, `refactor`, `docs`, `style`,
|
|
151
151
|
`test`, `chore`, `perf`. Scopes are the tree's own, listed in `implementation.md`. A full stop
|
|
152
|
-
at the end of the subject is not accepted.
|
|
152
|
+
at the end of the subject is not accepted. The letter case is checked as well, by the `subject-case` rule of the commit check: a word in capitals, such as a file name, can trip it, so the allowed case is read in the commit check settings before the subject is written.
|
|
153
153
|
|
|
154
154
|
```
|
|
155
155
|
feat(site): availability calendar with season prices
|
|
@@ -166,6 +166,10 @@ is mandatory:
|
|
|
166
166
|
Docs-skip: правка только в тестах хука, зеркала у него нет
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
+
The guard looks for the `Docs-skip` line in the command text only. A message read from a file by
|
|
170
|
+
`git commit -F <file>` is invisible to it and the commit is refused; the body goes inside the command,
|
|
171
|
+
as in `git commit -F -` with the text after it.
|
|
172
|
+
|
|
169
173
|
## Common misses
|
|
170
174
|
|
|
171
175
|
- **An audit right after adding answers "no" when the card already stands.** The work queue gives
|
|
@@ -113,6 +113,18 @@ npm run check:docs && npm run check:specs && npm run check:dupes && npm run chec
|
|
|
113
113
|
bash .claude/hooks/tests/run.sh # if the conflict touched the hooks
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
+
A merge without conflicts is not exempt: two branches can declare the same value apart, and the
|
|
117
|
+
merge joins them silently — the duplicate check turns red only at the push. After every merge of the
|
|
118
|
+
base, a conflict-free one included, the duplicate and the styles checks run (`npm run check:dupes`
|
|
119
|
+
and `npm run check:styles`), and the value moves to its one shared place; no line goes into the
|
|
120
|
+
known list.
|
|
121
|
+
|
|
122
|
+
**After a merge of the base, the migrations it brought are read.** Those that set the rights of a
|
|
123
|
+
role are opened. A branch migration that writes a role's full set of rights drops any right the base
|
|
124
|
+
added meanwhile; git sees two different files and marks no conflict, and the fall shows later as a
|
|
125
|
+
failing test on the count of rights, easy to take for a test error. The lost right returns by a new
|
|
126
|
+
migration of the branch.
|
|
127
|
+
|
|
116
128
|
The merge commit is signed by the bot the same way as any other — pattern
|
|
117
129
|
`git-workflow-commit`. After the push the state is read from the PR itself, not from one's own
|
|
118
130
|
tree — more on this in pattern `git-workflow-pr`:
|
|
@@ -79,6 +79,8 @@ AZURE_DEVOPS_EXT_PAT="$TOKEN" az repos pr create \
|
|
|
79
79
|
--description 'Закрывает рабочий элемент 86.'
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
+
Before the target branch is named, its presence on the host is checked: `git ls-remote --heads origin <ветка>`. An empty answer means the base was merged and removed; the request then takes the next branch up the chain as its base.
|
|
83
|
+
|
|
82
84
|
The reviewer is always the owner: without a review request the PR does not show in their queue.
|
|
83
85
|
One PR closes the work item whole — half a task is not rolled out by one PR: a task has one
|
|
84
86
|
branch, and work that does not fit it is split into tasks before the branch is created.
|
|
@@ -81,6 +81,10 @@ the repository's default branch: the request then carries the task past the epic
|
|
|
81
81
|
branch stays a copy nobody merges. The epic's own request is the only one based on the main branch,
|
|
82
82
|
and it opens when the last folder of its tasks is taken apart.
|
|
83
83
|
|
|
84
|
+
Before `gh pr create --base <ветка>` the base is checked on the host by `git ls-remote --heads origin
|
|
85
|
+
<ветка>`. An empty answer means the base was merged and removed: the request then takes the next
|
|
86
|
+
branch up the chain as its base, not the removed one.
|
|
87
|
+
|
|
84
88
|
Everything waiting for a pipeline run, a rework or an answer goes as a draft, and the question is
|
|
85
89
|
asked in the PR itself: a person reads the PR, not the session's conversation.
|
|
86
90
|
|
|
@@ -82,6 +82,8 @@ GITLAB_TOKEN="$TOKEN" glab mr create \
|
|
|
82
82
|
…'
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
Before the target branch is named, its presence on the host is checked: `git ls-remote --heads origin <ветка>`. An empty answer means the base was merged and removed; the request then takes the next branch up the chain as its base.
|
|
86
|
+
|
|
85
87
|
The reviewer is always the owner: without a review request the MR does not show in their queue.
|
|
86
88
|
The assignee is the same account the machine work goes from. Labels are read from the task, not
|
|
87
89
|
picked from memory:
|
|
@@ -94,3 +94,7 @@ rename or removal.
|
|
|
94
94
|
- **A lib nobody imports is checked by nothing.** `nx lint` and `nx test` check the lib itself,
|
|
95
95
|
not its contract with the consumer. The first importer is the first check: the models layer is
|
|
96
96
|
accepted after `nx build` and a live run of the scenario, not by a green `lint test`.
|
|
97
|
+
- **A lib's own `sourceTag` is written as a string literal.** The layout check finds the
|
|
98
|
+
description of a lib by the text `sourceTag: '<tag>'`, not by evaluating the module. A tag taken
|
|
99
|
+
from a constant passes the lint and is reported as "described in no file". Constants are for the
|
|
100
|
+
tags in `onlyDependOnLibsWithTags` only.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mockups-measure
|
|
3
|
+
kind: pattern
|
|
4
|
+
rule: mockups
|
|
5
|
+
description: Pattern of rule mockups. Load before the frames of a mockup are shown to the owner — reading the bounds of the sheet's frames and of the buttons inside them in one call, overlapping pairs and the distinct tops of a row. Not for checking a running page — that is the rule browser-verification.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Measuring a mockup
|
|
9
|
+
|
|
10
|
+
Pattern of the rule `mockups`. What must be true — the law `docs/constitution/mockups.md`.
|
|
11
|
+
|
|
12
|
+
## When to use
|
|
13
|
+
|
|
14
|
+
- The frames of a sheet are about to be shown to the owner.
|
|
15
|
+
- A row of cards, a toolbar or a form is drawn at a width other than the desktop one.
|
|
16
|
+
|
|
17
|
+
## A mockup is measured by node coordinates
|
|
18
|
+
|
|
19
|
+
A frame in a design tool makes a layout claim, just like a page. A look at its screenshot misses the
|
|
20
|
+
same things: the buttons of a card row are off one line, or frames on the sheet overlap. Before the
|
|
21
|
+
frames are shown to the owner, one call reads the bounds of the sheet's top-level frames and of the
|
|
22
|
+
buttons inside them. It prints the overlapping pairs and each row's distinct button tops. Two
|
|
23
|
+
values in one row are the defect.
|
|
24
|
+
|
|
25
|
+
## Common misses
|
|
26
|
+
|
|
27
|
+
- **At the tablet width the buttons of a card row stood at different heights, and frames on the
|
|
28
|
+
sheet overlapped.** The owner found both; one call reading node bounds would have shown them.
|
|
@@ -222,3 +222,7 @@ statement.
|
|
|
222
222
|
author sees their edit, not what the subject will grow into: a domain created along the way
|
|
223
223
|
turns out a month later to be half of its neighbour, and parting them means parting the scenario
|
|
224
224
|
numbers too.
|
|
225
|
+
- **A changed or removed scenario is edited in the live spec, not restated in `proposed/`.** The
|
|
226
|
+
spec audit refuses a second heading with a taken number. A changed promise or a removed
|
|
227
|
+
scenario goes into the domain's `scenarios.md` by the commit that changes the code and the test
|
|
228
|
+
title; the agreement names such scenarios by number in prose.
|
|
@@ -54,7 +54,7 @@ pick.
|
|
|
54
54
|
|
|
55
55
|
| File | Where |
|
|
56
56
|
| --- | --- |
|
|
57
|
-
| `grill.md` | to `docs/archive/` — the owner's answers cannot be recovered, and this is the only record of why the task was set this way |
|
|
57
|
+
| `grill.md` | to `docs/archive/` in the owner's language — the owner's answers cannot be recovered, and this is the only record of why the task was set this way. A grill in the layer's language is rewritten at the move; the quoted request stays verbatim |
|
|
58
58
|
| `progress.md` | to `docs/archive/` if it holds decisions along the way with reasons; otherwise deleted |
|
|
59
59
|
| `plan.md` | deleted — after the rollout its question is answered by the code, and "how it works" by the domain spec |
|
|
60
60
|
| review findings | written straight next to the epic plan — they do not move from here; work outside an epic shows them to the owner in the same turn |
|
|
@@ -262,6 +262,9 @@ indistinguishable from a sent one.
|
|
|
262
262
|
apart, and the owner's words are written only there, with nowhere to recover them from. So the
|
|
263
263
|
guard demands that the branch add a record to the archive. What exactly was moved it does not
|
|
264
264
|
check — the owner looks at that in review.
|
|
265
|
+
- **The folder of a task created after the work enters by a commit of its own.** The next commit
|
|
266
|
+
takes it apart. A folder assembled and removed between two commits leaves no trace: the owner may
|
|
267
|
+
merge the PR in that minute, and the grill is gone.
|
|
265
268
|
- **The closing steps are not agreed with the owner — they are listed here.** The rules review of
|
|
266
269
|
the work is part of closing, as are merging the agreement and taking the folder apart. The owner
|
|
267
270
|
decides not whether to launch it but what to do with the findings. A turn that ended with such a
|
|
@@ -144,6 +144,12 @@ A stage revision — to the same place, not by editing the plan:
|
|
|
144
144
|
прежний этап в замысле оставлен видимым.
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
+
A new request of the owner inside the same task goes into the grill, not only into the progress.
|
|
148
|
+
The grill leaves for the archive, the progress only when it holds decisions. The request is quoted
|
|
149
|
+
verbatim under "The owner request"; under "Decisions" goes the answer, or the line "closed by
|
|
150
|
+
assumption: <what is taken>" when the question was not put. Otherwise the archive keeps the first
|
|
151
|
+
answer while the code carries the second.
|
|
152
|
+
|
|
147
153
|
The session entry marks what was done and what confirms it:
|
|
148
154
|
|
|
149
155
|
```markdown
|
|
@@ -40,9 +40,7 @@ is found is written into the tree in the same turn — into the epic plan if it
|
|
|
40
40
|
progress if it concerns one.
|
|
41
41
|
|
|
42
42
|
Exploration that found nothing is no permission to ask: the epic plan, the archive and past sessions
|
|
43
|
-
are reached first, and the question names where the search went.
|
|
44
|
-
|
|
45
|
-
Exploration ends with command output, not with a feeling: the root memo, `ls` of the directory at
|
|
43
|
+
are reached first, and the question names where the search went. Exploration ends with command output, not with a feeling: the root memo, `ls` of the directory at
|
|
46
44
|
hand, a search over the documentation and the rules.
|
|
47
45
|
|
|
48
46
|
A member added beside a list, not into it, is named at every reader of that list: each place that
|
|
@@ -58,6 +56,10 @@ before questions about techniques: one folder generalised into a map leaves out
|
|
|
58
56
|
|
|
59
57
|
What was inferred is marked right in the list, together with what confirms it.
|
|
60
58
|
|
|
59
|
+
Removing an identifier that lives outside the code starts with a search for its value: a client of
|
|
60
|
+
the authorization server, a key, an environment variable — over the code, the environment samples
|
|
61
|
+
and the composition files. The plan names what uses the identifier now, not what it was created for.
|
|
62
|
+
|
|
61
63
|
**A ready-made module of the same kind is looked for before the first question** — in this tree and
|
|
62
64
|
in the trees recorded as samples of its layout. The one found is read whole: it closes the questions
|
|
63
65
|
about the structure — the source of the numbers, the rows, the screen, the storage.
|
|
@@ -86,10 +88,9 @@ All six questions are closed, and those the exploration did not answer are asked
|
|
|
86
88
|
|
|
87
89
|
The list of six is the set of what is closed by the start of work, not a set of lines to be said. A
|
|
88
90
|
question the owner has already answered is marked closed together with what closed it: the answer is
|
|
89
|
-
sought in the documentation and in
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
obvious costs a session.
|
|
91
|
+
sought in the documentation and in this session, the original request included. An obvious answer
|
|
92
|
+
closes by the line "question closed by assumption: <what is taken>": a wrong assumption costs an
|
|
93
|
+
edit, a question about the obvious costs a session.
|
|
93
94
|
|
|
94
95
|
**Two answers «recommended» in a row close the remaining questions by assumption.** An owner who took
|
|
95
96
|
the recommended option twice running has shown that the decisions are not theirs. From the second
|
|
@@ -117,12 +118,9 @@ The message with which the executor stops begins with what they wait for:
|
|
|
117
118
|
<Вопрос>
|
|
118
119
|
```
|
|
119
120
|
|
|
120
|
-
Under the question goes the table of the epic's position — the same as in the handover
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
Measurements, role findings and the list of decisions are by then written in the progress and are
|
|
125
|
-
superfluous in the message: a report with a question at its end drowns the question.
|
|
121
|
+
Under the question goes the table of the epic's position — the same as in the handover; work outside
|
|
122
|
+
an epic carries no table. Measurements, role findings and the list of decisions are already in the
|
|
123
|
+
progress and are left out of the message: a report with a question at its end drowns the question.
|
|
126
124
|
|
|
127
125
|
The answers are written into `docs/tasks/_draft-<slug>/grill.md` — the folder is still a draft,
|
|
128
126
|
there is no number.
|
|
@@ -132,6 +130,10 @@ mkdir -p docs/tasks/_draft-<slug>
|
|
|
132
130
|
cp docs/tasks/_template/grill.md docs/tasks/_draft-<slug>/grill.md
|
|
133
131
|
```
|
|
134
132
|
|
|
133
|
+
An answer chosen from a menu is written with the options it was chosen from: the label alone does
|
|
134
|
+
not show whether the owner took a ready option or wrote their own. A task that stands only on a
|
|
135
|
+
chosen option says so in its body.
|
|
136
|
+
|
|
135
137
|
**Next move:** the owner's answer is appended to the grill, and the next question follows. The
|
|
136
138
|
answers are over — in the same turn the work goes into the roles pipeline.
|
|
137
139
|
|
|
@@ -151,7 +153,9 @@ The agreement that came out of the pipeline is checked against `grill.md` line b
|
|
|
151
153
|
by it. The role writes the text without seeing the owner and can turn their answer into its
|
|
152
154
|
opposite: the order of stages came out reversed, and included items moved to "not included". A
|
|
153
155
|
critic's finding that diverges from the owner's answer is carried to the owner, not carried out in
|
|
154
|
-
silence.
|
|
156
|
+
silence. The same check holds for the executor's own decision on an open question of the agreement:
|
|
157
|
+
it is compared with the grill before it goes to the writer — an open question lists the owner's
|
|
158
|
+
answer among its variants without a mark, and is decided anew.
|
|
155
159
|
|
|
156
160
|
The turn does not end on this boundary. A closed grill looks like a finished piece — the answers are
|
|
157
161
|
on disk, the file is committed, there is something to report — and the report takes the place of the
|
|
@@ -182,9 +186,9 @@ an order is no order: two tasks whose order rested on understanding went into wo
|
|
|
182
186
|
round, and the second was redone under the first. The assigned order holds to the end of the epic; a
|
|
183
187
|
revision is the owner's decision.
|
|
184
188
|
|
|
185
|
-
The cards
|
|
186
|
-
every row of the makeup. The issued numbers return to the same table
|
|
187
|
-
|
|
189
|
+
The cards for all the tasks are created at once, right here — by the same call with `--epic-of`, for
|
|
190
|
+
every row of the makeup. The issued numbers return to the same table: "take the next" answers with a
|
|
191
|
+
number from now on.
|
|
188
192
|
|
|
189
193
|
**Next move:** the declared epic is committed together with the task numbers, and in the same turn
|
|
190
194
|
its branch is taken.
|
|
@@ -202,7 +206,7 @@ The plan of the epic is committed into it and the branch is pushed at once — t
|
|
|
202
206
|
tasks are taken from it, and one that exists only on the machine is a base nobody else has. The card
|
|
203
207
|
names the branch: the reader comes to the epic from the queue, and the queue holds no branches.
|
|
204
208
|
|
|
205
|
-
Nothing else is committed into the epic branch: it carries the plan and the merges of the tasks
|
|
209
|
+
Nothing else is committed into the epic branch: it carries the plan and the merges of the tasks; an
|
|
206
210
|
edit made in it directly reaches the main branch unreviewed.
|
|
207
211
|
|
|
208
212
|
**Next move:** the first task of the epic is taken — the branch of the task from the branch of the
|
|
@@ -229,10 +233,9 @@ call with `--outside-epic '<слово владельца>'` — a refusal witho
|
|
|
229
233
|
branch is created by a second call: a compound "create and commit at once" is refused by the
|
|
230
234
|
main-branch guard whole.
|
|
231
235
|
|
|
232
|
-
The number is already issued — there is no draft
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
comes first" does not apply here — it is about not creating the task before the grill.
|
|
236
|
+
The number is already issued — there is no draft: the folder opens straight under the branch name.
|
|
237
|
+
Half of all work starts this way (a past session, a noticed defect, a neighbouring task). The pitfall
|
|
238
|
+
"the number never comes first" does not apply: it is about not creating the task before the grill.
|
|
236
239
|
|
|
237
240
|
The other two files are written, not laid down as templates for later: an empty `plan.md` cannot be
|
|
238
241
|
told from a plan without stages, and the next session trusts the task folder. The template is opened
|
|
@@ -297,14 +300,11 @@ state line is rewritten to `этап-идёт`, and from there the work is led b
|
|
|
297
300
|
- **Stage:** 1 из 3 — <название первого этапа из замысла>
|
|
298
301
|
```
|
|
299
302
|
|
|
300
|
-
The turn does not end on this boundary. A written plan looks like a finished piece
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
Four things end a turn, and they are the same as for the other states: the window fill limit, a
|
|
306
|
-
guard's refusal, a question to the owner and handed-in work with the next begun. A pattern read to
|
|
307
|
-
the end is not among them — the text ended, the work did not.
|
|
303
|
+
The turn does not end on this boundary. A written plan looks like a finished piece — the file is
|
|
304
|
+
committed, there is something to report — and the report takes the place of the work: a session
|
|
305
|
+
ended with "next step — such-and-such" at a window fill of about two percent. A turn ends by the
|
|
306
|
+
window fill limit, a guard's refusal, a question to the owner or handed-in work with the next
|
|
307
|
+
begun; a pattern read to the end is not among them.
|
|
308
308
|
|
|
309
309
|
**Next move:** the first stage is done in the same turn, and it is declared closed after its command
|
|
310
310
|
from the "Checked by" line has passed.
|
|
@@ -134,6 +134,10 @@ comes from the template and is drawn before the request answers. A check or a fr
|
|
|
134
134
|
it reads an empty grid. The wait names a node that exists only with data: a row, a booking, a
|
|
135
135
|
selected record.
|
|
136
136
|
|
|
137
|
+
After a change of the window width, layout values come from different sources at different
|
|
138
|
+
moments: a media query applies at once, a breakpoint signal on the next frame. The test awaits by
|
|
139
|
+
polling the very value it measures; a wait for one value proves nothing about another.
|
|
140
|
+
|
|
137
141
|
## Common misses
|
|
138
142
|
|
|
139
143
|
- **A search on the stand matches by substring, and older seeds stay.** `editor@example.com` also
|
|
@@ -158,7 +162,17 @@ selected record.
|
|
|
158
162
|
- **Not only what the screen requests is substituted, but also what the header requests.** The
|
|
159
163
|
unread counter is requested on every screen under the header. Without a substitution the real
|
|
160
164
|
server answers that request, refuses the fake sign-in, the interceptor drops the session, and
|
|
161
|
-
fifty-nine tests fail on the vanished header — it looks like a screen defect.
|
|
165
|
+
fifty-nine tests fail on the vanished header — it looks like a screen defect. The same holds for a
|
|
166
|
+
call the task itself adds to a screen: the list of substituted calls is read against the calls
|
|
167
|
+
the screen makes after the edit, and the new one is substituted in every end-to-end test of that
|
|
168
|
+
screen. Unsubstituted, it goes to the real server, which refuses the fake sign-in; the screen
|
|
169
|
+
turns into the sign-in form, and the test fails by its time limit with no visible cause.
|
|
170
|
+
- **A default that matches the first option proves nothing.** A form that opens with a value taken
|
|
171
|
+
from context, such as the record of the card it was opened from, is checked with that value
|
|
172
|
+
standing anywhere but first in the substituted list. A form that ignored the context and took the
|
|
173
|
+
first option shows the same value, and the test stays green on the very defect it was written to
|
|
174
|
+
catch. A comment saying the test tells the two apart does not make it so; the order of the
|
|
175
|
+
substitution does.
|
|
162
176
|
- **State that lives only during an operation is not checked by a test.** The upload list under the
|
|
163
177
|
button is visible while the files are in flight: on substituted answers they land before the test
|
|
164
178
|
manages to read it, and the test turns red every other run. What is checked is either the final
|
|
@@ -98,3 +98,6 @@ environment either — that is `Q-FA-1` in the law.
|
|
|
98
98
|
draws the frame of an icon it did not find and says nothing. The build, the lint and the tests
|
|
99
99
|
stay green, and the owner sees an empty square. Before the edit the name is looked up among the
|
|
100
100
|
kit icon files: some names carry the `ico-` prefix and most do not.
|
|
101
|
+
- **A component that grew past the file limit is split, not squeezed.** An edit of a component does
|
|
102
|
+
not load the rule of plain TypeScript files, where the 500-line article lives, so it is repeated
|
|
103
|
+
in one line here: what the component does on its own moves out into a file next to it.
|
|
@@ -98,6 +98,10 @@ flowchart TD
|
|
|
98
98
|
- **The migration chain is run from an empty storage before the merge.** The apply order is
|
|
99
99
|
lexicographic by directory name, and the timestamp is set at creation: a migration from a branch
|
|
100
100
|
started earlier lands before the one it depends on.
|
|
101
|
+
- **A migration without a reverse is merged only after a copy of the production storage, and the PR
|
|
102
|
+
body names the copy.** Rolling back the image does not bring a dropped column or table back. When
|
|
103
|
+
the executor cannot reach the server, the owner is told which step is blocked and what opens it:
|
|
104
|
+
the owner's word replaces a check only when the owner was told the check did not run.
|
|
101
105
|
- **The divergence of migrations from the schema is measured on a shadow storage, not on the one
|
|
102
106
|
the pusher works with.** That one lawfully carries the trace of any unfinished branch, and a
|
|
103
107
|
check against it would hold up someone else's edit. The gate and the rollout call one and the
|
|
@@ -157,6 +157,10 @@ flowchart TD
|
|
|
157
157
|
- **The migration chain is run from an empty storage before the merge.** The apply order is
|
|
158
158
|
lexicographic by directory name, and the timestamp is set at creation: a migration from a branch
|
|
159
159
|
started earlier lands before the one it depends on.
|
|
160
|
+
- **A migration without a reverse is merged only after a copy of the production storage, and the PR
|
|
161
|
+
body names the copy.** Rolling back the image does not bring a dropped column or table back. When
|
|
162
|
+
the executor cannot reach the server, the owner is told which step is blocked and what opens it:
|
|
163
|
+
the owner's word replaces a check only when the owner was told the check did not run.
|
|
160
164
|
- **The divergence of migrations from the schema is measured on a shadow storage, not on the one
|
|
161
165
|
the pusher works with.** That one lawfully carries the trace of any unfinished branch, and a
|
|
162
166
|
check against it would hold up someone else's edit. The gate and the rollout call one and the
|
|
@@ -100,6 +100,10 @@ flowchart TD
|
|
|
100
100
|
- **The migration chain is run from an empty storage before the merge.** The apply order is
|
|
101
101
|
lexicographic by directory name, and the timestamp is set at creation: a migration from a branch
|
|
102
102
|
started earlier lands before the one it depends on.
|
|
103
|
+
- **A migration without a reverse is merged only after a copy of the production storage, and the PR
|
|
104
|
+
body names the copy.** Rolling back the image does not bring a dropped column or table back. When
|
|
105
|
+
the executor cannot reach the server, the owner is told which step is blocked and what opens it:
|
|
106
|
+
the owner's word replaces a check only when the owner was told the check did not run.
|
|
103
107
|
- **The divergence of migrations from the schema is measured on a shadow storage, not on the one
|
|
104
108
|
the pusher works with.** That one lawfully carries the trace of any unfinished branch, and a
|
|
105
109
|
check against it would hold up someone else's edit. The gate and the rollout call one and the
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mockups
|
|
3
|
+
kind: rule
|
|
4
|
+
law: mockups
|
|
5
|
+
description: Rule under the mockups law. Load when a screen is drawn or changed in a design tool, before the first frame and before the mockups are shown to the owner. Names the kit copy, the spec read before drawing, the agreement checked against mockups. Pattern mockups-measure.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Mockups — how it works here
|
|
9
|
+
|
|
10
|
+
Rule under the law `docs/constitution/mockups.md`. The law says what the owner must see before
|
|
11
|
+
the code is written; here — what it is called in this tree, where it lives and what is not checked.
|
|
12
|
+
|
|
13
|
+
## What it is called here
|
|
14
|
+
|
|
15
|
+
| In the law | Here |
|
|
16
|
+
| ----------------------------------- | ---------------------------------------------------------------------------- |
|
|
17
|
+
| mockup | a frame on a sheet of the design tool |
|
|
18
|
+
| the screen the mockup draws | the page or panel in the application that carries the same name |
|
|
19
|
+
| the description of the behaviour | the domain spec in `docs/specs/<domain>/` |
|
|
20
|
+
| the agreement | the product agreement of the task, `docs/specs/<domain>/proposed/<feature>/` |
|
|
21
|
+
| approved | shown to the owner and accepted in their words |
|
|
22
|
+
|
|
23
|
+
## Where it lives
|
|
24
|
+
|
|
25
|
+
In this tree — the table in `implementation.md` next to it. Paths live there, not here: the rule
|
|
26
|
+
travels between repositories, the layout does not, and a path named in the rule lies in the
|
|
27
|
+
first tree that keeps its code differently.
|
|
28
|
+
|
|
29
|
+
## Flow
|
|
30
|
+
|
|
31
|
+
The flow of a mockup from the first frame to the code: what is read before drawing, what is
|
|
32
|
+
measured before showing, and what is checked before work starts by the agreement.
|
|
33
|
+
|
|
34
|
+
```mermaid
|
|
35
|
+
flowchart TD
|
|
36
|
+
A[A screen is to be drawn or changed] --> B{The behaviour already exists in the tree}
|
|
37
|
+
B -->|Yes| C[The spec of its domain is read before the first frame]
|
|
38
|
+
B -->|No| D[A sample is asked per screen]
|
|
39
|
+
C --> E{A component of the kit goes on the sheet}
|
|
40
|
+
D --> E
|
|
41
|
+
E -->|Yes| F[Its lines and spacing are checked against the kit styles in code]
|
|
42
|
+
E -->|No| G[The frames are drawn]
|
|
43
|
+
F --> G
|
|
44
|
+
G --> H[The coordinates of the frames are measured]
|
|
45
|
+
H --> I[The owner approves the mockups]
|
|
46
|
+
I --> J{The agreement has visual rules}
|
|
47
|
+
J -->|Yes| K[Each rule is found on the mockup of every width; a rule the mockups do not show goes to the owner]
|
|
48
|
+
J -->|No| L[The code is written]
|
|
49
|
+
K --> L
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## How the law applies here
|
|
53
|
+
|
|
54
|
+
- **A kit component on a design-tool sheet is a copy of the kit, and the copy drifts.** The source
|
|
55
|
+
of look is the kit's styles in code. Before a component from the sheet goes into a mockup, its
|
|
56
|
+
visible lines and spacing are checked against the kit's styles. A divergence is a question to the
|
|
57
|
+
owner, and the answer is fixed once in the copy.
|
|
58
|
+
- **A mockup of behaviour the tree already has starts with reading the spec of its domain.** A
|
|
59
|
+
screen in a design tool looks like work without code, so exploration stops at the sheet of earlier
|
|
60
|
+
mockups. How a payment is taken, what a window asks and which fields a form holds are already
|
|
61
|
+
described by the spec and carried out by code. The spec is read before the first frame, and the
|
|
62
|
+
sample question is asked per screen: one sheet named as the sample of the whole set leaves the
|
|
63
|
+
other screens without one.
|
|
64
|
+
- **The agreement is checked against the approved mockups before work by it.** Every visual rule of
|
|
65
|
+
the agreement is found on the mockup of each width. A rule the mockups do not show goes to the
|
|
66
|
+
owner as a question. Found after the code, it costs a code edit and an agreement edit together.
|
|
67
|
+
- **A mockup is measured by node coordinates before it is shown.** The technique is the pattern
|
|
68
|
+
`mockups-measure`.
|
|
69
|
+
- **A design-tool call asks the rules gate for this rule,** like the browser driver does for its
|
|
70
|
+
own: without that the measurement pattern stays unread for the whole mockup task.
|
|
71
|
+
|
|
72
|
+
## What of the law is not here
|
|
73
|
+
|
|
74
|
+
Nothing checks that a mockup matches the screen it draws or that the owner approved it: both live
|
|
75
|
+
outside the tree, in the design tool and in the owner's words. The checks above are held by reading.
|
|
76
|
+
|
|
77
|
+
## Patterns
|
|
78
|
+
|
|
79
|
+
- `mockups-measure` — reading the bounds of frames and buttons in one call and what the numbers
|
|
80
|
+
mean.
|
|
@@ -149,15 +149,12 @@ flowchart TD
|
|
|
149
149
|
justification under someone else's accepted decision reads as its appraisal. One exception:
|
|
150
150
|
execution stopped by an obstacle — then the obstacle is named.
|
|
151
151
|
- **The last run of the main branch is read first thing in a session and after every known
|
|
152
|
-
merge.** A red main branch
|
|
153
|
-
fixed before new work is taken.
|
|
152
|
+
merge.** A red main branch lives until the owner notices; a red run is fixed before new work is taken.
|
|
154
153
|
- **A session does not start work by itself.** The handover, the state from the startup hook and an
|
|
155
154
|
assigned epic say what to do, not whether to work: a start needs the owner's word in the same
|
|
156
155
|
session. An empty message, one word or one path order no work.
|
|
157
156
|
- **A refusal by an external limiter removes the way, not the task.** It names no exit: the way is
|
|
158
157
|
taken from the guard that already described this fix, and the task stays the same.
|
|
159
|
-
- **An instruction to work by the progress covers all its steps, including those that change
|
|
160
|
-
history.** Questions are asked about what the progress lacks.
|
|
161
158
|
- **A question written by a past session does not become a question to the owner.** It is addressed
|
|
162
159
|
to the handover's author, and some are closed by a work step.
|
|
163
160
|
- **The owner's instruction holds until they cancel it, and a new fact against it is a line in the
|
|
@@ -176,8 +173,7 @@ flowchart TD
|
|
|
176
173
|
- **The task folder is taken apart by the last commit before the PR opens, not after approval.** A
|
|
177
174
|
person merges as soon as they see green, and no room is left for a closing commit.
|
|
178
175
|
- **After opening the PR, the executor tells the owner the number, what it waits for and what comes
|
|
179
|
-
next.** A draft waits for the run
|
|
180
|
-
hand, and that is said in the same words.
|
|
176
|
+
next.** A draft waits for the run, a PR opened ready waits for the owner's hand, and that is said.
|
|
181
177
|
- **A request to merge never comes before the work is checked.** Where the pipeline wakes for this
|
|
182
178
|
base: folder taken apart and pushed → PR as a draft → run green → draft lifted → the request to
|
|
183
179
|
merge, naming the number. Where it does not wake, the green push gate is the check, and opening
|
|
@@ -186,22 +182,25 @@ flowchart TD
|
|
|
186
182
|
open PR reads as an invitation to merge. Which of the two applies is decided by the bases the pipeline wakes for, and that is read from its file.
|
|
187
183
|
- **The plan guard is the lower bound of the requirement, not its limit.** It demands a folder only
|
|
188
184
|
for an edit of application code; the article above — for any work.
|
|
189
|
-
- **An instruction to work by a rule is an instruction to do its steps,
|
|
190
|
-
history.** Marking a stage, a commit, a push and opening a PR are
|
|
185
|
+
- **An instruction to work by a rule or by the progress is an instruction to do all its steps,
|
|
186
|
+
including those that change history.** Marking a stage, a commit, a push and opening a PR are
|
|
187
|
+
prescribed by the rule; questions are asked about what the progress lacks.
|
|
191
188
|
- **A taken task does not end a turn.** Creating the task, the branch, the column and the folder is
|
|
192
|
-
preparation
|
|
193
|
-
turn-exit guard names the first stage in its refusal.
|
|
189
|
+
preparation; the turn-exit guard names the first stage in its refusal.
|
|
194
190
|
- **The stages of a plan cover its done-sign whole.** Otherwise every stage closes, the run is
|
|
195
191
|
green, and half the order is not done. Either the stages are written up to the sign, or the sign
|
|
196
192
|
is narrowed to what the stages give.
|
|
193
|
+
- **Every rule of the product agreement becomes a step of some stage.** The plan names, per rule,
|
|
194
|
+
the stage that writes its code and the check that proves it, and is compared with the agreement
|
|
195
|
+
rule by rule before the first stage: a rule with no stage is found at the merge review, when the
|
|
196
|
+
code is written.
|
|
197
197
|
- **A stage's readiness sign is taken from the output of a command run while the plan is written.**
|
|
198
198
|
Written by a guess, it is checked at the stage itself — latest of everything that depended on it.
|
|
199
199
|
- **A plan for work that ports a technique from outside is written by a measurement of one's own
|
|
200
200
|
code.** Reading the sample says how it is built; what is needed here is said by a count over
|
|
201
201
|
one's own files.
|
|
202
202
|
- **A count that becomes the measure of the work is bounded by the declaration, not by the file.**
|
|
203
|
-
A file holds neighbouring sets too: a count over it
|
|
204
|
-
the real measure.
|
|
203
|
+
A file holds neighbouring sets too: a count over it came out twice the real measure.
|
|
205
204
|
- **Waiting for one part of a stage is never a stop of the stage.** The parts independent of what is
|
|
206
205
|
awaited are done in the same turn; the owner is told what is done and what is left for their step.
|
|
207
206
|
- **A finding made mid-stage is checked against the plan's exit conditions before the first edit.**
|
|
@@ -141,6 +141,15 @@ not belong there: that is NestJS with constructor DI.
|
|
|
141
141
|
console.log(n, JSON.stringify(s.rules[n].meta.defaultOptions));'
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
+
- **A decision is moved into a pure function of the util layer before the handler is written.** A
|
|
145
|
+
choice over a closed set becomes a table keyed by the enumeration, and a chain of field checks
|
|
146
|
+
becomes a list of checks. The handler calls them and keeps its branchings for its own flow: the
|
|
147
|
+
complexity linter refused one file twice because both lay right in the handler and spent its limit.
|
|
148
|
+
- **A file an edit pushed past the 500-line limit is split, not squeezed.** Joining comments or
|
|
149
|
+
dropping blank lines lowers the count and leaves the file just as long to read, and the next
|
|
150
|
+
edit hits the limit again. What the file does on its own moves out next to it: a mapping, a set of
|
|
151
|
+
derived values.
|
|
152
|
+
|
|
144
153
|
- A cast through `as Type` in a mapper is forbidden but watched by nothing: it accepts any value
|
|
145
154
|
and compiles. Instead — `this.typeCast`.
|
|
146
155
|
- An unused parameter is removed, not renamed: an underscore before the name hides the finding,
|
package/assets/traits.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
"db": {
|
|
3
|
+
"title": "хранилище: схема, миграции, записи предметной области"
|
|
4
|
+
},
|
|
5
|
+
"admin": {
|
|
6
|
+
"title": "админка: экраны правки записей и роли доступа"
|
|
7
|
+
},
|
|
8
|
+
"app": {
|
|
9
|
+
"title": "приложение: экраны, которыми пользуются люди"
|
|
10
|
+
},
|
|
11
|
+
"packages": {
|
|
12
|
+
"title": "публикуемые пакеты: реестр, версии, журнал изменений"
|
|
13
|
+
},
|
|
14
|
+
"mockups": {
|
|
15
|
+
"title": "макеты: рисунки экранов в дизайн-инструменте до кода"
|
|
16
|
+
}
|
|
14
17
|
}
|
package/package.json
CHANGED