@rt-tools/agent-kit 0.24.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/agents/business-analyst.md +51 -50
- package/assets/agents/cargo-writer.md +54 -0
- 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-epic-link.github.mjs +29 -0
- package/assets/checks/board-epics.github.mjs +286 -49
- 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 +29 -25
- package/assets/checks/board-paths.github.mjs +21 -16
- package/assets/checks/board-pull-state.github.mjs +168 -0
- package/assets/checks/board-runs.github.mjs +45 -43
- package/assets/checks/board-task-dirs.github.mjs +98 -0
- package/assets/checks/board-titles.github.mjs +19 -17
- package/assets/checks/board.github.mjs +133 -194
- package/assets/checks/check-archive-age.mjs +23 -19
- package/assets/checks/check-board.github.mjs +131 -263
- package/assets/checks/check-descriptions.mjs +30 -29
- package/assets/checks/check-doc-paths.mjs +91 -88
- package/assets/checks/check-dupes.mjs +84 -80
- package/assets/checks/check-file-size.mjs +74 -71
- 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 +138 -39
- package/assets/checks/check-push-gate.mjs +53 -50
- package/assets/checks/check-reuse.mjs +50 -40
- package/assets/checks/check-schema-drift.mjs +104 -84
- 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/epic-table.github.mjs +268 -0
- 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 +187 -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/specs-for.mjs +214 -0
- package/assets/checks/task-new.github.mjs +315 -61
- package/assets/commands/feedback.md +65 -59
- package/assets/commands/next-session.md +64 -57
- package/assets/commands/night.md +115 -0
- package/assets/commands/skill-curator.md +83 -79
- package/assets/defaults/gate-map.sh +108 -97
- package/assets/defaults/project.sh +232 -185
- package/assets/defaults/shell.sh +73 -68
- package/assets/defaults/turn-map.md +47 -44
- package/assets/docs/GLOSSARY.md +142 -65
- package/assets/hooks/browser-device-id.sh +16 -12
- package/assets/hooks/browser-guard-device-id.sh +34 -28
- 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 +14 -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 +50 -43
- package/assets/hooks/dispatch.sh +60 -46
- package/assets/hooks/docs-guard.sh +100 -91
- package/assets/hooks/epic-over.sh +49 -0
- package/assets/hooks/epic-stop-guard.sh +108 -0
- package/assets/hooks/exam-guard.sh +105 -93
- package/assets/hooks/git-guard-delivery-conflict.sh +41 -36
- package/assets/hooks/git-guard-delivery-draft.sh +48 -38
- package/assets/hooks/git-guard-delivery-epic.sh +167 -0
- package/assets/hooks/git-guard-delivery-folder.sh +50 -43
- package/assets/hooks/git-guard-delivery-signature.sh +119 -53
- package/assets/hooks/git-guard-delivery.sh +223 -183
- package/assets/hooks/git-guard-main.sh +38 -34
- package/assets/hooks/git-guard-push-tests.sh +99 -87
- 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 +45 -25
- package/assets/hooks/handoff-write.sh +74 -67
- package/assets/hooks/hook-input.sh +67 -58
- 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 +49 -24
- package/assets/hooks/qa-dataid-guard.sh +83 -58
- 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 +39 -34
- package/assets/hooks/rule-source-guard.sh +47 -42
- package/assets/hooks/skill-gate-layers.sh +63 -57
- package/assets/hooks/skill-gate-rearm.sh +15 -8
- package/assets/hooks/skill-gate.sh +89 -81
- package/assets/hooks/skill-loaded.sh +10 -6
- package/assets/hooks/sql-guard-parse.sh +71 -66
- package/assets/hooks/sql-guard-request.sh +51 -46
- package/assets/hooks/sql-guard-target.sh +60 -51
- package/assets/hooks/sql-guard-write.sh +87 -79
- package/assets/hooks/sql-guard.sh +52 -47
- package/assets/hooks/stand-login-guard.sh +43 -37
- 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 +260 -204
- package/assets/hooks/turn-exit-patterns.sh +63 -0
- package/assets/hooks/utf8.sh +14 -11
- package/assets/hooks/waiting-turn-guard.sh +104 -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 +99 -44
- package/assets/laws/autonomous-work.md +29 -27
- package/assets/laws/code-structure.md +31 -30
- package/assets/laws/delivery.md +170 -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 -124
- package/assets/laws/work-conduct.md +250 -244
- 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 +124 -88
- package/assets/patterns/browser-verification-stand.md +169 -157
- package/assets/patterns/component-structure-new.md +51 -42
- package/assets/patterns/dependencies-upgrade.md +55 -39
- package/assets/patterns/doc-style-human.md +55 -37
- 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 -87
- package/assets/patterns/git-workflow-commit.github.md +160 -142
- package/assets/patterns/git-workflow-commit.gitlab.md +96 -90
- 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 +102 -94
- 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 +127 -122
- package/assets/patterns/git-workflow-pr.github.md +186 -177
- package/assets/patterns/git-workflow-pr.gitlab.md +139 -132
- 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 +136 -107
- 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 +48 -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 +234 -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 +228 -202
- package/assets/patterns/testing-e2e.md +102 -101
- 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 +172 -142
- package/assets/pitfalls/doc-style.md +96 -91
- package/assets/pitfalls/git-workflow.azure.md +49 -46
- package/assets/pitfalls/git-workflow.github.md +270 -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 +87 -74
- package/assets/rules/browser-verification.md +223 -214
- 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 +201 -173
- 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 +268 -239
- 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 -143
- package/assets/rules/shared-code.md +82 -79
- package/assets/rules/spec-driven.md +279 -260
- package/assets/rules/status-report.md +62 -58
- package/assets/rules/styling-bem.md +81 -77
- package/assets/rules/task-flow.md +303 -270
- package/assets/rules/testing.md +224 -209
- package/assets/rules/turn-conduct.md +262 -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 +259 -233
- 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/bin/agent-kit.d.ts.map +1 -1
- package/bin/agent-kit.js +8 -1
- package/bin/agent-kit.js.map +1 -1
- package/lib/cargo-prose.d.ts +41 -0
- package/lib/cargo-prose.d.ts.map +1 -0
- package/lib/cargo-prose.js +88 -0
- package/lib/cargo-prose.js.map +1 -0
- package/lib/cargo.d.ts +12 -1
- package/lib/cargo.d.ts.map +1 -1
- package/lib/cargo.js +8 -2
- package/lib/cargo.js.map +1 -1
- 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 +5 -2
- 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 +12 -3
- package/lib/enroll.js.map +1 -1
- package/lib/fate.d.ts +29 -0
- package/lib/fate.d.ts.map +1 -0
- package/lib/fate.js +147 -0
- package/lib/fate.js.map +1 -0
- package/lib/override-marks.d.ts +7 -0
- package/lib/override-marks.d.ts.map +1 -1
- package/lib/override-marks.js +14 -0
- package/lib/override-marks.js.map +1 -1
- 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 +29 -9
- package/lib/ship.d.ts.map +1 -1
- package/lib/ship.js +44 -2
- package/lib/ship.js.map +1 -1
- package/lib/shipment.d.ts.map +1 -1
- package/lib/shipment.fixture.d.ts +8 -1
- package/lib/shipment.fixture.d.ts.map +1 -1
- package/lib/shipment.fixture.js +9 -0
- package/lib/shipment.fixture.js.map +1 -1
- package/lib/shipment.js +38 -5
- 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.27.0.tgz +0 -0
- package/rt-tools-agent-kit-0.24.0.tgz +0 -0
|
@@ -2,53 +2,54 @@
|
|
|
2
2
|
name: git-workflow-migration
|
|
3
3
|
kind: pattern
|
|
4
4
|
rule: deploy-flow
|
|
5
|
-
description:
|
|
5
|
+
description: Pattern of rule deploy-flow. Load when editing prisma/schema.prisma and prisma/migrations/** — ready-made commands for a one-off container, writing the migration file through migrate diff, applying to the local database. Not for the commit — pattern git-workflow-commit; for the PR — git-workflow-pr.
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# A migration and the chain run
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Pattern of the rule `deploy-flow`. What must be true meanwhile — the law
|
|
11
11
|
`docs/constitution/delivery.md`.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## When to use
|
|
14
14
|
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
15
|
+
- `prisma/schema.prisma` is being edited.
|
|
16
|
+
- A directory in `prisma/migrations/` is being created or renamed.
|
|
17
|
+
- A branch with a new migration is being prepared for the merge.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## The chain is run by one command
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
`Migrations match schema`
|
|
23
|
-
|
|
21
|
+
Local `lint`, `test`, `check:all` and the builds do not touch the migration order at all, and the
|
|
22
|
+
step `Migrations match schema` in `.github/workflows/deploy.yml` goes after the merge. The check
|
|
23
|
+
stands as a push gate and is called by hand:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
npm run check:schema
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
It applies the chain to a shadow database — the same as the working one, with the suffix
|
|
30
|
+
`_gate_shadow` — compares it with the schema and tears it down. One's own database is not
|
|
31
|
+
touched: an audit against it would judge the state of the machine, not of the repository. A
|
|
32
|
+
stopped docker and a production address the check skips silently.
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
When there is no database at hand at all, the same chain is run on a one-off container:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
docker run -d --rm --name <префикс>-migcheck -e POSTGRES_PASSWORD=migcheck -p 55432:5432 postgres:16-alpine
|
|
38
|
-
docker exec <префикс>-migcheck pg_isready -U postgres #
|
|
38
|
+
docker exec <префикс>-migcheck pg_isready -U postgres # an apply before readiness fails on the connection
|
|
39
39
|
DATABASE_URL=postgresql://postgres:migcheck@localhost:55432/postgres npx prisma migrate deploy
|
|
40
40
|
DATABASE_URL=postgresql://postgres:migcheck@localhost:55432/postgres npx prisma migrate diff \
|
|
41
41
|
--from-config-datasource --to-schema prisma/schema.prisma --exit-code
|
|
42
42
|
docker stop <префикс>-migcheck
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
The address is set as a prefix of the command itself — `export` does not live between calls.
|
|
46
46
|
|
|
47
|
-
##
|
|
47
|
+
## The migration file is written by the same container
|
|
48
48
|
|
|
49
|
-
`prisma migrate dev`
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
`prisma migrate dev` is not run either as a command or through `npm run prisma:migrate`: any
|
|
50
|
+
divergence of state it cures by offering to reset the database, and the local database holds the
|
|
51
|
+
owner's properties and bookings. The file is taken as the difference between the applied chain
|
|
52
|
+
and the schema:
|
|
52
53
|
|
|
53
54
|
```bash
|
|
54
55
|
DATABASE_URL=postgresql://postgres:migcheck@localhost:55432/postgres npx prisma migrate diff \
|
|
@@ -56,44 +57,45 @@ DATABASE_URL=postgresql://postgres:migcheck@localhost:55432/postgres npx prisma
|
|
|
56
57
|
> prisma/migrations/<метка>_<имя>/migration.sql
|
|
57
58
|
```
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
The directory is created **after** the chain is applied: an empty directory that got into
|
|
61
|
+
`migrate deploy` is marked applied, and its contents will no longer land on this container.
|
|
61
62
|
|
|
62
|
-
##
|
|
63
|
+
## The local database catches up with the branch
|
|
63
64
|
|
|
64
65
|
```bash
|
|
65
66
|
npx prisma migrate deploy
|
|
66
67
|
```
|
|
67
68
|
|
|
68
|
-
|
|
69
|
-
`relation … already exists`.
|
|
69
|
+
A renamed migration stays in it under the old name, and the apply fails on
|
|
70
|
+
`relation … already exists`. The state is edited, a repeated apply does not fix it:
|
|
70
71
|
|
|
71
72
|
```bash
|
|
72
73
|
npx prisma migrate resolve --applied <новое имя>
|
|
73
74
|
```
|
|
74
75
|
|
|
75
|
-
##
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
76
|
+
## Common misses
|
|
77
|
+
|
|
78
|
+
- **The apply in the image is set up by the settings file, not by an address in the
|
|
79
|
+
environment.** The seventh edition reads the storage address only from its own settings file:
|
|
80
|
+
neither the declaration in the schema nor an environment variable in the production stack
|
|
81
|
+
replaces it. That file is put into the image explicitly, next to the schema and the migrations.
|
|
82
|
+
Without it the build is green whole — client generation at the build stage passes — and the
|
|
83
|
+
first apply on the node refuses.
|
|
84
|
+
- The timestamp is set by the moment of creation, and the apply order is lexicographic: a
|
|
85
|
+
migration from a branch started earlier lands before the one it depends on. On an existing
|
|
86
|
+
database this is invisible — only an apply from scratch fails.
|
|
87
|
+
- The flags of `prisma migrate diff` are not those from the examples on the web: `--from-url`,
|
|
88
|
+
`--to-url`, `--shadow-database-url` and `--to-schema-datamodel` are removed, and
|
|
89
|
+
`prisma db execute` takes no database address at all and reads it from `prisma.config.ts`. On
|
|
90
|
+
an unknown flag both commands print the help, and the miss is visible only there. Which flags
|
|
91
|
+
exist now is looked up in `prisma migrate diff --help`, not in this text.
|
|
92
|
+
- A write to the production database (port 15432, the production host) is forbidden altogether:
|
|
93
|
+
the schema changes by a migration through the rollout, the data — through the admin.
|
|
94
|
+
- Rows are addressed by the primary key, not by a mask: a deletion by a mail mask once took the
|
|
95
|
+
owner's demonstration bookings away together with the test records.
|
|
96
|
+
- **The guard's question is not lifted by the form of the query.** It judges a condition by
|
|
97
|
+
identifier the same way in any spelling — one at a time or as a list — and answers both with a
|
|
98
|
+
question to the owner; a refusal comes only on a condition not by identifier. Where the question
|
|
99
|
+
reads as a refusal, there is one way: name the refused command to the owner and ask for the mode
|
|
100
|
+
in which the question gets through — not rewrite the query until it passes. Otherwise the
|
|
101
|
+
session carries away a conclusion about guard requirements it does not have.
|
|
@@ -2,92 +2,93 @@
|
|
|
2
2
|
name: git-workflow-pr-ready
|
|
3
3
|
kind: pattern
|
|
4
4
|
rule: git-workflow
|
|
5
|
-
description:
|
|
5
|
+
description: Pattern of rule git-workflow. Load when PRs are already open — leaving draft, handling a red run, bringing a chain to readiness, the order "finish what was handed over first, then take new work". Opening one PR — pattern git-workflow-pr; the chain order — git-workflow-stack.
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# Bringing a PR to readiness
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
`docs/constitution/delivery.md`.
|
|
12
|
-
`git-workflow-stack`,
|
|
10
|
+
Pattern of the rule `git-workflow`. What must be true — the law
|
|
11
|
+
`docs/constitution/delivery.md`. Opening a PR — pattern `git-workflow-pr`, the chain order —
|
|
12
|
+
`git-workflow-stack`, resolving one conflict — `git-workflow-merge`.
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## When to use
|
|
15
15
|
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
-
|
|
16
|
+
- A PR is open as a draft, and its run has ended.
|
|
17
|
+
- Several PRs are open at once, and it must be decided what comes first — finishing them or
|
|
18
|
+
taking the next task.
|
|
19
|
+
- The PR's run is red, while the edit in the branch is green on its own.
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## A draft is the state of the work, not its look
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
тот, кто её отдал.
|
|
23
|
+
A draft says one thing: the work cannot be merged. The host locks its merge button, and the
|
|
24
|
+
owner opening the list sees not "done" but "being done". A PR with a green run and a draft not
|
|
25
|
+
lifted is done work that looks unfinished, and only the one who handed it over can fix that.
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
Hence the order: **the draft is lifted in the same turn in which the green run was read.** Not
|
|
28
|
+
the next one, not after a neighbouring task.
|
|
30
29
|
|
|
31
30
|
```bash
|
|
32
31
|
gh pr ready <номер>
|
|
33
32
|
```
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
Lifting the draft is the last step of handing the work over, not a separate matter. Until it is
|
|
35
|
+
done, the work is not handed over, however many commits lie in the branch.
|
|
37
36
|
|
|
38
|
-
##
|
|
37
|
+
## Finish the handed-over first, then take new work
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
An open PR is work in flight: its run ages, its branch lags behind main, its body describes the
|
|
40
|
+
tree on the day it was written. All of this is cheap to fix today and expensive three tasks later.
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
So the queue is this:
|
|
44
43
|
|
|
45
|
-
1.
|
|
46
|
-
2.
|
|
47
|
-
3.
|
|
44
|
+
1. The runs of the open PRs are read, drafts with green ones are lifted.
|
|
45
|
+
2. The red ones are analysed and fixed.
|
|
46
|
+
3. Only then is the next task taken.
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
Taking a new task while leaving a dozen PRs behind as drafts means reporting work the owner does
|
|
49
|
+
not have: they see a list of "being done", not a list of "done".
|
|
51
50
|
|
|
52
|
-
##
|
|
51
|
+
## The state is read at once
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
What it is read with and how each field is read — pattern `git-workflow-freshness`; here only
|
|
54
|
+
what is done with what was read. An empty run is handled on a par with a red one: a chain PR's
|
|
55
|
+
base is not the main branch, and the base filter does not let such an event through to the
|
|
56
|
+
pipeline.
|
|
57
57
|
|
|
58
|
-
##
|
|
58
|
+
## A red run is analysed by step, not by PR
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
61
|
gh pr checks <номер>
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
The answer names the failed run and a link to it. Then the host is asked the name of the failed
|
|
65
|
+
step — `gh api` on that run, selecting `select(.conclusion=="failure")` over its steps.
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
The step name is the diagnosis. The fix goes into the chain branch where the cause arose, not
|
|
68
|
+
the one where the run went red: in a chain everything above the cause goes red.
|
|
69
69
|
|
|
70
|
-
##
|
|
70
|
+
## The cause is fixed in the lowest branch, then a wave upward
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
A cause shared by the whole chain is fixed once, in the lowest branch. It travels up by merging,
|
|
73
|
+
not by rebasing: a rebase rewrites the history of branches already handed over, and the host
|
|
74
|
+
closes the upper PRs as merged, though main has none of their edits.
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
The wave goes bottom-up, one branch at a time, and each step is three separate calls: switching
|
|
77
|
+
to the next chain branch, merging the previous one into it, pushing. They are not written as one
|
|
78
|
+
line: the delivery guard refuses such a command, and rightly — the check set runs on the tree
|
|
79
|
+
that lies there when the command is reviewed, that is, on the previous branch.
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
A branch skipped in the middle leaves its PR red and breaks the merge order, so the wave passes
|
|
82
|
+
the whole chain.
|
|
83
83
|
|
|
84
|
-
##
|
|
84
|
+
## Common misses
|
|
85
85
|
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
-
|
|
86
|
+
- The draft is not lifted because "the run is still going". The run ended an hour ago; its state
|
|
87
|
+
is read, not the memory of it going.
|
|
88
|
+
- The next task is taken, and a dozen PRs stayed drafts. For the owner nothing is done.
|
|
89
|
+
- The red is fixed in the branch where it went red. In a chain that is the upper one, and the
|
|
90
|
+
cause is in the lower; a fix from above leaves everything under it red.
|
|
91
|
+
- The cause is sent across branches by rebasing. The handed-over branches are rewritten, the PRs
|
|
92
|
+
closed as merged, main has no edits.
|
|
93
|
+
- An empty run taken for a green one. The event never reached the pipeline, and the PR is not
|
|
94
|
+
checked at all.
|