@jskit-ai/agent-docs 0.1.373 → 0.1.375
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/guide/agent/app-setup/authentication.md +34 -18
- package/guide/agent/app-setup/database-layer.md +42 -18
- package/guide/agent/app-setup/existing-application-migration.md +3 -2
- package/guide/agent/app-setup/initial-scaffolding.md +3 -2
- package/guide/agent/app-setup/package-with-nix.md +4 -2
- package/guide/agent/framework/data-access.md +4 -2
- package/guide/agent/framework/material-3.md +4 -2
- package/guide/agent/framework/security-pass.md +2 -1
- package/guide/agent/framework/test-pass.md +55 -4
- package/guide/agent/framework/typed-features.md +45 -3
- package/package.json +1 -1
- package/patterns/feature-package/example/booking-engine/package.json +1 -1
- package/patterns/minimal-foundation/example/AGENTS.md +4 -2
- package/patterns/minimal-foundation/example/package.json +3 -3
- package/patterns/minimal-foundation/example/server.js +2 -2
- package/patterns/shell-foundation/example/AGENTS.md +4 -2
- package/patterns/shell-foundation/example/package.json +4 -4
- package/patterns/shell-foundation/example/packages/main/package.json +1 -1
- package/patterns/shell-foundation/example/server.js +2 -2
- package/patterns/shell-foundation/example/src/components/ShellLayout.vue +13 -10
- package/reference/autogen/KERNEL_MAP.md +2 -0
- package/reference/autogen/PATTERN_INDEX.md +39 -39
- package/reference/autogen/packages/agent-docs.md +1 -1
- package/reference/autogen/packages/assistant-core.md +11 -8
- package/reference/autogen/packages/database-runtime.md +26 -4
- package/reference/autogen/packages/kernel.md +7 -2
- package/reference/autogen/packages/oidc-issuer-core.md +2 -2
- package/reference/autogen/packages/resource-runtime.md +1 -1
- package/reference/autogen/packages/shell-web.md +9 -1
- package/reference/autogen/tooling/jskit-catalog.md +31 -16
- package/reference/autogen/tooling/jskit-release.md +2 -1
- package/reference/autogen/tooling/testUtils.md +7 -0
- package/skills/jskit/references/data-access.md +4 -2
- package/skills/jskit/references/database-layer.md +42 -18
- package/skills/jskit/references/existing-application-migration.md +3 -2
- package/skills/jskit/references/material-3.md +4 -2
- package/skills/jskit/references/package-with-nix.md +4 -2
- package/skills/jskit/references/pattern-index.md +39 -39
- package/skills/jskit/references/patterns/app/minimal-foundation/example/AGENTS.md +4 -2
- package/skills/jskit/references/patterns/app/minimal-foundation/example/package.json +3 -3
- package/skills/jskit/references/patterns/app/minimal-foundation/example/server.js +2 -2
- package/skills/jskit/references/patterns/app/shell-foundation/example/AGENTS.md +4 -2
- package/skills/jskit/references/patterns/app/shell-foundation/example/package.json +4 -4
- package/skills/jskit/references/patterns/app/shell-foundation/example/packages/main/package.json +1 -1
- package/skills/jskit/references/patterns/app/shell-foundation/example/server.js +2 -2
- package/skills/jskit/references/patterns/app/shell-foundation/example/src/components/ShellLayout.vue +13 -10
- package/skills/jskit/references/patterns/auth/accounts-hub/example/package.json +3 -3
- package/skills/jskit/references/patterns/auth/oidc-sign-in/example/package.json +2 -2
- package/skills/jskit/references/patterns/auth/supabase-auth/example/package.json +1 -1
- package/skills/jskit/references/patterns/connectors/calendar-cli/example/package.json +5 -5
- package/skills/jskit/references/patterns/crud/crud-feature-package/example/packages/books/package.json +3 -3
- package/skills/jskit/references/patterns/crud/crud-screen-set/PATTERN.md +3 -1
- package/skills/jskit/references/patterns/database/mysql-application/example/package.json +2 -2
- package/skills/jskit/references/patterns/database/postgres-application/example/package.json +2 -2
- package/skills/jskit/references/patterns/realtime/realtime-application/example/package.json +2 -2
- package/skills/jskit/references/patterns/server/feature-package/example/booking-engine/package.json +1 -1
- package/skills/jskit/references/patterns/shell/application-shell/example/src/components/ShellLayout.vue +13 -10
- package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users/package.json +3 -3
- package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users-workspace/package.json +6 -6
- package/skills/jskit/references/security-pass.md +2 -1
- package/skills/jskit/references/test-pass.md +55 -4
- package/skills/jskit/references/typed-features.md +45 -3
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"./shared": "./src/shared/index.js"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@jskit-ai/crud-core": "0.2.
|
|
14
|
-
"@jskit-ai/resource-crud-core": "0.1.
|
|
15
|
-
"@jskit-ai/users-core": "0.2.
|
|
13
|
+
"@jskit-ai/crud-core": "0.2.65",
|
|
14
|
+
"@jskit-ai/resource-crud-core": "0.1.231",
|
|
15
|
+
"@jskit-ai/users-core": "0.2.76"
|
|
16
16
|
},
|
|
17
17
|
"jskit": {
|
|
18
18
|
"kind": "runtime",
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
"./shared": "./src/shared/index.js"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@jskit-ai/crud-core": "0.2.
|
|
14
|
-
"@jskit-ai/resource-crud-core": "0.1.
|
|
15
|
-
"@jskit-ai/users-core": "0.2.
|
|
16
|
-
"@jskit-ai/workspaces-core": "0.2.
|
|
13
|
+
"@jskit-ai/crud-core": "0.2.65",
|
|
14
|
+
"@jskit-ai/resource-crud-core": "0.1.231",
|
|
15
|
+
"@jskit-ai/users-core": "0.2.76",
|
|
16
|
+
"@jskit-ai/workspaces-core": "0.2.76"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@jskit-ai/kernel": "0.2.
|
|
20
|
-
"@jskit-ai/resource-runtime": "0.2.
|
|
19
|
+
"@jskit-ai/kernel": "0.2.38",
|
|
20
|
+
"@jskit-ai/resource-runtime": "0.2.61"
|
|
21
21
|
},
|
|
22
22
|
"jskit": {
|
|
23
23
|
"kind": "runtime",
|
|
@@ -70,7 +70,8 @@ a JSKIT app. The rules it applies are already in [Typed features](typed-features
|
|
|
70
70
|
account wait after repeated failures; both are on by default.
|
|
71
71
|
`config.auth.rateLimits` changes a limit and `false` removes one: a removed
|
|
72
72
|
limit is a finding unless the person chose it. Behind a proxy,
|
|
73
|
-
`TRUSTED_PROXIES` names it
|
|
73
|
+
`TRUSTED_PROXIES` names it (on mobilynet, the `MOBILYNET_EDGE_ADDRESSES`
|
|
74
|
+
mobilynet sets names its edge), or every client shares one count
|
|
74
75
|
([Sign-in protection](/guide/app-setup/authentication#sign-in-protection)).
|
|
75
76
|
- Any other route that repetition can abuse (sending email or codes,
|
|
76
77
|
invitations, costly reads, calls to a paid service) declares
|
|
@@ -14,8 +14,19 @@ The rules it applies are in [Typed features](typed-features.md),
|
|
|
14
14
|
[UI operations](ui-operations.md); query counts belong to the
|
|
15
15
|
[data pass](data-pass.md).
|
|
16
16
|
|
|
17
|
-
## Run the
|
|
17
|
+
## Run the whole suite first
|
|
18
18
|
|
|
19
|
+
- Start from one run of the whole suite, as `npm run verify` runs it: each of
|
|
20
|
+
its parts once, with the same commands, environment and
|
|
21
|
+
`V64_TEST_CONCURRENCY`, going on past a part that fails, each part's full
|
|
22
|
+
output and exit status kept in a file, with `jskit test`'s
|
|
23
|
+
`file-times.json`. This run is the pass's measurement before.
|
|
24
|
+
- Read that run to find what is wrong: the slowest files and parametrized
|
|
25
|
+
tests and where their time goes, tests repeated per width, locale, theme,
|
|
26
|
+
role or provider, each test's time before its first check, files or
|
|
27
|
+
packages run one after another, failures, skips with no covering run, and
|
|
28
|
+
`JSKIT_TEST_NETWORK_REFUSED` or warning lines. Fix from that run's evidence,
|
|
29
|
+
never from guesses or partial runs, and prove each fix against its numbers.
|
|
19
30
|
- `npx jskit check` reads the test scripts, test files, Playwright and Vitest
|
|
20
31
|
configs, CI workflows and the root Vite config, and names what makes a run
|
|
21
32
|
slow, fragile or unsafe, each finding with the change to make
|
|
@@ -52,6 +63,14 @@ The rules it applies are in [Typed features](typed-features.md),
|
|
|
52
63
|
of serial runs queued one after another. Run on the host's test machine, when the host offers one, not on a
|
|
53
64
|
shared development host; a time taken while other work loads the machine is
|
|
54
65
|
reported as such and never used as a baseline.
|
|
66
|
+
- From that run, rank the time by file and by parametrized test:
|
|
67
|
+
`file-times.json` and each part's 10 slowest files and tests, with a
|
|
68
|
+
parametrized test's variants (a loop over widths, roles or providers) summed
|
|
69
|
+
from the kept output. For each top item, say where its time goes:
|
|
70
|
+
preparation, server start, page load, sign-in, or its own checks.
|
|
71
|
+
- List the tests repeated per width, locale, theme, role or provider, with the
|
|
72
|
+
minutes in their repeated parts, and take each browser test's time before its
|
|
73
|
+
first check from its trace or from a timestamp at that check.
|
|
55
74
|
- The pass's own measurement, one run of each part before the work and one
|
|
56
75
|
after, is part of the pass the person asked for. `npm run verify`, the whole
|
|
57
76
|
run, runs once, at the end, only with the person's OK.
|
|
@@ -136,6 +155,35 @@ The rules it applies are in [Typed features](typed-features.md),
|
|
|
136
155
|
A build that writes into its own inputs is never reused (`not kept for
|
|
137
156
|
reuse, as src changed while it ran`): vue-router's generated types go to
|
|
138
157
|
`types/typed-router.d.ts`, outside `src`.
|
|
158
|
+
- Screen sizes are covered once each, not by repeating journeys. The full
|
|
159
|
+
journey runs once at desktop. At phone, it runs only the steps that differ
|
|
160
|
+
there: the drawer, the bottom navigation, a dialog that goes full screen. The
|
|
161
|
+
other widths get layout checks on the finished pages, with
|
|
162
|
+
`page.setViewportSize()` and the layout's assertions. A page that decides its
|
|
163
|
+
layout when it loads is reloaded at the new size first. A test for several
|
|
164
|
+
locales, themes, roles or providers repeats only the checks the variant
|
|
165
|
+
changes. A parametrized test's variants share the setup they don't change: a
|
|
166
|
+
`before` hook or a worker-scoped fixture, not a rebuild per variant. The
|
|
167
|
+
minutes in repeated parts, before and after, prove it.
|
|
168
|
+
- What most of a test's time goes to before its first check is paid once per
|
|
169
|
+
worker or file: `browserTestConfig()`'s `signIn` module signs each worker in
|
|
170
|
+
once, and a worker-scoped fixture holds an app or page every test of the
|
|
171
|
+
worker shares. Each test's time before its first check, before and after,
|
|
172
|
+
proves it.
|
|
173
|
+
- No test runs `npm install`, `npm ci`, `git clone` or a build of its own:
|
|
174
|
+
what it needs is made once by `--test-global-setup`. A search of the test
|
|
175
|
+
files and helpers for those commands proves it.
|
|
176
|
+
- A file that holds a large share of a part's wall time is split at its real
|
|
177
|
+
seams, as its tests run in turn: `file-times.json` shows its share, and the
|
|
178
|
+
part's wall time before and after proves the split.
|
|
179
|
+
- An app of several packages runs every package's test files in one parallel
|
|
180
|
+
pool: `npm --workspaces test` runs them package after package. The whole
|
|
181
|
+
run's wall time, near the sum of all files' times divided by the budget,
|
|
182
|
+
proves it.
|
|
183
|
+
- No script runs a suite, build or check twice: `npm run verify` and CI run
|
|
184
|
+
each part once, a preliminary check repeats nothing the run after it covers,
|
|
185
|
+
and a check that passed on the exact tree is never run again. Each part
|
|
186
|
+
starting once in the whole run's output proves it.
|
|
139
187
|
- No fixed sleep: a web-first assertion (`await expect(locator).toBeVisible()`),
|
|
140
188
|
`expect.poll()`, the event itself, or a fake clock (`mock.timers`,
|
|
141
189
|
`vi.useFakeTimers()`, `page.clock`) for the app's own delays. A poll's
|
|
@@ -146,10 +194,13 @@ The rules it applies are in [Typed features](typed-features.md),
|
|
|
146
194
|
`// jskit-test: fixed-wait - <what the window proves, or the latency the stand-in simulates>`.
|
|
147
195
|
- A file imports what it needs at its top level, so loading counts against the
|
|
148
196
|
file, not a test's time limit.
|
|
149
|
-
- The bounds stay: `jskit test`'s 10 minutes a file and 45 a run,
|
|
197
|
+
- The bounds stay: `jskit test`'s 10 minutes a file and 45 a run, its 10
|
|
198
|
+
seconds a file's process may live on after its last test (the linger
|
|
199
|
+
bound, which names what a test left open, or says the file was busy), and
|
|
150
200
|
`browserTestConfig()`'s `actionTimeout`, `navigationTimeout` and
|
|
151
|
-
`globalTimeout`. A bound in
|
|
152
|
-
measurement of the work's real
|
|
201
|
+
`globalTimeout`. A bound in
|
|
202
|
+
`test-time-bounds.json` rises only with a measurement of the work's real
|
|
203
|
+
need; a file stopped at the linger bound closes what its tests leave open.
|
|
153
204
|
- A passing run prints what a person reads: test servers log at
|
|
154
205
|
`LOG_LEVEL=warn` unless the shell asks for more.
|
|
155
206
|
|
|
@@ -1101,8 +1101,14 @@ the last run's largest app server reached.**
|
|
|
1101
1101
|
same number for a config.
|
|
1102
1102
|
- A Node test file is named `<name>.test.js`, and a database test
|
|
1103
1103
|
`<name>.integration.test.js`: given no files, `jskit test` runs node's
|
|
1104
|
-
default pattern
|
|
1105
|
-
|
|
1104
|
+
default pattern, less the files under a `support/` or `fixtures/` folder or
|
|
1105
|
+
`src/test/` not named as tests, and fails on a `tests/` file it would leave
|
|
1106
|
+
out, such as `<name>.integration.js` or `<name>.spec.js`, and on a run that
|
|
1107
|
+
takes no test file at all, before it prepares any test database.
|
|
1108
|
+
- A helper or fixture that tests import goes under `test/support/` or
|
|
1109
|
+
`test/fixtures/`, named as no test is (not `test-*.js`, `*.test.js`,
|
|
1110
|
+
`*_test.js` or `*-test.js`): `jskit test` fails a file it takes that declares
|
|
1111
|
+
no tests, naming it.
|
|
1106
1112
|
- No script passes a fixed concurrency or worker count. `jskit check` fails a
|
|
1107
1113
|
package script that runs `node --test` directly or passes one, a Vitest
|
|
1108
1114
|
config those scripts use whose `maxWorkers` does not come from
|
|
@@ -1150,6 +1156,26 @@ the last run's largest app server reached.**
|
|
|
1150
1156
|
each test signing in. `jskit check` fails a webServer that runs the development server
|
|
1151
1157
|
(`npm run develop`, `vite`), one webServer shared by every worker, and a
|
|
1152
1158
|
config without a `globalTimeout`.
|
|
1159
|
+
- Every test of a worker reaches its server from 127.0.0.1, as a different
|
|
1160
|
+
person each time, so the servers `jskit browser tests` starts count no
|
|
1161
|
+
per-address rate limit: a route's `rateLimit`, auth's sign-in limits and the
|
|
1162
|
+
accounts hub's per-address counters. The launcher sets
|
|
1163
|
+
`JSKIT_BROWSER_TEST_SERVER=1`, and a server with it whose `APP_ENV` is not
|
|
1164
|
+
`test` refuses to start. Prove a limit with a Node test against an ordinary
|
|
1165
|
+
server.
|
|
1166
|
+
- A failed test keeps its trace with DOM snapshots. To take them, Playwright
|
|
1167
|
+
runs a script in every frame, and Chromium logs `Blocked script execution in
|
|
1168
|
+
'about:srcdoc' because the document's frame is sandboxed and the
|
|
1169
|
+
'allow-scripts' permission is not set.` for each frame sandboxed without
|
|
1170
|
+
`allow-scripts`, such as an email preview: the sandbox at work, not the app.
|
|
1171
|
+
A test that fails on console errors leaves out that line, and only that line.
|
|
1172
|
+
- JSKIT's realtime connects by WebSocket only, which `page.route()` and
|
|
1173
|
+
`context.route()` never see, so an HTTP route that aborts `/socket.io`
|
|
1174
|
+
changes nothing. A test that must run without live updates closes the socket
|
|
1175
|
+
with `context.routeWebSocket(/\/socket\.io\//, (socket) => socket.close())`
|
|
1176
|
+
before its page opens. Any HTTP route also turns the browser's cache off for
|
|
1177
|
+
its page or context, so a guard that only watches requests listens to
|
|
1178
|
+
`page.on("request")` instead.
|
|
1153
1179
|
- A file that truly cannot run beside others, because it holds a resource of
|
|
1154
1180
|
the whole machine, says why on its first line,
|
|
1155
1181
|
`// jskit-test: alone - <reason>`. `jskit test` runs it after the others,
|
|
@@ -1180,6 +1206,22 @@ the last run's largest app server reached.**
|
|
|
1180
1206
|
files still finish and report: look for what it leaves open (a server, child
|
|
1181
1207
|
process, timer or socket) or a test without a timeout. A file with its own
|
|
1182
1208
|
bound is stopped at twice that bound.
|
|
1209
|
+
- A file whose tests have all ended but whose process is still running 10
|
|
1210
|
+
seconds later (the linger bound, `lingerMs`; its `after` hooks run within
|
|
1211
|
+
it) is stopped too, and fails the run by name with what its process still
|
|
1212
|
+
holds open, from `process.getActiveResourcesInfo()` read inside it, less
|
|
1213
|
+
its own stdout and stderr, and stdin unless something reads it: `Timeout`
|
|
1214
|
+
for an interval or timer, `TCPServerWrap` for a listening server,
|
|
1215
|
+
`TCPSocketWrap` for a connection, `ProcessWrap` for a child process,
|
|
1216
|
+
`PipeWrap` for a pipe or stdin being read. A test left it running: close
|
|
1217
|
+
it in the test or an `after` hook. A file still busy past the bound with
|
|
1218
|
+
nothing open fails the run as `busy, not held open`, with how long it
|
|
1219
|
+
lived on, whether its stop met it late or it ended by itself first: finish
|
|
1220
|
+
the work it does after its last test within the tests. A file's process
|
|
1221
|
+
normally ends within moments of its last test, and the report says the
|
|
1222
|
+
longest any took against the bound. Files marked `alone` or `network` get
|
|
1223
|
+
the same bound. A suite whose measured cleanup needs longer sets `lingerMs` in
|
|
1224
|
+
`test-time-bounds.json`, with the measurement in the commit that raises it.
|
|
1183
1225
|
|
|
1184
1226
|
Why: `jskit test` and `testConcurrency()` read one budget, so every runner
|
|
1185
1227
|
uses the machine without starving the other runs on it.
|
|
@@ -1441,7 +1483,7 @@ that must run alone says so on its own first line instead.
|
|
|
1441
1483
|
| `test/playwright-isolation` | a Playwright webServer every worker shares, without `browserTestConfig()` | [Test files run in parallel](#test-files-run-in-parallel) |
|
|
1442
1484
|
| `test/playwright-global-timeout` | a Playwright config without a `globalTimeout` (or `browserTestConfig()`), or with `globalTimeout: 0` | [Test files run in parallel](#test-files-run-in-parallel) |
|
|
1443
1485
|
| `test/vitest-workers` | `--maxWorkers`, `--minWorkers` or `--no-file-parallelism` passed to Vitest, or its config without `maxWorkers: testConcurrency()` or with `fileParallelism: false` | [Test files run in parallel](#test-files-run-in-parallel) |
|
|
1444
|
-
| `test/script-files` | a script that gives `jskit test` the files node's default pattern selects anyway (`jskit test --databases tests/**/*.test.js`), so `npm test -- <file>` runs every file and that one; drop them, as `jskit test` finds those files itself. A script that runs some of them (`tests/server/*.test.js`) or files the pattern leaves out (`tests/*.
|
|
1486
|
+
| `test/script-files` | a script that gives `jskit test` the files node's default pattern selects anyway (`jskit test --databases tests/**/*.test.js`), so `npm test -- <file>` runs every file and that one; drop them, as `jskit test` finds those files itself. While a `tests/` file named as a test ends in no `.test.js` (`x.integration.js`), which `jskit test` given no files refuses, the finding names it to rename first (a database test: `<name>.integration.test.js`). A script that runs some of them (`tests/server/*.test.js`) or files the pattern leaves out (`tests/bench/*.bench.js`) names them for a reason and is not reported | [Test files run in parallel](#test-files-run-in-parallel) |
|
|
1445
1487
|
|
|
1446
1488
|
The rules see shapes, not intent. Feature files, owned state beyond
|
|
1447
1489
|
registries, shutdown, loggers, shared action fields, strict inputs, the action
|