@jskit-ai/agent-docs 0.1.374 → 0.1.376

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.
Files changed (53) hide show
  1. package/guide/agent/app-extras/assistant-conversation.md +15 -5
  2. package/guide/agent/app-extras/assistant.md +10 -1
  3. package/guide/agent/app-setup/database-layer.md +42 -18
  4. package/guide/agent/framework/data-access.md +4 -2
  5. package/guide/agent/framework/material-3.md +4 -2
  6. package/guide/agent/framework/test-pass.md +55 -4
  7. package/guide/agent/framework/typed-features.md +45 -3
  8. package/package.json +1 -1
  9. package/patterns/feature-package/example/booking-engine/package.json +1 -1
  10. package/patterns/minimal-foundation/example/AGENTS.md +4 -2
  11. package/patterns/minimal-foundation/example/package.json +3 -3
  12. package/patterns/shell-foundation/example/AGENTS.md +4 -2
  13. package/patterns/shell-foundation/example/package.json +4 -4
  14. package/patterns/shell-foundation/example/packages/main/package.json +1 -1
  15. package/patterns/shell-foundation/example/src/components/ShellLayout.vue +13 -10
  16. package/reference/autogen/KERNEL_MAP.md +2 -0
  17. package/reference/autogen/PATTERN_INDEX.md +39 -39
  18. package/reference/autogen/packages/agent-docs.md +1 -1
  19. package/reference/autogen/packages/assistant-core.md +24 -11
  20. package/reference/autogen/packages/assistant-runtime.md +1 -0
  21. package/reference/autogen/packages/database-runtime.md +26 -4
  22. package/reference/autogen/packages/kernel.md +5 -2
  23. package/reference/autogen/packages/oidc-issuer-core.md +2 -2
  24. package/reference/autogen/packages/resource-runtime.md +1 -1
  25. package/reference/autogen/packages/shell-web.md +9 -1
  26. package/reference/autogen/tooling/jskit-catalog.md +31 -16
  27. package/reference/autogen/tooling/jskit-release.md +2 -1
  28. package/reference/autogen/tooling/testUtils.md +7 -0
  29. package/skills/jskit/references/data-access.md +4 -2
  30. package/skills/jskit/references/database-layer.md +42 -18
  31. package/skills/jskit/references/material-3.md +4 -2
  32. package/skills/jskit/references/pattern-index.md +39 -39
  33. package/skills/jskit/references/patterns/app/minimal-foundation/example/AGENTS.md +4 -2
  34. package/skills/jskit/references/patterns/app/minimal-foundation/example/package.json +3 -3
  35. package/skills/jskit/references/patterns/app/shell-foundation/example/AGENTS.md +4 -2
  36. package/skills/jskit/references/patterns/app/shell-foundation/example/package.json +4 -4
  37. package/skills/jskit/references/patterns/app/shell-foundation/example/packages/main/package.json +1 -1
  38. package/skills/jskit/references/patterns/app/shell-foundation/example/src/components/ShellLayout.vue +13 -10
  39. package/skills/jskit/references/patterns/auth/accounts-hub/example/package.json +3 -3
  40. package/skills/jskit/references/patterns/auth/oidc-sign-in/example/package.json +2 -2
  41. package/skills/jskit/references/patterns/auth/supabase-auth/example/package.json +1 -1
  42. package/skills/jskit/references/patterns/connectors/calendar-cli/example/package.json +5 -5
  43. package/skills/jskit/references/patterns/crud/crud-feature-package/example/packages/books/package.json +3 -3
  44. package/skills/jskit/references/patterns/crud/crud-screen-set/PATTERN.md +3 -1
  45. package/skills/jskit/references/patterns/database/mysql-application/example/package.json +2 -2
  46. package/skills/jskit/references/patterns/database/postgres-application/example/package.json +2 -2
  47. package/skills/jskit/references/patterns/realtime/realtime-application/example/package.json +2 -2
  48. package/skills/jskit/references/patterns/server/feature-package/example/booking-engine/package.json +1 -1
  49. package/skills/jskit/references/patterns/shell/application-shell/example/src/components/ShellLayout.vue +13 -10
  50. package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users/package.json +3 -3
  51. package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users-workspace/package.json +6 -6
  52. package/skills/jskit/references/test-pass.md +55 -4
  53. package/skills/jskit/references/typed-features.md +45 -3
@@ -1535,13 +1535,14 @@ client-supplied scope directly into storage. Apply the same authorization to
1535
1535
  history, sends, stops, deletion and attachment reads. The memory reference
1536
1536
  adapter requires a nonempty string; other adapters may use structured scopes.
1537
1537
 
1538
- Each callback receives these asynchronous operations. The first six serve the
1538
+ Each callback receives these asynchronous operations. The first eight serve the
1539
1539
  transcript service. All the others are mandatory for `createConversationRuntime()`:
1540
1540
 
1541
1541
  | Transaction operation | Contract |
1542
1542
  | --- | --- |
1543
1543
  | `listTurnIds()` | Stable IDs in oldest-to-newest order; include all stored turns. |
1544
1544
  | `readTurn(id)` | Detached turn snapshot in the client model above, or null if absent. |
1545
+ | `listTurnFacts()` | Optional. For every turn `listTurnIds()` lists, in that order, `{ turnId, roles, hasMessages, completedEnvelope }` as `readTurn` would give them, read without copying any turn: `roles` names which of `system`, `user` and `assistant` the turn holds, in that order; `hasMessages` whether it holds any message; `completedEnvelope` whether its `metadata.runtime` has `origin: "application"` and `completedEnvelope: true`. A write's own uncommitted changes are included. With it, a presentation or `pageUnit: "messages"` page reads only the turns it returns; without it, such a page reads every turn. |
1545
1546
  | `nextTurnId()` | Allocate an ID after the current tail under the write lock. |
1546
1547
  | `hasMessage(messageId)` | Check uniqueness across the whole scoped conversation. |
1547
1548
  | `findMessageTurnId(messageId)` | Optional. The turn ID holding that message, or an empty string; lets identity lookups avoid reading every turn. |
@@ -1597,7 +1598,9 @@ await verifyConversationStorageContract(storage, { runtime: true });
1597
1598
  ```
1598
1599
 
1599
1600
  Those checks cover scoped isolation, concurrent duplicate writes, stable
1600
- ordering, pagination, final replacement, attachments and detached reads. An
1601
+ ordering, pagination, final replacement, attachments and detached reads, and,
1602
+ for a transaction that offers `listTurnFacts()`, that its facts agree with
1603
+ `readTurn` for every turn, inside a rolled-back write too when `runtime: true`. An
1601
1604
  adapter selected with `runtime: true` also checks all metadata operations, scope
1602
1605
  isolation, patch preservation, combined transcript/metadata rollback, reading the
1603
1606
  turns after a turn and the saved, scoped and rolled-back compaction summary. Use a
@@ -2551,9 +2554,16 @@ status information; after some steps, the engine's account ends the reply instea
2551
2554
  Admission precedes every model call. The first resolves the authorized connection,
2552
2555
  checks access and admits the request; every later call (steps, checks, summaries,
2553
2556
  accounts) authorizes the same connection again and stops the reply when access is
2554
- gone. A configured `effort` reaches every provider as the AI SDK's standard
2555
- reasoning setting; without one, the engine's default applies (adaptive thinking at
2556
- high effort for Anthropic-format models). The system prompt is the configured
2557
+ gone. A reply reasons at the conversation's `effort`, else the one its connection
2558
+ declares (an AI integration's `settings.effort`, or the client's `effort`), sent
2559
+ on every call (steps, checks, summaries, accounts) as the AI SDK's standard
2560
+ reasoning setting in each provider's own field. Without one, the reply's steps
2561
+ ask for reasoning at high effort: adaptive thinking for Anthropic-format models,
2562
+ and `reasoning_effort: "high"` alone for DeepSeek models in the OpenAI style,
2563
+ which some OpenAI-compatible hosts need before they reason; other providers keep
2564
+ their own default, and the checks, summaries and accounts do not reason. A
2565
+ connection's effort outside the engine's levels is refused before any model call.
2566
+ The system prompt is the configured
2557
2567
  instructions, then the summary. The engine's state note with the current UTC time
2558
2568
  follows the conversation as its last message, so the provider's prompt cache keeps
2559
2569
  the whole history from one turn to the next.
@@ -273,7 +273,11 @@ assistantServer: {
273
273
  ```
274
274
 
275
275
  `aiIntegrationId` is the default. `aiIntegrationIds` is an optional allowlist for
276
- user selection. For a fixed agent, omit that list and hide its model control.
276
+ user selection. The integration may declare `settings.effort` (`none`,
277
+ `minimal`, `low`, `medium`, `high` or `xhigh`) to set how hard its replies
278
+ reason; without one the engine's default applies, which asks DeepSeek and
279
+ Anthropic-format models to reason at high effort. Some OpenAI-compatible hosts
280
+ reason only when asked: set an effort for a reasoning model served there. For a fixed agent, omit that list and hide its model control.
277
281
  For selection, pass allowed `{ id, label }` choices to the client. Client values
278
282
  never extend the server allowlist. Resolution runs for each request, so account
279
283
  isolation, key rotation and disconnect remain the existing resolver's job.
@@ -287,6 +291,11 @@ The ordinary action-tool loop stays the runtime's owner; the SDK does not execut
287
291
  application tools. Provider availability and account entitlement still come from
288
292
  the provider. Existing `aiConfigPrefix` environment configuration is supported
289
293
  when no integration is selected; that path rejects client integration overrides.
294
+ Its surface entry may set `effort` the same way, or `<PREFIX>_AI_EFFORT` in the
295
+ environment, which wins. A model on an OpenAI-compatible host that reasons only
296
+ when asked, such as DeepSeek V4.1 Flash on DeepInfra, is configured as
297
+ `provider: "deepseek"` with the host's `baseUrl`: its replies send
298
+ `reasoning_effort: "high"`, or the configured effort.
290
299
 
291
300
  The `assistant/assistant-surface` pattern includes a concrete AI capability and
292
301
  integration file. The published `assistant-core/examples/conversation` template
@@ -395,23 +395,39 @@ the application's `knexfile.js`:
395
395
  those two replaced, is set.
396
396
  Every file starts from the snapshot, rows included: a copy an earlier file of
397
397
  the run used is restored before the next file takes it, so no file sees what
398
- another wrote. On MySQL and MariaDB the restore replaces only the tables
398
+ another wrote. The run restores it in the background as soon as that file
399
+ ends, and when more files follow than run at once it keeps spare copies
400
+ ready, the next numbered ones, one for every four files at once, which it
401
+ makes in the background as the first files start: the file that follows
402
+ starts at once on a ready copy instead of waiting for a restore, and only
403
+ when none is ready does a file restore one itself. The run's last line says
404
+ how its files started (`jskit test: 41 of 42 test file(s) started on a ready
405
+ test database, 1 restored theirs first (390ms); 46 restore(s) in the
406
+ background (17204ms).`). A copy the run could not restore, such as one a
407
+ test left a view in, fails the run that left it, naming the copy and why.
408
+ On MySQL and MariaDB the restore replaces only the tables
399
409
  that differ from the snapshot, found exactly: a table's definition and its
400
410
  `AUTO_INCREMENT` counter (`SHOW CREATE TABLE`, so a row written and deleted,
401
411
  or a write rolled back, counts), a trigger on it, rows whose `CHECKSUM
402
- TABLE` is not the snapshot's, and tables missing or added; each replaced
403
- table is made on the server, its definition and then its rows copied from
404
- the snapshot database (`INSERT ... SELECT`), so no row passes through Node;
412
+ TABLE` is not the snapshot's, and tables missing or added. A table whose
413
+ primary key is one auto-increment id, and that differs only by the rows a
414
+ file added and the counter they moved, keeps its table: the rows from the
415
+ snapshot's counter on are deleted, reading only those, and the counter is
416
+ set back. Each other table is replaced, made on the server, its definition
417
+ and then its rows copied from the snapshot database (`INSERT ... SELECT`,
418
+ without foreign key or unique checks, since the snapshot's rows hold every
419
+ key), so no row passes through Node;
405
420
  a preparation fills up to eight tables at once, each on a connection of its
406
- own, shared between the databases it restores at once, and a test file's
407
- restore fills on its share of the eight by the run's files at once, so a
408
- run never fills on more than eight connections, plus one for each database
409
- being restored. No table waits in a connection pool's queue, where Knex gives
421
+ own, shared between the databases it restores at once, and a restore during
422
+ the run, a file's or the run's own, fills on its share of the eight by the
423
+ run's copies, spares included, so a run never fills on more than eight
424
+ connections, plus one for each database being restored. No table waits in a connection pool's queue, where Knex gives
410
425
  up after its `acquireConnectionTimeout`.
411
426
  The tables it fills are then sampled for the planner in one `ANALYZE TABLE`:
412
427
  InnoDB keeps the statistics it took of the empty table until it samples it
413
428
  again, and the planner would read a filled table as empty.
414
- A file that wrote three tables costs three tables, not the whole schema. On
429
+ A file that wrote three tables costs three tables, not the whole schema,
430
+ and one that only added rows to them costs those rows. On
415
431
  PostgreSQL the copy is made again from the snapshot database, which costs
416
432
  less than finding the tables; the snapshot database is analyzed once when
417
433
  it is built (`ANALYZE`), so each copy has its statistics.
@@ -419,15 +435,23 @@ the application's `knexfile.js`:
419
435
  whether its test files passed, failed or were stopped (Ctrl-C, `SIGTERM`),
420
436
  or its foreign key check failed before the first file, and so do the copies
421
437
  a run of fewer files does not take: the next run restores each one it takes
422
- instead of making it again. On MySQL and MariaDB a run after one whose files
423
- wrote three tables copies those three, not the schema; its summary says how
424
- many tables its restores copied (`restore 412ms of 3 table(s)`). A run that
425
- never reached its end (killed with `SIGKILL`, stopped at a command's time
426
- limit, or on a machine that went down) leaves nothing the next run does not
427
- restore, a table it was copying included. Each copy takes the disk space of
428
- the snapshot's rows, and there are as many as the most files a run took at
429
- once; they last until the project's test databases are dropped. Two runs at
430
- once on one database name still are not supported.
438
+ instead of making it again. A run that reaches its end, stopped or not,
439
+ first restores the copies its last files used, so the next finds them
440
+ ready. On MySQL and MariaDB a run after one that did not reach its end, and
441
+ whose files wrote three tables, copies those three, not the schema; its
442
+ summary says how many tables its restores copied (`restore 412ms of 3
443
+ table(s)`). A run that never reached its end (killed with `SIGKILL`, stopped
444
+ at a command's time limit, or on a machine that went down) leaves nothing
445
+ the next run does not restore, a table it was copying included. Each copy
446
+ takes the disk space of the snapshot's rows, and there are as many as the
447
+ most files a run took at once and its spares; they last until the project's
448
+ test databases are dropped. A run holds its test databases, on the
449
+ database server, from before it prepares them until it ends, and so does
450
+ `jskit migration-history`: another run on the same `TEST_DB_NAME`, from
451
+ another checkout or another session of the project on that server, waits
452
+ for it up to a minute, then refuses, naming the first run's database
453
+ session (`GET_LOCK` on MySQL and MariaDB, an advisory lock on PostgreSQL).
454
+ A run that ends without its cleanup gives them up with its process.
431
455
  - The snapshot holds the schema as the engine reports it and the rows the
432
456
  migrations wrote, including the migration ledger, in a database of its own
433
457
  on the database server, where `npm ci`, which empties `node_modules`, cannot
@@ -862,8 +862,10 @@ other than its id, takes `limit: 1`, one statement as `lock(id)` is
862
862
  (`workspaces.memberships.lockByWorkspaceIdAndUserId` locks its membership so).
863
863
  Without either, `lockWhere` locks every match in id order (on MySQL and MariaDB
864
864
  in the order of the index it reads, below), at most 1,000 (more throw), and
865
- PostgreSQL reads them once more under its locks, for a row that started to
866
- match while it waited; with a `limit` it stops once it holds that many. A
865
+ on PostgreSQL it is two statements by design: it reads them once more under
866
+ its locks, for a row that started to match while it waited; with a `limit` it
867
+ stops once it holds that many. Lock rows whose ids you know with
868
+ `lockMany(ids, txOptions)`, one statement on PostgreSQL, MySQL and MariaDB. A
867
869
  `limit` outside 1 to 1,000, or a `sort` on no stored field, is refused before
868
870
  any statement.
869
871
 
@@ -494,8 +494,10 @@ Run this behavior-preserving audit over every affected screen:
494
494
  4. Correct issues at the narrowest established owner. Consolidate only truly
495
495
  repeated policy; avoid pass-through wrappers and speculative abstractions.
496
496
  5. Run `jskit check` and `jskit check m3` on the affected files, then focused
497
- tests and Playwright at compact, medium, and expanded widths in light and
498
- dark (`shellBackButton(page)` and `pressShellBack(page)` from
497
+ tests, and Playwright: the journeys at desktop, at phone where their steps
498
+ differ, and layout checks at compact, medium and expanded widths in light and
499
+ dark, reloading a page that decides its layout at first load
500
+ (`shellBackButton(page)` and `pressShellBack(page)` from
499
501
  `@jskit-ai/shell-web/test/shellNavigation` drive Up).
500
502
 
501
503
  Do not declare Material 3 compliance from visual resemblance alone. Report any
@@ -19,8 +19,19 @@ The rules it applies are in [Typed features](/guide/framework/typed-features),
19
19
  [UI operations](/guide/framework/ui-operations); query counts belong to the
20
20
  [data pass](/guide/framework/data-pass).
21
21
 
22
- ## Run the checks first
22
+ ## Run the whole suite first
23
23
 
24
+ - Start from one run of the whole suite, as `npm run verify` runs it: each of
25
+ its parts once, with the same commands, environment and
26
+ `V64_TEST_CONCURRENCY`, going on past a part that fails, each part's full
27
+ output and exit status kept in a file, with `jskit test`'s
28
+ `file-times.json`. This run is the pass's measurement before.
29
+ - Read that run to find what is wrong: the slowest files and parametrized
30
+ tests and where their time goes, tests repeated per width, locale, theme,
31
+ role or provider, each test's time before its first check, files or
32
+ packages run one after another, failures, skips with no covering run, and
33
+ `JSKIT_TEST_NETWORK_REFUSED` or warning lines. Fix from that run's evidence,
34
+ never from guesses or partial runs, and prove each fix against its numbers.
24
35
  - `npx jskit check` reads the test scripts, test files, Playwright and Vitest
25
36
  configs, CI workflows and the root Vite config, and names what makes a run
26
37
  slow, fragile or unsafe, each finding with the change to make
@@ -57,6 +68,14 @@ The rules it applies are in [Typed features](/guide/framework/typed-features),
57
68
  of serial runs queued one after another. Run on the host's test machine, when the host offers one, not on a
58
69
  shared development host; a time taken while other work loads the machine is
59
70
  reported as such and never used as a baseline.
71
+ - From that run, rank the time by file and by parametrized test:
72
+ `file-times.json` and each part's 10 slowest files and tests, with a
73
+ parametrized test's variants (a loop over widths, roles or providers) summed
74
+ from the kept output. For each top item, say where its time goes:
75
+ preparation, server start, page load, sign-in, or its own checks.
76
+ - List the tests repeated per width, locale, theme, role or provider, with the
77
+ minutes in their repeated parts, and take each browser test's time before its
78
+ first check from its trace or from a timestamp at that check.
60
79
  - The pass's own measurement, one run of each part before the work and one
61
80
  after, is part of the pass the person asked for. `npm run verify`, the whole
62
81
  run, runs once, at the end, only with the person's OK.
@@ -141,6 +160,35 @@ The rules it applies are in [Typed features](/guide/framework/typed-features),
141
160
  A build that writes into its own inputs is never reused (`not kept for
142
161
  reuse, as src changed while it ran`): vue-router's generated types go to
143
162
  `types/typed-router.d.ts`, outside `src`.
163
+ - Screen sizes are covered once each, not by repeating journeys. The full
164
+ journey runs once at desktop. At phone, it runs only the steps that differ
165
+ there: the drawer, the bottom navigation, a dialog that goes full screen. The
166
+ other widths get layout checks on the finished pages, with
167
+ `page.setViewportSize()` and the layout's assertions. A page that decides its
168
+ layout when it loads is reloaded at the new size first. A test for several
169
+ locales, themes, roles or providers repeats only the checks the variant
170
+ changes. A parametrized test's variants share the setup they don't change: a
171
+ `before` hook or a worker-scoped fixture, not a rebuild per variant. The
172
+ minutes in repeated parts, before and after, prove it.
173
+ - What most of a test's time goes to before its first check is paid once per
174
+ worker or file: `browserTestConfig()`'s `signIn` module signs each worker in
175
+ once, and a worker-scoped fixture holds an app or page every test of the
176
+ worker shares. Each test's time before its first check, before and after,
177
+ proves it.
178
+ - No test runs `npm install`, `npm ci`, `git clone` or a build of its own:
179
+ what it needs is made once by `--test-global-setup`. A search of the test
180
+ files and helpers for those commands proves it.
181
+ - A file that holds a large share of a part's wall time is split at its real
182
+ seams, as its tests run in turn: `file-times.json` shows its share, and the
183
+ part's wall time before and after proves the split.
184
+ - An app of several packages runs every package's test files in one parallel
185
+ pool: `npm --workspaces test` runs them package after package. The whole
186
+ run's wall time, near the sum of all files' times divided by the budget,
187
+ proves it.
188
+ - No script runs a suite, build or check twice: `npm run verify` and CI run
189
+ each part once, a preliminary check repeats nothing the run after it covers,
190
+ and a check that passed on the exact tree is never run again. Each part
191
+ starting once in the whole run's output proves it.
144
192
  - No fixed sleep: a web-first assertion (`await expect(locator).toBeVisible()`),
145
193
  `expect.poll()`, the event itself, or a fake clock (`mock.timers`,
146
194
  `vi.useFakeTimers()`, `page.clock`) for the app's own delays. A poll's
@@ -151,10 +199,13 @@ The rules it applies are in [Typed features](/guide/framework/typed-features),
151
199
  `// jskit-test: fixed-wait - <what the window proves, or the latency the stand-in simulates>`.
152
200
  - A file imports what it needs at its top level, so loading counts against the
153
201
  file, not a test's time limit.
154
- - The bounds stay: `jskit test`'s 10 minutes a file and 45 a run, and
202
+ - The bounds stay: `jskit test`'s 10 minutes a file and 45 a run, its 10
203
+ seconds a file's process may live on after its last test (the linger
204
+ bound, which names what a test left open, or says the file was busy), and
155
205
  `browserTestConfig()`'s `actionTimeout`, `navigationTimeout` and
156
- `globalTimeout`. A bound in `test-time-bounds.json` rises only with a
157
- measurement of the work's real need.
206
+ `globalTimeout`. A bound in
207
+ `test-time-bounds.json` rises only with a measurement of the work's real
208
+ need; a file stopped at the linger bound closes what its tests leave open.
158
209
  - A passing run prints what a person reads: test servers log at
159
210
  `LOG_LEVEL=warn` unless the shell asks for more.
160
211
 
@@ -1106,8 +1106,14 @@ the last run's largest app server reached.**
1106
1106
  same number for a config.
1107
1107
  - A Node test file is named `<name>.test.js`, and a database test
1108
1108
  `<name>.integration.test.js`: given no files, `jskit test` runs node's
1109
- default pattern and fails on a `tests/` file it would leave out, such as
1110
- `<name>.integration.js` or `<name>.spec.js`.
1109
+ default pattern, less the files under a `support/` or `fixtures/` folder or
1110
+ `src/test/` not named as tests, and fails on a `tests/` file it would leave
1111
+ out, such as `<name>.integration.js` or `<name>.spec.js`, and on a run that
1112
+ takes no test file at all, before it prepares any test database.
1113
+ - A helper or fixture that tests import goes under `test/support/` or
1114
+ `test/fixtures/`, named as no test is (not `test-*.js`, `*.test.js`,
1115
+ `*_test.js` or `*-test.js`): `jskit test` fails a file it takes that declares
1116
+ no tests, naming it.
1111
1117
  - No script passes a fixed concurrency or worker count. `jskit check` fails a
1112
1118
  package script that runs `node --test` directly or passes one, a Vitest
1113
1119
  config those scripts use whose `maxWorkers` does not come from
@@ -1155,6 +1161,26 @@ the last run's largest app server reached.**
1155
1161
  each test signing in. `jskit check` fails a webServer that runs the development server
1156
1162
  (`npm run develop`, `vite`), one webServer shared by every worker, and a
1157
1163
  config without a `globalTimeout`.
1164
+ - Every test of a worker reaches its server from 127.0.0.1, as a different
1165
+ person each time, so the servers `jskit browser tests` starts count no
1166
+ per-address rate limit: a route's `rateLimit`, auth's sign-in limits and the
1167
+ accounts hub's per-address counters. The launcher sets
1168
+ `JSKIT_BROWSER_TEST_SERVER=1`, and a server with it whose `APP_ENV` is not
1169
+ `test` refuses to start. Prove a limit with a Node test against an ordinary
1170
+ server.
1171
+ - A failed test keeps its trace with DOM snapshots. To take them, Playwright
1172
+ runs a script in every frame, and Chromium logs `Blocked script execution in
1173
+ 'about:srcdoc' because the document's frame is sandboxed and the
1174
+ 'allow-scripts' permission is not set.` for each frame sandboxed without
1175
+ `allow-scripts`, such as an email preview: the sandbox at work, not the app.
1176
+ A test that fails on console errors leaves out that line, and only that line.
1177
+ - JSKIT's realtime connects by WebSocket only, which `page.route()` and
1178
+ `context.route()` never see, so an HTTP route that aborts `/socket.io`
1179
+ changes nothing. A test that must run without live updates closes the socket
1180
+ with `context.routeWebSocket(/\/socket\.io\//, (socket) => socket.close())`
1181
+ before its page opens. Any HTTP route also turns the browser's cache off for
1182
+ its page or context, so a guard that only watches requests listens to
1183
+ `page.on("request")` instead.
1158
1184
  - A file that truly cannot run beside others, because it holds a resource of
1159
1185
  the whole machine, says why on its first line,
1160
1186
  `// jskit-test: alone - <reason>`. `jskit test` runs it after the others,
@@ -1185,6 +1211,22 @@ the last run's largest app server reached.**
1185
1211
  files still finish and report: look for what it leaves open (a server, child
1186
1212
  process, timer or socket) or a test without a timeout. A file with its own
1187
1213
  bound is stopped at twice that bound.
1214
+ - A file whose tests have all ended but whose process is still running 10
1215
+ seconds later (the linger bound, `lingerMs`; its `after` hooks run within
1216
+ it) is stopped too, and fails the run by name with what its process still
1217
+ holds open, from `process.getActiveResourcesInfo()` read inside it, less
1218
+ its own stdout and stderr, and stdin unless something reads it: `Timeout`
1219
+ for an interval or timer, `TCPServerWrap` for a listening server,
1220
+ `TCPSocketWrap` for a connection, `ProcessWrap` for a child process,
1221
+ `PipeWrap` for a pipe or stdin being read. A test left it running: close
1222
+ it in the test or an `after` hook. A file still busy past the bound with
1223
+ nothing open fails the run as `busy, not held open`, with how long it
1224
+ lived on, whether its stop met it late or it ended by itself first: finish
1225
+ the work it does after its last test within the tests. A file's process
1226
+ normally ends within moments of its last test, and the report says the
1227
+ longest any took against the bound. Files marked `alone` or `network` get
1228
+ the same bound. A suite whose measured cleanup needs longer sets `lingerMs` in
1229
+ `test-time-bounds.json`, with the measurement in the commit that raises it.
1188
1230
 
1189
1231
  Why: `jskit test` and `testConcurrency()` read one budget, so every runner
1190
1232
  uses the machine without starving the other runs on it.
@@ -1446,7 +1488,7 @@ that must run alone says so on its own first line instead.
1446
1488
  | `test/playwright-isolation` | a Playwright webServer every worker shares, without `browserTestConfig()` | [Test files run in parallel](#test-files-run-in-parallel) |
1447
1489
  | `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) |
1448
1490
  | `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) |
1449
- | `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/*.integration.js`) names them for a reason and is not reported | [Test files run in parallel](#test-files-run-in-parallel) |
1491
+ | `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) |
1450
1492
 
1451
1493
  The rules see shapes, not intent. Feature files, owned state beyond
1452
1494
  registries, shutdown, loggers, shared action fields, strict inputs, the action
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/agent-docs",
3
- "version": "0.1.374",
3
+ "version": "0.1.376",
4
4
  "description": "Distributed JSKIT agent references, prompts, guides, and generated reference maps.",
5
5
  "type": "module",
6
6
  "files": [
@@ -5,7 +5,7 @@
5
5
  "private": true,
6
6
  "type": "module",
7
7
  "dependencies": {
8
- "@jskit-ai/kernel": "0.2.37",
8
+ "@jskit-ai/kernel": "0.2.38",
9
9
  "json-rest-schema": "^1.0.20"
10
10
  },
11
11
  "exports": {
@@ -29,8 +29,10 @@ Read the guide's page before the work it covers:
29
29
  `https://mobily-enterprises.github.io/jskit-ai/guide/framework/material-3`
30
30
  - tests:
31
31
  `https://mobily-enterprises.github.io/jskit-ai/guide/framework/typed-features#test-files-run-in-parallel`,
32
- and browser tests:
33
- `https://mobily-enterprises.github.io/jskit-ai/guide/framework/ui-operations#browser-verification`
32
+ browser tests:
33
+ `https://mobily-enterprises.github.io/jskit-ai/guide/framework/ui-operations#browser-verification`,
34
+ and a slow or failing suite, run whole first:
35
+ `https://mobily-enterprises.github.io/jskit-ai/guide/framework/test-pass`
34
36
  - a new capability: the pattern library; read the narrow pattern completely
35
37
  before implementing.
36
38
 
@@ -34,7 +34,7 @@
34
34
  "dependencies": {
35
35
  "@local/main": "0.1.0",
36
36
  "@fastify/static": "^10.1.3",
37
- "@jskit-ai/kernel": "0.2.37",
37
+ "@jskit-ai/kernel": "0.2.38",
38
38
  "@jskit-ai/material-web": "0.1.17",
39
39
  "@tanstack/vue-query": "^5.101.0",
40
40
  "fastify": "^5.12.7",
@@ -44,13 +44,13 @@
44
44
  "vue": "^3.5.44",
45
45
  "vue-router": "^5.3.1",
46
46
  "vuetify": "^4.3.0",
47
- "@jskit-ai/http-runtime": "0.2.38",
47
+ "@jskit-ai/http-runtime": "0.2.39",
48
48
  "@fastify/fast-json-stringify-compiler": "^5.1.0",
49
49
  "@vue/devtools-api": "^8.2.1"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@jskit-ai/config-eslint": "0.1.255",
53
- "@jskit-ai/jskit-catalog": "0.2.126",
53
+ "@jskit-ai/jskit-catalog": "0.2.128",
54
54
  "@playwright/test": "1.61.1",
55
55
  "@vitejs/plugin-vue": "^6.0.7",
56
56
  "eslint": "^10.8.0",
@@ -29,8 +29,10 @@ Read the guide's page before the work it covers:
29
29
  `https://mobily-enterprises.github.io/jskit-ai/guide/framework/material-3`
30
30
  - tests:
31
31
  `https://mobily-enterprises.github.io/jskit-ai/guide/framework/typed-features#test-files-run-in-parallel`,
32
- and browser tests:
33
- `https://mobily-enterprises.github.io/jskit-ai/guide/framework/ui-operations#browser-verification`
32
+ browser tests:
33
+ `https://mobily-enterprises.github.io/jskit-ai/guide/framework/ui-operations#browser-verification`,
34
+ and a slow or failing suite, run whole first:
35
+ `https://mobily-enterprises.github.io/jskit-ai/guide/framework/test-pass`
34
36
  - a new capability: the pattern library; read the narrow pattern completely
35
37
  before implementing.
36
38
 
@@ -34,7 +34,7 @@
34
34
  "dependencies": {
35
35
  "@local/main": "0.1.0",
36
36
  "@fastify/static": "^10.1.3",
37
- "@jskit-ai/kernel": "0.2.37",
37
+ "@jskit-ai/kernel": "0.2.38",
38
38
  "@jskit-ai/material-web": "0.1.17",
39
39
  "@tanstack/vue-query": "^5.101.0",
40
40
  "fastify": "^5.12.7",
@@ -44,14 +44,14 @@
44
44
  "vue": "^3.5.44",
45
45
  "vue-router": "^5.3.1",
46
46
  "vuetify": "^4.3.0",
47
- "@jskit-ai/http-runtime": "0.2.38",
48
- "@jskit-ai/shell-web": "0.2.62",
47
+ "@jskit-ai/http-runtime": "0.2.39",
48
+ "@jskit-ai/shell-web": "0.2.63",
49
49
  "@fastify/fast-json-stringify-compiler": "^5.1.0",
50
50
  "@vue/devtools-api": "^8.2.1"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@jskit-ai/config-eslint": "0.1.255",
54
- "@jskit-ai/jskit-catalog": "0.2.126",
54
+ "@jskit-ai/jskit-catalog": "0.2.128",
55
55
  "@playwright/test": "1.61.1",
56
56
  "@vitejs/plugin-vue": "^6.0.7",
57
57
  "eslint": "^10.8.0",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "description": "App-local runtime composition and lightweight glue.",
11
11
  "dependencies": {
12
- "@jskit-ai/kernel": "0.2.37"
12
+ "@jskit-ai/kernel": "0.2.38"
13
13
  },
14
14
  "jskit": {
15
15
  "kind": "runtime",
@@ -1,13 +1,16 @@
1
- <script>
2
- import { h } from "vue";
1
+ <script setup>
3
2
  import PackageShellLayout from "@jskit-ai/shell-web/client/components/ShellLayout";
4
3
 
5
- export default {
6
- name: "ShellLayout",
7
- inheritAttrs: false,
8
- setup(_, { attrs, slots }) {
9
- // Keep drawerWidth, railWidth, navigationItemSpacing, and future shell props package-owned.
10
- return () => h(PackageShellLayout, attrs, slots);
11
- }
12
- };
4
+ // Keep drawerWidth, railWidth, navigationItemSpacing, and future shell props package-owned.
5
+ // A template, not a render function, whose root is the layout alone (no comment beside it): the page a surface gives
6
+ // reaches the layout as a stable slot, so the layout redraws its app bar, navigation and page area only when what they
7
+ // show changes. Pages give the layout their content; write the layout's own slots (top-left, top-right, menu) here, as
8
+ // template slots.
9
+ defineOptions({ name: "ShellLayout", inheritAttrs: false });
13
10
  </script>
11
+
12
+ <template>
13
+ <PackageShellLayout v-bind="$attrs">
14
+ <slot />
15
+ </PackageShellLayout>
16
+ </template>
@@ -24,9 +24,11 @@ Exports
24
24
  - `APP_ENV_KEY`
25
25
  - `APP_ENVIRONMENTS`
26
26
  - `APP_ENVIRONMENT_META_NAME`
27
+ - `BROWSER_TEST_SERVER_KEY`
27
28
  - `STAGING_REACHES_REAL_PEOPLE_KEY`
28
29
  - `STAGING_REAL_PEOPLE_META_NAME`
29
30
  - `appEnvironment(env)`
31
+ - `browserTestServer(env)`
30
32
  - `isStagingOrProduction(env)`
31
33
  - `pageAppEnvironment(documentObject = globalThis.document)`
32
34
  - `pageStagingReachesRealPeople(documentObject = globalThis.document)`