@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,137 +2,143 @@
|
|
|
2
2
|
name: browser-verification-stand
|
|
3
3
|
kind: pattern
|
|
4
4
|
rule: browser-verification
|
|
5
|
-
description:
|
|
5
|
+
description: Pattern of rule browser-verification. Load when an honest stand is needed — the production build of the site, the admin stand, a stand behind real nginx, signing in to the admin, finding out what sits on a port. Not for layout measurements — that is pattern browser-verification-measure.
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# An honest stand
|
|
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
|
-
-
|
|
18
|
-
-
|
|
15
|
+
- What is checked is not visible on the dev server: server-side markup, locales, cache,
|
|
16
|
+
redirects, headers, bundle size.
|
|
17
|
+
- The port answers with something other than what was expected.
|
|
18
|
+
- Signing in to the admin is needed.
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Port numbers are declared by the tree, not by the pattern
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
The commands below name the ports by name — `API_PORT`, `SITE_PORT`, `ADMIN_PORT`, `SSR_PORT`, the
|
|
23
|
+
stand ports and the proxy ports. The pattern has no numbers: every tree lays out its stands its own
|
|
24
|
+
way, and a tree with one application, obliged to name eight foreign numbers, names invented ones —
|
|
25
|
+
and the substitutions lose their meaning. The tree declares the numbers by its own profile: in
|
|
26
|
+
environment variables or in an override section of this pattern, where its own ready-made commands
|
|
27
|
+
stand with the names of the runner targets.
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
The role of each name is what the prose speaks of: the intake port, the site port, the admin port,
|
|
30
|
+
the rendering server port. A tree that has no such application does not read those sections.
|
|
30
31
|
|
|
31
|
-
##
|
|
32
|
+
## First — what answers on the port
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
Before the first request, not after a puzzling answer:
|
|
34
35
|
|
|
35
36
|
```bash
|
|
36
37
|
lsof -nP -iTCP:$API_PORT -sTCP:LISTEN
|
|
37
38
|
```
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
(`node -r dotenv/config dist/apps/api/main.js`):
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
A built artifact from a past session regularly hangs on the intake port
|
|
41
|
+
(`node -r dotenv/config dist/apps/api/main.js`): it answers 200 with old code, and the procedure
|
|
42
|
+
created in the branch it does not have at all. There may be several such processes, and all of
|
|
43
|
+
them must be killed — by PID from `lsof`, each one: `pkill` by the pattern `nx serve api` hits none
|
|
44
|
+
of them.
|
|
43
45
|
|
|
44
|
-
##
|
|
46
|
+
## Production build of the site
|
|
45
47
|
|
|
46
48
|
```bash
|
|
47
49
|
npx nx build site
|
|
48
50
|
PORT=$SITE_STAND_PORT node dist/apps/site/server/server.mjs
|
|
49
51
|
```
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
This is not a dev server: the guard catches `nx|ng serve`, package runners and static servers, and
|
|
54
|
+
lets the launch of a built server through.
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
Behaviour that depends on the host — the owner's address, a redirect away, a different answer on
|
|
57
|
+
different names — is checked right here with one request carrying the given header. A proxy with
|
|
58
|
+
substitution is not needed for that: it adds one more process whose behaviour will have to be told
|
|
59
|
+
apart from the one under check.
|
|
57
60
|
|
|
58
|
-
##
|
|
61
|
+
## Admin stand
|
|
59
62
|
|
|
60
63
|
```bash
|
|
61
64
|
npx nx build admin --base-href=/
|
|
62
65
|
```
|
|
63
66
|
|
|
64
|
-
|
|
65
|
-
Angular DevTools
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
67
|
+
Without `--base-href` the stand serves an empty page with no errors in the console. A stand that
|
|
68
|
+
needs Angular DevTools also needs the dev configuration (`--configuration=development`): the
|
|
69
|
+
production build does not publish `window.ng`. No conclusions about bundle size and minification
|
|
70
|
+
may be drawn from such a build.
|
|
71
|
+
|
|
72
|
+
What was built is served by the tree's proxy with its real config, not by a static server. There are
|
|
73
|
+
two reasons, and both surface in the first minute. The application calls procedures on its own
|
|
74
|
+
origin, and on a deep link a static server answers `404`: it knows nothing of the single-page
|
|
75
|
+
application's routes and does not fall back to its entry point. The dev-server guard refuses such a
|
|
76
|
+
server the same as `nx serve`, and that is a pointer to the right move, not an obstacle. The
|
|
77
|
+
ready-made call is the section "A stand behind real nginx" below; it both serves what was built and
|
|
78
|
+
proxies the procedures.
|
|
79
|
+
|
|
80
|
+
Sign-in is done through the form, as a person does it. The account of the local development
|
|
81
|
+
database is not the owner's secret: the seed of the same tree puts it there, and the password lies
|
|
82
|
+
in the environment file next to it. Permission for it is not asked — permission is asked about a
|
|
83
|
+
production account, and there is never one on a local stand. Where there is no intake nearby, the
|
|
84
|
+
stand itself substitutes the sign-in answer: the application's path stays the same as a person's.
|
|
85
|
+
|
|
86
|
+
The token is not signed by hand and not put into browser storage by hand: put there so, it checks
|
|
87
|
+
the screen while bypassing the live sign-in path — that is, it answers the wrong question. Asking
|
|
88
|
+
a person to type a password, open a tab or press a button means a wrongly chosen path, not a lack
|
|
89
|
+
of rights on the executor's side.
|
|
90
|
+
|
|
91
|
+
**Ask for the work mode, not for the input.** Input into the password field is refused by the
|
|
92
|
+
classifier of automatic mode: it judges the action itself and does not tell addresses apart — a
|
|
93
|
+
stand on a local port looks to it like the production site. There is one move from here: name the
|
|
94
|
+
refused action to the owner, ask for normal mode, fill the form with the seed pair yourself and
|
|
95
|
+
return to automatic mode. The request "sign in yourself" and "type the password" shifts the
|
|
96
|
+
agent's work onto the owner and looks legitimate exactly because a real obstacle stands before
|
|
97
|
+
it: a refused field, a foreign extension in the browser, a profile that disconnected. The
|
|
98
|
+
obstacle stays the agent's obstacle.
|
|
99
|
+
|
|
100
|
+
The ways to lift the obstacle by one's own means come before any request. Substitute the value with
|
|
101
|
+
the form tool by a reference to the element; switch off the interfering extension in the browser
|
|
102
|
+
profile; raise the stand on another address. A second driver is not justified by the password field:
|
|
103
|
+
it fills the same field without the classifier, but the bypassed ban is lifted not from one field
|
|
104
|
+
but from all of them at once. Normal mode left on removes confirmation from every later action of
|
|
105
|
+
the session too, so the return is part of the sign-in, not a separate clean-up.
|
|
106
|
+
|
|
107
|
+
The owner's stand is never a fallback path: it builds the main branch and says nothing about the
|
|
108
|
+
edit in the working tree.
|
|
109
|
+
|
|
110
|
+
## API stand
|
|
111
|
+
|
|
112
|
+
The built artifact is raised on a free port, not on the intake port: there the owner's intake
|
|
113
|
+
answers, and its environment is not the one under check.
|
|
108
114
|
|
|
109
115
|
```bash
|
|
110
116
|
npx nx build api
|
|
111
117
|
env -u JWT_SECRET NODE_ENV=production API_PORT=$API_STAND_PORT DATABASE_URL=… node dist/apps/api/main.js
|
|
112
118
|
```
|
|
113
119
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
120
|
+
Environment variables are set in the command itself, one per case under check. A refusal at start-up
|
|
121
|
+
is as much a check result as a 200 answer. An application that fell in a provider factory does not
|
|
122
|
+
listen on the port at all, and that is seen by `lsof`, not by the text in the console.
|
|
117
123
|
|
|
118
|
-
|
|
124
|
+
A procedure is called by its full name, as the contract declares it:
|
|
119
125
|
|
|
120
126
|
```bash
|
|
121
|
-
curl -sS -X POST http://localhost:$API_STAND_PORT
|
|
127
|
+
curl -sS -X POST http://localhost:$API_STAND_PORT/<area>.v1.AuthService/GetMe \
|
|
122
128
|
-H 'content-type: application/json' -H "authorization: Bearer $TOKEN" -d '{}'
|
|
123
129
|
```
|
|
124
130
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
131
|
+
A token is signed by hand only where the signature itself is under check: proving that the debug
|
|
132
|
+
key is accepted has no other path. In every other case the token is taken from the live API by
|
|
133
|
+
signing in — a hand-written one hides a divergence in the set of claims.
|
|
128
134
|
|
|
129
|
-
##
|
|
135
|
+
## A stand behind real nginx
|
|
130
136
|
|
|
131
|
-
|
|
132
|
-
|
|
137
|
+
Cache, redirects and headers live in `deploy/nginx.conf`, not in the application. Any conclusion
|
|
138
|
+
about `301`, `Cache-Control` and `X-Cache-Status` is drawn only here:
|
|
133
139
|
|
|
134
140
|
```bash
|
|
135
|
-
docker run -d --name
|
|
141
|
+
docker run -d --name <prefix>-stand-nginx \
|
|
136
142
|
--add-host api:host-gateway --add-host ssr:host-gateway \
|
|
137
143
|
-p $PROXY_SITE_PORT:80 -p $PROXY_ADMIN_PORT:8081 \
|
|
138
144
|
-v "$PWD/deploy/nginx/main.conf:/etc/nginx/nginx.conf:ro" \
|
|
@@ -141,61 +147,65 @@ docker run -d --name <префикс>-stand-nginx \
|
|
|
141
147
|
nginx:1.27-alpine
|
|
142
148
|
```
|
|
143
149
|
|
|
144
|
-
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
150
|
+
- The config is mounted **as a directory**, not as a single file: the editor recreates the file,
|
|
151
|
+
the container is left with a truncated copy, and `nginx -t` inside falls on "unexpected end of
|
|
152
|
+
file" while the file outside is whole. Cured by recreating the container, not by editing the
|
|
153
|
+
config.
|
|
154
|
+
- The main config is substituted by a separate line: it lies in `deploy/nginx/`, not next to
|
|
155
|
+
`nginx.conf` — a file with the `.conf` extension in the mounted directory would get into
|
|
156
|
+
`include` and bring nginx down on the `user` directive. Without it the stand comes up on the
|
|
157
|
+
image's config, and the connection limit per worker there is its own.
|
|
158
|
+
- A foreign `Host` is refused by the **dev server**, not by the built application: the production
|
|
159
|
+
build answers it the same as its own. Behind the real proxy requests go with their own header
|
|
160
|
+
exactly because the proxy stands in front of the dev server — hence `-H "Host: localhost"`.
|
|
161
|
+
- The stand's environment variables must point at the stand's processes. `CACHE_REFRESH_URL`
|
|
162
|
+
pointed at the site port resets the cache past the process that keeps the redirect table in
|
|
163
|
+
memory — and a working mechanism looks broken.
|
|
164
|
+
|
|
165
|
+
## A stand lives exactly as long as the check
|
|
166
|
+
|
|
167
|
+
A stand is raised for one conclusion and is not needed after it. Abandoned, it hinders nothing and
|
|
168
|
+
gives no signal. It has its own name, a free port, it takes almost no room — it can be seen only by
|
|
169
|
+
a call to the list, and there is no reason to call it. So it is a person who has to take apart what
|
|
170
|
+
piled up, and they cannot tell an abandoned stand from a live one of a neighbouring tree by name.
|
|
171
|
+
|
|
172
|
+
Teardown goes by the same move the conclusion was made with:
|
|
166
173
|
|
|
167
174
|
```bash
|
|
168
|
-
docker rm -f
|
|
175
|
+
docker rm -f <stand name>
|
|
169
176
|
```
|
|
170
177
|
|
|
171
|
-
|
|
178
|
+
The name is given by the task number — so it is visible whose stand was left if the move broke off
|
|
179
|
+
after all.
|
|
172
180
|
|
|
173
|
-
##
|
|
181
|
+
## A tree for comparison
|
|
174
182
|
|
|
175
|
-
|
|
176
|
-
|
|
183
|
+
"The edit broke this" can be said only when it is visible that before the edit it was otherwise.
|
|
184
|
+
That is checked with a second tree, not from memory:
|
|
177
185
|
|
|
178
186
|
```bash
|
|
179
|
-
git worktree add
|
|
180
|
-
pnpm install --frozen-lockfile #
|
|
187
|
+
git worktree add ../<prefix>-base <commit> # the task branch is not touched
|
|
188
|
+
pnpm install --frozen-lockfile # from ../<prefix>-base: its node_modules are its own
|
|
181
189
|
```
|
|
182
190
|
|
|
183
|
-
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
191
|
+
- For comparison take not the main branch but the last commit on which the tree builds: main is
|
|
192
|
+
sometimes broken, and then "before" and "after" differ not because of the edit. Whether a commit
|
|
193
|
+
builds is checked by building, not by its being in the main branch.
|
|
194
|
+
- The stand of the second tree is raised on its own ports: the site, admin and intake ports are
|
|
195
|
+
taken by the owner, and the rendering port must not be taken — the developer's stand goes by the
|
|
196
|
+
name `ssr:<rendering port>`.
|
|
197
|
+
- Both stands are kept up at the same time — exactly until the comparison ends: comparing from
|
|
198
|
+
memory between two launches, you notice only what you managed to remember. With the comparison
|
|
199
|
+
done, the stand of the second tree is torn down by the same move, not left until the end of the
|
|
200
|
+
session. Stands left behind pile up across sessions and hold connections to the storage, and the
|
|
201
|
+
rule says so in a pitfall. Teardown refused — the stand is named to the owner at the end of the
|
|
202
|
+
session by name, with the port.
|
|
203
|
+
|
|
204
|
+
## The state of the ports is taken before the first build of the session
|
|
205
|
+
|
|
206
|
+
The owner's servers go down without your involvement: the site answered 404 on all its addresses
|
|
207
|
+
before the first build of the session, and the API fell silent in the middle of it. Without a
|
|
208
|
+
"before" measurement a fall can be neither attributed to your build nor cleared of suspicion.
|
|
199
209
|
|
|
200
210
|
```bash
|
|
201
211
|
for u in http://localhost:$API_PORT/health http://localhost:$SITE_PORT/ http://localhost:$ADMIN_PORT/; do
|
|
@@ -203,30 +213,32 @@ for u in http://localhost:$API_PORT/health http://localhost:$SITE_PORT/ http://l
|
|
|
203
213
|
done
|
|
204
214
|
```
|
|
205
215
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
##
|
|
210
|
-
|
|
211
|
-
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
-
|
|
217
|
-
|
|
218
|
-
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
216
|
+
The measurement is the answer, not `lsof`: the port is sometimes taken by a built artifact from a
|
|
217
|
+
past session, and it answers 200 with old code.
|
|
218
|
+
|
|
219
|
+
## Common misses
|
|
220
|
+
|
|
221
|
+
- **A single project build the servers survive, and there is no reason to give it up.** Measured
|
|
222
|
+
by the answer before and after: all ports stayed with their processes. Caution here costs more
|
|
223
|
+
than the check — a whole set of layout checks was left unrun exactly because the build was
|
|
224
|
+
deemed dangerous without measuring. A build from the cache is not a measurement: it builds
|
|
225
|
+
nothing at all, and that is visible by its duration.
|
|
226
|
+
- Do not raise your own dev server: the site, the admin and the intake are already up by the
|
|
227
|
+
owner, and a second instance is refused by the guard.
|
|
228
|
+
- **A refused static server is read as a ban on the check, while it is a pointer to the right
|
|
229
|
+
move.** It may not serve what was built not out of caution: the application calls its own
|
|
230
|
+
origin, and a deep link answers `404`. From here one goes not to bypass the guard but to the
|
|
231
|
+
tree's proxy with its real config.
|
|
232
|
+
- **The owner's dev server is a place to look, not a place to check.** The conclusion that the
|
|
233
|
+
screen is right is drawn on the production build behind the real proxy: server-side markup,
|
|
234
|
+
locales, cache, redirects and headers on the dev server are either different or absent
|
|
235
|
+
altogether. A look at the raised dev server is fit to understand what is going on on an
|
|
236
|
+
unfamiliar screen and unfit as confirmation: the confirmation is a measurement on a stand from
|
|
237
|
+
the production build.
|
|
238
|
+
- **A build of everything silences all three dev servers of the owner, not only the API.** After
|
|
239
|
+
`nx run-many -t build` both the site and the admin go down. Build what you check
|
|
240
|
+
(`npx nx build site`), not the whole tree. If the servers went down, the agent cannot bring them
|
|
241
|
+
back up — the guard is in the way, so the owner is told at once, not at the end of the session.
|
|
242
|
+
- Take the rendering port with care: the developer's stand goes by the same name
|
|
243
|
+
`ssr:<rendering port>` through `host-gateway`, and while a foreign process hangs on it, the
|
|
244
|
+
stand serves a foreign build.
|