import type { Database, RlsStrategy } from "./database.js"; /** * SECURITY DEFINER routines in `opengeni_private` the runtime calls: the event * trigger dispatcher's identity-only due inventory and intake retention pass * (0929), the recording recovery sweep's stalled-work inventory (0930), the * MCP Events subscription pump's due inventory (0932), the source feed pump's * due inventory (0935), the recording retention sweep's due inventory (0946), * the lookup of whose personal machine a chat runs on (0978), the re-arm of * the running commands a returning runner did not answer for (0984), the * control worker's content-free queued-turn hold summary (0988; since 1485 * also the turns parked waiting for subscription capacity), the API's * inventory of browsers an agent session holds (1002), the only writer of * the EU-only inference setting and its history (1060), the secret history * scrub's reader and cell writer (1091), the subscription * account-administrator grant (1103), which records a request's verified * account:admin proof for one transaction, agent calls' device lookup, * register, claim, device count, busy check and ring (1107), the lock-free * read of a known external identity (1172), the list of every * organization vault wherever it works (1218), the organization's * names-only member list (1211), the Slack agent update sweeper's * ids-only inventory of installations that send updates (1153) and the * recording compaction sweep's inventory of meeting tracks not yet kept * compact (1240), and the session storage pass's inventory of sessions with * content to collect and its collector of unreferenced content blobs (1359), * and the sandbox reaper's inventory of cold sandboxes whose chats are all * archived (1404), the organization-wide sandbox counts behind * plan-tiered sandbox limits (1475), and the deployment-wide check of * which Nango connections a live connection still stands for (1482), the * unpaid sandbox fleet counts behind the fleet limits (1486), and the * deployment-wide listing of live Nango rows' owners for the Nango sweep * (1487), and the managed warm box count fleet pressure reads (1492), and * the subscription needs-sign-in notice sync (1503), and the one-statement * lookup of the Slack event sources a shared Slack bot reaches (1552). * Each is * owned by its tables' owner, never PUBLIC, with a pinned search_path. Runtime * EXECUTE is required, except while a routine is in * DEFERRED_RUNTIME_PRIVATE_ROUTINES. */ export declare const RUNTIME_DEFINER_ROUTINES: readonly ["list_due_event_trigger_tasks_v1(integer)", "prune_event_intake_v1(integer, integer, integer)", "list_stalled_recording_work_v1(integer)", "list_due_mcp_event_subscriptions_v1(integer)", "list_due_event_source_feeds_v1(integer)", "list_due_recording_retention_v1(integer)", "session_machine_owner_subject_v1(uuid, uuid, uuid)", "rearm_unanswered_connected_commands(uuid, uuid, text)", "summarize_queued_turns_by_hold()", "list_agent_held_browser_sessions(integer, bigint)", "update_organization_inference_residency_v1(uuid, text, text, boolean, bigint, uuid)", "session_secret_redaction_rows_v1(uuid, uuid[], text, uuid, integer)", "redact_session_secret_cells_v1(uuid, text, jsonb)", "grant_subscription_account_administrator(jsonb)", "native_push_device_v2(text)", "register_native_push_device_v2(text, text, text, text, text, text[], text)", "claim_native_push_deliveries_v2(uuid, integer, integer)", "agent_call_device_count_v1(text, boolean)", "agent_call_ringing_v1(text)", "ring_agent_call_v1(uuid, boolean)", "read_external_identity_v1(uuid, text, text)", "list_organization_vaults_v1(uuid, jsonb)", "list_organization_member_names_v1(uuid)", "list_due_slack_agent_update_installations_v1(integer)", "list_organization_compute_v1(uuid, uuid, text)", "list_uncompacted_recording_tracks_v1(integer, text)", "end_agent_call_rings_v1(uuid)", "session_content_garbage_candidates_v1(integer)", "collect_session_content_garbage_v1(uuid, uuid, integer)", "cold_sandboxes_of_archived_chats_v1(integer, uuid, uuid, integer)", "organization_warm_sandbox_counts_v1(uuid, text, uuid)", "nango_connections_in_use_v1(text[])", "nango_live_connection_owners_v1(text, text, text, integer)", "sandbox_unpaid_fleet_v1(uuid, boolean)", "sandbox_fleet_warm_boxes_v1()", "discard_refused_session_create_v1(uuid, uuid)", "sync_subscription_relogin_notice_v1(uuid)", "deliver_app_notification_v1(uuid)", "list_shared_slack_event_sources_v2(uuid, uuid, uuid, text)"]; /** * Runtime definers whose EXECUTE is withheld for one release. A release that * does not know a definer rejects a runtime EXECUTE grant on it, so the grant * (and provisioning) waits until a binary that knows it is the previous * release; until then readiness accepts the routine with or without runtime * EXECUTE. 0937 withheld the first five and 0947 granted them; 0946 withheld * the recording retention inventory and 0950 granted it. 0978 withholds the * personal-machine owner lookup; until a later migration grants it, the * runtime treats the lookup as unavailable and keeps the earlier behaviour. * 0984 withheld the connected-command re-arm the same way and 1101 granted * it. 0988 withheld the queued-turn hold summary and 1274 granted it. * 1002 withheld the held-browser inventory and 1093 granted it. * 1060 withheld the EU-only change function and 1210 granted it. 1091 * withholds the secret history scrub's * reader and cell writer; until they are granted, a scrub reports the cells * only they reach as pending. 1103 withheld the subscription * account-administrator grant and 1149 granted it. 1107 withheld the agent * call routines and the native push v2 functions that carry the iOS VoIP * token; 1239 grants them. * 1172 withholds the lock-free external identity read; until it is granted, * authenticating an external user takes the organization membership fence * exclusively, as before. * 1218 withheld the organization vault list and 1224 the organization machine * and rig list; 1272 granted both. * 1211 withholds the names-only member list; until it is granted, members * get no names (as before). * 1153 withholds the Slack agent update sweeper's inventory; until it is * granted, the sweeper finds nothing and sends no update messages. * 1240 withheld the inventory of meeting tracks not yet kept compact, 1282 * granted it, 1283 withheld it again and 1361 grants it. * 1344 withholds the end of a call's ring on the other phones; until it is * granted, settling a call sends no ended push and those phones ring out. * 1359 withholds the session content collector and its inventory; until they * are granted, unreferenced content blobs stay until the session is archived. * 1404 withheld the inventory of cold sandboxes whose chats are all archived * and 1502 grants it. * 1475 withheld the organization-wide sandbox counts and 1479 granted them. * 1482 withheld the check of which Nango connections a live connection * stands for and 1487 the listing of live Nango rows' owners; 1499 granted * both. * 1486 withheld the unpaid sandbox fleet counts and 1490 granted them. * 1492 withholds the managed warm box count; until it is granted, fleet * pressure reads the warm count of every lease, self-hosted ones included. * 1501 withholds the discard of a refused keyed session create; until it is * granted, such a shell stays (as before). * 1503 withholds the subscription needs-sign-in notice sync; until it is * granted, only a status write by the tables' owner (the definer that records * a model request refused after refresh, and the migration's backfill) opens * or resolves a notice, and the person dismisses one left after a reconnect. * 1552 withholds the shared Slack bot's one-statement source lookup; until it * is granted, a Slack callback keeps 1538's per-workspace probe. */ export declare const DEFERRED_RUNTIME_PRIVATE_ROUTINES: readonly ["session_machine_owner_subject_v1(uuid, uuid, uuid)", "session_secret_redaction_rows_v1(uuid, uuid[], text, uuid, integer)", "redact_session_secret_cells_v1(uuid, text, jsonb)", "list_organization_member_names_v1(uuid)", "list_due_slack_agent_update_installations_v1(integer)", "end_agent_call_rings_v1(uuid)", "session_content_garbage_candidates_v1(integer)", "collect_session_content_garbage_v1(uuid, uuid, integer)", "sandbox_fleet_warm_boxes_v1()", "discard_refused_session_create_v1(uuid, uuid)", "sync_subscription_relogin_notice_v1(uuid)", "deliver_app_notification_v1(uuid)", "list_shared_slack_event_sources_v2(uuid, uuid, uuid, text)"]; export declare const SUBSCRIPTION_PLAN_MAINTENANCE_INVENTORY_ROUTINE = "list_subscription_plan_maintenance_accounts(integer)"; export declare const SUBSCRIPTION_PLAN_FREE_ANNIVERSARY_ROUTINE = "subscription_plan_free_anniversary(timestamp with time zone, timestamp with time zone)"; /** Read-only maintenance work checks (migrations 0730 and 0732) and the claim * each one previews, which fixes its owner and runtime grant. */ export declare const MAINTENANCE_WORK_PROBE_ROUTINES: readonly [readonly ["session_workflow_wakes_due_v1()", "claim_session_workflow_wakes(integer)", "private"], readonly ["automatic_session_title_fanout_due_v1()", "claim_automatic_session_title_fanout_v1(integer)", "private"], readonly ["knowledge_index_due_v1(text, integer)", "knowledge_index_claim(text, integer, integer)", "target"], readonly ["site_auth_maintenance_due_v1(bigint)", "claim_site_auth_maintenance(bigint, integer)", "private"], readonly ["sandbox_lease_reaper_due_v1()", "reap_sandbox_leases(bigint, bigint, bigint, bigint)", "private"], readonly ["sandbox_idle_checkpoint_due_v1(bigint)", "list_idle_checkpoint_candidates(integer, bigint)", "private"], readonly ["browser_deadline_checkpoint_due_v1()", "list_browser_deadline_checkpoints(integer)", "private"], readonly ["session_system_update_outbox_due_v1()", "claim_session_system_update_outbox_v2(integer)", "private"], readonly ["session_list_snapshots_expired_v1()", "reap_expired_session_list_snapshots(integer)", "private"], readonly ["connected_command_reconciliation_due_v1()", "claim_connected_machine_background_commands(uuid, integer, bigint, timestamp with time zone)", "private"], readonly ["connected_command_output_release_due_v1()", "claim_connected_command_output_releases(uuid, integer, bigint, timestamp with time zone)", "private"], readonly ["terminal_retained_processes_due_v1()", "claim_terminal_retained_processes(uuid, integer, bigint)", "private"], readonly ["sandbox_ended_epoch_blockers_due_v1()", "list_sandbox_ended_epoch_blockers(integer)", "private"], readonly ["sandbox_checkpoint_artifact_gc_due_v1(bigint)", "claim_sandbox_checkpoint_artifacts(uuid, integer, bigint)", "private"]]; /** Private predicate projections; never runtime-readable or writable. */ export declare const MAINTENANCE_PROBE_SOURCES: readonly ["session_workflow_wake_outbox", "site_auth_connections", "sandbox_leases", "sandbox_lease_holders", "browser_sessions", "session_system_update_outbox", "session_list_snapshots", "session_background_commands", "sandbox_retained_processes", "sandbox_workspace_mutation_admissions", "sandbox_checkpoint_artifacts", "rig_versions", "rig_changes", "enrollments", "sessions", "session_turns"]; export declare const MAINTENANCE_PROBE_TABLES: string[]; export declare const MAINTENANCE_PRIVATE_TABLES: string[]; export declare const MAINTENANCE_PROBE_OWNER_ROUTINES: string[]; export declare const SANDBOX_FILE_PUBLICATION_RUNTIME_ROUTINES: readonly ["record_sandbox_file_publication(uuid, uuid, uuid, uuid)", "list_sandbox_file_publications(uuid, uuid, jsonb)", "file_private_to_another(uuid, uuid, uuid)"]; export declare const ARTIFACT_PIN_RUNTIME_ROUTINES: readonly ["update_artifact_pin(uuid, uuid, text, text, boolean)", "list_artifact_pins(uuid, uuid)", "list_sandbox_file_publications_pinned(uuid, uuid, jsonb)"]; export declare const SCHEDULED_SLACK_BOT_MESSAGE_RUNTIME_ROUTINES: readonly ["prepare_scheduled_slack_bot_message(uuid, uuid, uuid, uuid, uuid, integer, text, text, text)", "read_scheduled_slack_bot_message(uuid, uuid, uuid, uuid)", "set_organization_slack_bot_access(uuid, uuid, uuid, text, boolean)", "set_slack_bot_workspace_access(uuid, uuid, uuid, text, boolean, uuid[])", "read_slack_bot_workspace_access(uuid, uuid, uuid)", "read_organization_slack_bot_access(uuid, uuid, uuid)", "list_organization_slack_bots(uuid, uuid)", "prepare_organization_slack_bot_message(uuid, uuid, uuid, uuid, uuid, integer, uuid, bigint, text, text, text)", "read_organization_slack_bot_message(uuid, uuid, uuid, uuid)"]; export declare const ORGANIZATION_SIGNUP_USE_CASE_RUNTIME_ROUTINES: readonly ["record_organization_signup_use_case(uuid, text, text)"]; export declare const SLACK_FILE_UPLOAD_OPERATIONS_TABLE = "slack_file_upload_operations"; /** * Release N of removed-feature retirement: these relations are no longer read * by their application features. Keep their exact ACL/RLS contracts while * present, but allow release N+1 to drop them. This inventory is deliberately * explicit; a prefix match must never make a new, live table optional. */ export declare const RETIRING_FEATURE_TABLES: { readonly automations: readonly ["automation_run_event_links", "automation_runs", "automation_sources", "automation_trigger_events", "automation_trigger_revisions", "automation_triggers", "automation_webhook_endpoints"]; readonly prReview: readonly ["pr_review_app_registrations", "pr_review_managed_github_authority_nonces", "pr_review_managed_github_routes", "pr_review_repository_bindings"]; readonly transcriptionRecordings: readonly ["transcription_recording_chunks", "transcription_recording_objects", "transcription_recording_segments", "transcription_recordings"]; readonly subscription: readonly ["claude_capacity_waiters", "claude_credential_leases", "claude_rotation_settings", "claude_session_account_pins", "claude_subscription_account_usage", "claude_subscription_credentials", "codex_capacity_waiters", "codex_apps_settings", "codex_credential_leases", "codex_rotation_settings", "codex_subscription_credentials", "codex_turn_source_bindings", "organization_codex_rotation_settings", "subscription_provider_cutovers", "workspace_codex_subscription_preferences", "xai_capacity_waiters", "xai_credential_leases", "xai_rotation_settings", "xai_session_account_pins", "xai_subscription_credentials"]; readonly variableSets: readonly ["session_variable_set_attachments", "workspace_variable_set_variables", "workspace_variable_sets"]; }; /** Vault routines (0739): the application role's only way into the vault tables. */ export declare const VAULT_RUNTIME_ROUTINES: readonly ["list_vaults_for_subject(uuid, jsonb)", "get_vault_for_subject(uuid, jsonb)", "create_vault(jsonb, jsonb)", "update_vault(uuid, bigint, jsonb, jsonb)", "delete_vault(uuid, text, boolean, jsonb)", "ensure_default_vault(uuid, text, jsonb)", "ensure_task_vault(uuid, uuid, jsonb)", "list_vault_items(uuid, text, text, boolean, text, integer, jsonb)", "get_vault_item(uuid, jsonb)", "upsert_vault_item(jsonb, jsonb)", "archive_vault_item(uuid, jsonb)", "restore_vault_item(uuid, jsonb)", "delete_vault_item_permanently(uuid, jsonb)", "move_vault_item(uuid, uuid, text, text, jsonb)", "read_vault_field_ciphertext(uuid, integer, text, jsonb, jsonb)", "list_vault_field_versions(uuid, jsonb)", "resolve_secret_reference_candidates(jsonb, jsonb)", "record_vault_secret_use(jsonb, jsonb, jsonb)", "set_session_vault_policy(uuid, jsonb, jsonb)", "session_secrets_view(uuid, jsonb)", "update_passkey_sign_count(uuid, bigint, jsonb)", "lease_vault_passkeys(jsonb, text, integer)", "release_vault_passkey_leases(text, jsonb)", "upsert_provider_vault_items(uuid, text, jsonb, jsonb)", "set_vault_sync_status(uuid, jsonb, jsonb)", "apply_secret_answers(uuid, uuid, jsonb, jsonb)", "link_provider_vault(jsonb, jsonb)", "provider_vault_sync_target(uuid, jsonb)", "provider_vault_item_ref(uuid, uuid, text, jsonb)", "provider_connection_home_workspace(uuid)"]; /** Vault tables (0739): FORCE row security, no application-role privileges. */ export declare const VAULT_TABLES: readonly ["vaults", "vault_items", "vault_item_fields", "vault_field_versions", "vault_item_name_aliases", "vault_name_aliases", "vault_passkey_leases"]; export declare const WORK_CLAIM_CAPABILITY_ROUTINES: readonly ["upsert_session_work_claim_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, integer, text, text, text, text, text, text, text)", "release_session_work_claim_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, integer, text)"]; /** * The immutable v1 snapshot CHECK validators. They outlive the retired pool * routines (migration 0751): the v1 columns and their constraints stay until * M6, so the runtime role keeps EXECUTE and PUBLIC does not. */ export declare const SUBSCRIPTION_SNAPSHOT_VALIDATOR_ROUTINES: readonly ["xai_provider_account_authority_snapshot_v1_valid(jsonb)", "claude_provider_account_authority_snapshot_v1_valid(jsonb)"]; /** * Migration 0707: the provider-neutral subscription-core routines (the * provider is their first argument). The runtime requires them; each is a * SECURITY DEFINER routine the runtime role executes and PUBLIC does not. */ export declare const SUBSCRIPTION_CORE_NEUTRAL_PRIVATE_ROUTINES: readonly ["subscription_core_owner_capability_held(text, uuid, text[], text, uuid, boolean)", "subscription_core_owner_membership_held(uuid, uuid)", "subscription_core_refresh_write_allowed(text, uuid, uuid, uuid)", "begin_subscription_core_refresh(text, uuid, uuid, uuid, uuid, text, text, uuid, text, bigint)", "persist_subscription_core_refresh(text, uuid, uuid, uuid, uuid, uuid, bigint, text, timestamp with time zone, timestamp with time zone)", "persist_subscription_core_refresh_with_plan(text, uuid, uuid, uuid, uuid, uuid, bigint, text, timestamp with time zone, timestamp with time zone, text)", "fail_subscription_core_refresh(text, uuid, uuid, uuid, uuid, uuid, bigint, text)", "quarantine_subscription_core_connection(text, uuid, uuid, uuid, uuid, uuid, text, bigint, bigint, text, text, timestamp with time zone)", "recover_subscription_core_connection_health(text, uuid, uuid, uuid, uuid)", "subscription_core_acceptance_authority_v2(text, uuid, uuid, uuid, text)", "subscription_core_task_authority_v2(text, uuid, uuid, uuid, text)", "subscription_core_revision_authority_v2(uuid, uuid, uuid, bigint)", "read_subscription_core_connection_credential(text, uuid, uuid, uuid, uuid, uuid, text, bigint)", "begin_subscription_core_connection_refresh(text, uuid, uuid, uuid, uuid, uuid, text, bigint)", "persist_subscription_core_connection_refresh(text, uuid, uuid, uuid, bigint, text, timestamp with time zone, timestamp with time zone)", "fail_subscription_core_connection_refresh(text, uuid, uuid, uuid, bigint, text)", "connect_subscription_core_personal(text, uuid, uuid, text, text, text, text, text, jsonb, timestamp with time zone, timestamp with time zone, text, text, text)", "disconnect_subscription_core_connection(text, uuid, uuid, text, uuid)", "manage_subscription_core_personal(text, uuid, uuid, text, uuid, text, text, boolean, integer)", "subscription_core_personal_connections(text, uuid, uuid, text)", "subscription_core_reach(text, uuid, uuid)", "set_subscription_core_reach(text, uuid, uuid, boolean, boolean)", "set_subscription_core_reach_allocator(text, uuid, uuid, boolean)", "connect_subscription_core_personal(text, uuid, uuid, text, text, text, text, text, jsonb, timestamp with time zone, timestamp with time zone, text, text, text, text)", "subscription_core_personal_connection_versions(text, uuid, uuid, text)", "subscription_core_personal_sharing(text, uuid, text, uuid, integer)", "read_subscription_core_owned_connection_credential(text, uuid, uuid, text, uuid)", "begin_subscription_core_owned_connection_refresh(text, uuid, uuid, text, uuid)", "record_subscription_core_owned_connection_quota(text, uuid, uuid, text, uuid, bigint, bigint, jsonb, timestamp with time zone)", "read_subscription_usage_history(uuid, uuid, text, text, uuid[])", "append_subscription_usage_reading(uuid, uuid, text, jsonb)", "prune_subscription_usage_history()", "subscription_usage_history_prune_due()"]; /** Migration 0707: the neutral writers' owner-only internals. */ export declare const SUBSCRIPTION_CORE_NEUTRAL_OWNER_ROUTINES: readonly ["capture_usage_reading()", "append_usage_reading(uuid, uuid, jsonb)", "capture_usage_call()", "subscription_core_writer_context(text, uuid, uuid, text)", "grant_subscription_core_owner_capability(text, text, uuid, uuid, text, uuid)", "drop_subscription_core_owner_capabilities(text, uuid)", "subscription_core_connection_target(text, uuid, uuid, uuid, uuid, uuid, text, bigint)", "apply_subscription_core_auto_assignments(text, uuid, uuid, boolean)"]; /** * The Codex-named twins of the migration 0707 neutral routines. Migration * 0707 kept them for binaries that still called them; the retirement * migration 0751 drops them (with the owner-only writer context and * connection target only they called), and the runtime posture requires them * absent through SUBSCRIPTION_RETIRED_ROUTINES. */ export declare const SUBSCRIPTION_CODEX_TWIN_PRIVATE_ROUTINES: readonly ["begin_subscription_codex_refresh(uuid, uuid, uuid, uuid, text, text, uuid, text, bigint)", "persist_subscription_codex_refresh(uuid, uuid, uuid, uuid, uuid, bigint, text, timestamp with time zone, timestamp with time zone)", "fail_subscription_codex_refresh(uuid, uuid, uuid, uuid, uuid, bigint, text)", "quarantine_subscription_codex_connection(uuid, uuid, uuid, uuid, uuid, text, bigint, bigint, text, text, timestamp with time zone)", "recover_subscription_codex_connection_health(uuid, uuid, uuid, uuid)", "persist_subscription_codex_refresh_with_plan(uuid, uuid, uuid, uuid, uuid, bigint, text, timestamp with time zone, timestamp with time zone, text)", "subscription_codex_acceptance_authority_v2(uuid, uuid, uuid, text)", "read_subscription_codex_connection_credential(uuid, uuid, uuid, uuid, uuid, text, bigint)", "begin_subscription_codex_connection_refresh(uuid, uuid, uuid, uuid, uuid, text, bigint)", "persist_subscription_codex_connection_refresh(uuid, uuid, uuid, bigint, text, timestamp with time zone, timestamp with time zone)", "fail_subscription_codex_connection_refresh(uuid, uuid, uuid, bigint, text)", "connect_subscription_codex_personal(uuid, uuid, text, text, text, text, text, jsonb, timestamp with time zone, timestamp with time zone, text, text, text)", "disconnect_subscription_codex_connection(uuid, uuid, text, uuid)", "subscription_codex_personal_connections(uuid, uuid, text)", "subscription_codex_task_authority_v2(uuid, uuid, uuid, text)", "subscription_codex_revision_authority_v2(uuid, uuid, uuid, bigint)", "manage_subscription_codex_personal(uuid, uuid, text, uuid, text, text, boolean, integer)", "subscription_codex_reach(uuid, uuid)", "set_subscription_codex_reach(uuid, uuid, boolean, boolean)"]; /** Where a retired routine lived: the data (target) schema or an owner schema. */ export type RetiredSubscriptionRoutineSchema = "target" | "opengeni_private" | "opengeni_subscription_internal"; /** * M4 retirement (migration 0751, design 5.3 "R. Retirement"): every routine * the drained retirement migration drops, by exact signature in * `oidvectortypes` form. The SuperGrok and Claude pool writers, resolvers, * revalidators, policy predicates and trigger functions, the Codex twins and * their owner-only internals, and 0689's Codex auto-assignment apply path. * The runtime posture requires every one absent, the real-PostgreSQL * migration test checks the drop against it, and the no-legacy guard forbids * runtime code from naming one. */ export declare const SUBSCRIPTION_RETIRED_ROUTINES: readonly { schema: RetiredSubscriptionRoutineSchema; signature: string; }[]; /** * Migration 0751: the policies the retirement drops, all in the data schema. * The pool and credential scopes on the legacy factory tables, the Claude * usage scope, and the legacy routines' runtime-capability policies on the * shared membership and authority tables. */ export declare const SUBSCRIPTION_RETIRED_POLICIES: readonly { table: string; policy: string; }[]; /** Migration 0751: the legacy factory triggers the retirement drops (data schema). */ export declare const SUBSCRIPTION_RETIRED_TRIGGERS: readonly { table: string; trigger: string; }[]; /** * Migration 0751's reach finalization (design 0713 note "Kept until * retirement"): 0689's trigger functions in opengeni_private that take * provider-free names. Their Codex names are retired with the dropped * objects. */ export declare const SUBSCRIPTION_RENAMED_ROUTINES: readonly { schema: "opengeni_private"; from: string; to: string; }[]; /** Migration 0751: 0689's triggers that take provider-free names (data schema). */ export declare const SUBSCRIPTION_RENAMED_TRIGGERS: readonly { table: string; from: string; to: string; }[]; /** * Migration 0751: 0689's two owner-only auto-assignment policies (data * schema), which take provider-free names and read the provider-free * setting SUBSCRIPTION_AUTO_ASSIGN_SETTING. */ export declare const SUBSCRIPTION_RENAMED_POLICIES: readonly { table: string; from: string; to: string; }[]; /** Migration 0751: the reach table takes the name of 0713's view over it. */ export declare const SUBSCRIPTION_RENAMED_RELATIONS: readonly { schema: "opengeni_private"; from: string; to: string; }[]; /** * The setting the auto-assignment trigger functions set to the organization * around each provider's apply, admitting their owner-only writes through the * renamed policies (0689's `opengeni.subscription_codex_auto_assign` before * migration 0751). */ export declare const SUBSCRIPTION_AUTO_ASSIGN_SETTING = "opengeni.subscription_core_auto_assign"; /** * The bare names of every retired routine, dropped or renamed (the * no-legacy guard's identifiers). */ export declare const SUBSCRIPTION_RETIRED_ROUTINE_NAMES: readonly string[]; /** * Every retired subscription object as the posture inspection describes it * (`routine schema.name(args)`, `policy table.name`, `trigger table.name`, * `relation schema.name`), in the byte order inspection reports them: what a * database that has not applied SUBSCRIPTION_RETIREMENT_MIGRATION still * holds, dropped objects and the Codex names of renamed ones alike. */ export declare function retiredSubscriptionObjectDescriptions(targetSchema?: string): string[]; /** The posture violation for a retired subscription object that is still present. */ export declare function retiredSubscriptionObjectViolation(object: string): string; /** * Migration 0712 (M4 generic precursor): the per-provider cutover receipt * reader. The runtime calls it for readiness and its RLS policies call it. */ export declare const SUBSCRIPTION_CORE_PRECURSOR_PRIVATE_ROUTINES: readonly ["subscription_provider_cutover_committed(text)"]; /** Migration 0712: owner-only trigger functions in opengeni_subscription_internal. */ export declare const SUBSCRIPTION_CORE_PRECURSOR_OWNER_ROUTINES: readonly ["guard_subscription_provider_cutover_receipts()", "keep_subscription_cutover_identity()"]; /** * Every provider whose drained subscription-core cutover migration is in this * binary's ledger. The binary refuses to start unless each has its receipt * (`opengeni_private.subscription_provider_cutover_committed`). A provider's * cutover PR adds its entry. */ export declare const SUBSCRIPTION_PROVIDER_CUTOVER_MIGRATIONS: Readonly>; /** * The drained M4 retirement migration (design 5.3 "R. Retirement"): it drops * SUBSCRIPTION_RETIRED_ROUTINES, _POLICIES and _TRIGGERS and refuses unless * every provider's cutover receipt is committed. A test database that * withholds a provider cutover to characterize a legacy runtime withholds * this migration too. */ export declare const SUBSCRIPTION_RETIREMENT_MIGRATION = "0751_subscription_core_legacy_retirement.sql"; /** * Migration 0716 (M4 PR 0b): accepted authority across a provider's cutover. * The runtime role may call the copy routine (inert until a provider's * writers call it), the reader, and the list of providers whose records can * exist; it holds no privilege on the compatibility relation itself. */ export declare const SUBSCRIPTION_AUTHORITY_COMPAT_PRIVATE_ROUTINES: readonly ["copy_subscription_authority_compat(text, text, uuid, uuid, bigint)", "read_subscription_authority_compat(text, text, uuid, uuid, bigint)", "subscription_authority_compat_providers()", "subscription_authority_carrier_inserted_now(text, uuid, uuid, bigint)"]; /** * Migration 0716: owner-only marker and guard triggers, the per-path source * resolvers and the deferred compatibility check, in * opengeni_subscription_internal. */ export declare const SUBSCRIPTION_AUTHORITY_COMPAT_OWNER_ROUTINES: readonly ["stamp_subscription_authority_inserted_at()", "keep_subscription_authority_inserted_at()", "subscription_authority_compat_entry_valid(jsonb)", "guard_subscription_authority_compat()", "subscription_compat_turn_human(uuid, uuid)", "subscription_compat_v2_has_entry(jsonb, text)", "subscription_compat_receiver_source(uuid, uuid)", "subscription_compat_delivery_sources(uuid, uuid, uuid, uuid, text)", "subscription_compat_compaction_source(uuid, uuid)", "subscription_compat_scheduled_source(uuid, uuid)", "subscription_compat_carrier_sources(text, uuid, uuid, bigint)", "subscription_compat_carrier_state(text, uuid, uuid, bigint)", "subscription_compat_record(text, text, uuid, uuid, bigint)", "subscription_compat_expected(text, timestamp with time zone, uuid, text, uuid, bigint, text)", "subscription_compat_carrier_expected(text, timestamp with time zone, text, uuid, uuid, bigint)", "subscription_compat_enter_scope(uuid, uuid)", "subscription_compat_leave_scope(text[])", "subscription_compat_effective(text, text, uuid, uuid, bigint)", "enforce_subscription_authority_compat()"]; /** * Migration 0717: the fences' owner-only helpers in * opengeni_subscription_internal (the v2 copy rule, a scheduled firing's v2 * value and the personal-entry liveness check). Only owner-run fences and * functions call them. */ export declare const SUBSCRIPTION_AUTHORITY_FENCE_OWNER_ROUTINES: readonly ["subscription_v2_copy_matches(jsonb, jsonb)", "subscription_scheduled_firing_v2(uuid, uuid, uuid, bigint)", "subscription_personal_entry_serviceable(uuid, jsonb)", "subscription_scheduled_run_personal_entries(uuid, uuid, uuid)"]; /** * Migration 1103: the administration writer context in * opengeni_subscription_internal (the writer context without the person-only * subject rule). Only the owner-run disconnect writer calls it. */ export declare const SUBSCRIPTION_ADMINISTRATION_OWNER_ROUTINES: readonly ["subscription_core_administration_context(text, uuid, uuid, text)"]; export declare const SUBSCRIPTION_M3_PRECURSOR_PRIVATE_ROUTINES: readonly ["authorize_subscription_ownerless_session_access(uuid, uuid, uuid, uuid)", "authorize_subscription_personal_placement_access(uuid, uuid, uuid, uuid, text, uuid, bigint, text, text)", "subscription_codex_refresh_write_allowed(uuid, uuid, uuid)", "resolve_subscription_codex_apps_designation(uuid, uuid)", "read_subscription_codex_apps_credential(uuid, uuid, uuid)", "begin_subscription_codex_apps_refresh(uuid, uuid, uuid)", "persist_subscription_codex_apps_refresh(uuid, uuid, uuid, bigint, text, timestamp with time zone, timestamp with time zone)", "fail_subscription_codex_apps_refresh(uuid, uuid, uuid, bigint, text)", "subscription_codex_reset_authority(uuid, uuid, uuid, text)", "subscription_codex_reset_credit_fence(uuid, uuid, uuid, text, text, uuid)", "subscription_codex_owner_capability_held(uuid, text[], text, uuid, boolean)", "subscription_codex_owner_membership_held(uuid, uuid)", "subscription_core_owner_capability_held(text, uuid, text[], text, uuid, boolean)", "subscription_core_owner_membership_held(uuid, uuid)", "subscription_core_refresh_write_allowed(text, uuid, uuid, uuid)", "begin_subscription_core_refresh(text, uuid, uuid, uuid, uuid, text, text, uuid, text, bigint)", "persist_subscription_core_refresh(text, uuid, uuid, uuid, uuid, uuid, bigint, text, timestamp with time zone, timestamp with time zone)", "persist_subscription_core_refresh_with_plan(text, uuid, uuid, uuid, uuid, uuid, bigint, text, timestamp with time zone, timestamp with time zone, text)", "fail_subscription_core_refresh(text, uuid, uuid, uuid, uuid, uuid, bigint, text)", "quarantine_subscription_core_connection(text, uuid, uuid, uuid, uuid, uuid, text, bigint, bigint, text, text, timestamp with time zone)", "recover_subscription_core_connection_health(text, uuid, uuid, uuid, uuid)", "subscription_core_acceptance_authority_v2(text, uuid, uuid, uuid, text)", "subscription_core_task_authority_v2(text, uuid, uuid, uuid, text)", "subscription_core_revision_authority_v2(uuid, uuid, uuid, bigint)", "read_subscription_core_connection_credential(text, uuid, uuid, uuid, uuid, uuid, text, bigint)", "begin_subscription_core_connection_refresh(text, uuid, uuid, uuid, uuid, uuid, text, bigint)", "persist_subscription_core_connection_refresh(text, uuid, uuid, uuid, bigint, text, timestamp with time zone, timestamp with time zone)", "fail_subscription_core_connection_refresh(text, uuid, uuid, uuid, bigint, text)", "connect_subscription_core_personal(text, uuid, uuid, text, text, text, text, text, jsonb, timestamp with time zone, timestamp with time zone, text, text, text)", "disconnect_subscription_core_connection(text, uuid, uuid, text, uuid)", "manage_subscription_core_personal(text, uuid, uuid, text, uuid, text, text, boolean, integer)", "subscription_core_personal_connections(text, uuid, uuid, text)", "subscription_core_reach(text, uuid, uuid)", "set_subscription_core_reach(text, uuid, uuid, boolean, boolean)", "set_subscription_core_reach_allocator(text, uuid, uuid, boolean)", "connect_subscription_core_personal(text, uuid, uuid, text, text, text, text, text, jsonb, timestamp with time zone, timestamp with time zone, text, text, text, text)", "subscription_core_personal_connection_versions(text, uuid, uuid, text)", "subscription_core_personal_sharing(text, uuid, text, uuid, integer)", "read_subscription_core_owned_connection_credential(text, uuid, uuid, text, uuid)", "begin_subscription_core_owned_connection_refresh(text, uuid, uuid, text, uuid)", "record_subscription_core_owned_connection_quota(text, uuid, uuid, text, uuid, bigint, bigint, jsonb, timestamp with time zone)", "read_subscription_usage_history(uuid, uuid, text, text, uuid[])", "append_subscription_usage_reading(uuid, uuid, text, jsonb)", "prune_subscription_usage_history()", "subscription_usage_history_prune_due()", "subscription_provider_cutover_committed(text)", "copy_subscription_authority_compat(text, text, uuid, uuid, bigint)", "read_subscription_authority_compat(text, text, uuid, uuid, bigint)", "subscription_authority_compat_providers()", "subscription_authority_carrier_inserted_now(text, uuid, uuid, bigint)"]; /** Owner-only private helpers the runtime role must never be able to execute. */ export declare const SUBSCRIPTION_M3_OWNER_ONLY_PRIVATE_ROUTINES: readonly ["subscription_codex_apps_designation_target(uuid, uuid)", "grant_subscription_codex_owner_capability(text, uuid, uuid, text, uuid)", "drop_subscription_codex_owner_capabilities(uuid)", "derive_scheduled_revision_subscription_authority()", "subscription_codex_cutover_v1_active()", "seed_subscription_codex_cutover()", "record_subscription_core_plan_change()", "keep_subscription_codex_cutover_identity()", "auto_assign_subscription_core_workspace()", "auto_assign_subscription_core_personal_workspace()", "capture_usage_reading()", "append_usage_reading(uuid, uuid, jsonb)", "capture_usage_call()", "subscription_core_writer_context(text, uuid, uuid, text)", "grant_subscription_core_owner_capability(text, text, uuid, uuid, text, uuid)", "drop_subscription_core_owner_capabilities(text, uuid)", "subscription_core_connection_target(text, uuid, uuid, uuid, uuid, uuid, text, bigint)", "apply_subscription_core_auto_assignments(text, uuid, uuid, boolean)", "guard_subscription_provider_cutover_receipts()", "keep_subscription_cutover_identity()", "stamp_subscription_authority_inserted_at()", "keep_subscription_authority_inserted_at()", "subscription_authority_compat_entry_valid(jsonb)", "guard_subscription_authority_compat()", "subscription_compat_turn_human(uuid, uuid)", "subscription_compat_v2_has_entry(jsonb, text)", "subscription_compat_receiver_source(uuid, uuid)", "subscription_compat_delivery_sources(uuid, uuid, uuid, uuid, text)", "subscription_compat_compaction_source(uuid, uuid)", "subscription_compat_scheduled_source(uuid, uuid)", "subscription_compat_carrier_sources(text, uuid, uuid, bigint)", "subscription_compat_carrier_state(text, uuid, uuid, bigint)", "subscription_compat_record(text, text, uuid, uuid, bigint)", "subscription_compat_expected(text, timestamp with time zone, uuid, text, uuid, bigint, text)", "subscription_compat_carrier_expected(text, timestamp with time zone, text, uuid, uuid, bigint)", "subscription_compat_enter_scope(uuid, uuid)", "subscription_compat_leave_scope(text[])", "subscription_compat_effective(text, text, uuid, uuid, bigint)", "enforce_subscription_authority_compat()", "subscription_v2_copy_matches(jsonb, jsonb)", "subscription_scheduled_firing_v2(uuid, uuid, uuid, bigint)", "subscription_personal_entry_serviceable(uuid, jsonb)", "subscription_scheduled_run_personal_entries(uuid, uuid, uuid)", "subscription_core_administration_context(text, uuid, uuid, text)"]; /** Per-task usage limits: the only runtime entry points. */ export declare const SESSION_USAGE_LIMIT_CAPABILITY_PREDICATE_ROUTINE = "session_usage_limit_capability_active(uuid, uuid)"; export declare const SESSION_USAGE_LIMIT_RUNTIME_ROUTINES: readonly ["maintain_session_usage_limits(integer, integer)", "session_usage_limit_command(jsonb)", "session_usage_limit_capability_active(uuid, uuid)"]; export declare const SESSION_USAGE_LIMIT_STATE_ROUTINE = "session_usage_limit_state(jsonb, boolean)"; /** Pure amount rules shared by the event trigger and the legacy import. */ export declare const SESSION_USAGE_LIMIT_AMOUNT_ROUTINES: readonly ["session_usage_limit_meter_amount(numeric, text, numeric, numeric)", "session_usage_limit_event_amount(jsonb)"]; /** Owner-internal helpers; never runtime-callable. */ export declare const SESSION_USAGE_LIMIT_INTERNAL_ROUTINES: readonly ["session_usage_limit_state(jsonb, boolean)", "session_usage_limit_apply_receipt(uuid, uuid, uuid, text, uuid, uuid, bigint, text, text, text)", "session_usage_limit_import_page(uuid, uuid, uuid, integer)", "session_usage_limit_import_step(uuid, uuid, uuid, integer)", "session_usage_limit_meter_amount(numeric, text, numeric, numeric)", "session_usage_limit_event_amount(jsonb)", "seed_session_usage_limit_root()", "meter_session_usage_limit_event()"]; export declare const SUBSCRIPTION_PLAN_RUNTIME_ROUTINES: readonly ["free_plan_credit_eligible(uuid)", "organization_plan_seats_used(uuid)", "upsert_organization_plan(uuid, text, text, text, timestamp with time zone, timestamp with time zone, boolean)", "expire_plan_credit_period(uuid, uuid, boolean)", "grant_plan_credit_period(uuid, text, timestamp with time zone, timestamp with time zone, text)", "replace_plan_credit_period(uuid, text, timestamp with time zone, timestamp with time zone, text)", "read_organization_plan_balance(uuid, timestamp with time zone)", "expire_ended_plan_credit_periods(uuid)", "begin_plan_credit_settlement(uuid)"]; export declare const BILLING_SUBSCRIPTION_OPERATION_ROUTINES: readonly ["begin_billing_subscription_operation(uuid, uuid, text, jsonb, jsonb)", "complete_billing_subscription_operation(uuid, uuid, jsonb)"]; export declare const RUNTIME_TARGET_SCHEMA_CAPABILITY_ROUTINES: readonly ["create_agent_child_session(uuid, uuid, uuid, uuid, uuid, integer, jsonb)", "begin_billing_subscription_operation(uuid, uuid, text, jsonb, jsonb)", "complete_billing_subscription_operation(uuid, uuid, jsonb)", "free_plan_credit_eligible(uuid)", "organization_plan_seats_used(uuid)", "upsert_organization_plan(uuid, text, text, text, timestamp with time zone, timestamp with time zone, boolean)", "expire_plan_credit_period(uuid, uuid, boolean)", "grant_plan_credit_period(uuid, text, timestamp with time zone, timestamp with time zone, text)", "replace_plan_credit_period(uuid, text, timestamp with time zone, timestamp with time zone, text)", "read_organization_plan_balance(uuid, timestamp with time zone)", "expire_ended_plan_credit_periods(uuid)", "begin_plan_credit_settlement(uuid)", "scheduled_task_is_exhausted(uuid)", "lock_live_native_original_origin_v2(jsonb)", "modal_native_origin_member_read_active(uuid, text)", "xai_provider_account_authority_snapshot_v1_valid(jsonb)", "claude_provider_account_authority_snapshot_v1_valid(jsonb)", "maintain_usage_allowances(integer, integer)", "usage_allowance_command(jsonb)", "usage_allowance_capability_active(uuid, uuid)", "maintain_session_usage_limits(integer, integer)", "session_usage_limit_command(jsonb)", "session_usage_limit_capability_active(uuid, uuid)", "knowledge_index_claim(text, integer, integer)", "knowledge_index_work(uuid, uuid, uuid, jsonb)", "knowledge_index_billing_policy(uuid, uuid, uuid, text, timestamp with time zone, bigint)", "knowledge_index_wait_for_funding(uuid, uuid, uuid)", "knowledge_index_paid_publication_guard(uuid, uuid, uuid)", "knowledge_visible_index_status(uuid, uuid, jsonb, jsonb, text)", "knowledge_entry_apply(uuid, uuid, jsonb, jsonb)", "knowledge_entry_confirm_legacy(uuid, uuid, jsonb, jsonb)", "agent_instruction_apply(uuid, uuid, jsonb, jsonb)", "knowledge_entry_read(uuid, uuid, jsonb, jsonb)", "knowledge_entry_prepare_file(uuid, uuid, jsonb, jsonb)", "knowledge_document_prepare(uuid, uuid, uuid, jsonb)", "agent_learning_manage(uuid, uuid, jsonb, jsonb)", "mcp_operation_command(jsonb, text, jsonb)", "skill_apply_lifecycle(uuid, uuid, jsonb, jsonb)", "company_brain_inspect_context_receipts(uuid, uuid, text, uuid, timestamp with time zone, uuid, integer)", "company_brain_context_get_or_create_selection(uuid, uuid, uuid, uuid, uuid, integer)", "propose_company_profile_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, text, text)", "propose_company_profile_for_attempt_v2(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, text, text, text)", "confirm_company_profile_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, uuid)", "get_company_profile_agent_policy(uuid, uuid, text)", "update_company_profile_agent_policy(uuid, uuid, text, text, bigint, uuid)", "undo_governed_learning_activation(uuid, uuid, uuid, uuid)", "inspect_governed_learning_decisions(uuid, uuid, text, integer)", "inspect_governed_learning_activations(uuid, uuid, text, integer)", "inspect_governed_learning_activation_undos(uuid, uuid, text, integer)", "fork_session_content(uuid, uuid, uuid, text, uuid, text, boolean, text, text, integer)", "fork_session_content(uuid, uuid, uuid, text, uuid, text, boolean, text, text, integer, uuid)", "fork_session_content(uuid, uuid, uuid, text, uuid, text, text, text, integer)", "replay_applied_session_fork(uuid, uuid, uuid, text, uuid, text, boolean, text, text, integer)", "session_tenancy_product_activated(uuid, integer)", "session_tenancy_any_product_activation()", "google_drive_document_citation(uuid, uuid, text, uuid, uuid)", "google_drive_file_authorized(uuid, uuid, text, uuid)", "knowledge_source_sync_lock_authority(uuid, uuid, uuid)", "ensure_managed_human_personal_workspace(uuid, text, uuid)", "get_external_identity_link_reference(uuid, uuid, text)", "get_external_identity_link_inventory_references(uuid, uuid[])", "ensure_external_identity(uuid, text, text)", "lookup_external_identity(uuid, text, text, text)", "prepare_external_workspace_membership_operation(jsonb)", "record_external_workspace_membership_operation(jsonb, jsonb)", "list_self_organization_memberships(text)", "list_self_organization_invitations(text)", "list_self_organization_invitations(text, uuid, integer)", "get_self_organization_invitation(text, uuid)", "list_organization_invitations(uuid, text, uuid, integer)", "list_organization_members(uuid, text)", "list_organization_administration_members(uuid, text)", "get_organization_administration_overview(uuid, text)", "get_workspace_kind(uuid, uuid)", "resolve_workspace_codex_subscription_source(uuid, uuid)", "capture_legacy_codex_turn_sources(uuid, uuid)", "list_organization_workspace_ids(uuid)", "list_organization_codex_workspace_ids(uuid)", "list_organization_subscription_workspace_ids(uuid)", "organization_workspace_command(jsonb)", "authorize_organization_shared_workspace_administration(uuid, uuid, text)", "resolve_organization_workspace_removal_subject(uuid, text, uuid)", "prepare_organization_workspace_member_removal(jsonb)", "record_organization_workspace_member_removal(jsonb, uuid, uuid)", "create_additional_managed_organization(text, text, text, text, uuid)", "create_managed_organization(text, text, text, uuid)", "assert_organization_shared_workspace_administrator(uuid, uuid, text)", "open_organization_shared_workspace_administration_capability(uuid, uuid, text)", "close_organization_shared_workspace_administration_capability(uuid)", "create_organization_shared_workspace(uuid, text, text, text, text, uuid)", "upsert_organization_shared_workspace_member(uuid, uuid, text, uuid, text, text, jsonb, boolean)", "update_organization_name(uuid, text, text, timestamp with time zone, uuid)", "create_organization_invitation_v2(jsonb)", "bind_pending_organization_invitations_for_verified_email(text, text)", "has_pending_organization_invitation_for_subject(text)", "accept_organization_invitation_v2(jsonb)", "complete_self_service_organization_setup(jsonb)", "ensure_organization_user_setup_intent(jsonb)", "claim_organization_user_setup_delivery(jsonb)", "claim_organization_user_setup_delivery_v2(jsonb)", "prepare_organization_user_setup_delivery(jsonb)", "prepare_organization_user_setup_delivery_v2(jsonb)", "settle_organization_user_setup_delivery(jsonb)", "preview_organization_user_setup(text)", "get_organization_invitation_for_administration(uuid, text, uuid)", "preflight_organization_user_setup(text)", "complete_organization_user_setup(jsonb)", "organization_membership_command(jsonb)", "prepare_organization_membership_protocol_settlements(jsonb)", "assert_active_managed_human_organization_membership(uuid, text)", "resolve_workspace_writer_grant_identity(uuid, text)", "prepare_workspace_membership_removal_settlements(jsonb)", "workspace_membership_removal_command(jsonb)", "get_organization_retention_policy(uuid, text)", "preview_organization_retention_deletions(uuid, integer)", "claim_organization_retention_deletion(uuid, uuid, uuid[])", "list_organization_retention_deletion_objects(uuid, uuid, uuid, text, integer)", "record_organization_retention_object_deleted(uuid, uuid, uuid, text, text, text, text)", "fail_organization_retention_deletion(uuid, uuid, uuid, text)", "finalize_organization_retention_deletion(uuid, uuid, uuid, text)", "complete_organization_retention_deletion(uuid, uuid, uuid, text)", ...string[], "open_private_session_create_capability(uuid, uuid, uuid, text)", "open_private_child_session_create_capability(uuid, uuid, uuid, uuid, uuid, uuid, integer)", "close_private_session_create_capability(uuid)", "resolve_session_attempt_personal_resources(uuid, uuid, uuid)", "list_owned_connection_accounts(uuid, uuid)", "accept_turn_personal_resource_attachment(uuid, uuid, uuid, uuid, text, integer, boolean, integer)", "list_self_user_resource_authorities(uuid, uuid, text, uuid, integer)", "issue_self_user_resource_grant(uuid, uuid, uuid, text, text, text, uuid, integer, boolean)", "revoke_self_user_resource_grant(uuid, uuid, uuid)", "authorize_session_attempt_personal_resource_reads(uuid, uuid, uuid)", "preference_registry_create_knowledge_proposal_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, uuid, text, text, text, text, integer, text, jsonb, timestamp with time zone, text)", "create_scoped_variable_set(uuid, uuid, text, text, text, jsonb, boolean)", "list_scoped_variable_sets(uuid, uuid, uuid, text, text)", "count_scoped_variable_sets(uuid, uuid, text)", "mutate_scoped_variable_set(uuid, uuid, uuid, text, text, boolean, text, boolean, text, text, boolean)", "read_scoped_variable_set_secret(uuid, uuid, uuid, text, text, text, uuid, uuid, uuid, integer)", "materialize_scoped_variable_set_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid)", "materialize_scoped_variable_set_for_session(uuid, uuid, uuid, uuid)", "list_vaults_for_subject(uuid, jsonb)", "get_vault_for_subject(uuid, jsonb)", "create_vault(jsonb, jsonb)", "update_vault(uuid, bigint, jsonb, jsonb)", "delete_vault(uuid, text, boolean, jsonb)", "ensure_default_vault(uuid, text, jsonb)", "ensure_task_vault(uuid, uuid, jsonb)", "list_vault_items(uuid, text, text, boolean, text, integer, jsonb)", "get_vault_item(uuid, jsonb)", "upsert_vault_item(jsonb, jsonb)", "archive_vault_item(uuid, jsonb)", "restore_vault_item(uuid, jsonb)", "delete_vault_item_permanently(uuid, jsonb)", "move_vault_item(uuid, uuid, text, text, jsonb)", "read_vault_field_ciphertext(uuid, integer, text, jsonb, jsonb)", "list_vault_field_versions(uuid, jsonb)", "resolve_secret_reference_candidates(jsonb, jsonb)", "record_vault_secret_use(jsonb, jsonb, jsonb)", "set_session_vault_policy(uuid, jsonb, jsonb)", "session_secrets_view(uuid, jsonb)", "update_passkey_sign_count(uuid, bigint, jsonb)", "lease_vault_passkeys(jsonb, text, integer)", "release_vault_passkey_leases(text, jsonb)", "upsert_provider_vault_items(uuid, text, jsonb, jsonb)", "set_vault_sync_status(uuid, jsonb, jsonb)", "apply_secret_answers(uuid, uuid, jsonb, jsonb)", "link_provider_vault(jsonb, jsonb)", "provider_vault_sync_target(uuid, jsonb)", "provider_vault_item_ref(uuid, uuid, text, jsonb)", "provider_connection_home_workspace(uuid)", "connection_authority_convergence_audit_capability_active(uuid)", "resolve_accepted_connection_use(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, text, uuid, text, text, text, text)", "inspect_organization_connection_authority_convergence(uuid, integer, uuid)", "get_self_personal_github_repository_selection(uuid, uuid, text, uuid)", "mutate_self_personal_github_repository_selection(uuid, uuid, text, uuid, bigint, bigint, text, jsonb, boolean)", "create_personal_document_authority(uuid, uuid, uuid)", "resolve_document_original_file(uuid, uuid, text, uuid)", "resolve_session_attempt_personal_document_reads(uuid, uuid, uuid, uuid)", "list_document_authority_reclassifications(uuid, uuid, text, uuid, integer, timestamp with time zone, uuid)", "reclassify_document_authority(jsonb)", "run_document_default_collection_backfill(jsonb)", "list_document_default_collection_backfill_runs(jsonb)", "get_document_default_collection_backfill_audit(jsonb)", "list_organization_document_authority_reclassifications(jsonb)", "create_scoped_rig(uuid, uuid, text, text, text, text, jsonb, boolean)", "list_scoped_rigs(uuid, uuid, uuid, text, text)", "count_scoped_rigs(uuid, uuid, text)", "mutate_scoped_rig(uuid, uuid, uuid, text, text, boolean, text, boolean, boolean)", "finalize_scoped_enrollment(uuid, uuid, text, text, boolean, boolean, text, text, text, boolean)", "list_scoped_enrollments(uuid, uuid, uuid, text)", "get_scoped_sandbox(uuid, uuid, uuid)", "get_session_machine_access(uuid, uuid, uuid)", "authorize_scoped_sandbox_attach(uuid, uuid, uuid)", "materialize_scoped_rig_version_for_attempt(uuid, uuid, uuid, uuid, uuid, integer)", "authorize_session_attempt_personal_machine(uuid, uuid, uuid, uuid, uuid, integer, uuid)", "assert_session_attempt_personal_machine(uuid, uuid, uuid, uuid, uuid, integer, uuid, boolean)", "consent_session_turn_personal_machine(uuid, uuid, uuid, uuid)", "get_session_attempt_machine(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, boolean, boolean)", "list_scoped_machine_dependent_sessions(uuid, uuid, uuid)", "detach_scoped_machine_dependent_sessions(uuid, uuid, uuid)", "preview_connected_machine_audience_change(uuid, uuid, uuid, text, text, boolean)", "change_connected_machine_audience(uuid, uuid, uuid, bigint, text, text, boolean)", "freeze_scheduled_task_personal_resources(uuid, uuid, uuid, bigint)", "clone_scheduled_task_personal_resource_authority(uuid, uuid, uuid, bigint, bigint)", "create_scheduled_agent_run_with_admission(uuid, uuid, uuid, uuid, bigint, text, text, text, timestamp with time zone, timestamp with time zone, jsonb)", "materialize_scheduled_task_reusable_session_from_run(uuid, uuid, uuid, uuid, uuid, bigint, text)", "scheduled_task_run_personal_resource_authority(uuid, uuid, uuid)", "scheduled_task_run_connection_authority_subject(uuid, uuid, uuid)", "scheduled_task_personal_resource_authority_subject(uuid, uuid, uuid, bigint)", "record_scheduled_task_revision_authority(uuid, uuid, uuid, bigint)", "clone_scheduled_task_revision_authority(uuid, uuid, uuid, bigint, bigint)", "scheduled_task_revision_authority_subject(uuid, uuid, uuid, bigint)", "scheduled_task_revision_authority_snapshot(uuid, uuid, uuid, bigint)", "validate_scheduled_agent_run_live_authority(uuid, uuid, uuid)", "scheduled_scoped_rig_version_metadata(uuid, uuid, text, uuid, uuid)", "scheduled_variable_set_expected_generation_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid)", "bind_scheduled_task_run_session(uuid, uuid, uuid, uuid)", "transition_scheduled_agent_run(uuid, uuid, uuid, uuid, uuid, text, text)", "mutate_managed_sign_in_method(text, text, jsonb)", "mutate_managed_passkey(text, text, jsonb)", "assert_managed_sign_in_recovery(text, text, uuid, jsonb)", "replay_managed_sign_in_method(text, text, jsonb)", "claim_managed_sign_in_notification(uuid, text, text, integer)", "settle_managed_sign_in_notification(uuid, uuid, text)", "ensure_canonical_human_identity(text, text)", "validate_canonical_human_session(text, text, boolean)", "get_canonical_human_identity_projection(text)", "apply_canonical_human_identity_operation(uuid, text, bigint, text, uuid, text, text, text)", "get_canonical_human_exact_login_binding(text, text)", "managed_auth_session_set_authority_state(text)", "managed_auth_session_set_snapshot(text, text, boolean, boolean, boolean)", "managed_auth_session_set_bootstrap(text, text, text, text, uuid, text, bigint, bigint)", "managed_auth_session_set_begin_transaction(text, text, text, uuid, text, bigint, uuid, bigint, text, text, uuid, uuid, text, timestamp with time zone)", "managed_auth_session_set_complete_transaction(text, text, uuid, text, bigint, bigint, uuid, text, text, text)", "managed_auth_session_set_mutate(text, text, uuid, text, bigint, bigint, text, uuid, uuid, uuid, text, text)", "managed_auth_actor_mutation_fence(text, bigint, uuid)", "managed_auth_actor_mutation_lease_acquire(text, bigint, uuid, integer)", "managed_auth_actor_mutation_lease_release(text, uuid)", "managed_auth_actor_mutation_lease_validate(text, bigint, uuid)", "managed_auth_adopted_session_snapshot(text)", "managed_auth_isolated_session_reap(integer)", "managed_auth_expired_session_set_reap(integer)", "managed_auth_session_set_operation_receipt(text, uuid, text, text)", "get_organization_recovery_overview(uuid, text, jsonb, text, text)", "organization_recovery_command(jsonb)", "create_task_note_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, text, integer)", "archive_task_note_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, integer, text)", "list_task_notes_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, boolean, integer)", "replace_task_note_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, uuid, uuid, integer, text, text, integer, text)", "resolve_task_note_knowledge_promotion_source(uuid, uuid, uuid, uuid, uuid, integer, uuid, integer, text, text, text)", "upsert_session_work_claim_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, integer, text, text, text, text, text, text, text)", "release_session_work_claim_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, integer, text)", "session_private_actor_visible(uuid, uuid, uuid, text)", "session_private_actor_visible_keys()", "session_reference_visible(uuid, uuid, uuid)", "session_visibility_lifecycle_capability_held()", "transition_session_visibility(uuid, uuid, uuid, text, text, integer, text, text, integer)", "session_visibility_change_blocker(uuid, uuid, uuid)", "session_visibility_foreign_authority_items(uuid, uuid, uuid)"]; /** * Boolean-only predicates that shared-table RLS policies must be able to * evaluate under table owners and SECURITY DEFINER roles unknown at migration * time. The capability ledger and the routine that mints its opaque token stay * private; only these exact policy predicates may be PUBLIC-executable. */ export declare const RUNTIME_TARGET_SCHEMA_PUBLIC_POLICY_PREDICATE_ROUTINES: readonly ["connection_authority_convergence_audit_capability_active(uuid)", "usage_allowance_capability_active(uuid, uuid)", "session_usage_limit_capability_active(uuid, uuid)"]; /** Owner-internal helpers that must exist but must never be callable by the runtime role. */ export declare const RUNTIME_TARGET_SCHEMA_FORBIDDEN_ROUTINES: readonly ["guard_session_agent_creation_provenance()", "personal_machine_grant_covers_descendant(uuid, uuid, uuid, uuid)", "personal_machine_turn_consent_covers_descendant(uuid, uuid, uuid)", "live_session_turn_machine_consent(uuid)", "bind_session_attempt_machine_consent(uuid, uuid, uuid)", "carry_session_attempt_machine_authorization(uuid, uuid, uuid)", "assert_session_attempt_machine_consent(uuid, uuid, uuid, uuid, uuid, integer, uuid, boolean, boolean)", "enable_organization_private_sessions_from_activation(uuid, text[])", "usage_allowance_members(uuid, uuid)", "usage_allowance_effective_period(uuid, jsonb, timestamp with time zone)", "count_workspace_allowance_debit()", "count_unbilled_model_allowance_debit()", "count_unbilled_allowance_usage(uuid, uuid, text, bigint, text)", "capture_usage_allowance_attribution()", "reverse_video_allowance_refund()", "capture_usage_allowance_period(uuid, uuid, jsonb, timestamp with time zone)", "emit_usage_allowance_notifications(uuid, uuid, jsonb, text, timestamp with time zone, text)", "usage_allowance_period(jsonb, timestamp with time zone)", "validate_usage_allowance_config(jsonb)", "validate_usage_allowance_rule(jsonb)", "guard_slack_file_upload_operation()", "guard_session_agent_id_immutable()", "guard_agent_instructions_claim_protocol()", "guard_org_agent_claim_protocol()", "session_usage_limit_state(jsonb, boolean)", "session_usage_limit_apply_receipt(uuid, uuid, uuid, text, uuid, uuid, bigint, text, text, text)", "session_usage_limit_import_page(uuid, uuid, uuid, integer)", "session_usage_limit_import_step(uuid, uuid, uuid, integer)", "session_usage_limit_meter_amount(numeric, text, numeric, numeric)", "session_usage_limit_event_amount(jsonb)", "seed_session_usage_limit_root()", "meter_session_usage_limit_event()", "activate_session_tenancy_from_additional_organization(uuid)", "acquire_automatic_session_title_quarantine_fences_v1(integer)", "organization_private_sessions_enabled(uuid)", "activate_greenfield_session_tenancy_from_setup(text)", "assert_session_tenancy_quiescent(uuid, uuid, uuid, boolean)", "check_tenancy_backfill_activation_evidence(uuid)", "set_verified_signup_trial_credits_enabled(boolean, text, text)", "set_credit_promotion_policy(jsonb, text, text)", "set_integration_backend(text, text, text, boolean, jsonb, text, text)", "nango_affected_connections(text)", "set_subscription_plan_catalog(jsonb, text, text)", "set_managed_auth_new_signups_enabled(boolean, text, text)", "document_migration_audit_capability_active(text)", "assert_document_migration_audit_authority(jsonb)"]; export declare const RUNTIME_TARGET_SCHEMA_INVOKER_ROUTINES: readonly ["guard_session_agent_creation_provenance()", "set_subscription_plan_catalog(jsonb, text, text)", "scheduled_task_is_exhausted(uuid)", "set_credit_promotion_policy(jsonb, text, text)", "set_integration_backend(text, text, text, boolean, jsonb, text, text)", "nango_affected_connections(text)", "claude_provider_account_authority_snapshot_v1_valid(jsonb)", "usage_allowance_period(jsonb, timestamp with time zone)", "validate_usage_allowance_config(jsonb)", "validate_usage_allowance_rule(jsonb)", "guard_slack_file_upload_operation()", "guard_session_agent_id_immutable()", "guard_agent_instructions_claim_protocol()", "guard_org_agent_claim_protocol()", "session_usage_limit_state(jsonb, boolean)", "session_usage_limit_meter_amount(numeric, text, numeric, numeric)", "session_usage_limit_event_amount(jsonb)", "resolve_workspace_codex_subscription_source(uuid, uuid)", "session_reference_visible(uuid, uuid, uuid)", "xai_provider_account_authority_snapshot_v1_valid(jsonb)"]; /** * The complete standalone tenant-table contract. Adding or removing a * FORCE-RLS table is an architectural change: update this list in the same * commit as the migration so startup cannot silently accept an unreviewed gap. */ export declare const FORCE_RLS_TABLES: readonly ["additional_organization_creation_receipts", "agent_call_host_phones", "agent_calls", "agent_instruction_operations", "agent_learning_revisions", "agent_learning_snapshots", "agent_publish_operations", "agent_revisions", "agent_run_states", "agent_slack_installs", "agent_workspace_access", "agents", "api_keys", "app_notifications", "app_package_exports", "app_server_runs", "app_sync_keys", "app_sync_queue", "app_sync_subscriptions", "app_webhooks", "attached_browser_devices", "attached_browser_inventories", "audit_events", "auth_runs", "automation_run_event_links", "automation_runs", "automation_sources", "automation_templates", "automation_trigger_events", "automation_trigger_revisions", "automation_triggers", "billing_auto_top_up_mutations", "billing_auto_top_up_operations", "billing_auto_top_up_settings", "billing_card_verifications", "billing_credit_alert_settings", "billing_credit_notification_deliveries", "billing_credit_notification_recipients", "billing_credit_notifications", "billing_customers", "billing_subscription_operations", "browser_identities", "browser_revision_components", "browser_revisions", "browser_session_associations", "browser_session_retained_downloads", "browser_sessions", "browser_state_artifacts", "browser_state_uploads", "canonical_human_identities", "canonical_human_identity_operations", "canonical_human_identity_subjects", "canonical_human_login_bindings", "capability_api_facets", "capability_catalog_items", "capability_component_owners", "capability_facet_installations", "capability_facets", "capability_installations", "capability_integration_facets", "capability_mcp_facets", "capability_operations", "capability_plugin_installations", "capability_plugin_versions", "capability_plugins", "capability_skill_facets", "capability_skill_files", "card_verification_gate_revisions", "channels", "claude_capacity_waiters", "claude_credential_leases", "claude_rotation_settings", "claude_session_account_pins", "claude_subscription_account_usage", "claude_subscription_credentials", "codex_apps_settings", "codex_capacity_waiters", "codex_credential_leases", "codex_reset_redemption_attempts", "codex_rotation_settings", "codex_subscription_credentials", "codex_turn_source_bindings", "company_brain_context_selection_receipts", "company_brain_preference_proposal_receipts", "company_brain_turn_context_snapshots", "company_profile_activation_events", "company_profile_agent_automatic_activation_receipts", "company_profile_agent_confirmation_receipts", "company_profile_agent_proposal_receipts", "company_profile_heads", "company_profile_revisions", "company_profile_snapshots", "composer_drafts", "computer_session_associations", "computer_sessions", "connect_attempts", "connection_disconnect_operations", "connection_use_audit_facts", "connection_use_once_consumption_receipts", "connections", "connector_action_policies", "connector_action_requests", "credential_profiles", "credit_debit_allocations", "credit_ledger_entries", "device_enrollment_requests", "document_authority_reclassifications", "document_bases", "document_chunks", "document_default_collection_backfill_operations", "document_default_collection_backfill_receipts", "document_default_collection_backfill_runs", "documents", "editable_artifact_blob_refs", "editable_artifact_idempotency_receipts", "editable_artifact_live_outbox", "editable_artifact_live_tickets", "editable_artifact_materialization_jobs", "editable_artifact_materialization_results", "editable_artifact_operations", "editable_artifact_replica_leases", "editable_artifact_scope_authorization_heads", "editable_artifact_sequence_checkpoints", "editable_artifact_session_links", "editable_artifact_snapshots", "editable_artifact_transactions", "editable_artifact_undo_claims", "editable_artifact_versions", "editable_artifacts", "end_user_tool_credentials", "enrollment_token_redemptions", "enrollments", "event_deliveries", "event_source_feeds", "event_sources", "event_triggers", "external_identities", "external_identity_links", "external_link_task_authorities", "external_link_turn_authorities", "external_workspace_member_revocations", "feedback_submissions", "file_uploads", "files", "generated_image_artifacts", "generated_video_artifacts", "github_installation_repositories", "github_installation_repository_removals", "github_installations", "governed_learning_activation_receipts", "governed_learning_activation_undo_receipts", "governed_learning_decision_receipts", "host_export_config", "host_export_consumers", "host_export_cursor_state", "host_export_dead_letters", "host_export_outbox", "host_mcp_bindings", "host_mcp_delegations", "host_mcp_resolver_operations", "host_mcp_resolvers", "host_mcp_task_authorities", "host_mcp_turn_authorities", "image_generation_operations", "import_batches", "inbound_events", "integration_backend_revisions", "integration_facet_binding_owners", "integration_facet_bindings", "integration_facet_definitions", "integration_oauth_pending_states", "integration_oauth_state_nonces", "integration_spec_revisions", "integration_tools", "interaction_interventions", "interaction_operations", "interaction_resource_operations", "knowledge_change_proposals", "knowledge_claim_evidence", "knowledge_claim_relations", "knowledge_claim_reviews", "knowledge_claims", "knowledge_collection_activity", "knowledge_collection_activity_accounts", "knowledge_document_versions", "knowledge_entities", "knowledge_entity_aliases", "knowledge_entries", "knowledge_entry_decisions", "knowledge_entry_links", "knowledge_entry_operations", "knowledge_entry_revisions", "knowledge_entry_search", "knowledge_entry_vectors", "knowledge_facts", "knowledge_index_jobs", "knowledge_lifecycle_events", "knowledge_memories", "knowledge_memory_lifecycle_events", "knowledge_memory_relationships", "knowledge_operation_receipts", "knowledge_providers", "knowledge_review_batches", "knowledge_source_acl_versions", "knowledge_source_objects", "knowledge_sources", "knowledge_sync_runs", "machine_metrics_latest", "machine_metrics_series", "machine_removal_operations", "managed_auth_actor_mutation_leases", "managed_auth_browser_installations", "managed_auth_login_return_intents", "managed_auth_login_slots", "managed_auth_login_transaction_rate_limits", "managed_auth_login_transactions", "managed_auth_session_set_operations", "managed_auth_session_sets", "managed_sign_in_method_operations", "mcp_connection_rate_limits", "mcp_event_subscriptions", "mcp_operations", "memory_slack_publication_configurations", "memory_slack_publication_receipts", "memory_slack_publications", "model_call_credit_holds", "model_call_fact_reconciliation_candidates", "model_call_fact_reconciliation_progress", "model_call_facts", "nango_usage_events", "network_routes", "new_session_drafts", "organization_agent_admin_access", "organization_api_key_workspaces", "organization_codex_rotation_settings", "organization_company_profile_agent_policies", "organization_company_profile_agent_policy_events", "organization_connectors", "organization_console_audit_events", "organization_console_roles", "organization_credential_providers", "organization_end_user_labels", "organization_end_user_profiles", "organization_identity_issuers", "organization_inference_residency", "organization_inference_residency_events", "organization_integration_policies", "organization_integration_policy_operations", "organization_invitation_binding_events", "organization_managed_workspaces", "organization_mcp_assertion_replays", "organization_mcp_connection_settings", "organization_mcp_trusted_issuer_events", "organization_mcp_trusted_issuer_subjects", "organization_mcp_trusted_issuers", "organization_membership_invitations", "organization_membership_lifecycle_events", "organization_membership_operation_receipts", "organization_memberships", "organization_model_defaults", "organization_model_provider_connection_operations", "organization_model_provider_connections", "organization_model_provider_custom_models", "organization_plans", "organization_privacy_preferences", "organization_private_session_setting_events", "organization_private_session_settings", "organization_profile_events", "organization_recovery_approvals", "organization_recovery_command_receipts", "organization_recovery_custodian_acceptances", "organization_recovery_custodians", "organization_recovery_events", "organization_recovery_notification_attempts", "organization_recovery_notification_outbox", "organization_recovery_operations", "organization_recovery_policies", "organization_recovery_policy_heads", "organization_service_accounts", "organization_session_review_settings", "organization_shared_workspace_administration_capabilities", "organization_skill_reach", "organization_tool_servers", "organization_user_resource_authorities", "organization_user_resource_grants", "organization_user_retention_deletion_events", "organization_user_retention_deletions", "organization_user_retention_object_deletion_receipts", "organization_user_retention_object_obligations", "organization_user_retention_policies", "organization_user_setup_deliveries", "organization_user_setup_delivery_attempts", "organization_user_setup_intents", "organization_webhook_deliveries", "organization_webhooks", "organization_workspace_lifecycle_events", "organization_workspace_operation_receipts", "personal_document_once_consumption_receipts", "personal_github_repository_selection_heads", "personal_github_repository_selection_operations", "personal_github_repository_selections", "personal_resource_once_consumption_receipts", "plan_credit_periods", "pr_review_app_registrations", "pr_review_managed_github_authority_nonces", "pr_review_repository_bindings", "preference_registry_events", "preference_registry_preferences", "preference_registry_revisions", "preference_registry_snapshots", "private_session_create_capabilities", "promotion_decisions", "promotion_enforcement", "promotion_machine_proofs", "recording_chunks", "recording_events", "recording_live_segments", "recording_live_unbacked_hours", "recording_notes", "recording_people", "recording_segment_edits", "recording_speaker_assignments", "recording_speaker_voices", "recording_tracks", "recording_transcript_piece_results", "recording_transcript_segments", "recording_transcript_versions", "recording_voice_rejections", "recording_voiceprints", "recordings", "remember_knowledge_confirmation_receipts", "remember_knowledge_memory_materializations", "retained_screenshot_artifacts", "rig_changes", "rig_versions", "rigs", "sandbox_checkpoint_artifacts", "sandbox_lease_holders", "sandbox_leases", "sandbox_pty_sessions", "sandbox_retained_processes", "sandbox_session_envelopes", "sandbox_workspace_mutation_admissions", "sandboxes", "scheduled_task_blocker_reviews", "scheduled_task_connection_authority_snapshots", "scheduled_task_event_inbox", "scheduled_task_event_occurrences", "scheduled_task_event_settings", "scheduled_task_personal_resource_authorities", "scheduled_task_personal_resource_snapshots", "scheduled_task_reusable_connection_materializations", "scheduled_task_revision_authorities", "scheduled_task_run_connection_authority_snapshots", "scheduled_task_run_personal_resource_admissions", "scheduled_task_run_personal_resource_once_receipts", "scheduled_task_run_personal_resource_snapshots", "scheduled_task_runs", "scheduled_task_schedule_outbox", "scheduled_tasks", "secret_approval_rules", "secret_use_approvals", "self_service_organization_setup_receipts", "session_admin_access", "session_attempt_codemode_calls", "session_attempt_connected_machine_authorizations", "session_attempt_interruptions", "session_attempt_machine_consents", "session_attempt_model_context_snapshots", "session_attempt_personal_document_admissions", "session_attempt_personal_document_snapshots", "session_attempt_personal_resource_admissions", "session_attempt_personal_resource_snapshots", "session_attempt_tool_catalogs", "session_background_commands", "session_command_receipts", "session_content_blobs", "session_event_cursors", "session_events", "session_goal_revisions", "session_goals", "session_history_items", "session_human_input_requests", "session_list_snapshots", "session_mcp_servers", "session_message_search_texts", "session_pending_tool_calls", "session_pins", "session_realtime_connections", "session_realtime_context_projections", "session_realtime_entries", "session_realtime_modes", "session_recordings", "session_share_links", "session_spawn_denials", "session_stream_acknowledgments", "session_system_update_outbox", "session_system_updates", "session_tenancy_activations", "session_tenancy_additional_organization_activation_evidence", "session_tenancy_greenfield_activation_evidence", "session_title_operations", "session_turn_app_action_grants", "session_turn_attempts", "session_turn_machine_consents", "session_turn_startup_milestones", "session_turns", "session_variable_set_attachments", "session_visibility_write_capabilities", "session_work_claim_revisions", "session_work_claim_write_capabilities", "session_work_claims", "session_workflow_wake_outbox", "sessions", "sidebar_layouts", "site_abuse_reports", "site_auth_codes", "site_auth_connections", "site_data_changes", "site_data_collections", "site_data_files", "site_data_insert_keys", "site_data_rate_windows", "site_data_record_values", "site_data_records", "site_data_usage", "site_data_validation_windows", "site_data_workspace_validation_windows", "site_hostname_holds", "site_hostnames", "site_limit_profiles", "site_opens", "site_platform_brake", "site_platform_storage", "site_platform_totals", "site_platform_usage", "site_project_placements", "site_publications", "site_runtime_conversations", "site_runtime_rate_windows", "site_runtime_usage", "site_session_access", "site_sidebar_states", "site_sql_databases", "site_sql_migrations", "site_sql_queries", "site_sql_rate_windows", "site_sql_usage", "site_tool_allowances", "site_tool_data_resets", "site_tool_data_sources", "site_viewer_sessions", "skill_config_conversion_receipts", "skill_source_bindings", "skill_write_receipts", "slack_agent_intro_posts", "slack_agent_proposals", "slack_agent_suggestions", "slack_agent_update_deliveries", "slack_agent_update_recipients", "slack_agent_update_settings", "slack_agent_user_states", "slack_app_home_refreshes", "slack_ask_forms", "slack_bot_delete_operations", "slack_bot_post_operations", "slack_bot_update_operations", "slack_bot_user_links", "slack_channel_routes", "slack_installation_bindings", "slack_interaction_action_handles", "slack_interaction_inbox", "slack_interaction_progress_deliveries", "slack_interactions", "slack_route_prompt_options", "slack_route_prompts", "slack_shared_task_origins", "slack_task_policy_activation_events", "slack_task_policy_heads", "slack_task_policy_revisions", "slack_user_dm_routes", "slack_user_link_access_request_operations", "slack_user_link_access_requests", "social_connections", "social_posts", "subscription_apps_designations", "subscription_capacity_waiters", "subscription_capacity_wake_outbox", "subscription_connection_aliases", "subscription_connection_assignment_policies", "subscription_connection_people", "subscription_connection_quota", "subscription_connection_workspaces", "subscription_connections", "subscription_leases", "subscription_operation_leases", "subscription_person_preferences", "subscription_provider_cutovers", "subscription_session_bindings", "subscription_settings", "subscription_turn_failures", "task_note_events", "task_note_knowledge_promotion_capabilities", "task_note_replacement_receipts", "task_note_write_capabilities", "task_notes", "teams_bot_chat_choices", "teams_bot_context_cutoffs", "teams_bot_context_messages", "teams_bot_inbox", "teams_bot_installations", "teams_bot_links", "teams_bot_onboarding_limits", "teams_bot_outbox", "teams_bot_proofs", "teams_bot_reply_claims", "teams_bot_route_prompt_options", "teams_bot_route_prompts", "teams_bot_routes", "teams_bot_welcomes", "temporal_schedule_cleanup_outbox", "tenancy_backfill_receipts", "tenancy_backfill_unresolved_rows", "tool_gateway_approval_capabilities", "transcription_recording_chunks", "transcription_recording_objects", "transcription_recording_segments", "transcription_recordings", "turn_connection_authority_snapshots", "turn_personal_resource_attachment_receipts", "turn_personal_resource_once_receipts", "turn_personal_resource_snapshots", "turn_timing_profiles", "usage_events", "vault_field_versions", "vault_item_fields", "vault_item_name_aliases", "vault_items", "vault_name_aliases", "vault_passkey_leases", "vaults", "video_generation_operations", "video_generation_references", "workspace_activity_events", "workspace_artifact_events", "workspace_artifact_uploads", "workspace_artifact_versions", "workspace_artifacts", "workspace_captures", "workspace_codex_subscription_preferences", "workspace_control_events", "workspace_credential_providers", "workspace_gateway_custom_models", "workspace_inference_controls", "workspace_instruction_policy_activation_events", "workspace_instruction_policy_deactivation_events", "workspace_instruction_policy_heads", "workspace_instruction_policy_onboarding_proposals", "workspace_instruction_policy_revisions", "workspace_instruction_policy_snapshots", "workspace_interaction_revisions", "workspace_learning_policy_activation_events", "workspace_learning_policy_heads", "workspace_learning_policy_revisions", "workspace_learning_policy_snapshots", "workspace_member_execution_defaults", "workspace_model_policies", "workspace_screenshot_quotas", "workspace_session_activity_revisions", "workspace_variable_set_variables", "workspace_variable_sets", "workspace_video_generation_policies", "workspace_video_generation_quotas", "workspace_webhook_deliveries", "workspace_webhooks", "xai_capacity_waiters", "xai_credential_leases", "xai_rotation_settings", "xai_session_account_pins", "xai_subscription_credentials"]; /** * Deployment-global and authentication tables used by ordinary API/worker * traffic. They intentionally do not carry workspace RLS: their access model * is implemented by the authentication/access layer or by exact global keys. */ export declare const NON_RLS_RUNTIME_TABLES: readonly ["auth_identities", "auth_passkeys", "auth_rate_limits", "auth_sessions", "auth_users", "auth_verifications", "automation_webhook_endpoints", "deployment_model_catalog", "event_ingress_routes", "integration_oauth_clients", "managed_accounts", "mcp_oauth_access_tokens", "mcp_oauth_authorization_codes", "mcp_oauth_authorization_requests", "mcp_oauth_clients", "mcp_oauth_refresh_tokens", "nested_agent_depth_configuration", "pr_review_managed_github_routes", "slack_api_rate_limits", "stripe_webhook_events", "workspace_memberships", "workspaces"]; /** * Exact full-CRUD class for the standalone runtime role. This is deliberately * explicit instead of being derived from FORCE_RLS_TABLES: adding a protected * table must not silently grant it broader DML than its migration intended. */ export declare const RUNTIME_FULL_DML_TABLES: readonly ["agent_call_host_phones", "agent_run_states", "agent_slack_installs", "agent_workspace_access", "agents", "api_keys", "app_package_exports", "app_server_runs", "app_sync_keys", "app_sync_queue", "app_sync_subscriptions", "app_webhooks", "audit_events", "auth_identities", "auth_passkeys", "auth_rate_limits", "auth_sessions", "auth_users", "auth_verifications", "automation_run_event_links", "automation_runs", "automation_sources", "automation_templates", "automation_trigger_events", "automation_trigger_revisions", "automation_triggers", "automation_webhook_endpoints", "billing_credit_alert_settings", "billing_credit_notification_deliveries", "billing_credit_notifications", "billing_customers", "browser_session_associations", "capability_catalog_items", "capability_component_owners", "capability_facet_installations", "capability_installations", "capability_operations", "capability_plugin_installations", "channels", "codex_apps_settings", "codex_capacity_waiters", "codex_credential_leases", "codex_reset_redemption_attempts", "codex_rotation_settings", "codex_subscription_credentials", "composer_drafts", "computer_session_associations", "connect_attempts", "connection_disconnect_operations", "connections", "connector_action_policies", "connector_action_requests", "credential_profiles", "credit_ledger_entries", "device_enrollment_requests", "document_bases", "document_chunks", "documents", "editable_artifact_replica_leases", "end_user_tool_credentials", "enrollment_token_redemptions", "enrollments", "event_deliveries", "event_ingress_routes", "event_source_feeds", "event_sources", "event_triggers", "file_uploads", "files", "generated_image_artifacts", "generated_video_artifacts", "github_installation_repositories", "github_installation_repository_removals", "github_installations", "host_mcp_bindings", "host_mcp_delegations", "image_generation_operations", "import_batches", "inbound_events", "integration_facet_binding_owners", "integration_facet_bindings", "integration_oauth_clients", "integration_oauth_pending_states", "integration_oauth_state_nonces", "machine_metrics_latest", "machine_metrics_series", "machine_removal_operations", "managed_accounts", "mcp_connection_rate_limits", "mcp_event_subscriptions", "mcp_oauth_access_tokens", "mcp_oauth_authorization_codes", "mcp_oauth_authorization_requests", "mcp_oauth_clients", "mcp_oauth_refresh_tokens", "memory_slack_publication_configurations", "memory_slack_publication_receipts", "memory_slack_publications", "model_call_credit_holds", "model_call_fact_reconciliation_candidates", "model_call_fact_reconciliation_progress", "model_call_facts", "new_session_drafts", "organization_agent_admin_access", "organization_api_key_workspaces", "organization_codex_rotation_settings", "organization_connectors", "organization_credential_providers", "organization_end_user_profiles", "organization_identity_issuers", "organization_managed_workspaces", "organization_mcp_assertion_replays", "organization_mcp_connection_settings", "organization_mcp_trusted_issuer_events", "organization_mcp_trusted_issuer_subjects", "organization_mcp_trusted_issuers", "organization_model_defaults", "organization_model_provider_connection_operations", "organization_model_provider_connections", "organization_model_provider_custom_models", "organization_privacy_preferences", "organization_service_accounts", "organization_session_review_settings", "organization_skill_reach", "organization_tool_servers", "organization_webhook_deliveries", "organization_webhooks", "pr_review_app_registrations", "pr_review_managed_github_routes", "pr_review_repository_bindings", "recording_chunks", "recording_live_segments", "recording_live_unbacked_hours", "recording_notes", "recording_people", "recording_segment_edits", "recording_speaker_assignments", "recording_speaker_voices", "recording_tracks", "recording_transcript_piece_results", "recording_transcript_segments", "recording_transcript_versions", "recording_voice_rejections", "recording_voiceprints", "recordings", "retained_screenshot_artifacts", "rig_changes", "rig_versions", "rigs", "sandbox_checkpoint_artifacts", "sandbox_lease_holders", "sandbox_leases", "sandbox_pty_sessions", "sandbox_retained_processes", "sandbox_session_envelopes", "sandbox_workspace_mutation_admissions", "sandboxes", "scheduled_task_blocker_reviews", "scheduled_task_event_inbox", "scheduled_task_event_occurrences", "scheduled_task_event_settings", "scheduled_task_schedule_outbox", "secret_approval_rules", "secret_use_approvals", "session_admin_access", "session_attempt_interruptions", "session_background_commands", "session_command_receipts", "session_event_cursors", "session_events", "session_goals", "session_history_items", "session_human_input_requests", "session_list_snapshots", "session_mcp_servers", "session_pending_tool_calls", "session_pins", "session_realtime_connections", "session_realtime_context_projections", "session_realtime_entries", "session_realtime_modes", "session_recordings", "session_share_links", "session_stream_acknowledgments", "session_system_update_outbox", "session_system_updates", "session_title_operations", "session_turn_app_action_grants", "session_turn_attempts", "session_turns", "session_workflow_wake_outbox", "sessions", "sidebar_layouts", "site_abuse_reports", "site_auth_codes", "site_data_changes", "site_data_collections", "site_data_files", "site_data_insert_keys", "site_data_rate_windows", "site_data_record_values", "site_data_records", "site_data_usage", "site_data_validation_windows", "site_data_workspace_validation_windows", "site_hostnames", "site_limit_profiles", "site_opens", "site_platform_brake", "site_platform_storage", "site_platform_totals", "site_platform_usage", "site_project_placements", "site_publications", "site_runtime_conversations", "site_runtime_rate_windows", "site_runtime_usage", "site_session_access", "site_sidebar_states", "site_sql_databases", "site_sql_migrations", "site_sql_queries", "site_sql_rate_windows", "site_sql_usage", "site_tool_allowances", "site_tool_data_sources", "site_viewer_sessions", "slack_agent_intro_posts", "slack_agent_proposals", "slack_agent_suggestions", "slack_agent_update_deliveries", "slack_agent_update_recipients", "slack_agent_update_settings", "slack_agent_user_states", "slack_api_rate_limits", "slack_app_home_refreshes", "slack_ask_forms", "slack_bot_delete_operations", "slack_bot_post_operations", "slack_bot_update_operations", "slack_bot_user_links", "slack_channel_routes", "slack_interaction_action_handles", "slack_interaction_inbox", "slack_interaction_progress_deliveries", "slack_interactions", "slack_route_prompt_options", "slack_route_prompts", "slack_user_dm_routes", "social_connections", "social_posts", "stripe_webhook_events", "subscription_apps_designations", "subscription_capacity_waiters", "subscription_capacity_wake_outbox", "subscription_connection_aliases", "subscription_connection_assignment_policies", "subscription_connection_people", "subscription_connection_quota", "subscription_connection_workspaces", "subscription_connections", "subscription_leases", "subscription_operation_leases", "subscription_person_preferences", "subscription_provider_cutovers", "subscription_session_bindings", "subscription_settings", "subscription_turn_failures", "teams_bot_chat_choices", "teams_bot_context_cutoffs", "teams_bot_context_messages", "teams_bot_inbox", "teams_bot_installations", "teams_bot_links", "teams_bot_onboarding_limits", "teams_bot_outbox", "teams_bot_proofs", "teams_bot_reply_claims", "teams_bot_route_prompt_options", "teams_bot_route_prompts", "teams_bot_routes", "teams_bot_welcomes", "tool_gateway_approval_capabilities", "transcription_recording_chunks", "transcription_recording_objects", "transcription_recording_segments", "transcription_recordings", "turn_timing_profiles", "usage_events", "video_generation_operations", "video_generation_references", "workspace_artifact_uploads", "workspace_artifacts", "workspace_captures", "workspace_codex_subscription_preferences", "workspace_control_events", "workspace_credential_providers", "workspace_gateway_custom_models", "workspace_inference_controls", "workspace_instruction_policy_heads", "workspace_member_execution_defaults", "workspace_memberships", "workspace_model_policies", "workspace_screenshot_quotas", "workspace_video_generation_policies", "workspace_video_generation_quotas", "workspace_webhook_deliveries", "workspace_webhooks", "workspaces"]; /** * A provider's legacy subscription tables once its drained cutover receipt * exists: kept for forensics, read-only for the runtime role. Role * provisioning grants them full DML only to a database without the receipt * (an older binary's world); this binary requires the receipt, so its * contract is SELECT only. */ export declare const SUBSCRIPTION_CUTOVER_READ_ONLY_TABLES: Readonly>; /** Configuration and lifecycle-owned audit rows are read-only at runtime. */ export declare const RUNTIME_READ_ONLY_TABLES: readonly ["billing_credit_notification_recipients", "billing_subscription_operations", "card_verification_gate_revisions", "codex_turn_source_bindings", "company_profile_activation_events", "company_profile_heads", "company_profile_snapshots", "deployment_model_catalog", "document_authority_reclassifications", "integration_backend_revisions", "knowledge_lifecycle_events", "knowledge_memories", "knowledge_memory_lifecycle_events", "knowledge_memory_relationships", "nested_agent_depth_configuration", "organization_inference_residency", "organization_integration_policies", "organization_integration_policy_operations", "organization_plans", "plan_credit_periods", "preference_registry_events", "preference_registry_snapshots", "promotion_decisions", "promotion_enforcement", "session_tenancy_activations", "session_work_claims", "site_hostname_holds", "skill_source_bindings", "skill_write_receipts", "slack_installation_bindings", "slack_task_policy_activation_events", "slack_task_policy_heads", "slack_task_policy_revisions", "workspace_instruction_policy_deactivation_events", "workspace_instruction_policy_snapshots", "workspace_learning_policy_activation_events", "workspace_learning_policy_heads", "workspace_learning_policy_revisions", "workspace_learning_policy_snapshots"]; /** Existing runtime authorities that may be observed and advanced, never created or deleted. */ export declare const RUNTIME_READ_UPDATE_TABLES: readonly ["workspace_session_activity_revisions"]; /** Append-only evidence/revision tables are insertable and queryable, never mutable. */ export declare const RUNTIME_READ_INSERT_TABLES: readonly ["agent_revisions", "app_notifications", "billing_auto_top_up_mutations", "browser_revision_components", "browser_revisions", "company_profile_revisions", "credit_debit_allocations", "editable_artifact_blob_refs", "editable_artifact_idempotency_receipts", "editable_artifact_live_outbox", "editable_artifact_materialization_jobs", "editable_artifact_materialization_results", "editable_artifact_operations", "editable_artifact_sequence_checkpoints", "editable_artifact_snapshots", "editable_artifact_transactions", "editable_artifact_undo_claims", "editable_artifact_versions", "external_link_task_authorities", "external_link_turn_authorities", "feedback_submissions", "host_mcp_resolver_operations", "host_mcp_task_authorities", "host_mcp_turn_authorities", "knowledge_change_proposals", "knowledge_claim_evidence", "knowledge_claim_relations", "knowledge_claim_reviews", "knowledge_claims", "knowledge_document_versions", "knowledge_entities", "knowledge_entity_aliases", "knowledge_facts", "knowledge_operation_receipts", "knowledge_providers", "knowledge_source_acl_versions", "knowledge_source_objects", "knowledge_sources", "knowledge_sync_runs", "nango_usage_events", "organization_console_audit_events", "organization_end_user_labels", "pr_review_managed_github_authority_nonces", "preference_registry_preferences", "preference_registry_revisions", "promotion_machine_proofs", "recording_events", "session_attempt_tool_catalogs", "session_content_blobs", "session_goal_revisions", "session_message_search_texts", "session_spawn_denials", "slack_shared_task_origins", "slack_user_link_access_request_operations", "temporal_schedule_cleanup_outbox", "workspace_activity_events", "workspace_artifact_events", "workspace_artifact_versions", "workspace_instruction_policy_activation_events", "workspace_instruction_policy_onboarding_proposals", "workspace_instruction_policy_revisions"]; /** Durable operation journals are append/read plus claim/settle updates, never deletes. */ export declare const RUNTIME_READ_INSERT_UPDATE_TABLES: readonly ["agent_calls", "agent_publish_operations", "attached_browser_devices", "attached_browser_inventories", "auth_runs", "billing_auto_top_up_operations", "billing_auto_top_up_settings", "billing_card_verifications", "browser_identities", "browser_session_retained_downloads", "browser_sessions", "browser_state_artifacts", "browser_state_uploads", "capability_api_facets", "capability_facets", "capability_integration_facets", "capability_mcp_facets", "capability_plugin_versions", "capability_plugins", "capability_skill_facets", "capability_skill_files", "computer_sessions", "editable_artifact_session_links", "editable_artifacts", "external_identity_links", "external_workspace_member_revocations", "host_mcp_resolvers", "integration_facet_definitions", "integration_spec_revisions", "integration_tools", "interaction_interventions", "interaction_operations", "interaction_resource_operations", "network_routes", "organization_console_roles", "scheduled_task_runs", "scheduled_tasks", "session_attempt_codemode_calls", "session_attempt_model_context_snapshots", "session_turn_startup_milestones", "site_auth_connections", "site_tool_data_resets", "slack_user_link_access_requests", "workspace_interaction_revisions"]; /** * These FORCE-RLS tables are owned by security-definer host-export routines. * The ordinary application role must have no direct table privileges on them. */ export declare const PROTECTED_NO_DIRECT_DML_TABLES: readonly ["additional_organization_creation_receipts", "agent_instruction_operations", "agent_learning_revisions", "agent_learning_snapshots", "canonical_human_identities", "canonical_human_identity_operations", "canonical_human_identity_subjects", "canonical_human_login_bindings", "company_brain_context_selection_receipts", "company_brain_preference_proposal_receipts", "company_brain_turn_context_snapshots", "company_profile_agent_automatic_activation_receipts", "company_profile_agent_confirmation_receipts", "company_profile_agent_proposal_receipts", "connection_use_audit_facts", "connection_use_once_consumption_receipts", "document_default_collection_backfill_operations", "document_default_collection_backfill_receipts", "document_default_collection_backfill_runs", "editable_artifact_live_tickets", "editable_artifact_scope_authorization_heads", "external_identities", "governed_learning_activation_receipts", "governed_learning_activation_undo_receipts", "governed_learning_decision_receipts", "host_export_config", "host_export_consumers", "host_export_cursor_state", "host_export_dead_letters", "host_export_outbox", "knowledge_collection_activity", "knowledge_collection_activity_accounts", "knowledge_entries", "knowledge_entry_decisions", "knowledge_entry_links", "knowledge_entry_operations", "knowledge_entry_revisions", "knowledge_entry_search", "knowledge_entry_vectors", "knowledge_index_jobs", "knowledge_review_batches", "managed_auth_actor_mutation_leases", "managed_auth_browser_installations", "managed_auth_login_return_intents", "managed_auth_login_slots", "managed_auth_login_transaction_rate_limits", "managed_auth_login_transactions", "managed_auth_session_set_operations", "managed_auth_session_sets", "managed_sign_in_method_operations", "mcp_operations", "organization_company_profile_agent_policies", "organization_company_profile_agent_policy_events", "organization_inference_residency_events", "organization_invitation_binding_events", "organization_membership_invitations", "organization_membership_lifecycle_events", "organization_membership_operation_receipts", "organization_memberships", "organization_private_session_setting_events", "organization_private_session_settings", "organization_profile_events", "organization_recovery_approvals", "organization_recovery_command_receipts", "organization_recovery_custodian_acceptances", "organization_recovery_custodians", "organization_recovery_events", "organization_recovery_notification_attempts", "organization_recovery_notification_outbox", "organization_recovery_operations", "organization_recovery_policies", "organization_recovery_policy_heads", "organization_shared_workspace_administration_capabilities", "organization_user_resource_authorities", "organization_user_resource_grants", "organization_user_retention_deletion_events", "organization_user_retention_deletions", "organization_user_retention_object_deletion_receipts", "organization_user_retention_object_obligations", "organization_user_retention_policies", "organization_user_setup_deliveries", "organization_user_setup_delivery_attempts", "organization_user_setup_intents", "organization_workspace_lifecycle_events", "organization_workspace_operation_receipts", "personal_document_once_consumption_receipts", "personal_github_repository_selection_heads", "personal_github_repository_selection_operations", "personal_github_repository_selections", "personal_resource_once_consumption_receipts", "private_session_create_capabilities", "remember_knowledge_confirmation_receipts", "remember_knowledge_memory_materializations", "scheduled_task_connection_authority_snapshots", "scheduled_task_personal_resource_authorities", "scheduled_task_personal_resource_snapshots", "scheduled_task_reusable_connection_materializations", "scheduled_task_revision_authorities", "scheduled_task_run_connection_authority_snapshots", "scheduled_task_run_personal_resource_admissions", "scheduled_task_run_personal_resource_once_receipts", "scheduled_task_run_personal_resource_snapshots", "self_service_organization_setup_receipts", "session_attempt_connected_machine_authorizations", "session_attempt_machine_consents", "session_attempt_personal_document_admissions", "session_attempt_personal_document_snapshots", "session_attempt_personal_resource_admissions", "session_attempt_personal_resource_snapshots", "session_tenancy_additional_organization_activation_evidence", "session_tenancy_greenfield_activation_evidence", "session_turn_machine_consents", "session_variable_set_attachments", "session_visibility_write_capabilities", "session_work_claim_revisions", "session_work_claim_write_capabilities", "skill_config_conversion_receipts", "task_note_events", "task_note_knowledge_promotion_capabilities", "task_note_replacement_receipts", "task_note_write_capabilities", "task_notes", "tenancy_backfill_receipts", "tenancy_backfill_unresolved_rows", "turn_connection_authority_snapshots", "turn_personal_resource_attachment_receipts", "turn_personal_resource_once_receipts", "turn_personal_resource_snapshots", "vault_field_versions", "vault_item_fields", "vault_item_name_aliases", "vault_items", "vault_name_aliases", "vault_passkey_leases", "vaults", "workspace_variable_set_variables", "workspace_variable_sets"]; export type RuntimeTableDmlPrivilege = "SELECT" | "INSERT" | "UPDATE" | "DELETE"; export type RuntimeTablePrivilegeContract = Readonly>; /** Exact per-table DML contract. Absence means no direct table privileges. */ export declare const RUNTIME_TABLE_PRIVILEGES: RuntimeTablePrivilegeContract; /** All tables with any direct runtime DML; retained as the aggregate public contract. */ export declare const RUNTIME_DML_TABLES: readonly string[]; export type RuntimeDatabasePostureOptions = { rlsStrategy: RlsStrategy; expectedRole?: string; targetSchema?: string; protectedTables?: readonly string[]; tablePrivileges?: RuntimeTablePrivilegeContract; protectedNoDirectDmlTables?: readonly string[]; targetSchemaCapabilityRoutines?: readonly string[]; targetSchemaForbiddenRoutines?: readonly string[]; /** Frozen binary contract; current callers require both additive Insights capabilities. */ modelFactCapabilityRoutines?: readonly string[]; /** * Only for checking a database migrated to an earlier point of the migration ledger, such as a * migration test's predecessor state. Contract tables named here may be absent because a later * migration creates them; when one is present it is checked like every other contract table. */ tablesCreatedByLaterMigrations?: readonly string[]; /** * The same, for runtime definers (named without their argument list): a definer a later * migration creates may be absent even though every table it works on already exists. When * one is present it is checked like every other definer. */ routinesCreatedByLaterMigrations?: readonly string[]; /** * The same, for owner-internal target-schema helpers (named without their argument list): * a helper a later migration creates may be absent. When one is present it is checked like * every other helper. */ targetRoutinesCreatedByLaterMigrations?: readonly string[]; }; export type RuntimeDatabaseIdentity = { currentUser: string; sessionUser: string; databaseOwner: string; canConnectDatabase: boolean; canCreateInDatabase: boolean; rowSecurity: string; canLogin: boolean; superuser: boolean; inherit: boolean; createRole: boolean; createDatabase: boolean; replication: boolean; bypassRls: boolean; }; export type RuntimeSchemaPosture = { name: string; owner: string; usage: boolean; create: boolean; }; export type RuntimeTablePosture = { name: string; owner: string; rlsEnabled: boolean; rlsForced: boolean; rlsActive: boolean; policyCount: number; artifactOutboxDispatcherPolicy: boolean; artifactMaterializerPolicy: boolean; select: boolean; insert: boolean; update: boolean; delete: boolean; truncate: boolean; references: boolean; trigger: boolean; /** Effective column ACLs, kept separate so they cannot satisfy table grants. */ columnPrivileges?: string[]; extraPrivileges?: string[]; hasInheritance?: boolean | undefined; }; export type RuntimeRoutinePosture = { name: string; owner: string; execute: boolean; publicExecute?: boolean; securityDefiner: boolean; triggerCallable?: boolean | undefined; hasDependents?: boolean | undefined; configuration?: string[] | null; }; export type RuntimeTargetRoutinePosture = RuntimeRoutinePosture & { publicExecute: boolean; }; export type RuntimePrivateTablePosture = { name: string; owner: string; rlsEnabled?: boolean; rlsForced?: boolean; rlsActive?: boolean; policyCount?: number; select: boolean; insert: boolean; update: boolean; delete: boolean; truncate?: boolean; references?: boolean; trigger?: boolean; /** Effective relation ACL privileges not represented by the named flags. */ extraPrivileges?: string[]; columnPrivileges?: string[]; hasInheritance?: boolean | undefined; }; export type RuntimeDatabasePosture = { identity: RuntimeDatabaseIdentity; /** Privilege-bearing role relationships; exact PG16+ management-only grants are excluded. */ memberships: string[]; schemas: RuntimeSchemaPosture[]; ownedSchemas: string[]; ownedRelations: string[]; tables: RuntimeTablePosture[]; privateTables: RuntimePrivateTablePosture[]; targetRoutines: RuntimeTargetRoutinePosture[]; privateRoutines: RuntimeRoutinePosture[]; /** Separate owner-only schema: not part of the previous binary's runtime API inventory. */ subscriptionOwnerRoutines?: RuntimeRoutinePosture[]; sessionVariableSetAttachmentsCutoverPresent: boolean; /** * Retired subscription objects (SUBSCRIPTION_RETIRED_ROUTINES, _POLICIES and * _TRIGGERS, and the Codex names of SUBSCRIPTION_RENAMED_*) the database * still holds; empty once migration 0751 applied. */ retiredSubscriptionObjects: string[]; /** Migration 0689: Codex runs on the shared subscription core. */ subscriptionCodexCutoverActivationPresent: boolean; /** * Providers of SUBSCRIPTION_PROVIDER_CUTOVER_MIGRATIONS whose cutover * receipt the database holds (migration 0712's readiness function). */ subscriptionProviderCutoverReceipts: string[]; /** Catalog evidence for dropping receipts only after their feature tables. */ retiringFeatureTablesPresent?: { subscription: boolean; variableSets: boolean; }; }; export declare class RuntimeDatabasePostureError extends Error { readonly violations: readonly string[]; constructor(violations: readonly string[]); } /** Posture/configuration mismatches cannot heal through connection backoff. */ export declare function isRetryableRuntimeDatabaseStartupError(error: unknown): boolean; /** The part of a standalone posture read only from schema, privilege and role catalogs. */ type RuntimeCatalogPosture = Pick; /** * The catalog part of the latest standalone inspection and the catalog * fingerprint it was read under. One per readiness check: repeated probes * re-read the catalogs only when the fingerprint changed. */ export type RuntimeDatabaseCatalogPostureCache = { entry?: { key: string; catalog: RuntimeCatalogPosture; }; }; export declare function createRuntimeDatabaseCatalogPostureCache(): RuntimeDatabaseCatalogPostureCache; /** * Inspect PostgreSQL catalogs plus one value-free global activation predicate; no tenant content. * With `catalogCache`, the standalone catalog queries run again only when the * catalog fingerprint changed since the cached inspection; identity, * activation predicates, retired objects and cutover receipts are always read live. */ export declare function inspectRuntimeDatabasePosture(db: Database, options: RuntimeDatabasePostureOptions, catalogCache?: RuntimeDatabaseCatalogPostureCache): Promise; /** Private per-task usage accounting; FORCE-RLS, owner-only. */ export declare const RUNTIME_SESSION_USAGE_LIMIT_PRIVATE_TABLES: readonly ["session_usage_limit_roots", "session_usage_limit_receipts", "session_usage_limit_config_receipts"]; /** Additive private inventory; absent from older binaries' exact data tables. */ export declare const RUNTIME_ALLOWANCE_PRIVATE_TABLES: readonly ["workspace_usage_allowances", "workspace_member_allowances", "workspace_allowance_grants", "workspace_allowance_counters", "workspace_allowance_periods", "workspace_allowance_notifications", "usage_allowance_attribution_receipts", "workspace_video_allowance_allocations", "workspace_allowance_clear_receipts"]; /** * Pure deterministic evaluator used by startup/readiness and unit tests. * * Invariant for {@link classifyRuntimeDatabasePosture}: a missing runtime * EXECUTE grant may only ADD findings. Never let `execute === false` skip, * guard or select another check (for example `if (routine.execute) continue;` * ahead of owner or search_path checks, or an unsafe check nested under * `if (!routine.execute)`): the classifier would see that unsafe finding * disappear once the grant is present and report it as degraded. Use * `!execute` only as a direct term of the finding's own condition. */ export declare function evaluateRuntimeDatabasePosture(catalogPosture: RuntimeDatabasePosture, options: RuntimeDatabasePostureOptions): string[]; export declare function assertRuntimeDatabasePosture(db: Database, options: RuntimeDatabasePostureOptions): Promise; /** * Findings of {@link evaluateRuntimeDatabasePosture}, split by what they mean * for a running process. Together they are exactly the strict findings. * * - `fatal`: unsafe or unknowable posture (excess or PUBLIC privileges, wrong * owner, search_path or RLS, forbidden roles or memberships, missing CONNECT * or schema USAGE, missing or ambiguous objects, failed shape checks). * - `degraded`: findings caused only by the runtime role lacking an EXECUTE * grant that this binary's contract requires. Only the features behind those * routines fail (PostgreSQL refuses the call); nothing is exposed. */ export type RuntimeDatabasePostureFindings = { fatal: string[]; degraded: string[]; }; /** * Classifies the strict findings for runtime startup and readiness. A finding * is degraded only when granting the missing contract-required EXECUTE grants * removes it and raises no finding the actual catalog does not already have * (a grant that would expose another problem means the missing grant was * hiding it, so everything stays fatal). This holds for every check, present * and future, without tagging individual messages. * * Release and CI gates (the posture CLI, the compatibility workflow, the * previous-binary checks) keep using {@link evaluateRuntimeDatabasePosture}, * where every finding fails. */ export declare function classifyRuntimeDatabasePosture(posture: RuntimeDatabasePosture, options: RuntimeDatabasePostureOptions): RuntimeDatabasePostureFindings; /** Receives the degraded findings of every runtime readiness inspection (empty when none). */ export type RuntimeDatabaseDegradedListener = (degraded: readonly string[]) => void; /** * The startup and readiness form of {@link assertRuntimeDatabasePosture}: it * throws {@link RuntimeDatabasePostureError} with the fatal findings only. * Degraded findings (a missing required EXECUTE grant) go to `onDegraded` * and do not make the process unready: one withheld or revoked grant must not * take every pod out of service for one feature. */ export declare function assertRuntimeDatabaseReadiness(db: Database, options: RuntimeDatabasePostureOptions, onDegraded?: RuntimeDatabaseDegradedListener, catalogCache?: RuntimeDatabaseCatalogPostureCache): Promise<{ posture: RuntimeDatabasePosture; degraded: string[]; }>; export type RuntimeDatabaseDegradedObserver = { warn(message: string, attributes: Record): void; info(message: string, attributes: Record): void; setGauge(input: { name: string; help?: string; value: number; }): void; }; /** * Degraded findings of the latest completed posture inspection in this * process. An inspection that throws (database unreachable, a fatal finding * still reports first) leaves the previous value. */ export declare const RUNTIME_DATABASE_DEGRADED_GAUGE = "opengeni_runtime_database_degraded_findings"; /** At most this many findings are named in one log line; the count is exact. */ export declare const RUNTIME_DATABASE_DEGRADED_LOG_FINDINGS = 20; /** A persisting degraded posture is logged again at most this often. */ export declare const RUNTIME_DATABASE_DEGRADED_LOG_INTERVAL_MS: number; /** * Reports degraded runtime posture: the gauge holds the number of degraded * findings of the latest completed inspection; a structured warning names them when * they change, and again at most every * {@link RUNTIME_DATABASE_DEGRADED_LOG_INTERVAL_MS} while they persist; an * info line records recovery. Use one reporter per process for startup and * readiness, so a pod logs a degraded posture once, not once per path. */ export declare function reportRuntimeDatabaseDegraded(observability: RuntimeDatabaseDegradedObserver, source: string, options?: { logIntervalMs?: number; now?: () => number; }): RuntimeDatabaseDegradedListener; export declare function runtimeDatabaseReadyCheck(db: Database, options: RuntimeDatabasePostureOptions, onDegraded?: RuntimeDatabaseDegradedListener): () => Promise; export {};