testing/cross_backend/default_spine_surface.ts

Canonical no-domain spine surface — the standard fuz_app auth/account/admin/audit surface with no consumer domain layer on top.

This is the single source of truth for "the standard spine surface", shared by:

$lib-free by contract. This module and everything it imports use relative specifiers (no $lib SvelteKit alias) so the spawned TS test binary — run under Gro's loader, which resolves .js.ts and package imports but not the $lib alias — can import it transitively. Keep it that way: a $lib import anywhere in this graph breaks the binary spawn while still typechecking under vitest.

view source

Declarations
#

7 declarations

create_spine_ready_route_spec
#

testing/cross_backend/default_spine_surface.ts view source

(log?: Logger | undefined): RouteSpec import {create_spine_ready_route_spec} from '@fuzdev/fuz_app/testing/cross_backend/default_spine_surface.js';

The spine's /ready route spec — the column-presence schema-drift deploy gate, reading . Mounted live by the TS spine binary (in build_spine_app) and the in-process readiness parity leg, but kept off the declared surface (create_spine_surface_spec) like the fact-serving / ws / sse behaviors — describe_ready_cross_tests (gated on capabilities.ready) is its explicit coverage, not the generic round-trip.

log?

optional logger for server-side drift diagnostics

type Logger | undefined
optional

returns

RouteSpec

create_spine_route_specs
#

testing/cross_backend/default_spine_surface.ts view source

(ctx: AppServerContext): RouteSpec[] import {create_spine_route_specs} from '@fuzdev/fuz_app/testing/cross_backend/default_spine_surface.js';

Account REST + signup route specs under /api/account (bootstrap auto-mounted by the surface builder / create_app_server), plus the audit-log SSE stream under /api/admin only when ctx.audit_sse is set (the TS spine binary passes audit_log_sse: true).

The shared create_spine_surface_spec() builds its ctx with audit_sse: null, so the declared surface snapshot stays SSE-free and the Rust spine_stub cross test is unaffected — only the live TS binary mounts the stream at SPINE_SSE_PATH.

ctx

returns

RouteSpec[]

create_spine_surface_spec
#

testing/cross_backend/default_spine_surface.ts view source

(): AppSurfaceSpec import {create_spine_surface_spec} from '@fuzdev/fuz_app/testing/cross_backend/default_spine_surface.js';

The AppSurfaceSpec for the standard spine surface — the wire-shape source the cross-process round-trip + RPC-round-trip suites validate against. bootstrap: {mode: 'surface_only'} mounts POST /api/account/bootstrap's shape to match the binary (which wires bootstrap for real); the harness's globalSetup already consumed the live bootstrap, so the cross-process round-trip validates the binary's 409 against the route's declared error schema.

returns

AppSurfaceSpec

spine_roles
#

testing/cross_backend/default_spine_surface.ts view source

RoleSchemaResult import {spine_roles} from '@fuzdev/fuz_app/testing/cross_backend/default_spine_surface.js';

The spine's closed role registry: built-ins plus two app roles — SPINE_CELL_EDITOR_ROLE (no grant path; the role-shaped-cell_grant suite's bootstrap-seeded role) and SPINE_PARTICIPANT_ROLE (grant_paths: ['admin']; the role-gated-participation suite's admin-grantable role). Threaded into the cell spec set's role-validity gate and the auth grantability gates; the Rust stub mirrors the same membership in both its RoleRegistry and known_roles. The participant entry also gives the admin suite real app-role grant-path coverage (admin_account_list.grantable_roles carries it on both spines).

spine_rpc_endpoints
#

testing/cross_backend/default_spine_surface.ts view source

(ctx: AppServerContext, options?: SpineRpcEndpointsOptions | undefined): RpcEndpointSpec[] import {spine_rpc_endpoints} from '@fuzdev/fuz_app/testing/cross_backend/default_spine_surface.js';

Factory-form RPC endpoints over the per-test ctx.deps. create_app_server (in the binary) owns live dispatch; the surface builder invokes the factory once with a stub ctx for setup-time path/method lookup, so the handler closures are never called across the process boundary.

Test binaries append their own _testing_reset action to this endpoint's actions (see testing/cross_backend/testing_reset_actions.ts); it is intentionally excluded here so it stays off the declared surface (the harness calls it directly over the daemon-token channel).

options.notification_sender, when supplied, reaches the role-grant-offer sub-factory so the spine emits the WS notification family — see SpineRpcEndpointsOptions.

ctx

options?

type SpineRpcEndpointsOptions | undefined
optional

returns

RpcEndpointSpec[]

spine_session_options
#

testing/cross_backend/default_spine_surface.ts view source

SessionOptions<string> import {spine_session_options} from '@fuzdev/fuz_app/testing/cross_backend/default_spine_surface.js';

Session config — cookie name matches the binary's issued session cookie (fuz_session) so cookie-attribute assertions + jar extraction line up.

SpineRpcEndpointsOptions
#

testing/cross_backend/default_spine_surface.ts view source

SpineRpcEndpointsOptions import type {SpineRpcEndpointsOptions} from '@fuzdev/fuz_app/testing/cross_backend/default_spine_surface.js';

Options for .

notification_sender?

WS notification sender threaded into the role-grant-offer sub-factory for server-initiated fan-out (role_grant_offer_received / _accepted / _declined / _retracted / _supersede, flat role_grant_revoke).

Shared-instance trap. Pass the SAME BackendWebsocketTransport instance the WS endpoint registers connections against — the transport *is* the connection registry, so a separate instance would fan out to an empty registry and reach nobody (silently). The TS spine binary constructs one ws_transport and threads it both here and into register_ws_endpoint.

Omitted (the default) for the shared create_spine_surface_spec path — surface generation doesn't depend on it, and it must stay absent there so the declared snapshot is unaffected.

type NotificationSender | null

readonly

Depends on
#

Imported by
#