import '../../assert_dev_env.js';
import { rpc_call } from '../../rpc_helpers.js';
/** Fire one authed JSON-RPC call; throw on a non-success envelope. */
const rpc_scenario = (method, params) => async (ctx) => {
    const result = await rpc_call({ app: ctx.transport, path: ctx.rpc_path, method, params });
    if (!result.ok) {
        throw new Error(`bench scenario '${method}' failed: ${result.error.code} ${result.error.message}`);
    }
};
/**
 * Starter cross-impl scenarios — all on the standard spine surface, so they
 * run on every backend (TS Hono, Rust spine), and all reads, so they're safe
 * to repeat against one bootstrapped keeper without state accumulation.
 *
 * - `account_verify` — the dispatch + auth-resolve floor (no real query work).
 * - `account_session_list` — an authed DB read.
 * - `audit_log_list` — an admin paginated read (the keeper holds `ROLE_ADMIN`).
 *
 * `login` is deliberately omitted: the cross-process test binaries wire a
 * fast `TestingArgon2idHasher`, so a login scenario would measure dispatch
 * rather than real Argon2 cost — misleading without its own clearly-labeled
 * tier.
 */
export const default_bench_scenarios = [
    { name: 'account_verify', run: rpc_scenario('account_verify') },
    { name: 'account_session_list', run: rpc_scenario('account_session_list') },
    { name: 'audit_log_list', run: rpc_scenario('audit_log_list', { limit: 20 }) },
];
