@fuzdev/fuz_app 0.78.1 → 0.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/actions/CLAUDE.md +5 -5
  2. package/dist/actions/action_rpc.d.ts +1 -1
  3. package/dist/actions/compile_action_registry.d.ts +1 -1
  4. package/dist/actions/compile_action_registry.js +1 -1
  5. package/dist/actions/connection_closer.d.ts +1 -1
  6. package/dist/actions/connection_closer.js +1 -1
  7. package/dist/auth/actor_lookup_action_specs.d.ts +1 -1
  8. package/dist/auth/actor_lookup_action_specs.js +1 -1
  9. package/dist/auth/actor_lookup_queries.d.ts +1 -1
  10. package/dist/auth/actor_lookup_queries.js +1 -1
  11. package/dist/auth/actor_search_actions.d.ts +1 -1
  12. package/dist/auth/actor_search_actions.js +1 -1
  13. package/dist/auth/actor_search_queries.d.ts +3 -3
  14. package/dist/auth/actor_search_queries.js +3 -3
  15. package/dist/auth/all_action_spec_registries.d.ts +1 -1
  16. package/dist/auth/all_action_spec_registries.js +1 -1
  17. package/dist/auth/cell_action_specs.d.ts +1 -1
  18. package/dist/auth/cell_action_specs.js +1 -1
  19. package/dist/auth/cell_actions.d.ts +2 -2
  20. package/dist/auth/cell_actions.js +2 -2
  21. package/dist/auth/cell_audit_events.d.ts +3 -3
  22. package/dist/auth/cell_audit_events.js +3 -3
  23. package/dist/auth/cell_data_schema.d.ts +2 -2
  24. package/dist/auth/cell_data_schema.js +2 -2
  25. package/dist/auth/cell_field_actions.d.ts +3 -3
  26. package/dist/auth/cell_field_actions.js +3 -3
  27. package/dist/auth/cell_grant_actions.d.ts +3 -3
  28. package/dist/auth/cell_grant_actions.js +3 -3
  29. package/dist/auth/cell_item_actions.d.ts +3 -3
  30. package/dist/auth/cell_item_actions.js +3 -3
  31. package/dist/db/cell_queries.d.ts +2 -2
  32. package/dist/db/cell_queries.js +1 -1
  33. package/dist/http/CLAUDE.md +4 -4
  34. package/dist/http/auth_shape.d.ts +2 -2
  35. package/dist/http/auth_shape.js +2 -2
  36. package/dist/http/ip_canonical.d.ts +1 -1
  37. package/dist/http/ip_canonical.js +1 -1
  38. package/dist/http/proxy.d.ts +1 -1
  39. package/dist/http/proxy.js +1 -1
  40. package/dist/http/route_spec.d.ts +1 -1
  41. package/dist/server/app_server_context.d.ts +1 -1
  42. package/dist/server/app_server_context.js +1 -1
  43. package/dist/testing/CLAUDE.md +6 -2
  44. package/dist/testing/audit_completeness.js +1 -1
  45. package/dist/testing/audit_drift_guard.d.ts +1 -1
  46. package/dist/testing/cross_backend/backend_config.d.ts +1 -1
  47. package/dist/testing/cross_backend/bench/run_cross_impl_bench.d.ts +1 -1
  48. package/dist/testing/cross_backend/capabilities.d.ts +10 -0
  49. package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
  50. package/dist/testing/cross_backend/capabilities.js +1 -0
  51. package/dist/testing/cross_backend/cell_cross_helpers.d.ts +1 -1
  52. package/dist/testing/cross_backend/cell_cross_helpers.js +2 -2
  53. package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
  54. package/dist/testing/cross_backend/default_backend_configs.js +2 -0
  55. package/dist/testing/cross_backend/default_secrets.d.ts +1 -1
  56. package/dist/testing/cross_backend/default_secrets.js +1 -1
  57. package/dist/testing/cross_backend/default_spine_surface.d.ts +1 -1
  58. package/dist/testing/cross_backend/default_spine_surface.js +1 -1
  59. package/dist/testing/cross_backend/fact_serving.d.ts +14 -0
  60. package/dist/testing/cross_backend/fact_serving.d.ts.map +1 -0
  61. package/dist/testing/cross_backend/fact_serving.js +189 -0
  62. package/dist/testing/cross_backend/setup.d.ts +3 -3
  63. package/dist/testing/cross_backend/setup.js +2 -2
  64. package/dist/testing/cross_backend/spawn_backend.d.ts +1 -1
  65. package/dist/testing/cross_backend/spawn_backend.js +1 -1
  66. package/dist/testing/cross_backend/testing_reset_actions.d.ts +34 -0
  67. package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
  68. package/dist/testing/cross_backend/testing_reset_actions.js +43 -0
  69. package/dist/testing/cross_backend/testing_server_bun.js +3 -3
  70. package/dist/testing/cross_backend/testing_server_core.d.ts +3 -3
  71. package/dist/testing/cross_backend/testing_server_deno.js +2 -2
  72. package/dist/testing/cross_backend/testing_server_node.js +1 -1
  73. package/dist/testing/cross_backend/ts_spine_backend_config.d.ts +1 -1
  74. package/dist/testing/cross_backend/ts_spine_backend_config.js +1 -1
  75. package/dist/testing/cross_backend/xfail.js +1 -1
  76. package/dist/testing/data_exposure.js +1 -1
  77. package/dist/testing/db_entities.d.ts +1 -1
  78. package/dist/testing/db_entities.js +3 -3
  79. package/dist/testing/integration.d.ts +1 -1
  80. package/dist/testing/role_grant_helpers.js +1 -1
  81. package/dist/testing/rpc_round_trip.js +1 -1
  82. package/dist/testing/schema_introspect.d.ts +3 -3
  83. package/dist/testing/schema_introspect.js +3 -3
  84. package/dist/testing/transports/sse_transport.js +2 -2
  85. package/dist/testing/transports/ws_client.d.ts +1 -1
  86. package/dist/testing/transports/ws_client.js +2 -2
  87. package/dist/testing/transports/ws_transport.js +1 -1
  88. package/dist/ui/CLAUDE.md +1 -1
  89. package/dist/ui/sidebar_state.svelte.d.ts +2 -2
  90. package/dist/ui/sidebar_state.svelte.js +2 -2
  91. package/package.json +1 -1
@@ -10,8 +10,8 @@ import '../assert_dev_env.js';
10
10
  * WS attach, graceful drain shutdown — and delegates the runtime-boundary
11
11
  * primitives (HTTP serve, WS upgrade construction, signals, pid, exit) to a
12
12
  * {@link TestingServerAdapter}. The two shipped adapters are
13
- * `testing_server_node.ts` (`@hono/node-server` + `@hono/node-ws`) and
14
- * `testing_server_deno.ts` (`Deno.serve` + `hono/deno`).
13
+ * `testing/cross_backend/testing_server_node.ts` (`@hono/node-server` + `@hono/node-ws`) and
14
+ * `testing/cross_backend/testing_server_deno.ts` (`Deno.serve` + `hono/deno`).
15
15
  *
16
16
  * The app itself — routes, RPC, DB, `_testing_reset`, optional WS mount —
17
17
  * is the caller's {@link StartTestingServerOptions.build_app} seam, so this
@@ -57,7 +57,7 @@ export interface PreparedWebsocket {
57
57
  }
58
58
  /**
59
59
  * Runtime adapter contract for the test-binary entry. Each adapter
60
- * (`testing_server_node.ts`, `testing_server_deno.ts`) implements this and
60
+ * (`testing/cross_backend/testing_server_node.ts`, `testing/cross_backend/testing_server_deno.ts`) implements this and
61
61
  * hands the shape to {@link start_testing_server}.
62
62
  */
63
63
  export interface TestingServerAdapter {
@@ -3,8 +3,8 @@ import '../assert_dev_env.js';
3
3
  * Deno runtime adapter for spawnable cross-process test server binaries.
4
4
  *
5
5
  * Binds `Deno.serve` and `hono/deno`'s module-level `upgradeWebSocket`. The
6
- * shared `testing_server_core.ts` owns the rest. Counterpart to
7
- * `testing_server_node.ts` — together they isolate the JS-runtime axis (Deno
6
+ * shared `testing/cross_backend/testing_server_core.ts` owns the rest. Counterpart to
7
+ * `testing/cross_backend/testing_server_node.ts` — together they isolate the JS-runtime axis (Deno
8
8
  * vs Node V8) on identical TS surfaces, and the Rust spine binary covers the
9
9
  * cross-language axis.
10
10
  *
@@ -4,7 +4,7 @@ import '../assert_dev_env.js';
4
4
  *
5
5
  * Binds `@hono/node-server`'s `serve()` and `@hono/node-ws`'s two-phase
6
6
  * `createNodeWebSocket(app)` / `injectWebSocket(server)`. The shared
7
- * `testing_server_core.ts` owns the rest. A test binary builds this adapter
7
+ * `testing/cross_backend/testing_server_core.ts` owns the rest. A test binary builds this adapter
8
8
  * and hands it to `start_testing_server` alongside its `build_app` seam.
9
9
  *
10
10
  * `@hono/node-server` + `@hono/node-ws` are **optional** peer deps (same
@@ -21,7 +21,7 @@ import type { BackendConfig } from './backend_config.js';
21
21
  export declare const TS_SPINE_DIR_ENV = "FUZ_TESTING_TS_SPINE_DIR";
22
22
  /**
23
23
  * Audit-log SSE stream path the TS spine binary serves (it wires
24
- * `audit_log_sse`). Matches `SPINE_SSE_PATH` in `default_spine_surface.ts`
24
+ * `audit_log_sse`). Matches `SPINE_SSE_PATH` in `testing/cross_backend/default_spine_surface.ts`
25
25
  * and the cross-process SSE suite's default. Scoped to the TS configs
26
26
  * (which advertise `capabilities.sse: true`) — the Rust spine doesn't serve
27
27
  * the stream, so the shared `ts_default_capabilities` stays `sse: false`.
@@ -5,7 +5,7 @@ import { make_default_ts_backend_config, ts_default_capabilities, } from './defa
5
5
  export const TS_SPINE_DIR_ENV = 'FUZ_TESTING_TS_SPINE_DIR';
6
6
  /**
7
7
  * Audit-log SSE stream path the TS spine binary serves (it wires
8
- * `audit_log_sse`). Matches `SPINE_SSE_PATH` in `default_spine_surface.ts`
8
+ * `audit_log_sse`). Matches `SPINE_SSE_PATH` in `testing/cross_backend/default_spine_surface.ts`
9
9
  * and the cross-process SSE suite's default. Scoped to the TS configs
10
10
  * (which advertise `capabilities.sse: true`) — the Rust spine doesn't serve
11
11
  * the stream, so the shared `ts_default_capabilities` stays `sse: false`.
@@ -14,7 +14,7 @@ import '../assert_dev_env.js';
14
14
  * stops throwing (i.e. the impl starts passing), forcing whoever closed
15
15
  * the gap to delete the marker. A `.skip` would rot silently; this can't.
16
16
  *
17
- * Sibling to `test_if` in `capabilities.ts`. No taxonomy — a one-line
17
+ * Sibling to `test_if` in `testing/cross_backend/capabilities.ts`. No taxonomy — a one-line
18
18
  * marker with a tracking id and a reason, nothing more.
19
19
  *
20
20
  * @module
@@ -8,7 +8,7 @@ import './assert_dev_env.js';
8
8
  * - Cross-privilege: verifies admin routes return 403 for non-admin users,
9
9
  * and non-admin responses exclude admin-only fields
10
10
  *
11
- * Cadence: per-describe `setup_test()` call (see `round_trip.ts` module
11
+ * Cadence: per-describe `setup_test()` call (see `testing/round_trip.ts` module
12
12
  * docstring). The runtime body manages its own request ordering (auth-free
13
13
  * → cross-privilege → 2xx) to avoid session-invalidation contamination
14
14
  * between assertions, so per-test fixture re-creation isn't needed.
@@ -28,7 +28,7 @@ export declare const create_test_account_with_actor: (db: Db, options: {
28
28
  * `_supersede` notification chain a real grant emits. Cross-process
29
29
  * suites must instead drive `role_grant_offer_create_action_spec` +
30
30
  * `role_grant_offer_accept_action_spec` via
31
- * `role_grant_helpers.ts`'s `role_grant_offer_and_accept` so the
31
+ * `testing/role_grant_helpers.ts`'s `role_grant_offer_and_accept` so the
32
32
  * fixture observes the full post-commit fan-out the way production
33
33
  * does — otherwise tests would mask real divergence between the TS
34
34
  * and Rust spines.
@@ -3,7 +3,7 @@ import './assert_dev_env.js';
3
3
  * DB-backed entity factories for tests that need real `account` + `actor`
4
4
  * rows in the database.
5
5
  *
6
- * Companion to `entities.ts` — that file ships in-memory factories
6
+ * Companion to `testing/entities.ts` — that file ships in-memory factories
7
7
  * (`create_test_account`, `create_test_actor`) for tests that mock the
8
8
  * DB; this file ships factories that hit a real `Db` so query-level
9
9
  * tests don't reimplement the same `query_create_account_with_actor`
@@ -12,7 +12,7 @@ import './assert_dev_env.js';
12
12
  * For full-fledged test accounts that also need an API token + signed
13
13
  * session cookie + role_grants, use `bootstrap_test_keeper` (keeper) or
14
14
  * `create_test_account_with_credentials` (additional accounts) from
15
- * `app_server.ts` instead.
15
+ * `testing/app_server.ts` instead.
16
16
  *
17
17
  * @module
18
18
  */
@@ -37,7 +37,7 @@ export const create_test_account_with_actor = async (db, options) => query_creat
37
37
  * `_supersede` notification chain a real grant emits. Cross-process
38
38
  * suites must instead drive `role_grant_offer_create_action_spec` +
39
39
  * `role_grant_offer_accept_action_spec` via
40
- * `role_grant_helpers.ts`'s `role_grant_offer_and_accept` so the
40
+ * `testing/role_grant_helpers.ts`'s `role_grant_offer_and_accept` so the
41
41
  * fixture observes the full post-commit fan-out the way production
42
42
  * does — otherwise tests would mask real divergence between the TS
43
43
  * and Rust spines.
@@ -41,7 +41,7 @@ export interface StandardIntegrationTestOptions {
41
41
  * `require_rpc_endpoint_path` on setup so consumer projects see a
42
42
  * clear setup error instead of confusing test failures.
43
43
  *
44
- * Accepts either an array (eager) or a factory — see `rpc_helpers.ts`
44
+ * Accepts either an array (eager) or a factory — see `testing/rpc_helpers.ts`
45
45
  * for the union semantics. The factory must return the same endpoint
46
46
  * `path` regardless of ctx — invoked once at setup with a stub ctx
47
47
  * for path lookup; the running backend handles live dispatch.
@@ -2,7 +2,7 @@ import './assert_dev_env.js';
2
2
  /**
3
3
  * RPC-flow helpers for role_grant lifecycle in tests.
4
4
  *
5
- * Sibling to `db_entities.ts`'s `create_test_role_grant_direct` — that one
5
+ * Sibling to `testing/db_entities.ts`'s `create_test_role_grant_direct` — that one
6
6
  * seeds a role_grant directly via `query_create_role_grant` (bypassing the
7
7
  * consent flow) for tests that focus on revoke or isolation semantics. This
8
8
  * file ships the RPC-driven complement: `role_grant_offer_and_accept`
@@ -8,7 +8,7 @@ import './assert_dev_env.js';
8
8
  * method's declared output schema. DB-backed via the suite's `setup_test`
9
9
  * fixture-producing callback.
10
10
  *
11
- * Cadence: per-describe `setup_test()` call (see `round_trip.ts` module
11
+ * Cadence: per-describe `setup_test()` call (see `testing/round_trip.ts` module
12
12
  * docstring). RPC round-trip tests fire one JSON-RPC envelope per
13
13
  * method-direction and don't mutate state in a way that contaminates the
14
14
  * next case.
@@ -15,7 +15,7 @@ import './assert_dev_env.js';
15
15
  * and PGlite. The snapshot is fully deterministic: every collection sorts by
16
16
  * a stable key and excludes time-varying fields like `applied_at`.
17
17
  *
18
- * Paired with `schema_parity.ts` for comparison + assertion helpers.
18
+ * Paired with `testing/schema_parity.ts` for comparison + assertion helpers.
19
19
  *
20
20
  * @module
21
21
  */
@@ -63,8 +63,8 @@ export type SequenceSnapshot = z.infer<typeof SequenceSnapshot>;
63
63
  /**
64
64
  * Normalized database schema snapshot for parity comparison — the single
65
65
  * source of truth for the snapshot shape across the introspection query
66
- * (`query_schema_snapshot`), the diff comparator (`schema_parity.ts`), and
67
- * the cross-impl RPC action's wire validator (`testing_reset_actions.ts`).
66
+ * (`query_schema_snapshot`), the diff comparator (`testing/schema_parity.ts`), and
67
+ * the cross-impl RPC action's wire validator (`testing/cross_backend/testing_reset_actions.ts`).
68
68
  *
69
69
  * All fields are deterministically ordered on capture so structural equality
70
70
  * via `JSON.stringify` or per-key comparison yields stable results.
@@ -15,7 +15,7 @@ import './assert_dev_env.js';
15
15
  * and PGlite. The snapshot is fully deterministic: every collection sorts by
16
16
  * a stable key and excludes time-varying fields like `applied_at`.
17
17
  *
18
- * Paired with `schema_parity.ts` for comparison + assertion helpers.
18
+ * Paired with `testing/schema_parity.ts` for comparison + assertion helpers.
19
19
  *
20
20
  * @module
21
21
  */
@@ -54,8 +54,8 @@ export const SequenceSnapshot = z.object({
54
54
  /**
55
55
  * Normalized database schema snapshot for parity comparison — the single
56
56
  * source of truth for the snapshot shape across the introspection query
57
- * (`query_schema_snapshot`), the diff comparator (`schema_parity.ts`), and
58
- * the cross-impl RPC action's wire validator (`testing_reset_actions.ts`).
57
+ * (`query_schema_snapshot`), the diff comparator (`testing/schema_parity.ts`), and
58
+ * the cross-impl RPC action's wire validator (`testing/cross_backend/testing_reset_actions.ts`).
59
59
  *
60
60
  * All fields are deterministically ordered on capture so structural equality
61
61
  * via `JSON.stringify` or per-key comparison yields stable results.
@@ -8,9 +8,9 @@ import '../assert_dev_env.js';
8
8
  * delegates frame parsing to the shared `create_sse_frame_reader`. Uses only
9
9
  * built-in streaming `fetch` + `TextDecoder` — no extra dep.
10
10
  *
11
- * Mirrors how `ws_transport.ts` is the cross-process counterpart to the
11
+ * Mirrors how `testing/transports/ws_transport.ts` is the cross-process counterpart to the
12
12
  * in-process WS harness; the in-process SSE route suite
13
- * (`../sse_round_trip.ts`) shares the same `create_sse_frame_reader` over a
13
+ * (`testing/sse_round_trip.ts`) shares the same `create_sse_frame_reader` over a
14
14
  * Hono `Response.body`.
15
15
  *
16
16
  * @module
@@ -82,7 +82,7 @@ export interface WsClient {
82
82
  * Resolves `true` immediately when the socket is already closed.
83
83
  * Distinct from `close()` (client-initiated): this awaits a close the
84
84
  * test did not request. Mirrors `wait_for_close` on the SSE frame reader
85
- * in `../sse_round_trip.ts`.
85
+ * in `testing/sse_round_trip.ts`.
86
86
  */
87
87
  wait_for_close: (timeout_ms?: number) => Promise<boolean>;
88
88
  /** Every message the server has sent, in arrival order. */
@@ -6,10 +6,10 @@ import '../assert_dev_env.js';
6
6
  * driver implements — `send` / `request` / `close` / `messages` /
7
7
  * `wait_for`. Two impls today:
8
8
  *
9
- * - **In-process** — `create_ws_test_harness` in `../ws_round_trip.ts`.
9
+ * - **In-process** — `create_ws_test_harness` in `testing/ws_round_trip.ts`.
10
10
  * Drives `register_action_ws` against a fake Hono upgrade so the
11
11
  * dispatcher's full path runs without the wire upgrade.
12
- * - **Cross-process** — `create_ws_transport` in `./ws_transport.ts`.
12
+ * - **Cross-process** — `create_ws_transport` in `testing/transports/ws_transport.ts`.
13
13
  * Wraps the native `WebSocket` upgrade against a real running binary,
14
14
  * threading the session cookie captured by `FetchTransport`.
15
15
  *
@@ -2,7 +2,7 @@ import '../assert_dev_env.js';
2
2
  /**
3
3
  * Cross-process WebSocket transport.
4
4
  *
5
- * Implements the shared `WsClient` interface (see `ws_client.ts`) over a
5
+ * Implements the shared `WsClient` interface (see `testing/transports/ws_client.ts`) over a
6
6
  * real `WebSocket` upgrade against a spawned test binary. The cookie
7
7
  * captured by the sibling `FetchTransport` on bootstrap is threaded onto
8
8
  * the upgrade request so the WS session authenticates as the same
package/dist/ui/CLAUDE.md CHANGED
@@ -12,7 +12,7 @@ RPC adapters are provisioned once at the admin shell and read by every
12
12
  `Admin*.svelte`.
13
13
 
14
14
  For Svelte 5 patterns (runes, inline `$props`, contexts, snippets,
15
- attachments), see Skill(fuz-stack) svelte-patterns. See ../../docs/usage.md
15
+ attachments), see Skill(fuz-stack) svelte-patterns. See ../../../docs/usage.md
16
16
  for end-to-end wiring examples ("Role grant offer UI", "Admin UI"). This
17
17
  file is a reference, not a tutorial.
18
18
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Reactive sidebar visibility state. Provisioned by `AppShell.svelte` via
2
+ * Reactive sidebar visibility state. Provisioned by `ui/AppShell.svelte` via
3
3
  * `sidebar_state_context`; consumers read `show_sidebar` and call
4
4
  * `toggle_sidebar` / `activate`.
5
5
  *
@@ -7,7 +7,7 @@
7
7
  */
8
8
  /**
9
9
  * Svelte context carrying a reactive `SidebarState` accessor. Set by
10
- * `AppShell.svelte` (creates a fresh `SidebarState` if not supplied);
10
+ * `ui/AppShell.svelte` (creates a fresh `SidebarState` if not supplied);
11
11
  * consumers call `sidebar_state_context.get()` to read or toggle visibility.
12
12
  */
13
13
  export declare const sidebar_state_context: {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Reactive sidebar visibility state. Provisioned by `AppShell.svelte` via
2
+ * Reactive sidebar visibility state. Provisioned by `ui/AppShell.svelte` via
3
3
  * `sidebar_state_context`; consumers read `show_sidebar` and call
4
4
  * `toggle_sidebar` / `activate`.
5
5
  *
@@ -8,7 +8,7 @@
8
8
  import { create_context } from '@fuzdev/fuz_ui/context_helpers.js';
9
9
  /**
10
10
  * Svelte context carrying a reactive `SidebarState` accessor. Set by
11
- * `AppShell.svelte` (creates a fresh `SidebarState` if not supplied);
11
+ * `ui/AppShell.svelte` (creates a fresh `SidebarState` if not supplied);
12
12
  * consumers call `sidebar_state_context.get()` to read or toggle visibility.
13
13
  */
14
14
  export const sidebar_state_context = create_context();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzdev/fuz_app",
3
- "version": "0.78.1",
3
+ "version": "0.80.0",
4
4
  "description": "fullstack app library",
5
5
  "glyph": "🗝",
6
6
  "logo": "logo.svg",