testing/cross_backend/action_manifest_parity.ts

Cross-impl action-manifest parity — structural diff + assertion over two ActionManifests captured via the _testing_action_manifest RPC action.

The action-surface twin of schema_parity.ts: two live impls (the TS fuz_app spine and the Rust testing_spine_stub) are each other's parity reference. After both bootstrap, dump each one's live RPC method set, diff, fail loudly on drift. The diff entries name the specific divergence (a method only one impl mounts, a per-method input-shape, auth-axis, side-effect, or rate-limit-class mismatch) so the error message points at the source.

const manifest_a = await capture_action_manifest(ts_handle); const manifest_b = await capture_action_manifest(rust_handle); assert_action_manifests_equal(manifest_a, manifest_b, {a: 'ts', b: 'rust'});

Non-coverage: the manifest captures `{method, input, side_effects, account, actor, roles, credential_types, rate_limit}` — the wire-relevant auth shape plus whether the method takes params at all. It does not capture the input/output schemas themselves (the declared-surface wire shape is gated by rpc_round_trip) nor the protocol actions heartbeat / cancel (excluded by construction — see action_manifest.ts).

view source

Declarations
#

5 declarations

ActionManifestDiff
#

testing/cross_backend/action_manifest_parity.ts view source

ActionManifestDiff

type { readonly kind: "method_only_in"; readonly where: "a" | "b"; readonly method: string; } | { readonly kind: "input_differs"; readonly method: string; readonly a: "object" | "void"; readonly b: "object" | "void"; } | { readonly kind: "side_effects_differ"; readonly method: string; readonly a: boolean; readonly b: boolean; } | { readonly kind: "rate_limit_differs"; readonly method: string; readonly a: "both" | "account" | "ip" | null; readonly b: "both" | "account" | "ip" | null; } | { readonly kind: "auth_field_differs"; readonly method: string; readonly field: "account" | "actor" | "roles" | "credential_types"; readonly a: unknown; readonly b: unknown; }

import type {ActionManifestDiff} from '@fuzdev/fuz_app/testing/cross_backend/action_manifest_parity.js';

Structured drift entry. where is the named source impl ('a' or 'b').

ActionManifestDiffLabels
#

testing/cross_backend/action_manifest_parity.ts view source

ActionManifestDiffLabels import type {ActionManifestDiffLabels} from '@fuzdev/fuz_app/testing/cross_backend/action_manifest_parity.js';

Labels used in formatted output — defaults to 'a' and 'b'.

a?

type string

readonly

b?

type string

readonly

assert_action_manifests_equal
#

testing/cross_backend/action_manifest_parity.ts view source

(a: { methods: { method: string; input: "object" | "void"; side_effects: boolean; account: "optional" | "none" | "required"; actor: "optional" | "none" | "required"; roles: string[]; credential_types: string[]; rate_limit: "both" | ... 2 more ... | null; }[]; }, b: { ...; }, labels?: ActionManifestDiffLabels): void import {assert_action_manifests_equal} from '@fuzdev/fuz_app/testing/cross_backend/action_manifest_parity.js';

Throw if the two manifests disagree. The error message names the impls (via labels) and lists every diff, so the failure is self-diagnosing.

a

b

labels?

optional default {}

returns

void

diff_action_manifests
#

testing/cross_backend/action_manifest_parity.ts view source

(a: { methods: { method: string; input: "object" | "void"; side_effects: boolean; account: "optional" | "none" | "required"; actor: "optional" | "none" | "required"; roles: string[]; credential_types: string[]; rate_limit: "both" | ... 2 more ... | null; }[]; }, b: { ...; }): ActionManifestDiff[] import {diff_action_manifests} from '@fuzdev/fuz_app/testing/cross_backend/action_manifest_parity.js';

Structural diff between two manifests — empty array means parity holds.

Order is deterministic: methods in sorted order, with each method's input-shape, side-effect, rate-limit, and auth-field sub-diffs grouped together.

a

b

returns

ActionManifestDiff[]

format_action_manifest_diffs
#

Depends on
#