@fuzdev/fuz_app 0.82.0 → 0.84.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 (40) hide show
  1. package/dist/auth/account_queries.d.ts.map +1 -1
  2. package/dist/auth/account_queries.js +19 -9
  3. package/dist/auth/migrations.d.ts +21 -18
  4. package/dist/auth/migrations.d.ts.map +1 -1
  5. package/dist/auth/migrations.js +22 -19
  6. package/dist/db/CLAUDE.md +6 -0
  7. package/dist/db/schema_ready.d.ts +83 -0
  8. package/dist/db/schema_ready.d.ts.map +1 -0
  9. package/dist/db/schema_ready.js +103 -0
  10. package/dist/http/CLAUDE.md +3 -2
  11. package/dist/http/common_routes.d.ts +49 -0
  12. package/dist/http/common_routes.d.ts.map +1 -1
  13. package/dist/http/common_routes.js +92 -0
  14. package/dist/testing/CLAUDE.md +35 -6
  15. package/dist/testing/cross_backend/backend_config.d.ts +2 -2
  16. package/dist/testing/cross_backend/capabilities.d.ts +10 -0
  17. package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
  18. package/dist/testing/cross_backend/capabilities.js +1 -0
  19. package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
  20. package/dist/testing/cross_backend/default_backend_configs.js +6 -0
  21. package/dist/testing/cross_backend/default_spine_surface.d.ts +48 -0
  22. package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
  23. package/dist/testing/cross_backend/default_spine_surface.js +24 -24
  24. package/dist/testing/cross_backend/expected_schema.json +113 -0
  25. package/dist/testing/cross_backend/ready.d.ts +14 -0
  26. package/dist/testing/cross_backend/ready.d.ts.map +1 -0
  27. package/dist/testing/cross_backend/ready.js +50 -0
  28. package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts +39 -0
  29. package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -0
  30. package/dist/testing/cross_backend/rust_spine_stub_backend_config.js +103 -0
  31. package/dist/testing/cross_backend/ts_spine_backend_config.d.ts +1 -1
  32. package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
  33. package/dist/testing/cross_backend/ts_spine_backend_config.js +6 -2
  34. package/dist/testing/schema_ready_fixture.d.ts +46 -0
  35. package/dist/testing/schema_ready_fixture.d.ts.map +1 -0
  36. package/dist/testing/schema_ready_fixture.js +48 -0
  37. package/package.json +22 -15
  38. package/dist/testing/cross_backend/spine_stub_backend_config.d.ts +0 -66
  39. package/dist/testing/cross_backend/spine_stub_backend_config.d.ts.map +0 -1
  40. package/dist/testing/cross_backend/spine_stub_backend_config.js +0 -53
@@ -1 +1 @@
1
- {"version":3,"file":"ts_spine_backend_config.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/ts_spine_backend_config.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAOvD,8GAA8G;AAC9G,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAE3D;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,4BAA4B,CAAC;AAK3D,6FAA6F;AAC7F,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,iDAAiD;AACjD,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,gDAAgD;AAChD,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,wDAAwD,CAAC;AAEzF,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,wDAAwD,CAAC;AAEzF,wDAAwD;AACxD,eAAO,MAAM,kBAAkB,uDAAuD,CAAC;AAEvF,MAAM,WAAW,2BAA2B;IAC3C,mFAAmF;IACnF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GACxC,UAAS,2BAAgC,KACvC,aAgBF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,GACvC,UAAS,2BAAgC,KACvC,aAgBF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,GACxC,UAAS,2BAAgC,KACvC,aA6BF,CAAC"}
1
+ {"version":3,"file":"ts_spine_backend_config.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/ts_spine_backend_config.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAOvD,8GAA8G;AAC9G,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAE3D;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,4BAA4B,CAAC;AAS3D,6FAA6F;AAC7F,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,iDAAiD;AACjD,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,gDAAgD;AAChD,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,wDAAwD,CAAC;AAEzF,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,wDAAwD,CAAC;AAEzF,wDAAwD;AACxD,eAAO,MAAM,kBAAkB,uDAAuD,CAAC;AAEvF,MAAM,WAAW,2BAA2B;IAC3C,mFAAmF;IACnF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GACxC,UAAS,2BAAgC,KACvC,aAgBF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,GACvC,UAAS,2BAAgC,KACvC,aAgBF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,GACxC,UAAS,2BAAgC,KACvC,aA6BF,CAAC"}
@@ -11,8 +11,12 @@ export const TS_SPINE_DIR_ENV = 'FUZ_TESTING_TS_SPINE_DIR';
11
11
  * the stream, so the shared `ts_default_capabilities` stays `sse: false`.
12
12
  */
13
13
  export const TS_SPINE_SSE_PATH = '/api/admin/audit/stream';
14
- /** Capabilities for the TS spine binary — `ts_default_capabilities` plus `sse` (the binary wires `audit_log_sse`). */
15
- const ts_spine_capabilities = Object.freeze({ ...ts_default_capabilities, sse: true });
14
+ /**
15
+ * Capabilities for the TS spine binary — `ts_default_capabilities` plus `sse`
16
+ * (the binary wires `audit_log_sse`) and `ready` (the binary live-mounts the
17
+ * `/ready` deploy gate in `build_spine_app`).
18
+ */
19
+ const ts_spine_capabilities = Object.freeze({ ...ts_default_capabilities, sse: true, ready: true });
16
20
  /** Default port for the Node TS spine binary — slots beside the Rust `spine_stub` (1177). */
17
21
  export const TS_SPINE_NODE_DEFAULT_PORT = 1178;
18
22
  /** Default port for the Deno TS spine binary. */
@@ -0,0 +1,46 @@
1
+ import './assert_dev_env.js';
2
+ import type { Db } from '../db/db.js';
3
+ import { type ExpectedSchema } from '../db/schema_ready.js';
4
+ /** Options for `sync_expected_schema_fixture`. */
5
+ export interface SyncExpectedSchemaFixtureOptions {
6
+ /** A bootstrapped DB — the consumer has run its full migration chain on it. */
7
+ db: Db;
8
+ /** Committed fixture location — an `import.meta.url`-relative URL or a path. */
9
+ fixture_url: URL | string;
10
+ /**
11
+ * When true, overwrite the fixture with the live column map instead of just
12
+ * reading it. Drive from an env flag (e.g. `UPDATE_SCHEMA_READY === '1'`).
13
+ */
14
+ update?: boolean;
15
+ }
16
+ /** The live column map and the committed fixture, for a `deepEqual` assertion. */
17
+ export interface SyncExpectedSchemaFixtureResult {
18
+ /** Columns introspected from the live, freshly-bootstrapped DB. */
19
+ live: Record<string, Array<string>>;
20
+ /** The committed fixture (re-read after writing when `update`). */
21
+ committed: ExpectedSchema;
22
+ }
23
+ /**
24
+ * Introspect the live (bootstrapped) DB's columns, write them to the committed
25
+ * fixture when `update`, then read the committed fixture back. The caller
26
+ * asserts `deepEqual(live, committed)`:
27
+ *
28
+ * ```ts
29
+ * const {live, committed} = await sync_expected_schema_fixture({
30
+ * db,
31
+ * fixture_url: new URL('../../lib/server/expected_schema.json', import.meta.url),
32
+ * update: process.env.UPDATE_SCHEMA_READY === '1',
33
+ * });
34
+ * assert.deepEqual(live, committed);
35
+ * ```
36
+ *
37
+ * When `update` writes the fixture it emits raw `JSON.stringify` (one array
38
+ * element per line); Prettier collapses short arrays inline, so run `gro format`
39
+ * after `UPDATE_SCHEMA_READY=1` before committing or the format check will flag
40
+ * the regenerated file. (The content is identical either way — the regen test
41
+ * compares values, not formatting.)
42
+ *
43
+ * @returns the live column map and the committed map (post-write when `update`)
44
+ */
45
+ export declare const sync_expected_schema_fixture: (options: SyncExpectedSchemaFixtureOptions) => Promise<SyncExpectedSchemaFixtureResult>;
46
+ //# sourceMappingURL=schema_ready_fixture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema_ready_fixture.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/schema_ready_fixture.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAmB7B,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM,aAAa,CAAC;AACpC,OAAO,EAAuB,KAAK,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAEhF,kDAAkD;AAClD,MAAM,WAAW,gCAAgC;IAChD,+EAA+E;IAC/E,EAAE,EAAE,EAAE,CAAC;IACP,gFAAgF;IAChF,WAAW,EAAE,GAAG,GAAG,MAAM,CAAC;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,kFAAkF;AAClF,MAAM,WAAW,+BAA+B;IAC/C,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACpC,mEAAmE;IACnE,SAAS,EAAE,cAAc,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,4BAA4B,GACxC,SAAS,gCAAgC,KACvC,OAAO,CAAC,+BAA+B,CAQzC,CAAC"}
@@ -0,0 +1,48 @@
1
+ import './assert_dev_env.js';
2
+ /**
3
+ * Gen-time helper for the `/ready` schema-drift probe's committed fixture.
4
+ *
5
+ * A consumer commits an `expected_schema.json` (the column map a fresh full
6
+ * migration-chain bootstrap produces) and serves it through
7
+ * `create_ready_route_spec`. This helper keeps the regenerate-and-verify test
8
+ * that guards that fixture to ~10 lines: it introspects a freshly-bootstrapped
9
+ * DB, writes the fixture when an update flag is set, and reads it back so the
10
+ * caller can assert the committed copy equals a fresh bootstrap — the assertion
11
+ * that fails when the fixture drifts from the DDLs, so the runtime expectation
12
+ * can't silently fall behind.
13
+ *
14
+ * @module
15
+ */
16
+ import { readFileSync, writeFileSync } from 'node:fs';
17
+ import { query_public_columns } from '../db/schema_ready.js';
18
+ /**
19
+ * Introspect the live (bootstrapped) DB's columns, write them to the committed
20
+ * fixture when `update`, then read the committed fixture back. The caller
21
+ * asserts `deepEqual(live, committed)`:
22
+ *
23
+ * ```ts
24
+ * const {live, committed} = await sync_expected_schema_fixture({
25
+ * db,
26
+ * fixture_url: new URL('../../lib/server/expected_schema.json', import.meta.url),
27
+ * update: process.env.UPDATE_SCHEMA_READY === '1',
28
+ * });
29
+ * assert.deepEqual(live, committed);
30
+ * ```
31
+ *
32
+ * When `update` writes the fixture it emits raw `JSON.stringify` (one array
33
+ * element per line); Prettier collapses short arrays inline, so run `gro format`
34
+ * after `UPDATE_SCHEMA_READY=1` before committing or the format check will flag
35
+ * the regenerated file. (The content is identical either way — the regen test
36
+ * compares values, not formatting.)
37
+ *
38
+ * @returns the live column map and the committed map (post-write when `update`)
39
+ */
40
+ export const sync_expected_schema_fixture = async (options) => {
41
+ const { db, fixture_url, update } = options;
42
+ const live = await query_public_columns(db);
43
+ if (update) {
44
+ writeFileSync(fixture_url, JSON.stringify(live, null, '\t') + '\n');
45
+ }
46
+ const committed = JSON.parse(readFileSync(fixture_url, 'utf8'));
47
+ return { live, committed };
48
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzdev/fuz_app",
3
- "version": "0.82.0",
3
+ "version": "0.84.0",
4
4
  "description": "fullstack app library",
5
5
  "glyph": "🗝",
6
6
  "logo": "logo.svg",
@@ -14,8 +14,8 @@
14
14
  "build": "gro build",
15
15
  "check": "gro check",
16
16
  "test": "gro test",
17
- "test:cross": "FUZ_TEST_CROSS_BACKEND=1 vitest run --project cross_backend_ts_node --project cross_backend_ts_deno --project cross_backend_ts_bun",
18
- "test:cross:spine-stub": "FUZ_TEST_CROSS_BACKEND=1 vitest run --project cross_backend_spine_stub",
17
+ "test:cross:ts": "FUZ_TEST_CROSS_BACKEND=1 vitest run --project cross_backend_ts_node --project cross_backend_ts_deno --project cross_backend_ts_bun",
18
+ "test:cross:rust-spine-stub": "FUZ_TEST_CROSS_BACKEND=1 vitest run --project cross_backend_rust_spine_stub",
19
19
  "test:cross:schema-parity": "FUZ_TEST_CROSS_BACKEND=1 vitest run --project cross_backend_schema_parity",
20
20
  "benchmark:cross-impl": "gro run src/benchmarks/cross_impl.bench.ts",
21
21
  "preview": "vite preview",
@@ -28,16 +28,17 @@
28
28
  "peerDependencies": {
29
29
  "@electric-sql/pglite": ">=0.4",
30
30
  "@fuzdev/blake3_wasm": ">=0.1.0",
31
- "@fuzdev/fuz_util": ">=0.53.4",
31
+ "@fuzdev/fuz_util": ">=0.65.1",
32
32
  "@hono/node-server": ">=1",
33
33
  "@hono/node-ws": ">=1",
34
34
  "@node-rs/argon2": ">=2",
35
35
  "@sveltejs/kit": "^2",
36
+ "esm-env": "^1",
36
37
  "hono": ">=4",
37
38
  "pg": ">=8",
38
39
  "svelte": "^5",
39
40
  "ws": ">=8",
40
- "zod": ">=4"
41
+ "zod": "^4"
41
42
  },
42
43
  "peerDependenciesMeta": {
43
44
  "@electric-sql/pglite": {
@@ -52,6 +53,9 @@
52
53
  "@node-rs/argon2": {
53
54
  "optional": true
54
55
  },
56
+ "esm-env": {
57
+ "optional": true
58
+ },
55
59
  "hono": {
56
60
  "optional": true
57
61
  },
@@ -65,19 +69,18 @@
65
69
  "devDependencies": {
66
70
  "@electric-sql/pglite": "^0.4.5",
67
71
  "@fuzdev/blake3_wasm": "^0.1.1",
68
- "@fuzdev/fuz_code": "^0.45.1",
69
- "@fuzdev/fuz_css": "^0.61.1",
70
- "@fuzdev/fuz_ui": "^0.197.0",
71
- "@fuzdev/fuz_util": "^0.63.0",
72
- "@fuzdev/gro": "^0.200.0",
72
+ "@fuzdev/fuz_code": "^0.46.0",
73
+ "@fuzdev/fuz_css": "^0.62.0",
74
+ "@fuzdev/fuz_ui": "^0.199.0",
75
+ "@fuzdev/fuz_util": "^0.65.1",
76
+ "@fuzdev/gro": "^0.204.0",
73
77
  "@hono/node-server": "^1.19.14",
74
78
  "@hono/node-ws": "^1.3.1",
75
- "@jridgewell/trace-mapping": "^0.3.31",
76
79
  "@node-rs/argon2": "^2.0.2",
77
80
  "@ryanatkn/eslint-config": "^0.12.1",
78
81
  "@sveltejs/acorn-typescript": "^1.0.9",
79
82
  "@sveltejs/adapter-static": "^3.0.10",
80
- "@sveltejs/kit": "^2.61.1",
83
+ "@sveltejs/kit": "^2.63.0",
81
84
  "@sveltejs/package": "^2.5.7",
82
85
  "@sveltejs/vite-plugin-svelte": "^6.2.4",
83
86
  "@types/estree": "^1.0.8",
@@ -93,9 +96,9 @@
93
96
  "pg": "^8.20.0",
94
97
  "prettier": "^3.7.4",
95
98
  "prettier-plugin-svelte": "^3.5.1",
96
- "svelte": "^5.56.0",
97
- "svelte-check": "^4.4.5",
98
- "svelte-docinfo": "^0.2.1",
99
+ "svelte": "^5.56.2",
100
+ "svelte-check": "^4.6.0",
101
+ "svelte-docinfo": "^0.4.1",
99
102
  "svelte2tsx": "^0.7.52",
100
103
  "tslib": "^2.8.1",
101
104
  "typescript": "^5.9.3",
@@ -143,6 +146,10 @@
143
146
  "types": "./dist/*.svelte.d.ts",
144
147
  "svelte": "./dist/*.svelte",
145
148
  "default": "./dist/*.svelte"
149
+ },
150
+ "./*.json": {
151
+ "types": "./dist/*.json.d.ts",
152
+ "default": "./dist/*.json"
146
153
  }
147
154
  }
148
155
  }
@@ -1,66 +0,0 @@
1
- import '../assert_dev_env.js';
2
- /**
3
- * Cross-process `BackendConfig` preset for the non-domain spine consumer,
4
- * `testing_spine_stub` — a Rust binary that mounts only the spine surface
5
- * (auth / account / admin / audit / role-grant offers) with no domain
6
- * layer. fuz_app drives it from `src/test/cross_backend/*.cross.test.ts`
7
- * to verify its TS spec against the Rust spine end-to-end with no domain
8
- * implementation in the loop — drift becomes a fuz_app failure rather than
9
- * a downstream consumer's failure with mixed signals.
10
- *
11
- * **Binary discovery — env-supplied, never hardcoded.** The binary lives
12
- * in a sibling Rust workspace, not in fuz_app, so the preset never bakes a
13
- * path in. `FUZ_TESTING_SPINE_STUB_BIN` (or the `binary_path` option) must
14
- * point at a prebuilt binary; the preset throws a clear error when neither
15
- * is set rather than guessing. Build once with
16
- * `cargo build -p testing_spine_stub --release` and point the env var at
17
- * the resulting `target/release/testing_spine_stub`; operators / CI cache
18
- * the binary across runs for fast spawns.
19
- *
20
- * **Operator setup** — the target Postgres database must exist before the
21
- * harness runs (the harness never issues `CREATE DATABASE`, to avoid
22
- * forcing a `CREATEDB` grant on the test role):
23
- *
24
- * ```bash
25
- * createdb fuz_app_test_spine_stub 2>/dev/null || true
26
- * ```
27
- *
28
- * The binary self-wipes the auth-namespace schema on every boot
29
- * (`FUZ_TESTING_RESET_DB_ON_STARTUP=true`, set by the Rust-family builder),
30
- * so no manual `DROP TABLE` between sessions is needed; per-test reset is
31
- * the orthogonal `_testing_reset` RPC action `default_cross_process_setup`
32
- * fires.
33
- *
34
- * @module
35
- */
36
- import type { BackendConfig } from './backend_config.js';
37
- /** Env var naming the prebuilt `testing_spine_stub` binary. Required when `binary_path` is omitted. */
38
- export declare const SPINE_STUB_BIN_ENV = "FUZ_TESTING_SPINE_STUB_BIN";
39
- /** Default listening port — slots beside zzz's 1175/1176; matches the binary's `DEFAULT_PORT`. */
40
- export declare const SPINE_STUB_DEFAULT_PORT = 1177;
41
- /** Default Postgres database — real PG (PGlite isn't reachable from `tokio-postgres`). */
42
- export declare const SPINE_STUB_DEFAULT_DATABASE_URL = "postgres://localhost/fuz_app_test_spine_stub";
43
- export interface SpineStubBackendConfigOptions {
44
- /** Listening port. Default `SPINE_STUB_DEFAULT_PORT`. */
45
- readonly port?: number;
46
- /** Postgres connection URL. Default `SPINE_STUB_DEFAULT_DATABASE_URL`. */
47
- readonly database_url?: string;
48
- /**
49
- * Prebuilt binary path. Overrides the `FUZ_TESTING_SPINE_STUB_BIN` env
50
- * var. When neither is set the preset throws.
51
- */
52
- readonly binary_path?: string;
53
- }
54
- /**
55
- * Build the `BackendConfig` for `testing_spine_stub`. Resolves the binary
56
- * from `options.binary_path` or `FUZ_TESTING_SPINE_STUB_BIN`; throws when
57
- * neither is set so a missing build surfaces as a clear error rather than
58
- * a confusing spawn failure. Reconciles the binary's env contract: port
59
- * via `--port` (and `FUZ_SPINE_STUB_PORT`), daemon-token dir via
60
- * `FUZ_SPINE_STUB_DIR` (anchored to `paths.root` so the written
61
- * `{dir}/run/daemon_token` matches the path `spawn_backend` reads).
62
- *
63
- * @throws Error when no binary path is available.
64
- */
65
- export declare const spine_stub_backend_config: (options?: SpineStubBackendConfigOptions) => BackendConfig;
66
- //# sourceMappingURL=spine_stub_backend_config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spine_stub_backend_config.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/spine_stub_backend_config.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAOvD,uGAAuG;AACvG,eAAO,MAAM,kBAAkB,+BAA+B,CAAC;AAE/D,kGAAkG;AAClG,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C,0FAA0F;AAC1F,eAAO,MAAM,+BAA+B,iDAAiD,CAAC;AAE9F,MAAM,WAAW,6BAA6B;IAC7C,yDAAyD;IACzD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,GACrC,UAAS,6BAAkC,KACzC,aAsCF,CAAC"}
@@ -1,53 +0,0 @@
1
- import '../assert_dev_env.js';
2
- import { build_test_backend_paths } from './build_test_backend_paths.js';
3
- import { make_default_rust_backend_config, rust_default_capabilities, } from './default_backend_configs.js';
4
- /** Env var naming the prebuilt `testing_spine_stub` binary. Required when `binary_path` is omitted. */
5
- export const SPINE_STUB_BIN_ENV = 'FUZ_TESTING_SPINE_STUB_BIN';
6
- /** Default listening port — slots beside zzz's 1175/1176; matches the binary's `DEFAULT_PORT`. */
7
- export const SPINE_STUB_DEFAULT_PORT = 1177;
8
- /** Default Postgres database — real PG (PGlite isn't reachable from `tokio-postgres`). */
9
- export const SPINE_STUB_DEFAULT_DATABASE_URL = 'postgres://localhost/fuz_app_test_spine_stub';
10
- /**
11
- * Build the `BackendConfig` for `testing_spine_stub`. Resolves the binary
12
- * from `options.binary_path` or `FUZ_TESTING_SPINE_STUB_BIN`; throws when
13
- * neither is set so a missing build surfaces as a clear error rather than
14
- * a confusing spawn failure. Reconciles the binary's env contract: port
15
- * via `--port` (and `FUZ_SPINE_STUB_PORT`), daemon-token dir via
16
- * `FUZ_SPINE_STUB_DIR` (anchored to `paths.root` so the written
17
- * `{dir}/run/daemon_token` matches the path `spawn_backend` reads).
18
- *
19
- * @throws Error when no binary path is available.
20
- */
21
- export const spine_stub_backend_config = (options = {}) => {
22
- const { port = SPINE_STUB_DEFAULT_PORT, database_url = SPINE_STUB_DEFAULT_DATABASE_URL, binary_path = process.env[SPINE_STUB_BIN_ENV], } = options;
23
- if (!binary_path) {
24
- throw new Error(`spine_stub_backend_config: no binary path — set ${SPINE_STUB_BIN_ENV} to a prebuilt ` +
25
- '`testing_spine_stub` binary (build it with `cargo build -p testing_spine_stub --release`) ' +
26
- 'or pass `binary_path`.');
27
- }
28
- const name = 'spine_stub';
29
- const paths = build_test_backend_paths(name);
30
- return make_default_rust_backend_config({
31
- name,
32
- port,
33
- // `--port` is the binary's authoritative port input; the
34
- // `FUZ_SPINE_STUB_PORT` env the builder also sets (via `port_env_var`)
35
- // is the lower-precedence fallback — both carry the same value.
36
- start_command: [binary_path, '--port', String(port)],
37
- database_url,
38
- // The stub now serves `GET /api/admin/audit/stream` (the spine
39
- // `fuz_realtime::SseRegistry` + audit listener), so it advertises `sse`
40
- // like the TS spines — the cross-process SSE suite's three cases run.
41
- capabilities: { ...rust_default_capabilities, sse: true },
42
- port_env_var: 'FUZ_SPINE_STUB_PORT',
43
- rust_log: 'info,testing_spine_stub=info',
44
- paths,
45
- extra_env: {
46
- // The binary writes its daemon-token JSON to
47
- // `{FUZ_SPINE_STUB_DIR}/run/daemon_token`; anchoring the dir to
48
- // `paths.root` makes that equal `paths.daemon_token_path`, which
49
- // `spawn_backend` reads after the health probe.
50
- FUZ_SPINE_STUB_DIR: paths.root,
51
- },
52
- });
53
- };