/** * Exit taxonomy for the materialised schema-gate container * (`@fjall/schema-gate`). The dependent app containers declare * `dependsOn: [{ container: "fjall-schema-gate", condition: "SUCCESS" }]`, so * ANY non-zero exit stops the task pre-RUNNING and counts toward the * deployment circuit breaker — the codes exist for the forensic log and the * deploy-time ECS tail, not for ECS itself. * * Lives in `@fjall/util` because three packages must agree on it: the gate * runner emits the codes, `@fjall/deploy-core`'s deployment tail translates * them into one human line, and the constructs' docs cite them. Coupled * values across package boundaries — a drift would have the tail describe * an exit the runner never emits. * * - `pass` (0) — every configured target verified; app containers start. * - `refused` (1) — a target's live schema does not satisfy the expected * version (forward skew, or a never-migrated database). The gate did its * job; the deploy must roll back or the migration must land first. * - `configError` (2) — the gate could not even attempt verification: * missing/empty env, unsupported tool or engine family, or an internal * error. Points at a construct bug or an author override. * - `connectionError` (3) — the server could not be reached after the * bounded retry budget (network, TLS, timeout). Indeterminate: the schema * may be fine. * - `busy` (4) — the server was reachable and answered every attempt, but * refused to run the probe because a concurrency cap or quota was * exhausted (ClickHouse `TOO_MANY_SIMULTANEOUS_QUERIES` 202 / * `QUOTA_EXCEEDED` 201, Postgres `too_many_connections` 53300 / * `cannot_connect_now` 57P03) for the whole budget. Indeterminate, and * distinct from `connectionError` because the cure is different: the * server is healthy and something else holds the slot. * - `denied` (5) — the server was reachable and rejected the gate's * identity or its rights (auth failure, unknown user, missing grant, * read-only violation). Definitive: no retry will change it, and the fix * is provisioning, not capacity. * * Precedence when targets disagree: `configError` is detected before any * connection is attempted; then `refused` (definitive evidence), then * `denied` (definitive), then `busy`, then `connectionError` (both * indeterminate; `busy` carries the more specific cure). */ export declare const SCHEMA_GATE_EXIT: { readonly pass: 0; readonly refused: 1; readonly configError: 2; readonly connectionError: 3; readonly busy: 4; readonly denied: 5; }; export type SchemaGateExitKind = keyof typeof SCHEMA_GATE_EXIT; export type SchemaGateExitCode = (typeof SCHEMA_GATE_EXIT)[SchemaGateExitKind]; /** * One human line per exit kind, for the deploy-time ECS tail and forensic * logs. Keyed on the taxonomy so adding an exit kind without a hint is a * compile error (`Record` rejects a missing key). */ export declare const SCHEMA_GATE_EXIT_HINTS: Record; /** * Inverse lookup for the deployment tail: an ECS container exit code → the * taxonomy kind, or `undefined` for a code the gate never emits (a signal * exit such as 143, or an OOM 137). */ export declare function schemaGateExitKind(code: number): SchemaGateExitKind | undefined;