@jskit-ai/agent-docs 0.1.324 → 0.1.326

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 (26) hide show
  1. package/guide/agent/app-setup/authentication.md +109 -1
  2. package/guide/agent/framework/data-pass.md +160 -0
  3. package/guide/agent/framework/quality-pass.md +99 -0
  4. package/guide/agent/framework/visual-identity.md +152 -0
  5. package/guide/agent/index.md +6 -0
  6. package/package.json +1 -1
  7. package/patterns/minimal-foundation/example/package.json +2 -2
  8. package/patterns/shell-foundation/example/package.json +3 -3
  9. package/reference/autogen/PATTERN_INDEX.md +19 -19
  10. package/reference/autogen/packages/auth-core.md +13 -0
  11. package/reference/autogen/packages/auth-provider-local-core.md +19 -1
  12. package/reference/autogen/packages/auth-provider-local-db-core.md +9 -0
  13. package/reference/autogen/packages/auth-web.md +6 -0
  14. package/skills/jskit/SKILL.md +5 -1
  15. package/skills/jskit/references/data-pass.md +155 -0
  16. package/skills/jskit/references/pattern-index.md +19 -19
  17. package/skills/jskit/references/patterns/app/minimal-foundation/example/package.json +2 -2
  18. package/skills/jskit/references/patterns/app/shell-foundation/example/package.json +3 -3
  19. package/skills/jskit/references/patterns/auth/accounts-hub/example/package.json +1 -1
  20. package/skills/jskit/references/patterns/auth/oidc-sign-in/example/package.json +2 -2
  21. package/skills/jskit/references/patterns/auth/supabase-auth/example/package.json +1 -1
  22. package/skills/jskit/references/patterns/realtime/realtime-application/example/package.json +2 -2
  23. package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users/package.json +1 -1
  24. package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users-workspace/package.json +2 -2
  25. package/skills/jskit/references/quality-pass.md +94 -0
  26. package/skills/jskit/references/visual-identity.md +147 -0
@@ -15,7 +15,7 @@ A concrete Fastify, Vue, and JSKIT application foundation for products that do n
15
15
 
16
16
  - Id: `app/minimal-foundation`
17
17
  - Keywords: `app`, `fastify`, `foundation`, `minimal`, `server`, `vite`, `vue`
18
- - Owner: `@jskit-ai/agent-docs@0.1.324`
18
+ - Owner: `@jskit-ai/agent-docs@0.1.326`
19
19
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/app/minimal-foundation/PATTERN.md)
20
20
  - Examples: [example/](../../skills/jskit/references/patterns/app/minimal-foundation/example/)
21
21
  - Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`
@@ -26,7 +26,7 @@ A concrete JSKIT web application foundation with responsive shell navigation, se
26
26
 
27
27
  - Id: `app/shell-foundation`
28
28
  - Keywords: `app`, `foundation`, `material`, `navigation`, `placements`, `shell`, `vite`, `vue`
29
- - Owner: `@jskit-ai/agent-docs@0.1.324`
29
+ - Owner: `@jskit-ai/agent-docs@0.1.326`
30
30
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/app/shell-foundation/PATTERN.md)
31
31
  - Examples: [example/](../../skills/jskit/references/patterns/app/shell-foundation/example/)
32
32
  - Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`, `@jskit-ai/shell-web`
@@ -37,7 +37,7 @@ Configure an assistant runtime for one application surface and expose its chat a
37
37
 
38
38
  - Id: `assistant/assistant-surface`
39
39
  - Keywords: `ai`, `assistant`, `chat`, `config`, `environment`, `page`, `placement`, `settings`, `surface`
40
- - Owner: `@jskit-ai/assistant-runtime@0.2.64`
40
+ - Owner: `@jskit-ai/assistant-runtime@0.2.65`
41
41
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/assistant/assistant-surface/PATTERN.md)
42
42
  - Examples: [example/](../../skills/jskit/references/patterns/assistant/assistant-surface/example/)
43
43
  - Requires: `@jskit-ai/assistant-runtime`, `@jskit-ai/connectors-catalog`, `@jskit-ai/connectors-core`, `@jskit-ai/shell-web`
@@ -48,7 +48,7 @@ Run one OpenID Connect sign-in for all of an owner's apps as its own JSKIT proje
48
48
 
49
49
  - Id: `auth/accounts-hub`
50
50
  - Keywords: `accounts hub`, `auth`, `authentication`, `issuer`, `master login`, `oidc`, `openid connect`, `single sign-on`, `sso`
51
- - Owner: `@jskit-ai/oidc-issuer-core@0.1.38`
51
+ - Owner: `@jskit-ai/oidc-issuer-core@0.1.39`
52
52
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/auth/accounts-hub/PATTERN.md)
53
53
  - Examples: [example/](../../skills/jskit/references/patterns/auth/accounts-hub/example/)
54
54
  - Requires: `@jskit-ai/oidc-issuer-core`
@@ -59,7 +59,7 @@ Compose JSKIT authentication routes, views, profile controls, and public surface
59
59
 
60
60
  - Id: `auth/auth-surface`
61
61
  - Keywords: `account`, `auth`, `login`, `logout`, `password`, `placement`, `profile`, `reset`, `surface`
62
- - Owner: `@jskit-ai/auth-web@0.2.39`
62
+ - Owner: `@jskit-ai/auth-web@0.2.41`
63
63
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/auth/auth-surface/PATTERN.md)
64
64
  - Examples: [example/](../../skills/jskit/references/patterns/auth/auth-surface/example/)
65
65
  - Requires: `@jskit-ai/auth-core`, `@jskit-ai/auth-web`, `@jskit-ai/shell-web`
@@ -70,7 +70,7 @@ Let people sign in with the accounts they already have in an accounts hub or ano
70
70
 
71
71
  - Id: `auth/oidc-sign-in`
72
72
  - Keywords: `accounts hub`, `auth`, `authentication`, `back-channel logout`, `dynamic client registration`, `issuer`, `master login`, `oidc`, `openid connect`, `single sign-on`, `sso`
73
- - Owner: `@jskit-ai/auth-provider-oidc-core@0.2.43`
73
+ - Owner: `@jskit-ai/auth-provider-oidc-core@0.2.45`
74
74
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/auth/oidc-sign-in/PATTERN.md)
75
75
  - Examples: [example/](../../skills/jskit/references/patterns/auth/oidc-sign-in/example/)
76
76
  - Requires: `@jskit-ai/auth-provider-oidc-core`, `@jskit-ai/auth-web`
@@ -81,7 +81,7 @@ Add Supabase authentication through normal npm composition, explicit environment
81
81
 
82
82
  - Id: `auth/supabase-auth`
83
83
  - Keywords: `auth`, `authentication`, `oauth`, `sessions`, `supabase`
84
- - Owner: `@jskit-ai/auth-provider-supabase-core@0.2.30`
84
+ - Owner: `@jskit-ai/auth-provider-supabase-core@0.2.31`
85
85
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/auth/supabase-auth/PATTERN.md)
86
86
  - Examples: [example/](../../skills/jskit/references/patterns/auth/supabase-auth/example/)
87
87
  - Requires: `@jskit-ai/auth-provider-supabase-core`
@@ -246,7 +246,7 @@ Add a protected administration surface, settings shell, and semantic navigation
246
246
 
247
247
  - Id: `console/console-surface`
248
248
  - Keywords: `admin`, `console`, `navigation`, `owner`, `placement`, `settings`, `surface`
249
- - Owner: `@jskit-ai/console-web@0.1.271`
249
+ - Owner: `@jskit-ai/console-web@0.1.273`
250
250
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/console/console-surface/PATTERN.md)
251
251
  - Examples: [example/](../../skills/jskit/references/patterns/console/console-surface/example/)
252
252
  - Requires: `@jskit-ai/console-core`, `@jskit-ai/console-web`, `@jskit-ai/shell-web`
@@ -279,7 +279,7 @@ Build a routed CRUD user interface as thin application pages over JSKIT's shared
279
279
 
280
280
  - Id: `crud/crud-screen-set`
281
281
  - Keywords: `actions`, `add`, `crud`, `delete`, `edit`, `filters`, `list`, `material`, `routes`, `view`, `vue`
282
- - Owner: `@jskit-ai/http-web@0.2.42`
282
+ - Owner: `@jskit-ai/http-web@0.2.43`
283
283
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/crud/crud-screen-set/PATTERN.md)
284
284
  - Examples: [example/](../../skills/jskit/references/patterns/crud/crud-screen-set/example/)
285
285
  - Requires: `@jskit-ai/http-web`, `@jskit-ai/resource-core`, `@jskit-ai/resource-crud-core`
@@ -323,7 +323,7 @@ Wrap a JSKIT web application in a Capacitor Android shell using native Capacitor
323
323
 
324
324
  - Id: `mobile/android-application`
325
325
  - Keywords: `android`, `capacitor`, `device`, `mobile`, `native`, `shell`, `webview`
326
- - Owner: `@jskit-ai/mobile-capacitor@0.2.35`
326
+ - Owner: `@jskit-ai/mobile-capacitor@0.2.36`
327
327
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/mobile/android-application/PATTERN.md)
328
328
  - Examples: [example/](../../skills/jskit/references/patterns/mobile/android-application/example/)
329
329
  - Requires: `@capacitor/android`, `@capacitor/app`, `@capacitor/cli`, `@jskit-ai/mobile-capacitor`
@@ -334,7 +334,7 @@ Add JSKIT realtime events with an optional Redis backplane and an explicit shell
334
334
 
335
335
  - Id: `realtime/realtime-application`
336
336
  - Keywords: `realtime`, `redis`, `socket.io`, `sockets`, `status`, `websocket`
337
- - Owner: `@jskit-ai/realtime@0.2.38`
337
+ - Owner: `@jskit-ai/realtime@0.2.39`
338
338
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/realtime/realtime-application/PATTERN.md)
339
339
  - Examples: [example/](../../skills/jskit/references/patterns/realtime/realtime-application/example/)
340
340
  - Requires: `@jskit-ai/realtime`, `@jskit-ai/shell-web`
@@ -345,7 +345,7 @@ Compose application-owned Google Publisher Tag delivery with the generic rewarde
345
345
 
346
346
  - Id: `rewards/google-rewarded`
347
347
  - Keywords: `ads`, `google`, `publisher tag`, `rewarded`, `unlock`
348
- - Owner: `@jskit-ai/rewarded-web@0.2.48`
348
+ - Owner: `@jskit-ai/rewarded-web@0.2.50`
349
349
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/rewards/google-rewarded/PATTERN.md)
350
350
  - Examples: [example/](../../skills/jskit/references/patterns/rewards/google-rewarded/example/)
351
351
  - Requires: `@jskit-ai/rewarded-web`
@@ -356,7 +356,7 @@ Define a server feature through explicit capabilities and first-class actions, a
356
356
 
357
357
  - Id: `server/feature-package`
358
358
  - Keywords: `actions`, `aggregate`, `feature`, `handle`, `orchestration`, `owns`, `package`, `provider`, `repository`, `routes`, `server`, `table resource`
359
- - Owner: `@jskit-ai/agent-docs@0.1.324`
359
+ - Owner: `@jskit-ai/agent-docs@0.1.326`
360
360
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/server/feature-package/PATTERN.md)
361
361
  - Examples: [example/](../../skills/jskit/references/patterns/server/feature-package/example/)
362
362
  - Requires: `@jskit-ai/kernel`
@@ -367,7 +367,7 @@ Compose the JSKIT responsive shell, semantic placements, settings navigation, an
367
367
 
368
368
  - Id: `shell/application-shell`
369
369
  - Keywords: `adaptive`, `app`, `layout`, `navigation`, `placement`, `responsive`, `settings`, `shell`
370
- - Owner: `@jskit-ai/shell-web@0.2.35`
370
+ - Owner: `@jskit-ai/shell-web@0.2.36`
371
371
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/shell/application-shell/PATTERN.md)
372
372
  - Examples: [example/](../../skills/jskit/references/patterns/shell/application-shell/example/)
373
373
  - Requires: `@jskit-ai/kernel`, `@jskit-ai/shell-web`
@@ -378,7 +378,7 @@ Add product routes and shell extensions through file routing, semantic placement
378
378
 
379
379
  - Id: `ui/page-and-placement`
380
380
  - Keywords: `component`, `navigation`, `outlet`, `page`, `placement`, `routes`, `section`, `shell`, `subpages`, `vue`
381
- - Owner: `@jskit-ai/shell-web@0.2.35`
381
+ - Owner: `@jskit-ai/shell-web@0.2.36`
382
382
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/ui/page-and-placement/PATTERN.md)
383
383
  - Examples: [example/](../../skills/jskit/references/patterns/ui/page-and-placement/example/)
384
384
  - Requires: `@jskit-ai/kernel`, `@jskit-ai/shell-web`
@@ -389,7 +389,7 @@ Compose an account settings route and profile, preference, notification, and sig
389
389
 
390
390
  - Id: `users/account-settings`
391
391
  - Keywords: `account`, `link provider`, `notifications`, `oauth`, `preferences`, `profile`, `settings`, `sign-in methods`, `user`, `vue`
392
- - Owner: `@jskit-ai/users-web@0.2.54`
392
+ - Owner: `@jskit-ai/users-web@0.2.56`
393
393
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/users/account-settings/PATTERN.md)
394
394
  - Examples: [example/](../../skills/jskit/references/patterns/users/account-settings/example/)
395
395
  - Requires: `@jskit-ai/shell-web`, `@jskit-ai/users-core`, `@jskit-ai/users-web`
@@ -400,7 +400,7 @@ Expose user administration and workspace-scoped member operations through app-ow
400
400
 
401
401
  - Id: `users/user-administration-server`
402
402
  - Keywords: `account`, `admin`, `member`, `repository`, `resource`, `routes`, `service`, `user`, `workspace`
403
- - Owner: `@jskit-ai/users-core@0.2.42`
403
+ - Owner: `@jskit-ai/users-core@0.2.43`
404
404
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/users/user-administration-server/PATTERN.md)
405
405
  - Examples: [example/](../../skills/jskit/references/patterns/users/user-administration-server/example/)
406
406
  - Requires: `@jskit-ai/crud-core`, `@jskit-ai/users-core`
@@ -411,7 +411,7 @@ Configure roles, workspace access policy, invitations, and app-owned invitation
411
411
 
412
412
  - Id: `workspaces/workspace-server`
413
413
  - Keywords: `access`, `invite`, `membership`, `multitenancy`, `policy`, `role`, `tenancy`, `workspace`
414
- - Owner: `@jskit-ai/workspaces-core@0.2.42`
414
+ - Owner: `@jskit-ai/workspaces-core@0.2.43`
415
415
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/workspaces/workspace-server/PATTERN.md)
416
416
  - Examples: [example/](../../skills/jskit/references/patterns/workspaces/workspace-server/example/)
417
417
  - Requires: `@jskit-ai/users-core`, `@jskit-ai/workspaces-core`
@@ -422,7 +422,7 @@ Compose workspace selection, invitation, member administration, settings, and re
422
422
 
423
423
  - Id: `workspaces/workspace-surfaces`
424
424
  - Keywords: `admin`, `invite`, `member`, `navigation`, `settings`, `surface`, `switcher`, `workspace`
425
- - Owner: `@jskit-ai/workspaces-web@0.2.54`
425
+ - Owner: `@jskit-ai/workspaces-web@0.2.56`
426
426
  - Read: [PATTERN.md](../../skills/jskit/references/patterns/workspaces/workspace-surfaces/PATTERN.md)
427
427
  - Examples: [example/](../../skills/jskit/references/patterns/workspaces/workspace-surfaces/example/)
428
428
  - Requires: `@jskit-ai/shell-web`, `@jskit-ai/workspaces-core`, `@jskit-ai/workspaces-web`
@@ -203,6 +203,19 @@ Exports
203
203
  Exports
204
204
  - `noAppProfiles`
205
205
 
206
+ ### `src/server/passSignIn.js`
207
+ Exports
208
+ - `resolvePassSignInFromEnv(env)`
209
+ - `signPass({ privateKey, subject, audience, resource, id = randomBytes(18).toString("base64url"), lifetimeSeconds = PASS_LIFETIME_SECONDS, now = Date.now() })`
210
+ - `verifyPass(token, { publicKey, audience, resource }, now = Date.now())`
211
+ - `type AuthPass`
212
+ Local functions
213
+ - `base64urlJson(value)`
214
+ - `parseBase64urlJson(part)`
215
+ - `isClaimText(value)`
216
+ - `isClaimSeconds(value)`
217
+ - `readPassPublicKey(text)`
218
+
206
219
  ### `src/server/providers/AuthAccessProvider.js`
207
220
  Exports
208
221
  - `AuthAccessProvider`
@@ -93,6 +93,7 @@ Local functions
93
93
  Exports
94
94
  - `parseIdentities(content)`
95
95
  - `parseOAuthAttempts(content)`
96
+ - `parsePasses(content)`
96
97
  - `parseRecovery(content)`
97
98
  - `parseRegistrations(content)`
98
99
  - `parseSecondFactors(content)`
@@ -101,6 +102,7 @@ Exports
101
102
  - `parseUsers(content)`
102
103
  - `serializeIdentities(identities)`
103
104
  - `serializeOAuthAttempts(attempts)`
105
+ - `serializePasses(records)`
104
106
  - `serializeRecovery(records)`
105
107
  - `serializeRegistrations(records)`
106
108
  - `serializeSecondFactors(records)`
@@ -156,6 +158,11 @@ Local functions
156
158
  Exports
157
159
  - `createLocalOAuthFlows({ backend, config, firstAccountSetup, logger, oauthProvidersById, profileProjector, securityStatus, sessions })`
158
160
 
161
+ ### `src/server/lib/passSignIn.js`
162
+ Exports
163
+ - `createLocalPassSignIn({ backend, config, passIdentity, profileProjector, sessions })`
164
+ - `noPassIdentities()`
165
+
159
166
  ### `src/server/lib/passwordFlows.js`
160
167
  Exports
161
168
  - `createLocalPasswordFlows({ backend, config, passwords, profileProjector, recoverySender, sessions })`
@@ -218,7 +225,7 @@ Exports
218
225
 
219
226
  ### `src/server/lib/service.js`
220
227
  Exports
221
- - `createLocalAuthService({ backend, config, confirmationMode = confirmEveryRegistrationByLink, confirmationSender, firstAccountSetup: givenFirstAccountSetup = null, invitationContextResolver, logger, passwordStrategy, profileProjector, recoverySender, secondFactorEvents })`
228
+ - `createLocalAuthService({ backend, config, confirmationMode = confirmEveryRegistrationByLink, confirmationSender, firstAccountSetup: givenFirstAccountSetup = null, invitationContextResolver, logger, passIdentity = noPassIdentities, passwordStrategy, profileProjector, recoverySender, secondFactorEvents })`
222
229
 
223
230
  ### `src/server/lib/sessions.js`
224
231
  Exports
@@ -265,6 +272,7 @@ Exports
265
272
  ### `src/server/types.js`
266
273
  Exports
267
274
  - `type AuthLocalBackendTransaction`
275
+ - `type AuthLocalPassIdentity`
268
276
  - `type AuthLocalRegistration`
269
277
  - `type AuthLocalSecondFactor`
270
278
  - `type AuthLocalSecondFactorEvent`
@@ -307,6 +315,16 @@ Exports
307
315
  Local functions
308
316
  - `readBody(req)`
309
317
 
318
+ ### `test-support/passSignInScenario.js`
319
+ Exports
320
+ - `createPassIssuer()`
321
+ - `exercisePassSignIn(service, { backend, issuer })`
322
+ - `passIdentityByEmail(backend)`
323
+ - `passwordlessAccount({ id, email, displayName, disabled = false })`
324
+ - `sessionCookies(session)`
325
+ Local functions
326
+ - `refused(code, status = 401)`
327
+
310
328
  ### `test-support/secondFactorScenario.js`
311
329
  Exports
312
330
  - `SCENARIO_START`
@@ -74,6 +74,7 @@ Exports
74
74
  - `localAuthSecondFactorResource`
75
75
  - `localAuthSessionResource`
76
76
  - `localAuthSignInFailureResource`
77
+ - `localAuthUsedPassResource`
77
78
  - `localAuthUserResource`
78
79
  Local functions
79
80
  - `idStartsWith(query, prefix, { column })`
@@ -98,6 +99,10 @@ Exports
98
99
  - `requiredDateTime(value, fallback = nowIso())`
99
100
  - `text(value)`
100
101
 
102
+ ### `src/server/lib/usedPassRecords.js`
103
+ Exports
104
+ - `usedPassRecords(usedPasses, options)`
105
+
101
106
  ### `src/server/providers/AuthLocalDatabaseBackendProvider.js`
102
107
  Exports
103
108
  - `AuthLocalDatabaseBackendProvider`
@@ -124,6 +129,10 @@ Exports
124
129
  Exports
125
130
  - None
126
131
 
132
+ ### `migrations/auth_local_db_used_passes.cjs`
133
+ Exports
134
+ - None
135
+
127
136
  ### `migrations/auth_local_db_users_email_verified.cjs`
128
137
  Exports
129
138
  - None
@@ -411,6 +411,12 @@ Local functions
411
411
  Exports
412
412
  - `buildRoutes(controller, { includeDevLoginAs = false, rateLimits = DEFAULT_AUTH_RATE_LIMITS } = {})`
413
413
 
414
+ ### `src/server/routes/passSignInRoutes.js`
415
+ Exports
416
+ - `registerPassSignInRoutes(fastify, { service, rateLimit })`
417
+ Local functions
418
+ - `parseForm(_request, body, done)`
419
+
414
420
  ### `src/server/routes/secondFactorRoutes.js`
415
421
  Exports
416
422
  - `registerSecondFactorRoutes(router, { rateLimits })`
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jskit
3
- description: Build, extend, troubleshoot, review, deslop, and verify JSKIT apps using its public framework APIs, package-owned source patterns, runtime capabilities, surfaces, placements, CRUDs, verification conventions, and Vue/Vuetify Material 3 UI contract, including UI passes over a task's changes, a section, or the whole app. Use for every JSKIT UI creation, modification, review, cleanup, or UI pass task.
3
+ description: Build, extend, troubleshoot, review, deslop, and verify JSKIT apps using its public framework APIs, package-owned source patterns, runtime capabilities, surfaces, placements, CRUDs, verification conventions, and Vue/Vuetify Material 3 UI contract, including UI passes over a task's changes, a section, or the whole app, and the JSKIT half of identity, quality and data passes. Use for every JSKIT UI creation, modification, review, cleanup, or pass task.
4
4
  ---
5
5
 
6
6
  # JSKIT
@@ -62,6 +62,10 @@ manifests, migrations, tests, and runtime behaviour are the evidence.
62
62
  also read [Material 3](references/material-3.md) completely before acting.
63
63
  - For a UI pass (the changes, a section, or the whole app), also read
64
64
  [UI pass](references/ui-pass.md) completely.
65
+ - For an identity pass, a quality pass or a data pass, also read
66
+ [visual identity](references/visual-identity.md),
67
+ [quality pass](references/quality-pass.md) or
68
+ [data pass](references/data-pass.md) completely.
65
69
  - Before writing a list, save, batch or test, a refactor, or calling work
66
70
  done, read [sanity checks](references/sanity-checks.md).
67
71
 
@@ -0,0 +1,155 @@
1
+ <!-- Generated from `packages/agent-docs/site/guide/framework/data-pass.md`. -->
2
+
3
+ # Data pass
4
+
5
+ A data pass makes an app's data hold up at real sizes. Genesis's data pass
6
+ skill (`genesis-data-pass`) holds the method: map the data, measure each path
7
+ at a few rows and at a realistic size, then make counts follow the rows read,
8
+ narrow reads in the query, enforce and try every constraint, migrate safely,
9
+ index the real filters, and leave tests at realistic sizes. This page says
10
+ which JSKIT pieces each step uses. The rules themselves are in
11
+ [Data access](data-access.md) and the [sanity checks](sanity-checks.md);
12
+ read the sections each step names.
13
+
14
+ ## Map the data
15
+
16
+ - Each table has one owner: the feature whose table resource (`own()`)
17
+ declares it ([The resource is the only door](data-access.md#the-resource-is-the-only-door)).
18
+ Other features read it through that owner
19
+ ([Tables you don't own](data-access.md#tables-you-don-t-own)).
20
+ `expectEveryTableOwned()` fails on a table nobody owns.
21
+ - A table's constraints and indexes are in the migrations of the package that
22
+ owns it, and the foreign keys between packages in a `constraints/`
23
+ subdirectory ([Directory order comes before filenames](database-layer.md#directory-order-comes-before-filenames)).
24
+ - The paths to measure are the CRUD lists and records, the feature's actions
25
+ and services, the [many-row writes](data-access.md#layer-3-many-rows-at-once),
26
+ the [reports](data-access.md#layer-5-reports-the-resource-cannot-express)
27
+ and the [background work](data-access.md#background-work).
28
+
29
+ ## Measure
30
+
31
+ Count each path's statements on `TEST_DB_NAME`, never `DB_NAME`, with
32
+ `expectFlatQueries()` from `@jskit-ai/resource-runtime/test`, or
33
+ `countQueries(knex, work)` from
34
+ `@jskit-ai/database-runtime/server/testDatabases` when you want the counts and
35
+ statements themselves ([Tests](data-access.md#tests),
36
+ [Query counts and batches](sanity-checks.md#query-counts-and-batches)).
37
+ Record each count at a few rows and at the realistic size before changing
38
+ anything; the report compares them.
39
+
40
+ ## Fix the paths
41
+
42
+ - **Counts follow the rows read.** A handle's `get()` or `query()`, or a
43
+ service call, inside a loop becomes one id-list read through `queryAll()` or
44
+ `include`, grouped with `Map.groupBy()`
45
+ ([Reads shaped for the screen](data-access.md#reads-shaped-for-the-screen)).
46
+ A write that does not use its result passes `returning: "id"` or `"none"`; a
47
+ batch uses `createMany()` and `patchMany()`.
48
+ - **The query narrows.** Filters, sorts, limits, existence checks and counts go
49
+ in the read: the searchSchema's filters, `q` for typed text, `take: 1` for
50
+ one row, `aggregate()` for a count
51
+ ([Narrow in the query](data-access.md#narrow-in-the-query)).
52
+ The lint rules `jskit/narrow-in-query` and `jskit/search-on-server`, and
53
+ `jskit check`'s `data/search-q`, report what they can see.
54
+ - A fix that needs an API the owner does not have is asked of that owner, or
55
+ of JSKIT for its packages, never written around it
56
+ ([Exceptions](data-access.md#exceptions)).
57
+
58
+ ## Constraints
59
+
60
+ - Required fields, enumerations and ranges are in the resource's schema, and
61
+ required, unique and foreign keys in the table's migration. A rule the
62
+ schema cannot express, such as a uniqueness within an owner or a check that
63
+ reads another row, belongs to the owner's service, inside its
64
+ [transaction](data-access.md#transactions).
65
+ - Try each one: a server test sends one value that breaks it and asserts the
66
+ refusal's status and code, and that the message tells the person what to do
67
+ ([Every refusal explained](quality-pass.md#every-refusal-explained)).
68
+ A unique or foreign key the database enforces needs that test too, so its
69
+ error reaches the person as a sentence, not a 500.
70
+ - `addMissingForeignKey(knex, key)` from
71
+ `@jskit-ai/database-runtime/server/foreignKeyMigrations` adds a key on fresh
72
+ and already-migrated databases alike; it fails, naming the rows with no
73
+ parent, and deletes nothing. Before adding any constraint, count the rows
74
+ that break it; ask the person what they should say rather than rewrite them.
75
+
76
+ ## Migrations
77
+
78
+ - Each change is a new `.cjs` Knex migration in the package that owns the
79
+ table; one that has run anywhere is never edited
80
+ ([Authoring schema changes](database-layer.md#authoring-schema-changes),
81
+ [Migration ownership](crud-operations.md#migration-ownership)).
82
+ - Backfill large tables in bounded chunks with the many-row writes, from a job
83
+ or a script, not inside one migration statement that holds a lock for its
84
+ whole run. Seed data is not a migration
85
+ ([Seed data is not a migration](database-layer.md#seed-data-is-not-a-migration)).
86
+ - Prove a migration on the selected engine as the database layer's
87
+ [Verification](database-layer.md#verification) describes: fresh
88
+ preparation, an upgrade that keeps rows, and a second preparation with
89
+ nothing pending. Changing a migration or seed source changes the test
90
+ databases' snapshot digest, so the next test run rebuilds them
91
+ ([Integration test databases](database-layer.md#integration-test-databases)).
92
+
93
+ ## Indexes
94
+
95
+ - Take the filters, sorts and joins from the statements `countQueries()`
96
+ captured, and give each an index in a new migration, its columns in the order
97
+ the query uses them; the owner columns of a scoped table usually come first.
98
+ - A filter on another table's field needs that field declared `indexed: true`
99
+ on its own table resource, with a database index on its column; `own()`
100
+ refuses it at startup otherwise ([Layer 1: the table resource](data-access.md#layer-1-the-table-resource)).
101
+ - `lockWhere` needs an index that starts with the ownership columns, and with
102
+ `sort` or `limit` one that reads rows in the lock's order; without it the
103
+ lock refuses and names the index ([Layer 4: locks](data-access.md#layer-4-locks)).
104
+ - Read the plan on the test database at the realistic size (below, per engine)
105
+ and see each index used.
106
+
107
+ ## Tests at realistic sizes
108
+
109
+ - Each list, batch and write path keeps a one-line `expectFlatQueries()` test
110
+ whose `seed` builds the realistic size; each scoped path keeps an
111
+ `expectScoped()` test proving another owner's rows stay unseen and unchanged
112
+ ([Tests](data-access.md#tests)).
113
+ - A capped read keeps a test that seeds past its cap and finds the row it
114
+ needs.
115
+ - Run `npm run lint`, `npx jskit check` and `npm run verify`.
116
+
117
+ ## PostgreSQL
118
+
119
+ - `CREATE INDEX CONCURRENTLY` builds an index without blocking writes, but
120
+ cannot run in a transaction: give that migration `exports.config = {
121
+ transaction: false }` and nothing else, and use `DROP INDEX CONCURRENTLY` in
122
+ its `down()`. A failed concurrent build leaves an invalid index behind; drop
123
+ it before retrying.
124
+ - On a large table, add a foreign key or check `NOT VALID`, which takes only a
125
+ brief lock and enforces it for new rows, then `VALIDATE CONSTRAINT` in a
126
+ later migration, which reads the old rows without blocking writes.
127
+ - Adding a column with a constant default is instant; changing a column's type
128
+ rewrites the table and locks it for the whole rewrite.
129
+ - PostgreSQL does not index a foreign key's column for you: index it when the
130
+ app filters or joins by it, or deletes parent rows.
131
+ - A partial index (`WHERE archived_at IS NULL`) serves a filter the app always
132
+ applies, at a fraction of the size.
133
+ - Read plans with `EXPLAIN (ANALYZE, BUFFERS)`, after `ANALYZE` on freshly
134
+ seeded tables, so the planner sees the realistic size.
135
+ - Counts and sums come back as strings; compare them with `Number()` in tests.
136
+
137
+ ## MySQL
138
+
139
+ - DDL commits as it goes, so a migration with several schema statements can
140
+ stop half-applied: one schema change per migration, written for its partial
141
+ states ([MySQL and MariaDB failures can leave partial schema](database-layer.md#mysql-and-mariadb-failures-can-leave-partial-schema)).
142
+ - Ask for an online change explicitly, `ALGORITHM=INPLACE, LOCK=NONE` (or
143
+ `ALGORITHM=INSTANT` to add a column), so a change that would lock the table
144
+ fails instead of locking it.
145
+ - InnoDB indexes each foreign key's column itself; an index whose leading
146
+ columns match makes it a duplicate.
147
+ - MySQL has no partial indexes; an index on the filtered column plus the owner
148
+ columns serves the same filter.
149
+ - With the `utf8mb4_0900_ai_ci` collation a unique key ignores case and accents
150
+ (`Soup` and `soup` collide); try a value that differs only in case when such a
151
+ key is a constraint.
152
+ - Read plans with `EXPLAIN ANALYZE` (MySQL 8.0.18 and later; `EXPLAIN` on
153
+ MariaDB).
154
+ - `information_schema` reads are slow and lock metadata: keep them in
155
+ migrations and checks, never on a request path.
@@ -15,7 +15,7 @@ A concrete Fastify, Vue, and JSKIT application foundation for products that do n
15
15
 
16
16
  - Id: `app/minimal-foundation`
17
17
  - Keywords: `app`, `fastify`, `foundation`, `minimal`, `server`, `vite`, `vue`
18
- - Owner: `@jskit-ai/agent-docs@0.1.324`
18
+ - Owner: `@jskit-ai/agent-docs@0.1.326`
19
19
  - Read: [PATTERN.md](patterns/app/minimal-foundation/PATTERN.md)
20
20
  - Examples: [example/](patterns/app/minimal-foundation/example/)
21
21
  - Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`
@@ -26,7 +26,7 @@ A concrete JSKIT web application foundation with responsive shell navigation, se
26
26
 
27
27
  - Id: `app/shell-foundation`
28
28
  - Keywords: `app`, `foundation`, `material`, `navigation`, `placements`, `shell`, `vite`, `vue`
29
- - Owner: `@jskit-ai/agent-docs@0.1.324`
29
+ - Owner: `@jskit-ai/agent-docs@0.1.326`
30
30
  - Read: [PATTERN.md](patterns/app/shell-foundation/PATTERN.md)
31
31
  - Examples: [example/](patterns/app/shell-foundation/example/)
32
32
  - Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`, `@jskit-ai/shell-web`
@@ -37,7 +37,7 @@ Configure an assistant runtime for one application surface and expose its chat a
37
37
 
38
38
  - Id: `assistant/assistant-surface`
39
39
  - Keywords: `ai`, `assistant`, `chat`, `config`, `environment`, `page`, `placement`, `settings`, `surface`
40
- - Owner: `@jskit-ai/assistant-runtime@0.2.64`
40
+ - Owner: `@jskit-ai/assistant-runtime@0.2.65`
41
41
  - Read: [PATTERN.md](patterns/assistant/assistant-surface/PATTERN.md)
42
42
  - Examples: [example/](patterns/assistant/assistant-surface/example/)
43
43
  - Requires: `@jskit-ai/assistant-runtime`, `@jskit-ai/connectors-catalog`, `@jskit-ai/connectors-core`, `@jskit-ai/shell-web`
@@ -48,7 +48,7 @@ Run one OpenID Connect sign-in for all of an owner's apps as its own JSKIT proje
48
48
 
49
49
  - Id: `auth/accounts-hub`
50
50
  - Keywords: `accounts hub`, `auth`, `authentication`, `issuer`, `master login`, `oidc`, `openid connect`, `single sign-on`, `sso`
51
- - Owner: `@jskit-ai/oidc-issuer-core@0.1.38`
51
+ - Owner: `@jskit-ai/oidc-issuer-core@0.1.39`
52
52
  - Read: [PATTERN.md](patterns/auth/accounts-hub/PATTERN.md)
53
53
  - Examples: [example/](patterns/auth/accounts-hub/example/)
54
54
  - Requires: `@jskit-ai/oidc-issuer-core`
@@ -59,7 +59,7 @@ Compose JSKIT authentication routes, views, profile controls, and public surface
59
59
 
60
60
  - Id: `auth/auth-surface`
61
61
  - Keywords: `account`, `auth`, `login`, `logout`, `password`, `placement`, `profile`, `reset`, `surface`
62
- - Owner: `@jskit-ai/auth-web@0.2.39`
62
+ - Owner: `@jskit-ai/auth-web@0.2.41`
63
63
  - Read: [PATTERN.md](patterns/auth/auth-surface/PATTERN.md)
64
64
  - Examples: [example/](patterns/auth/auth-surface/example/)
65
65
  - Requires: `@jskit-ai/auth-core`, `@jskit-ai/auth-web`, `@jskit-ai/shell-web`
@@ -70,7 +70,7 @@ Let people sign in with the accounts they already have in an accounts hub or ano
70
70
 
71
71
  - Id: `auth/oidc-sign-in`
72
72
  - Keywords: `accounts hub`, `auth`, `authentication`, `back-channel logout`, `dynamic client registration`, `issuer`, `master login`, `oidc`, `openid connect`, `single sign-on`, `sso`
73
- - Owner: `@jskit-ai/auth-provider-oidc-core@0.2.43`
73
+ - Owner: `@jskit-ai/auth-provider-oidc-core@0.2.45`
74
74
  - Read: [PATTERN.md](patterns/auth/oidc-sign-in/PATTERN.md)
75
75
  - Examples: [example/](patterns/auth/oidc-sign-in/example/)
76
76
  - Requires: `@jskit-ai/auth-provider-oidc-core`, `@jskit-ai/auth-web`
@@ -81,7 +81,7 @@ Add Supabase authentication through normal npm composition, explicit environment
81
81
 
82
82
  - Id: `auth/supabase-auth`
83
83
  - Keywords: `auth`, `authentication`, `oauth`, `sessions`, `supabase`
84
- - Owner: `@jskit-ai/auth-provider-supabase-core@0.2.30`
84
+ - Owner: `@jskit-ai/auth-provider-supabase-core@0.2.31`
85
85
  - Read: [PATTERN.md](patterns/auth/supabase-auth/PATTERN.md)
86
86
  - Examples: [example/](patterns/auth/supabase-auth/example/)
87
87
  - Requires: `@jskit-ai/auth-provider-supabase-core`
@@ -246,7 +246,7 @@ Add a protected administration surface, settings shell, and semantic navigation
246
246
 
247
247
  - Id: `console/console-surface`
248
248
  - Keywords: `admin`, `console`, `navigation`, `owner`, `placement`, `settings`, `surface`
249
- - Owner: `@jskit-ai/console-web@0.1.271`
249
+ - Owner: `@jskit-ai/console-web@0.1.273`
250
250
  - Read: [PATTERN.md](patterns/console/console-surface/PATTERN.md)
251
251
  - Examples: [example/](patterns/console/console-surface/example/)
252
252
  - Requires: `@jskit-ai/console-core`, `@jskit-ai/console-web`, `@jskit-ai/shell-web`
@@ -279,7 +279,7 @@ Build a routed CRUD user interface as thin application pages over JSKIT's shared
279
279
 
280
280
  - Id: `crud/crud-screen-set`
281
281
  - Keywords: `actions`, `add`, `crud`, `delete`, `edit`, `filters`, `list`, `material`, `routes`, `view`, `vue`
282
- - Owner: `@jskit-ai/http-web@0.2.42`
282
+ - Owner: `@jskit-ai/http-web@0.2.43`
283
283
  - Read: [PATTERN.md](patterns/crud/crud-screen-set/PATTERN.md)
284
284
  - Examples: [example/](patterns/crud/crud-screen-set/example/)
285
285
  - Requires: `@jskit-ai/http-web`, `@jskit-ai/resource-core`, `@jskit-ai/resource-crud-core`
@@ -323,7 +323,7 @@ Wrap a JSKIT web application in a Capacitor Android shell using native Capacitor
323
323
 
324
324
  - Id: `mobile/android-application`
325
325
  - Keywords: `android`, `capacitor`, `device`, `mobile`, `native`, `shell`, `webview`
326
- - Owner: `@jskit-ai/mobile-capacitor@0.2.35`
326
+ - Owner: `@jskit-ai/mobile-capacitor@0.2.36`
327
327
  - Read: [PATTERN.md](patterns/mobile/android-application/PATTERN.md)
328
328
  - Examples: [example/](patterns/mobile/android-application/example/)
329
329
  - Requires: `@capacitor/android`, `@capacitor/app`, `@capacitor/cli`, `@jskit-ai/mobile-capacitor`
@@ -334,7 +334,7 @@ Add JSKIT realtime events with an optional Redis backplane and an explicit shell
334
334
 
335
335
  - Id: `realtime/realtime-application`
336
336
  - Keywords: `realtime`, `redis`, `socket.io`, `sockets`, `status`, `websocket`
337
- - Owner: `@jskit-ai/realtime@0.2.38`
337
+ - Owner: `@jskit-ai/realtime@0.2.39`
338
338
  - Read: [PATTERN.md](patterns/realtime/realtime-application/PATTERN.md)
339
339
  - Examples: [example/](patterns/realtime/realtime-application/example/)
340
340
  - Requires: `@jskit-ai/realtime`, `@jskit-ai/shell-web`
@@ -345,7 +345,7 @@ Compose application-owned Google Publisher Tag delivery with the generic rewarde
345
345
 
346
346
  - Id: `rewards/google-rewarded`
347
347
  - Keywords: `ads`, `google`, `publisher tag`, `rewarded`, `unlock`
348
- - Owner: `@jskit-ai/rewarded-web@0.2.48`
348
+ - Owner: `@jskit-ai/rewarded-web@0.2.50`
349
349
  - Read: [PATTERN.md](patterns/rewards/google-rewarded/PATTERN.md)
350
350
  - Examples: [example/](patterns/rewards/google-rewarded/example/)
351
351
  - Requires: `@jskit-ai/rewarded-web`
@@ -356,7 +356,7 @@ Define a server feature through explicit capabilities and first-class actions, a
356
356
 
357
357
  - Id: `server/feature-package`
358
358
  - Keywords: `actions`, `aggregate`, `feature`, `handle`, `orchestration`, `owns`, `package`, `provider`, `repository`, `routes`, `server`, `table resource`
359
- - Owner: `@jskit-ai/agent-docs@0.1.324`
359
+ - Owner: `@jskit-ai/agent-docs@0.1.326`
360
360
  - Read: [PATTERN.md](patterns/server/feature-package/PATTERN.md)
361
361
  - Examples: [example/](patterns/server/feature-package/example/)
362
362
  - Requires: `@jskit-ai/kernel`
@@ -367,7 +367,7 @@ Compose the JSKIT responsive shell, semantic placements, settings navigation, an
367
367
 
368
368
  - Id: `shell/application-shell`
369
369
  - Keywords: `adaptive`, `app`, `layout`, `navigation`, `placement`, `responsive`, `settings`, `shell`
370
- - Owner: `@jskit-ai/shell-web@0.2.35`
370
+ - Owner: `@jskit-ai/shell-web@0.2.36`
371
371
  - Read: [PATTERN.md](patterns/shell/application-shell/PATTERN.md)
372
372
  - Examples: [example/](patterns/shell/application-shell/example/)
373
373
  - Requires: `@jskit-ai/kernel`, `@jskit-ai/shell-web`
@@ -378,7 +378,7 @@ Add product routes and shell extensions through file routing, semantic placement
378
378
 
379
379
  - Id: `ui/page-and-placement`
380
380
  - Keywords: `component`, `navigation`, `outlet`, `page`, `placement`, `routes`, `section`, `shell`, `subpages`, `vue`
381
- - Owner: `@jskit-ai/shell-web@0.2.35`
381
+ - Owner: `@jskit-ai/shell-web@0.2.36`
382
382
  - Read: [PATTERN.md](patterns/ui/page-and-placement/PATTERN.md)
383
383
  - Examples: [example/](patterns/ui/page-and-placement/example/)
384
384
  - Requires: `@jskit-ai/kernel`, `@jskit-ai/shell-web`
@@ -389,7 +389,7 @@ Compose an account settings route and profile, preference, notification, and sig
389
389
 
390
390
  - Id: `users/account-settings`
391
391
  - Keywords: `account`, `link provider`, `notifications`, `oauth`, `preferences`, `profile`, `settings`, `sign-in methods`, `user`, `vue`
392
- - Owner: `@jskit-ai/users-web@0.2.54`
392
+ - Owner: `@jskit-ai/users-web@0.2.56`
393
393
  - Read: [PATTERN.md](patterns/users/account-settings/PATTERN.md)
394
394
  - Examples: [example/](patterns/users/account-settings/example/)
395
395
  - Requires: `@jskit-ai/shell-web`, `@jskit-ai/users-core`, `@jskit-ai/users-web`
@@ -400,7 +400,7 @@ Expose user administration and workspace-scoped member operations through app-ow
400
400
 
401
401
  - Id: `users/user-administration-server`
402
402
  - Keywords: `account`, `admin`, `member`, `repository`, `resource`, `routes`, `service`, `user`, `workspace`
403
- - Owner: `@jskit-ai/users-core@0.2.42`
403
+ - Owner: `@jskit-ai/users-core@0.2.43`
404
404
  - Read: [PATTERN.md](patterns/users/user-administration-server/PATTERN.md)
405
405
  - Examples: [example/](patterns/users/user-administration-server/example/)
406
406
  - Requires: `@jskit-ai/crud-core`, `@jskit-ai/users-core`
@@ -411,7 +411,7 @@ Configure roles, workspace access policy, invitations, and app-owned invitation
411
411
 
412
412
  - Id: `workspaces/workspace-server`
413
413
  - Keywords: `access`, `invite`, `membership`, `multitenancy`, `policy`, `role`, `tenancy`, `workspace`
414
- - Owner: `@jskit-ai/workspaces-core@0.2.42`
414
+ - Owner: `@jskit-ai/workspaces-core@0.2.43`
415
415
  - Read: [PATTERN.md](patterns/workspaces/workspace-server/PATTERN.md)
416
416
  - Examples: [example/](patterns/workspaces/workspace-server/example/)
417
417
  - Requires: `@jskit-ai/users-core`, `@jskit-ai/workspaces-core`
@@ -422,7 +422,7 @@ Compose workspace selection, invitation, member administration, settings, and re
422
422
 
423
423
  - Id: `workspaces/workspace-surfaces`
424
424
  - Keywords: `admin`, `invite`, `member`, `navigation`, `settings`, `surface`, `switcher`, `workspace`
425
- - Owner: `@jskit-ai/workspaces-web@0.2.54`
425
+ - Owner: `@jskit-ai/workspaces-web@0.2.56`
426
426
  - Read: [PATTERN.md](patterns/workspaces/workspace-surfaces/PATTERN.md)
427
427
  - Examples: [example/](patterns/workspaces/workspace-surfaces/example/)
428
428
  - Requires: `@jskit-ai/shell-web`, `@jskit-ai/workspaces-core`, `@jskit-ai/workspaces-web`
@@ -35,7 +35,7 @@
35
35
  "@local/main": "0.1.0",
36
36
  "@fastify/static": "^10.1.3",
37
37
  "@jskit-ai/kernel": "0.2.26",
38
- "@jskit-ai/material-web": "0.1.6",
38
+ "@jskit-ai/material-web": "0.1.7",
39
39
  "@tanstack/vue-query": "^5.101.0",
40
40
  "fastify": "^5.12.7",
41
41
  "pino": "^10.3.1",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "devDependencies": {
52
52
  "@jskit-ai/config-eslint": "0.1.252",
53
- "@jskit-ai/jskit-catalog": "0.2.76",
53
+ "@jskit-ai/jskit-catalog": "0.2.78",
54
54
  "@playwright/test": "1.61.1",
55
55
  "@vitejs/plugin-vue": "^6.0.7",
56
56
  "eslint": "^10.8.0",