/** * One fixed, closed census of the Skills database maintenance surface. * * Why it exists (I6-00024): a production migration is held until the exact * current registry, version ledger and migration ledger are read from the live * database. The enrollment inspection answers a different question (one * operator key), and no existing reader returns the fixed aggregate + ledger * census. This module is that reader, and it is deliberately shaped so it * cannot become a general SQL console: * * - No target, query, schema or table input exists. The only argument is the * database URL, and the operation refuses to run unless the connection * resolves to the fixed public schema the Skills store uses. * - Every owned-table read is schema-qualified to `public`. A connection whose * search path falls through to a later schema cannot substitute another * schema's tables: a missing public table refuses (CENSUS_SCHEMA_UNAVAILABLE) * instead of counting rows that do not belong to the fixed target. * - The transaction is READ ONLY, REPEATABLE READ, with a five-second * statement timeout and a one-second lock timeout, asserted from inside the * read path rather than assumed. * - The output is a closed shape with per-field size bounds, a bounded * migration ledger and a total serialized-size gate. Nothing is truncated * silently: a census that would exceed a bound refuses instead. * - Nothing imports the application store: no initialization, migrations, * backfills or writes happen on this path. */ export interface SchemaCensusResult { status: "inspected"; database: string; role: string; serverVersion: string; schema: "public"; transaction: { readOnly: true; isolation: "repeatable read"; statementTimeoutMs: number; lockTimeoutMs: number; }; migrations: { count: number; versions: string[]; }; registry: { rows: number; }; versions: { rows: number; }; lifecycle: { active: { live: number; tombstoned: number; }; archived: { live: number; tombstoned: number; }; }; authorizationEpoch: { exists: false; } | { exists: true; nullCount: number; }; } type CensusCode = "CENSUS_POSTGRES_REQUIRED" | "CENSUS_SCHEMA_UNAVAILABLE" | "CENSUS_ACCESS_DENIED" | "CENSUS_WRITE_REFUSED" | "CENSUS_TIMEOUT" | "CENSUS_CONNECTION_FAILED" | "CENSUS_TARGET_MISMATCH" | "CENSUS_INVALID_RESULT" | "CENSUS_OUTPUT_UNBOUNDED" | "CENSUS_FAILED"; export declare class SchemaCensusError extends Error { readonly code: CensusCode; constructor(code: CensusCode); } /** * Census metadata only. Deliberately does not import or initialize the application store. * * @param databaseUrl explicit PostgreSQL URL; there is no implicit localhost fallback. */ export declare function inspectSchemaCensus(databaseUrl: string): Promise; export {};