testing/cross_backend/cell_crud.ts

Dedicated stateful cell-CRUD parity suite for the cross-backend harness.

The generic describe_rpc_round_trip_tests can't cover cells: the verbs are stateful (update / delete / get-by-id need a real cell id threaded from a prior create) and cell_get's input has a top-level .refine(). So cells stay off the standard declared surface (create_spine_surface_spec) — exactly like ws / sse — and this suite plus its sibling describe_cell_relations_cross_tests (grant / field / item / clone / audit) are the cell validators. This one gates on capabilities.cell_crud; it runs against any backend that live-mounts the cell surface (the TS spine binary, the in-process Hono app, and the Rust testing_spine_stub).

Drives the full lifecycle (create → get → update → delete → list, threading the created id) plus the authz matrix the wire contract guarantees. Every success response is parsed against the verb's declared Zod output schema (CellCreateOutput / CellGetOutput / …), so a TS↔Rust envelope drift — not just a CellJson field drift — fails the suite:

  • owner does full CRUD; responses match the output schemas exactly;
  • anon sees public cells only — private is 404 (existence not leaked);
  • a non-owner non-admin editing / reading / deleting another's private cell gets 404 (IDOR mask), never 403;
  • admin reaches any cell;
  • duplicate active path → 409 (cell_path_taken);
  • path write by a non-admin → 403 (cell_path_admin_only), on both create and update (even by the owner);
  • cell_get with neither id nor pathinvalid_params;
  • null-auth cell_list with created_byinvalid_params;
  • a denied caller (non-editor update / non-admin path create) carrying a kind inside data still gets the authz error (404 / 403), never the kind error — authz runs before the input-shape checks, on both spines;
  • an empty-string kind is rejected on create (cell_kind_empty) and is accepted as a list filter that matches nothing.

The visibility-manage-tier 403 (cell_visibility_manage_only) needs a non-owner editor, which only a cell_grant can produce, so it lives in describe_cell_relations_cross_tests alongside the grant verbs rather than here.

$lib-free by contract (relative specifiers only) so the suite can be imported from the spawnable cross-process test files.

view source

Declarations
#

describe_cell_crud_cross_tests
#

Depends on
#