testing/cross_backend/capabilities.ts view source
BackendCapabilities import type {BackendCapabilities} from '@fuzdev/fuz_app/testing/cross_backend/capabilities.js'; Optional behaviors a backend may support. Each flag's TSDoc names the tests that gate on it; add a new flag here before referencing it from a suite body, and document the gating tests inline. A wiring fact no suite reads doesn't belong here.
ws
WebSocket transport is reachable end-to-end. Gates the cross-process
WS round-trip suite, the per-account connection-cap suite
(describe_ws_connection_cap_cross_tests), and the front door's
WS-path cases (describe_transport_composition_cross_tests) — the
upgrade rows, and the rows that ask for no upgrade, which run in-process
too; the in-process describe_ws_round_trip_tests runs against
register_action_ws directly and ignores this flag.
type boolean
sse
SSE transport is reachable end-to-end. Gates the cross-process SSE
suite (describe_cross_process_sse_tests — connect, audit data frame,
close-on-revoke, the per-session stream cap); in-process SSE uses the
on_audit_event hook and ignores this flag.
type boolean
cell_crud
Cell CRUD verbs (cell_create / cell_get / cell_update /
cell_delete / cell_list) are live-mounted on the backend's RPC
path and its DB carries the fuz_cell migration namespace. Gates the
dedicated describe_cell_crud_cross_tests suite. Like ws / sse,
cells stay off the standard declared surface — only this flag opts a
backend into the cell parity coverage.
type boolean
cell_relations
The relation / ACL / audit cell verbs beyond plain CRUD
(cell_grant_* / cell_field_* / cell_item_* / cell_clone /
cell_audit_list) are live-mounted on the backend's RPC path. Gates
the dedicated describe_cell_relations_cross_tests suite — grant
lifecycle, field / item bidirectional relations, clone shallow + deep,
manage-tier audit gating, and the now-reachable
cell_visibility_manage_only 403 (editor-grant principal). Like
cell_crud, these stay off the standard declared surface; a backend
mounting only plain CRUD declares cell_crud: true, cell_relations: false.
type boolean
account_lifecycle
The account-lifecycle admin verbs (account_delete soft-delete,
account_undelete reactivation, account_purge keeper hard-delete)
are live-mounted on the backend's RPC path. Gates the dedicated
describe_account_lifecycle_cross_tests suite.
Unlike cells / fact-serving / ws / sse, these verbs are on the standard declared surface — they live in create_admin_actions, so create_spine_surface_spec carries them and the spec-derived round-trip + attack-surface suites already auto-enumerate their wire shape + auth. This flag gates the *behavioral* parity the generic round-trip can't provide: it can't drive verbs that delete their own subject (soft-delete → undelete round-trip, keeper-confirmed purge, the keeper-guard refusal), so the dedicated cross suite adds them.
type boolean
fact_serving
The cell-gated fact-serving route (GET /api/cells/:cell_id/facts/:hash)
is live-mounted on the backend, its DB carries the fuz_facts migration
namespace, and it mounts the _testing_put_fact seeder — declared in
testing_backdoors, which describe_spine_cross_suites requires. Gates
describe_fact_serving_cross_tests' per-reference read model (cell-scoped
admit via a viewable cell, cross-owner-dedup-no-leak, 404-mask),
describe_cell_ref_admission_cross_tests (its grant, item, and clone
cases with cell_relations), and the fact cases of the
moderation suite. Like cells, the serve route stays off the standard
declared surface. The admin bare-hash route is its own flag,
fact_serving_admin_hash. The suite's missing-disk-file case assumes the
backend serves external facts from disk: one with X-Accel delivery on
hands off with a 200 (nginx would answer the missing file) and fails it.
type boolean
fact_serving_admin_hash
The admin-only bare-hash fact route (GET /api/facts/:hash) is
live-mounted. Gates the bare-hash cases of
describe_fact_serving_cross_tests (with fact_serving, whose seeder
they use), describe_query_shape_cross_tests and
describe_token_scope_surface_cross_tests. A backend serving only the
cell-gated route states `fact_serving: true, fact_serving_admin_hash:
false`.
type boolean
ready
The /ready readiness deploy gate (GET /ready) is live-mounted on the
backend — the public column-presence schema-drift probe over the committed
expected_schema.json. Gates describe_ready_cross_tests (anonymous
GET /ready → 200 {ready: true} on a clean spine bootstrap). Like
ws/sse/cells, the route stays off the standard declared surface
(create_spine_surface_spec); this flag opts a backend into the dedicated
readiness parity coverage. The drift → 503 path stays per-impl unit tests.
type boolean
account_status
The account surface serves GET /api/account/status (account info +
bootstrap_available flag). Bundled into create_account_route_specs, so
any backend mounting the account routes serves it — true for every
spine. Gates the account status response body case in
describe_standard_integration_tests: when true the case asserts the
route is present (fail-loud on 404, no silent skip); when false it skips
explicitly (a backend that deliberately omits the route).
type boolean
peer_request
The backend can initiate a JSON-RPC request to a connected client
and await its typed reply (the server→client request/response direction
ActionPeer adds). Gates describe_peer_ping_ws_tests — the on-demand
peer/ping round-trip plus its security negatives (unsolicited-response
rejection, per-connection id isolation, never-replying Timeout,
wrong-shape reply rejection).
true on fuz_app's own spine presets — the Rust testing_spine_stub and
the TS spine (ConnectionRegistry.request_connection drives the
round-trip, correlated by register_action_ws). A MountFlag: a backend
states true once it mounts peer/ping on a WS endpoint and the HTTP
RPC endpoint (the no-transport refusal).
Like ws/sse/cells, peer/ping stays
off the standard declared surface (it's a protocol action,
manifest-excluded), so this flag is the only opt-in into the peer parity
coverage.
type boolean
ws_handshake_pipelining
The backend's HTTP server accepts WebSocket frames written in the same
TCP write as the upgrade request, handing them to the socket once the
handshake completes. Gates the frames sent with the handshake case in
describe_cross_process_ws_tests — the deterministic form of "frames
that arrive before the connection is admitted wait for admission", since
those frames are in the backend's hands before it can have admitted
anything.
true for Node (ws) and the Rust spine (hyper hands the
leftover bytes to the upgraded stream); false for a Bun backend that
upgrades after an asynchronous check, as one behind auth does — Bun.serve
answers such a request 400 (observed on Bun 1.4.3). A backend
without it still runs the suite's client-library case (requests sent the
moment the socket opens), which pins the same contract without forcing
the ordering.
type boolean
ws_account_actions
The backend's WebSocket endpoint mounts the self-service account actions
(account_session_revoke_all among them), so a socket can revoke the
session it is running on. Gates the self-revocation case in
describe_cross_process_ws_tests: the socket reads the reply to its
request, then is closed with WS_CLOSE_SESSION_REVOKED. Also gates that
suite's WS-mutation audit case (with rpc_path; it calls
_testing_drain_effects).
true on fuz_app's own spine presets — the TS spine binary mounts its
full action set on /api/ws, and the Rust testing_spine_stub serves
one action registry on RPC and WS. A MountFlag: a consumer's WS endpoint
carries whatever its domain mounts, so it states true once the account
actions are there.
type boolean
cell_gated_create
A test CellCreateAuthorize policy is live-mounted on the backend's cell
layer — creating a kind: 'gated' cell requires the participant role
or admin; every other kind (and a typeless cell) is open. Gates
describe_cell_gated_create_cross_tests, the TS↔Rust cell-creation-
authorizer parity proof. The authorizer adds no method / column / wire
shape, so schema-snapshot + action-manifest parity are blind to an
authorizer divergence — this behavioral cross case is the only gate that
catches one. true only on the reference spine binaries that mount the
test policy (the TS spine full_spine_mount + the Rust
testing_spine_stub); consumers and the in-process default app don't
mount it. The same binaries mount the steward-revoke test policy
(test_cell_grant_steward_revoke_authorize) beside it, so the flag also
gates describe_cell_grant_steward_cross_tests (with cell_relations).
type boolean
ws_role_gated
The backend mounts a second, role-gated WebSocket endpoint at
SPINE_ROLE_GATED_WS_PATH, gated on SPINE_ROLE_GATED_WS_ROLES, beside
its ungated ws_path. Gates describe_ws_role_gated_cross_tests: a
revoked global grant of a listed role closes the account's gated socket
with WS_CLOSE_PERMISSION_REVOKED, its ungated socket stays open and
still receives the account's pushes, a re-upgrade is refused at the gate,
and a scoped revoke closes nothing. true only on the reference spine binaries that
mount that endpoint (the TS spine binary + the Rust testing_spine_stub).
type boolean
ws_refusal_body
A refused WebSocket upgrade carries its refusal body — the flat
{error, ...} the same refusal answers over plain HTTP. Not a gate: it
forks how describe_transport_composition_cross_tests reads its WS rows.
true, an empty refusal body fails the case; false, an empty body is
allowed (the case pins the status alone) and a non-empty one is still
asserted.
false on Node: @hono/node-ws writes a refused upgrade to the raw
socket with Content-Length: 0, dropping the response body. true on
Bun and the Rust spine, which send the response as built.
type boolean
testing_backdoors
The _testing_* backdoors the backend mounts on its RPC endpoint, from
TESTING_BACKDOOR_METHODS (a consumer's own seams stay off it). Not a
flag, but declared like a MountFlag: no family default, so every config
states it. describe_testing_backdoor_cross_tests checks the declaration
against the backend — a declared method must be mounted, an undeclared one
must answer method_not_found — and runs its credential-gate rows over
the declared ones; describe_spine_cross_suites requires _testing_reset
and _testing_drain_effects (the per-test reset and the audit barrier),
skips a suite whose backdoor is undeclared, naming it — credential_deadline
(_testing_shorten_credential_expiry), origin_conformance
(_testing_origin_check), ws_outbound_overflow
(_testing_flood_notifications) — and requires _testing_put_fact of a
backend declaring fact_serving.
fuz_app's spine presets declare every one; the in-process transport none (the backdoor suites are cross-process only).
type readonly TestingBackdoorMethod[]