@rt-tools/agent-kit 0.23.0 → 0.26.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/README.md +8 -2
- package/assets/agents/business-analyst.md +51 -50
- package/assets/agents/conscience.md +37 -35
- package/assets/agents/project-manager.md +49 -48
- package/assets/agents/prose-editor.md +31 -29
- package/assets/agents/qa-engineer.md +50 -48
- package/assets/agents/rules-reviewer.md +63 -58
- package/assets/agents/skill-curator.md +83 -78
- package/assets/agents/spec-critic.md +34 -29
- package/assets/agents/spec-writer.md +35 -32
- package/assets/agents/strict-teacher.md +39 -37
- package/assets/checks/archive-age.mjs +48 -28
- package/assets/checks/archive-prune.mjs +16 -14
- package/assets/checks/board-epics.github.mjs +75 -41
- package/assets/checks/board-folders.mjs +61 -0
- package/assets/checks/board-gh.github.mjs +35 -26
- package/assets/checks/board-long-work.github.mjs +24 -24
- package/assets/checks/board-paths.github.mjs +21 -16
- package/assets/checks/board-runs.github.mjs +45 -43
- package/assets/checks/board-titles.github.mjs +19 -17
- package/assets/checks/board.github.mjs +150 -128
- package/assets/checks/check-archive-age.mjs +23 -19
- package/assets/checks/check-board.github.mjs +179 -157
- package/assets/checks/check-descriptions.mjs +30 -29
- package/assets/checks/check-doc-paths.mjs +104 -82
- package/assets/checks/check-dupes.mjs +84 -80
- package/assets/checks/check-file-size.mjs +79 -70
- package/assets/checks/check-glossary.mjs +47 -37
- package/assets/checks/check-hook-scope.mjs +30 -27
- package/assets/checks/check-lib-layers.mjs +22 -21
- package/assets/checks/check-profile-drift.mjs +48 -43
- package/assets/checks/check-prose-style.mjs +125 -33
- package/assets/checks/check-push-gate.mjs +53 -50
- package/assets/checks/check-reuse.mjs +50 -40
- package/assets/checks/check-schema-drift.mjs +87 -83
- package/assets/checks/check-specs.mjs +155 -134
- package/assets/checks/check-state-next.mjs +66 -52
- package/assets/checks/check-states.mjs +32 -30
- package/assets/checks/check-styles.mjs +52 -51
- package/assets/checks/check-turn-map.mjs +54 -46
- package/assets/checks/lib-boundaries.mjs +32 -30
- package/assets/checks/lib-common.mjs +30 -29
- package/assets/checks/lib-domains.mjs +34 -34
- package/assets/checks/lib-manifests.mjs +17 -15
- package/assets/checks/lib-reexports.mjs +18 -18
- package/assets/checks/rt-kit-checks.config.mjs +174 -142
- package/assets/checks/signals.mjs +43 -39
- package/assets/checks/spec-anchors.mjs +114 -87
- package/assets/checks/spec-common.mjs +128 -84
- package/assets/checks/spec-contract.mjs +30 -30
- package/assets/checks/spec-proposed.mjs +27 -24
- package/assets/checks/spec-scenarios.mjs +51 -28
- package/assets/checks/task-new.github.mjs +85 -56
- package/assets/commands/feedback.md +65 -59
- package/assets/commands/next-session.md +64 -57
- package/assets/commands/skill-curator.md +83 -79
- package/assets/defaults/gate-map.sh +115 -91
- package/assets/defaults/project.sh +228 -178
- package/assets/defaults/shell.sh +85 -65
- package/assets/defaults/turn-map.md +45 -44
- package/assets/docs/GLOSSARY.md +142 -65
- package/assets/hooks/browser-device-id.sh +12 -12
- package/assets/hooks/browser-guard-device-id.sh +46 -14
- package/assets/hooks/browser-guard-no-asking.sh +5 -4
- package/assets/hooks/browser-guard-no-listing.sh +12 -11
- package/assets/hooks/browser-guard-no-other-drivers.sh +48 -42
- package/assets/hooks/browser-guard-require-select.sh +34 -23
- package/assets/hooks/claim-guard.sh +62 -56
- package/assets/hooks/commit-msg.sh +11 -10
- package/assets/hooks/conscience-guard.sh +91 -45
- package/assets/hooks/constitution-index.sh +16 -16
- package/assets/hooks/deny-tail.sh +28 -26
- package/assets/hooks/dev-server-guard.sh +46 -43
- package/assets/hooks/dispatch.sh +84 -39
- package/assets/hooks/docs-guard.sh +105 -86
- package/assets/hooks/exam-guard.sh +146 -84
- package/assets/hooks/git-guard-delivery-conflict.sh +38 -36
- package/assets/hooks/git-guard-delivery-draft.sh +85 -0
- package/assets/hooks/git-guard-delivery-folder.sh +50 -43
- package/assets/hooks/git-guard-delivery-signature.sh +88 -52
- package/assets/hooks/git-guard-delivery.sh +207 -253
- package/assets/hooks/git-guard-main.sh +65 -26
- package/assets/hooks/git-guard-push-tests.sh +133 -75
- package/assets/hooks/glossary-load.sh +23 -22
- package/assets/hooks/grill-gate-ask.sh +12 -11
- package/assets/hooks/grill-gate.sh +94 -87
- package/assets/hooks/guard-note.sh +20 -19
- package/assets/hooks/handoff-entry-guard.sh +26 -24
- package/assets/hooks/handoff-write.sh +74 -67
- package/assets/hooks/hook-input.sh +70 -50
- package/assets/hooks/lint-after-edit.sh +95 -61
- package/assets/hooks/observe.sh +28 -26
- package/assets/hooks/override-write-guard.sh +23 -21
- package/assets/hooks/postmortem-guard.sh +42 -39
- package/assets/hooks/profile-check.sh +22 -20
- package/assets/hooks/proposal-guard.sh +57 -49
- package/assets/hooks/prose-style-guard.sh +19 -17
- package/assets/hooks/qa-dataid-guard.sh +52 -49
- package/assets/hooks/rerun-guard.sh +31 -30
- package/assets/hooks/reuse-first-guard.sh +108 -87
- package/assets/hooks/roles.sh +14 -14
- package/assets/hooks/rule-article.sh +36 -34
- package/assets/hooks/rule-source-guard.sh +52 -36
- package/assets/hooks/skill-gate-layers.sh +59 -57
- package/assets/hooks/skill-gate-rearm.sh +15 -8
- package/assets/hooks/skill-gate.sh +89 -81
- package/assets/hooks/skill-loaded.sh +6 -6
- package/assets/hooks/sql-guard-parse.sh +68 -66
- package/assets/hooks/sql-guard-request.sh +48 -46
- package/assets/hooks/sql-guard-target.sh +57 -51
- package/assets/hooks/sql-guard-write.sh +84 -79
- package/assets/hooks/sql-guard.sh +52 -47
- package/assets/hooks/stand-login-guard.sh +104 -0
- package/assets/hooks/task-context-load.sh +60 -55
- package/assets/hooks/task-flow-context.sh +87 -69
- package/assets/hooks/task-flow-draft-guard.sh +55 -48
- package/assets/hooks/task-flow-guard.sh +67 -64
- package/assets/hooks/turn-entry-load.sh +39 -32
- package/assets/hooks/turn-exit-guard.sh +256 -204
- package/assets/hooks/turn-exit-patterns.sh +53 -0
- package/assets/hooks/utf8.sh +11 -11
- package/assets/hooks/waiting-turn-guard.sh +94 -94
- package/assets/hooks/window-fill-guard.sh +70 -62
- package/assets/hooks/work-start-guard.sh +52 -49
- package/assets/hooks/write-targets.sh +115 -30
- package/assets/laws/autonomous-work.md +29 -27
- package/assets/laws/code-structure.md +31 -30
- package/assets/laws/delivery.md +148 -137
- package/assets/laws/entity-editing.md +52 -50
- package/assets/laws/entity-models.md +14 -13
- package/assets/laws/frontend-application.md +39 -38
- package/assets/laws/lib-imports.md +27 -27
- package/assets/laws/lists.md +31 -29
- package/assets/laws/navigation.md +37 -37
- package/assets/laws/observability.md +41 -40
- package/assets/laws/project-documentation.md +106 -99
- package/assets/laws/reuse-first.md +31 -29
- package/assets/laws/shared-code.md +27 -27
- package/assets/laws/verifiability.md +131 -114
- package/assets/laws/work-conduct.md +250 -250
- package/assets/patterns/admin-lists-screen.md +72 -69
- package/assets/patterns/admin-nav-item.md +51 -46
- package/assets/patterns/angular-patterns-state.md +32 -31
- package/assets/patterns/api-layer-pair.md +33 -31
- package/assets/patterns/autonomous-work-run.md +50 -49
- package/assets/patterns/browser-verification-measure.md +143 -67
- package/assets/patterns/browser-verification-stand.md +181 -128
- package/assets/patterns/component-structure-new.md +51 -42
- package/assets/patterns/dependencies-upgrade.md +55 -39
- package/assets/patterns/doc-style-human.md +93 -0
- package/assets/patterns/doc-style-sweep.md +82 -79
- package/assets/patterns/doc-style-trace.md +87 -81
- package/assets/patterns/doc-style-write.md +130 -122
- package/assets/patterns/entity-aside.md +77 -63
- package/assets/patterns/entity-models-new.md +37 -37
- package/assets/patterns/entity-store.md +33 -33
- package/assets/patterns/git-workflow-commit.azure.md +94 -75
- package/assets/patterns/git-workflow-commit.github.md +153 -129
- package/assets/patterns/git-workflow-commit.gitlab.md +96 -78
- package/assets/patterns/git-workflow-docker.md +165 -147
- package/assets/patterns/git-workflow-freshness.md +45 -45
- package/assets/patterns/git-workflow-merge.md +99 -86
- package/assets/patterns/git-workflow-migration.md +54 -52
- package/assets/patterns/git-workflow-pr-ready.md +57 -56
- package/assets/patterns/git-workflow-pr.azure.md +126 -121
- package/assets/patterns/git-workflow-pr.github.md +179 -175
- package/assets/patterns/git-workflow-pr.gitlab.md +138 -131
- package/assets/patterns/git-workflow-restart.md +35 -31
- package/assets/patterns/git-workflow-secrets.md +80 -73
- package/assets/patterns/git-workflow-stack.md +131 -106
- package/assets/patterns/lib-layers-move.md +62 -53
- package/assets/patterns/lib-layers-new.md +59 -45
- package/assets/patterns/observability-record.md +72 -67
- package/assets/patterns/platform-access-di.md +31 -29
- package/assets/patterns/reuse-first-extend.md +66 -61
- package/assets/patterns/shared-code-new.md +39 -38
- package/assets/patterns/spec-driven-domain.md +161 -151
- package/assets/patterns/spec-driven-rule.md +179 -168
- package/assets/patterns/spec-driven-sweep.md +41 -39
- package/assets/patterns/status-report-table.github.md +37 -36
- package/assets/patterns/styling-bem-component.md +42 -42
- package/assets/patterns/styling-bem-layout.md +39 -34
- package/assets/patterns/styling-bem-sheet.md +59 -58
- package/assets/patterns/task-flow-archive.md +222 -215
- package/assets/patterns/task-flow-close.md +215 -203
- package/assets/patterns/task-flow-handoff.md +154 -145
- package/assets/patterns/task-flow-resume.md +138 -133
- package/assets/patterns/task-flow-start.md +204 -192
- package/assets/patterns/testing-e2e.md +103 -92
- package/assets/patterns/testing-unit.md +77 -70
- package/assets/patterns/ts-procedure.md +32 -29
- package/assets/patterns/turn-entry-map.md +50 -48
- package/assets/pitfalls/agent-kit.md +152 -141
- package/assets/pitfalls/doc-style.md +96 -91
- package/assets/pitfalls/git-workflow.azure.md +49 -46
- package/assets/pitfalls/git-workflow.github.md +264 -234
- package/assets/pitfalls/git-workflow.gitlab.md +49 -45
- package/assets/pitfalls/spec-driven.md +73 -71
- package/assets/pitfalls/styling-bem.md +46 -40
- package/assets/pitfalls/task-flow.md +262 -246
- package/assets/pitfalls/testing.md +99 -92
- package/assets/pitfalls/turn-conduct.md +96 -81
- package/assets/rules/angular-patterns.md +81 -80
- package/assets/rules/api-layer.md +77 -74
- package/assets/rules/autonomous-work.md +75 -74
- package/assets/rules/browser-verification.md +223 -188
- package/assets/rules/component-structure.md +72 -69
- package/assets/rules/dependencies.md +74 -67
- package/assets/rules/deploy-flow.azure.md +118 -108
- package/assets/rules/deploy-flow.github.md +145 -135
- package/assets/rules/deploy-flow.gitlab.md +120 -110
- package/assets/rules/doc-style.md +209 -148
- package/assets/rules/entity-conventions.needs-admin.md +81 -79
- package/assets/rules/entity-models.md +73 -70
- package/assets/rules/git-workflow.azure.md +224 -228
- package/assets/rules/git-workflow.github.md +250 -242
- package/assets/rules/git-workflow.gitlab.md +218 -217
- package/assets/rules/lib-layers.md +85 -86
- package/assets/rules/lists.md +101 -97
- package/assets/rules/navigation.md +78 -78
- package/assets/rules/observability.needs-app.md +165 -153
- package/assets/rules/platform-access.md +76 -75
- package/assets/rules/reuse-first.md +153 -137
- package/assets/rules/shared-code.md +82 -79
- package/assets/rules/spec-driven.md +272 -260
- package/assets/rules/status-report.md +55 -58
- package/assets/rules/styling-bem.md +83 -72
- package/assets/rules/task-flow.md +282 -270
- package/assets/rules/testing.md +224 -188
- package/assets/rules/turn-conduct.md +255 -258
- package/assets/rules/turn-entry.md +92 -87
- package/assets/rules/typescript-conventions.md +94 -88
- package/assets/samples/specs/_template/spec.md +47 -47
- package/assets/samples/tasks/_template/grill.md +20 -20
- package/assets/samples/tasks/_template/plan.md +32 -30
- package/assets/samples/tasks/_template/progress.md +16 -16
- package/assets/skills/agent-kit-extend.md +129 -113
- package/assets/skills/agent-kit.md +236 -222
- package/assets/skills/write-a-skill.md +76 -71
- package/assets/templates/findings.md +19 -19
- package/assets/templates/gate-map.sh +16 -14
- package/assets/templates/implementation.md +28 -27
- package/assets/templates/pattern.md +17 -17
- package/assets/templates/pitfalls.md +6 -6
- package/assets/templates/postmortem.md +24 -23
- package/assets/templates/project.sh +24 -24
- package/assets/templates/proposal.md +62 -60
- package/assets/templates/rule.md +38 -38
- package/assets/workflows/feature.js +46 -46
- package/assets/workflows/plan.js +54 -54
- package/lib/catalog.d.ts +2 -0
- package/lib/catalog.d.ts.map +1 -1
- package/lib/catalog.js +4 -3
- package/lib/catalog.js.map +1 -1
- package/lib/commands.d.ts.map +1 -1
- package/lib/commands.js +68 -4
- package/lib/commands.js.map +1 -1
- package/lib/companion.js +3 -2
- package/lib/companion.js.map +1 -1
- package/lib/enroll.d.ts +7 -1
- package/lib/enroll.d.ts.map +1 -1
- package/lib/enroll.js +13 -4
- package/lib/enroll.js.map +1 -1
- package/lib/observations.d.ts +10 -1
- package/lib/observations.d.ts.map +1 -1
- package/lib/observations.js +1 -0
- package/lib/observations.js.map +1 -1
- package/lib/override-marks.d.ts +24 -0
- package/lib/override-marks.d.ts.map +1 -0
- package/lib/override-marks.js +98 -0
- package/lib/override-marks.js.map +1 -0
- package/lib/plan.d.ts +11 -0
- package/lib/plan.d.ts.map +1 -1
- package/lib/plan.js +10 -1
- package/lib/plan.js.map +1 -1
- package/lib/ship.d.ts +0 -7
- package/lib/ship.d.ts.map +1 -1
- package/lib/ship.js +10 -2
- package/lib/ship.js.map +1 -1
- package/lib/shipment.d.ts.map +1 -1
- package/lib/shipment.js +7 -3
- package/lib/shipment.js.map +1 -1
- package/lib/sync.d.ts.map +1 -1
- package/lib/sync.js +45 -11
- package/lib/sync.js.map +1 -1
- package/package.json +1 -1
- package/rt-tools-agent-kit-0.26.0.tgz +0 -0
- package/rt-tools-agent-kit-0.23.0.tgz +0 -0
|
@@ -2,78 +2,79 @@
|
|
|
2
2
|
name: autonomous-work-run
|
|
3
3
|
kind: pattern
|
|
4
4
|
rule: autonomous-work
|
|
5
|
-
description:
|
|
5
|
+
description: Pattern of rule autonomous-work. Load when the owner has left and the work runs through the night — the cycle of one piece of work, chained branching, a written default instead of a question, the list by morning, handling a guard refusal. Not for ordinary work — patterns task-flow-start and -resume.
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# A night without the owner
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Pattern of the rule `autonomous-work`. What must be true — the law
|
|
11
11
|
`docs/constitution/autonomous-work.md`.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## When to use
|
|
14
14
|
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
15
|
+
- The owner said they are leaving and asked for work on one's own.
|
|
16
|
+
- More than one task in a row is taken in a session, and they cannot be handed outside.
|
|
17
|
+
- The work ran into a question, and there is nobody to ask.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## The chain of branches
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
The first work branches from main, each next one — from the previous:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
git checkout -b <КЛЮЧ>-<номер-1>-<slug> main #
|
|
24
|
+
git checkout -b <КЛЮЧ>-<номер-1>-<slug> main # the first of the night
|
|
25
25
|
git checkout -b <КЛЮЧ>-<номер-2>-<slug> <КЛЮЧ>-<номер-1>-<slug>
|
|
26
26
|
git checkout -b <КЛЮЧ>-<номер-3>-<slug> <КЛЮЧ>-<номер-2>-<slug>
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
The merge order is from the bottom up, and it is named in the morning list by numbers. A branch
|
|
30
|
+
created from main in the middle of the chain will collide with its neighbour in shared files —
|
|
31
|
+
indexes, counters, journals — and the owner will be the one to sort it out.
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
git log --oneline --graph --decorate main..HEAD | head -20 #
|
|
34
|
+
git log --oneline --graph --decorate main..HEAD | head -20 # what the chain stands on now
|
|
35
35
|
git branch --list '<КЛЮЧ>-*' --format='%(refname:short) %(upstream:short)'
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
##
|
|
38
|
+
## The cycle of one piece of work
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
npm run task:move -- <номер> in-progress #
|
|
42
|
-
git checkout -b <КЛЮЧ>-<номер>-<slug> <прошлая ветка> #
|
|
41
|
+
npm run task:move -- <номер> in-progress # taken
|
|
42
|
+
git checkout -b <КЛЮЧ>-<номер>-<slug> <прошлая ветка> # a chain, not a fan
|
|
43
43
|
cp -r docs/tasks/_template docs/tasks/<КЛЮЧ>-<номер>-<slug>
|
|
44
|
-
#
|
|
45
|
-
git add docs/tasks/<КЛЮЧ>-<номер>-<slug> && git commit #
|
|
46
|
-
#
|
|
47
|
-
#
|
|
44
|
+
# the grill with defaults, the plan, the state «этап-идёт»
|
|
45
|
+
git add docs/tasks/<КЛЮЧ>-<номер>-<slug> && git commit # the folder goes into history at once
|
|
46
|
+
# work by stages: each ends with a commit and a run of the readiness sign
|
|
47
|
+
# the folder is taken apart into the archive by the last commit
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
Nothing goes outside during the night: no `git push`, no `gh pr create`, no publishing, no cargo
|
|
51
|
+
mark. The branch stays local, and in the morning the owner decides what to hand out of it.
|
|
52
52
|
|
|
53
|
-
##
|
|
53
|
+
## A default instead of a question
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
Written into the grill, into the decisions section — where the owner's answer would have been
|
|
56
|
+
written:
|
|
56
57
|
|
|
57
58
|
```markdown
|
|
58
59
|
- **<что принято>** — <довод>. Спросить было некого: заход автономный. Цена ошибки:
|
|
59
60
|
<что придётся переделать, если владелец решит иначе>.
|
|
60
61
|
```
|
|
61
62
|
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
The cost of a mistake is not politeness but a sign: it separates a default that can be replayed in
|
|
64
|
+
ten minutes from one for whose sake the work is better postponed whole.
|
|
64
65
|
|
|
65
|
-
##
|
|
66
|
+
## A postponed task
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
A task that needs the owner's word is not taken: its state on the board stays as it was, and a
|
|
69
|
+
line goes into the morning list.
|
|
69
70
|
|
|
70
71
|
```markdown
|
|
71
72
|
- **RT-<номер> — <заголовок>.** Отложена: <какой вопрос и почему умолчания у него нет>.
|
|
72
73
|
```
|
|
73
74
|
|
|
74
|
-
##
|
|
75
|
+
## The morning list
|
|
75
76
|
|
|
76
|
-
|
|
77
|
+
Appended along the way, after each closed piece of work, not assembled at the end.
|
|
77
78
|
|
|
78
79
|
```markdown
|
|
79
80
|
| Работа | Ветка | Чем подтверждена | Чего ждёт |
|
|
@@ -81,25 +82,25 @@ git add docs/tasks/<КЛЮЧ>-<номер>-<slug> && git commit # папка
|
|
|
81
82
|
| RT-… — <что сделано> | `<ветка>` (на `<предыдущей>`) | `<команда>` — <вывод> | заявки и слияния |
|
|
82
83
|
```
|
|
83
84
|
|
|
84
|
-
|
|
85
|
+
The order of rows is the merge order. Below the list — the postponed tasks with their questions.
|
|
85
86
|
|
|
86
|
-
##
|
|
87
|
+
## A guard's refusal
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
The refusal names the skipped step: the step is done, the call is repeated, the work goes on. The
|
|
90
|
+
night ends with work, not with an argument with the guard.
|
|
90
91
|
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
-
|
|
94
|
-
|
|
92
|
+
- The refusal demands what must not be done (a push, a PR). The work is brought to the place where
|
|
93
|
+
the demand can be met in the morning and goes into the morning list as the line "waits for a PR".
|
|
94
|
+
- The refusal repeats at the same place twice — then the skipped step was understood wrongly: the
|
|
95
|
+
rule named in the refusal is read, not the wording rewritten.
|
|
95
96
|
|
|
96
|
-
##
|
|
97
|
+
## Common misses
|
|
97
98
|
|
|
98
|
-
-
|
|
99
|
-
|
|
100
|
-
-
|
|
101
|
-
|
|
102
|
-
-
|
|
103
|
-
|
|
104
|
-
-
|
|
105
|
-
|
|
99
|
+
- **The branch was created from main by habit.** The chain breaks silently, and the cost surfaces
|
|
100
|
+
for the owner at the second merge.
|
|
101
|
+
- **A default was taken and not written down.** In the morning it cannot be told from knowledge,
|
|
102
|
+
and the owner learns of it only when the work was done wrong.
|
|
103
|
+
- **A task was taken and postponed halfway.** On the board it is in progress, in the branch — half
|
|
104
|
+
an edit; the next session reads it as begun and does not start over.
|
|
105
|
+
- **The morning list was assembled from memory at the last minute.** By that hour the window was
|
|
106
|
+
already shrinking, and half of the night did not get into it.
|
|
@@ -2,39 +2,73 @@
|
|
|
2
2
|
name: browser-verification-measure
|
|
3
3
|
kind: pattern
|
|
4
4
|
rule: browser-verification
|
|
5
|
-
description:
|
|
5
|
+
description: Pattern of rule browser-verification. Load when a conclusion about layout needs a number behind it — ready-made measurements, a computed value broken down over all nodes, a narrow screen through an iframe, pitfalls of the computer tool. Not for raising a stand — pattern browser-verification-stand.
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# Measurement instead of a look
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Pattern of the rule `browser-verification`. What must be true — the law
|
|
11
11
|
`docs/constitution/verifiability.md`.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## When to use
|
|
14
14
|
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
15
|
+
- Layout was edited, and the result needs confirming.
|
|
16
|
+
- The screen looks wrong, and there is nothing to search for: a search over the code answers
|
|
17
|
+
"clean".
|
|
18
|
+
- A narrow screen is under check.
|
|
18
19
|
|
|
19
|
-
##
|
|
20
|
+
## A conclusion is backed by a number
|
|
20
21
|
|
|
21
|
-
`getComputedStyle`, `getBoundingClientRect`,
|
|
22
|
-
|
|
22
|
+
`getComputedStyle`, `getBoundingClientRect`, contrast, matching centres, landing in the viewport.
|
|
23
|
+
"Looks fine" is never a check result.
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
A measurement answers only the question asked. A match on the listed properties says nothing about a
|
|
26
|
+
rule that is not in the measured list. The rows of the profile popup matched the reference by
|
|
27
|
+
padding, font size and rounding, while the reference paints no hover background there at all — a
|
|
28
|
+
full-width highlight held on for two rounds with correct numbers. If the reference sources are
|
|
29
|
+
available, the divergence is found by reading, and the measurement stays a check of the result.
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
The look of an element that today is visible on no screen is not confirmed by a measurement, and a
|
|
32
|
+
rule about it stays a hypothesis.
|
|
32
33
|
|
|
33
|
-
##
|
|
34
|
+
## The waiting state is measured on a delayed request
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
A button in waiting, a list skeleton and a loading bar live exactly as long as the request runs: on
|
|
37
|
+
a stand that is a fraction of a second, and no measurement call can catch them. The request itself
|
|
38
|
+
is delayed, not the measurement.
|
|
39
|
+
|
|
40
|
+
The technique has three parts, and the third is mandatory: the network call is substituted, the
|
|
41
|
+
answer is held for a few seconds, and it ends with a refusal. A real answer would leave a real
|
|
42
|
+
record on the stand — that is how an extra row got into the stand's database.
|
|
43
|
+
|
|
44
|
+
```javascript
|
|
45
|
+
globalThis.__realFetch ??= globalThis.fetch;
|
|
46
|
+
globalThis.fetch = (input, init) => {
|
|
47
|
+
const url = typeof input === 'string' ? input : input.url;
|
|
48
|
+
if (!url.includes('<the piece of the address being held>')) {
|
|
49
|
+
return globalThis.__realFetch(input, init);
|
|
50
|
+
}
|
|
51
|
+
return new Promise((resolve) => {
|
|
52
|
+
setTimeout(() => resolve(new Response('{}', { status: 500 })), 5000);
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
'substituted';
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The substitution is removed by assigning the saved one back: the page lives until reload, and a
|
|
60
|
+
forgotten substitution leads the next measurement astray.
|
|
61
|
+
|
|
62
|
+
The sign that this is exactly the case: the button on the screenshot in its ordinary look, while
|
|
63
|
+
the request has already gone out in the list of network calls. Assembling the technique anew each
|
|
64
|
+
time costs more than reading it here: over one epic it was assembled three times.
|
|
65
|
+
|
|
66
|
+
## A value that is not in the code
|
|
67
|
+
|
|
68
|
+
The typeface, `line-height`, colour and `appearance` of form elements are set by the browser, and
|
|
69
|
+
the tree has none of these values. A search over the code answers "clean" for such a defect, the
|
|
70
|
+
linter and the build are silent. It is found by breaking the computed value down over all nodes of
|
|
71
|
+
the page, not by measuring a couple of elements:
|
|
38
72
|
|
|
39
73
|
```javascript
|
|
40
74
|
[...document.querySelectorAll('*')].reduce((acc, el) => {
|
|
@@ -44,15 +78,15 @@ description: Паттерн правила browser-verification. Брать, к
|
|
|
44
78
|
}, {});
|
|
45
79
|
```
|
|
46
80
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
81
|
+
That is how 91 controls out of 106 set in the wrong typeface were found on the admin dashboard,
|
|
82
|
+
and 13 out of 87 on the site's main page. The count fits any inherited property: what is looked at
|
|
83
|
+
is not one value but the number of nodes with an unexpected one.
|
|
50
84
|
|
|
51
|
-
##
|
|
85
|
+
## Measurement across all thresholds at once
|
|
52
86
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
87
|
+
A measurement at one width per call gives numbers from different minutes: between calls the page
|
|
88
|
+
is redrawn, and they cannot be compared. So the widths are run as a batch in one pass — each lives
|
|
89
|
+
in its own frame, and the measurement is taken from all of them at once:
|
|
56
90
|
|
|
57
91
|
```javascript
|
|
58
92
|
await (async (address, widths, row) => {
|
|
@@ -82,53 +116,95 @@ await (async (address, widths, row) => {
|
|
|
82
116
|
})('/screen', [360, 599, 600, 904, 905, 1239, 1240, 1440], '.field');
|
|
83
117
|
```
|
|
84
118
|
|
|
85
|
-
|
|
119
|
+
The answer is read by three signs, and the first is not about looks:
|
|
120
|
+
|
|
121
|
+
- **the heights of neighbours in one row are equal** — a set of values in `heights` longer than
|
|
122
|
+
one means the fields came out different sizes;
|
|
123
|
+
- **there is no horizontal scrolling** — `scrolls` is true where the content is wider than the
|
|
124
|
+
frame;
|
|
125
|
+
- **no left edge goes past the frame width** — `escaped` above zero. On a screenshot this is not
|
|
126
|
+
visible at all: an element beyond the right edge looks absent.
|
|
86
127
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
- **ни одна левая граница не выходит за ширину кадра** — `escaped` больше нуля. На снимке этого
|
|
91
|
-
не видно вовсе: элемент за правым краем выглядит отсутствующим.
|
|
128
|
+
The frame width is smaller than the ordered one by a scrollbar, so the comparison is against `got`,
|
|
129
|
+
not against the number from the list. A threshold named by the ordered width turns out on the other
|
|
130
|
+
side of itself in the frame.
|
|
92
131
|
|
|
93
|
-
|
|
94
|
-
из списка: порог, названный по заказанной ширине, на кадре оказывается по другую сторону от
|
|
95
|
-
себя.
|
|
132
|
+
## Narrow screen
|
|
96
133
|
|
|
97
|
-
|
|
134
|
+
`resize_window` does not work when Chrome is in full-screen mode: the tool reports success,
|
|
135
|
+
`innerWidth` does not change, media queries stay desktop. Narrow widths are checked in a nested
|
|
136
|
+
iframe of the needed width — inside it `matchMedia` counts from the frame; at `width: 375px` and
|
|
137
|
+
`border: 2px` the inner `innerWidth` equals 371.
|
|
98
138
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
вложенном iframe нужной ширины — внутри него `matchMedia` считается от рамки; при
|
|
102
|
-
`width: 375px` и `border: 2px` внутренний `innerWidth` равен 371.
|
|
139
|
+
Changing the number of elements in a container is a layout edit: it is checked at 375, not only by
|
|
140
|
+
response codes.
|
|
103
141
|
|
|
104
|
-
|
|
105
|
-
только кодами ответа.
|
|
142
|
+
## An input event is not replaced by a faked value
|
|
106
143
|
|
|
107
|
-
|
|
144
|
+
**Scrolling set by assignment gives no event.** The scroll value changes, but the subscriber does
|
|
145
|
+
not fire on the document, on the window or on the root node. The sign the application computes by
|
|
146
|
+
the event stays as it was, and the edit made reads as not made — two sessions in a row took apart a
|
|
147
|
+
working listener.
|
|
148
|
+
|
|
149
|
+
Hence two checks, and neither replaces the other: the mechanics are checked with a real wheel, and
|
|
150
|
+
the layout under the sign — with a sign set by hand. The class is put on the host, and what depends
|
|
151
|
+
on it is measured; the threshold takes no part in that.
|
|
152
|
+
|
|
153
|
+
The sign that this is exactly the case: the listener is set, the scroll value changed, the event
|
|
154
|
+
counter is zero. There is no need to take the listener itself apart after that — it works.
|
|
155
|
+
|
|
156
|
+
## Pitfalls of the `computer` tool
|
|
157
|
+
|
|
158
|
+
- Click coordinates are the coordinates of the **screenshot**, not CSS pixels: at a viewport of 2560
|
|
159
|
+
the screenshot arrives 1568 wide, and a click at the "seen" coordinate goes astray, giving a false
|
|
160
|
+
signal. Recompute by the actual scale or aim through `find`.
|
|
161
|
+
- The `zoom` area must lie entirely inside the viewport.
|
|
162
|
+
- An `await` between clicks is mandatory: a synchronous loop of "clicked — read the DOM" reads the
|
|
163
|
+
state before the redraw and returns stale values.
|
|
164
|
+
- `select_browser` goes stale after 300 seconds. On a long check this fires in the middle of the
|
|
165
|
+
work — it is not a stand failure; repeat the call and go on. The pinned profile is named by the
|
|
166
|
+
tree itself — by an environment variable or by its own file next to the layout settings. It is
|
|
167
|
+
asked from the helper, not remembered: the identifier is local to the machine and does not travel
|
|
168
|
+
into the package at all.
|
|
169
|
+
|
|
170
|
+
## A long run is started in the page, not in the call
|
|
171
|
+
|
|
172
|
+
A tool call is cut off by its own limit at about forty-five seconds, while the walk it started
|
|
173
|
+
goes on — nobody will ask it for the result any more. One width from the set of screens takes
|
|
174
|
+
about a minute and a half, so not one fits into a call.
|
|
175
|
+
|
|
176
|
+
The order is this: the call puts the walk into a page variable and ends at once, and the following
|
|
177
|
+
calls ask that same variable whether it is done.
|
|
178
|
+
|
|
179
|
+
```javascript
|
|
180
|
+
globalThis.__probe = { done: false, rows: [] };
|
|
181
|
+
(async () => {
|
|
182
|
+
for (const w of [375, 480, 481, 768, 769, 1080, 1081, 1380]) {
|
|
183
|
+
globalThis.__probe.rows.push(await measureWidth(w));
|
|
184
|
+
}
|
|
185
|
+
globalThis.__probe.done = true;
|
|
186
|
+
})();
|
|
187
|
+
|
|
188
|
+
'started';
|
|
189
|
+
```
|
|
108
190
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
- Между кликами обязателен `await`: синхронный цикл «кликнул — прочитал DOM» читает состояние
|
|
114
|
-
до перерисовки и возвращает устаревшие значения.
|
|
115
|
-
- `select_browser` протухает через 300 секунд. На длинной проверке это срабатывает посреди
|
|
116
|
-
работы — это не сбой стенда, повторить вызов и продолжить. Закреплённый профиль называет само дерево — переменной окружения либо своим файлом рядом с
|
|
117
|
-
настройками раскладки; спрашивается он у помощника, а не помнится: идентификатор локален для
|
|
118
|
-
машины и в пакет не едет вовсе.
|
|
191
|
+
The tool's answer is truncated at about fifteen hundred characters with no mark: the end of the
|
|
192
|
+
summary looks not cut off but absent — output gathered in one pass and printed at once reads as
|
|
193
|
+
shorter than it is. So what was gathered stays in the variable whole, and is printed in slices by
|
|
194
|
+
index.
|
|
119
195
|
|
|
120
|
-
##
|
|
196
|
+
## Router behaviour is reproduced by clicks
|
|
121
197
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
198
|
+
Substituting the address, `history.pushState` with `popstate` and entering by a direct link raise
|
|
199
|
+
the application anew, and it has no accumulated state — no open outlet, no guard of the previous
|
|
200
|
+
panel. A clean pass over the addresses reads as "the defect is not confirmed": the event feed panel
|
|
201
|
+
got stuck on the very first click from the menu and passed the check by addresses three times.
|
|
126
202
|
|
|
127
|
-
##
|
|
203
|
+
## Common misses
|
|
128
204
|
|
|
129
|
-
-
|
|
130
|
-
|
|
131
|
-
-
|
|
132
|
-
|
|
133
|
-
-
|
|
134
|
-
|
|
205
|
+
- A comment in a config is a hypothesis like any other. A claim about eviction of a cache record
|
|
206
|
+
held on through three rounds of adversarial code review and was refuted by one `curl`.
|
|
207
|
+
- The conclusion "no defect, it is the cache" closes the investigation, so it is accepted only
|
|
208
|
+
after a check on a clean build.
|
|
209
|
+
- A defect in a client chunk from a compilation before the edit looks like a defect in the code:
|
|
210
|
+
the sign of a dev build is bundle names without a hash.
|