@opengeni/db 0.31.1 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-auth.d.ts +209 -1
- package/dist/browser-downloads.d.ts +51 -0
- package/dist/browser-identities.d.ts +11 -2
- package/dist/browser-sessions.d.ts +83 -1
- package/dist/browser-state-artifacts.d.ts +75 -1
- package/dist/canonical-human-identities.d.ts +48 -0
- package/dist/canonical-human-identities.js +28 -0
- package/dist/canonical-human-identities.js.map +1 -0
- package/dist/capability-integrations.d.ts +8 -6
- package/dist/{chunk-MWDVXQOL.js → chunk-5KTIEDX7.js} +5773 -4212
- package/dist/chunk-5KTIEDX7.js.map +1 -0
- package/dist/{chunk-NBE6CHRI.js → chunk-CQZ4QSP5.js} +49 -9
- package/dist/chunk-CQZ4QSP5.js.map +1 -0
- package/dist/chunk-F32YT7MP.js +117 -0
- package/dist/chunk-F32YT7MP.js.map +1 -0
- package/dist/{chunk-ISI2TIUG.js → chunk-JC5QPLUM.js} +30 -3
- package/dist/chunk-JC5QPLUM.js.map +1 -0
- package/dist/{chunk-F5FT7BEZ.js → chunk-P3RE4D2B.js} +2 -2
- package/dist/chunk-TAUTWOS5.js +259 -0
- package/dist/chunk-TAUTWOS5.js.map +1 -0
- package/dist/{chunk-YHZXQ7HP.js → chunk-VKLB2ZGI.js} +446 -19
- package/dist/chunk-VKLB2ZGI.js.map +1 -0
- package/dist/database.d.ts +5 -0
- package/dist/editable-artifact-durable-export.js +2 -2
- package/dist/editable-artifacts.js +3 -3
- package/dist/index.d.ts +438 -29
- package/dist/index.js +35640 -28969
- package/dist/index.js.map +1 -1
- package/dist/insights.d.ts +23 -7
- package/dist/integration-bindings.d.ts +24 -24
- package/dist/integration-facets.d.ts +99 -0
- package/dist/interaction-revisions.d.ts +11 -0
- package/dist/interaction-schema.d.ts +698 -34
- package/dist/provision-roles.js +1 -1
- package/dist/runtime-posture.d.ts +8 -7
- package/dist/schema.d.ts +9464 -5412
- package/dist/schema.js +51 -9
- package/dist/session-control.d.ts +29 -3
- package/dist/session-tenancy.d.ts +44 -0
- package/dist/session-tenancy.js +16 -0
- package/dist/session-tenancy.js.map +1 -0
- package/dist/slack-task-policy-schema.d.ts +847 -0
- package/dist/slack-task-policy.d.ts +65 -0
- package/dist/task-notes-schema.d.ts +924 -0
- package/dist/task-notes.d.ts +85 -0
- package/dist/video-generation.d.ts +9 -0
- package/dist/video-generation.js +5 -3
- package/dist/xai-subscription.d.ts +326 -0
- package/drizzle/0212_browser_state_transfer_hardening.sql +560 -0
- package/drizzle/0213_browser_interaction_authority.sql +67 -0
- package/drizzle/0214_browser_download_saves.sql +34 -0
- package/drizzle/0215_browser_controller_host.sql +385 -0
- package/drizzle/0216_browser_auth_health_evidence.sql +137 -0
- package/drizzle/0217_external_browser_auth_operations.sql +22 -0
- package/drizzle/0218_organization_tenancy_foundation.sql +299 -0
- package/drizzle/0219_organization_tenancy_managed_human_provisioning.sql +317 -0
- package/drizzle/0219_site_auth_maintenance_sessions.sql +234 -0
- package/drizzle/0220_memory_slack_append_only_cascade.sql +38 -0
- package/drizzle/0220_session_channels.sql +54 -0
- package/drizzle/0221_sessions_channel_index.sql +5 -0
- package/drizzle/0222_session_visibility_authority_epochs.sql +158 -0
- package/drizzle/0222_sessions_channel_fk.sql +89 -0
- package/drizzle/0223_pending_tool_event_output.sql +55 -0
- package/drizzle/0223_sessions_channel_fk_validate.sql +118 -0
- package/drizzle/0224_slack_post_outcome_reconciliation.sql +123 -0
- package/drizzle/0225_session_visibility_fork_activation.sql +1363 -0
- package/drizzle/0226_personal_codex_authority_foundation.sql +365 -0
- package/drizzle/0227_slack_native_actions.sql +145 -0
- package/drizzle/0228_interaction_controller_data_plane.sql +14 -0
- package/drizzle/0228_slack_task_policy.sql +400 -0
- package/drizzle/0229_slack_inbox_file_fact.sql +10 -0
- package/drizzle/0230_user_scoped_variable_sets_rigs.sql +84 -0
- package/drizzle/0231_integration_definition_identity_cutover.sql +271 -0
- package/drizzle/0232_integration_facet_authority_cutover.sql +610 -0
- package/drizzle/0233_skill_and_integration_authority_cutover.sql +1162 -0
- package/drizzle/0234_xai_subscription_authority.sql +1139 -0
- package/drizzle/0235_canonical_human_login_bindings.sql +920 -0
- package/drizzle/0236_browser_identity_lifecycle.sql +39 -0
- package/drizzle/0236_session_visibility_slack_policy.sql +72 -0
- package/drizzle/0237_interaction_transition_reaper.sql +263 -0
- package/drizzle/0238_goal_persistence_policy.sql +471 -0
- package/drizzle/0238_supergrok_realtime_model.sql +29 -0
- package/drizzle/0239_supergrok_video_funding.sql +50 -0
- package/drizzle/0239_task_tree_notes.sql +990 -0
- package/package.json +13 -5
- package/src/browser-auth.ts +2600 -123
- package/src/browser-downloads.ts +517 -0
- package/src/browser-identities.ts +220 -3
- package/src/browser-sessions.ts +334 -45
- package/src/browser-state-artifacts.ts +402 -12
- package/src/canonical-human-identities.ts +317 -0
- package/src/capability-integrations.ts +121 -213
- package/src/database.ts +41 -1
- package/src/index.ts +4157 -394
- package/src/insights.ts +109 -28
- package/src/integration-bindings.ts +101 -101
- package/src/{integration-features.ts → integration-facets.ts} +187 -184
- package/src/interaction-revisions.ts +33 -3
- package/src/interaction-schema.ts +311 -8
- package/src/pack-components.ts +43 -43
- package/src/pack-installations.ts +0 -43
- package/src/plugin-packages.ts +9 -9
- package/src/provision-roles.ts +232 -0
- package/src/runtime-posture.ts +227 -14
- package/src/schema.ts +1188 -75
- package/src/session-control.ts +122 -37
- package/src/session-queue-commands.ts +78 -1
- package/src/session-tenancy.ts +188 -0
- package/src/session-tool-call-settlement.ts +9 -3
- package/src/slack-task-policy-schema.ts +130 -0
- package/src/slack-task-policy.ts +341 -0
- package/src/task-notes-schema.ts +135 -0
- package/src/task-notes.ts +178 -0
- package/src/video-generation.ts +90 -12
- package/src/workspace-artifacts.ts +1 -1
- package/src/xai-subscription.ts +1887 -0
- package/dist/chunk-ISI2TIUG.js.map +0 -1
- package/dist/chunk-MWDVXQOL.js.map +0 -1
- package/dist/chunk-NBE6CHRI.js.map +0 -1
- package/dist/chunk-YHZXQ7HP.js.map +0 -1
- package/dist/integration-features.d.ts +0 -99
- /package/dist/{chunk-F5FT7BEZ.js.map → chunk-P3RE4D2B.js.map} +0 -0
package/src/runtime-posture.ts
CHANGED
|
@@ -48,11 +48,88 @@ const KNOWLEDGE_SOURCE_SYNC_LOCK_AUTHORITY_TABLES = [
|
|
|
48
48
|
"knowledge_sources",
|
|
49
49
|
"knowledge_source_objects",
|
|
50
50
|
] as const;
|
|
51
|
+
const MANAGED_HUMAN_PERSONAL_WORKSPACE_ROUTINE =
|
|
52
|
+
"ensure_managed_human_personal_workspace(uuid, text, uuid)";
|
|
53
|
+
const MANAGED_HUMAN_PERSONAL_WORKSPACE_AUTHORITY_TABLES = [
|
|
54
|
+
"organization_memberships",
|
|
55
|
+
"organization_user_retention_policies",
|
|
56
|
+
"organization_user_resource_authorities",
|
|
57
|
+
"organization_user_resource_grants",
|
|
58
|
+
] as const;
|
|
59
|
+
const CANONICAL_HUMAN_IDENTITY_ROUTINES = [
|
|
60
|
+
"ensure_canonical_human_identity(text, text)",
|
|
61
|
+
"validate_canonical_human_session(text, text, boolean)",
|
|
62
|
+
"get_canonical_human_identity_projection(text)",
|
|
63
|
+
"apply_canonical_human_identity_operation(uuid, text, bigint, text, uuid, text, text, text)",
|
|
64
|
+
] as const;
|
|
65
|
+
const CANONICAL_HUMAN_IDENTITY_AUTHORITY_TABLES = [
|
|
66
|
+
"canonical_human_identities",
|
|
67
|
+
"canonical_human_identity_subjects",
|
|
68
|
+
"canonical_human_login_bindings",
|
|
69
|
+
"canonical_human_identity_operations",
|
|
70
|
+
] as const;
|
|
71
|
+
const SESSION_PRIVATE_ACTOR_VISIBLE_ROUTINE =
|
|
72
|
+
"session_private_actor_visible(uuid, uuid, uuid, text)";
|
|
73
|
+
const SESSION_REFERENCE_VISIBLE_ROUTINE = "session_reference_visible(uuid, uuid, uuid)";
|
|
74
|
+
const TASK_NOTE_CAPABILITY_ROUTINES = [
|
|
75
|
+
"create_task_note_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, text, integer)",
|
|
76
|
+
"archive_task_note_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, integer, text)",
|
|
77
|
+
"list_task_notes_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, boolean, integer)",
|
|
78
|
+
] as const;
|
|
79
|
+
const TRANSITION_SESSION_VISIBILITY_ROUTINE =
|
|
80
|
+
"transition_session_visibility(uuid, uuid, uuid, text, text, integer, text, text)";
|
|
81
|
+
const FORK_SESSION_CONTENT_ROUTINE =
|
|
82
|
+
"fork_session_content(uuid, uuid, uuid, text, uuid, text, text, text)";
|
|
83
|
+
const SESSION_AUTHORITY_ROUTINES = new Set<string>([
|
|
84
|
+
FORK_SESSION_CONTENT_ROUTINE,
|
|
85
|
+
SESSION_PRIVATE_ACTOR_VISIBLE_ROUTINE,
|
|
86
|
+
SESSION_REFERENCE_VISIBLE_ROUTINE,
|
|
87
|
+
TRANSITION_SESSION_VISIBILITY_ROUTINE,
|
|
88
|
+
...TASK_NOTE_CAPABILITY_ROUTINES,
|
|
89
|
+
]);
|
|
90
|
+
const XAI_CREATE_CREDENTIAL_ROUTINE =
|
|
91
|
+
"create_xai_subscription_credential(uuid, uuid, text, text, text, text, text, text, text, timestamp with time zone)";
|
|
92
|
+
const XAI_DISCONNECT_CREDENTIAL_ROUTINE =
|
|
93
|
+
"disconnect_xai_subscription_credential(uuid, uuid, text, uuid, jsonb)";
|
|
94
|
+
const XAI_SNAPSHOT_VALIDATOR_ROUTINE = "xai_provider_account_authority_snapshot_v1_valid(jsonb)";
|
|
95
|
+
const XAI_AUTHORITY_LIVE_ROUTINE =
|
|
96
|
+
"xai_subscription_authority_live(uuid, uuid, text, uuid, text, uuid, uuid, bigint)";
|
|
97
|
+
const XAI_POOL_VISIBLE_ROUTINE = "xai_subscription_pool_visible(uuid, uuid, text, text, uuid)";
|
|
98
|
+
const XAI_RESOLVE_POOL_ROUTINE = "resolve_xai_authority_pool(uuid, uuid, text, jsonb)";
|
|
99
|
+
const XAI_REVALIDATE_CREDENTIAL_ROUTINE =
|
|
100
|
+
"revalidate_xai_subscription_authority(uuid, text, uuid, jsonb)";
|
|
101
|
+
const XAI_AUTHORITY_TABLES = [
|
|
102
|
+
"organization_memberships",
|
|
103
|
+
"organization_user_resource_authorities",
|
|
104
|
+
"workspace_memberships",
|
|
105
|
+
"xai_subscription_credentials",
|
|
106
|
+
] as const;
|
|
51
107
|
|
|
52
108
|
export const RUNTIME_TARGET_SCHEMA_CAPABILITY_ROUTINES = [
|
|
109
|
+
FORK_SESSION_CONTENT_ROUTINE,
|
|
110
|
+
XAI_AUTHORITY_LIVE_ROUTINE,
|
|
111
|
+
XAI_CREATE_CREDENTIAL_ROUTINE,
|
|
112
|
+
XAI_DISCONNECT_CREDENTIAL_ROUTINE,
|
|
53
113
|
KNOWLEDGE_SOURCE_SYNC_LOCK_AUTHORITY_ROUTINE,
|
|
114
|
+
MANAGED_HUMAN_PERSONAL_WORKSPACE_ROUTINE,
|
|
115
|
+
...CANONICAL_HUMAN_IDENTITY_ROUTINES,
|
|
116
|
+
SESSION_PRIVATE_ACTOR_VISIBLE_ROUTINE,
|
|
117
|
+
SESSION_REFERENCE_VISIBLE_ROUTINE,
|
|
118
|
+
TRANSITION_SESSION_VISIBILITY_ROUTINE,
|
|
119
|
+
XAI_POOL_VISIBLE_ROUTINE,
|
|
120
|
+
XAI_RESOLVE_POOL_ROUTINE,
|
|
121
|
+
XAI_REVALIDATE_CREDENTIAL_ROUTINE,
|
|
122
|
+
XAI_SNAPSHOT_VALIDATOR_ROUTINE,
|
|
54
123
|
] as const;
|
|
55
124
|
|
|
125
|
+
export const RUNTIME_TARGET_SCHEMA_INVOKER_ROUTINES = [
|
|
126
|
+
SESSION_REFERENCE_VISIBLE_ROUTINE,
|
|
127
|
+
XAI_SNAPSHOT_VALIDATOR_ROUTINE,
|
|
128
|
+
] as const;
|
|
129
|
+
const RUNTIME_TARGET_SCHEMA_INVOKER_ROUTINE_SET = new Set<string>(
|
|
130
|
+
RUNTIME_TARGET_SCHEMA_INVOKER_ROUTINES,
|
|
131
|
+
);
|
|
132
|
+
|
|
56
133
|
/**
|
|
57
134
|
* The complete standalone tenant-table contract. Adding or removing a
|
|
58
135
|
* FORCE-RLS table is an architectural change: update this list in the same
|
|
@@ -72,6 +149,11 @@ export const FORCE_RLS_TABLES = [
|
|
|
72
149
|
"browser_session_associations",
|
|
73
150
|
"browser_sessions",
|
|
74
151
|
"browser_state_artifacts",
|
|
152
|
+
"browser_state_uploads",
|
|
153
|
+
"canonical_human_identities",
|
|
154
|
+
"canonical_human_identity_operations",
|
|
155
|
+
"canonical_human_identity_subjects",
|
|
156
|
+
"canonical_human_login_bindings",
|
|
75
157
|
"capability_api_facets",
|
|
76
158
|
"capability_catalog_items",
|
|
77
159
|
"capability_component_owners",
|
|
@@ -86,6 +168,7 @@ export const FORCE_RLS_TABLES = [
|
|
|
86
168
|
"capability_plugins",
|
|
87
169
|
"capability_skill_facets",
|
|
88
170
|
"capability_skill_files",
|
|
171
|
+
"channels",
|
|
89
172
|
"codex_apps_settings",
|
|
90
173
|
"codex_capacity_waiters",
|
|
91
174
|
"codex_credential_leases",
|
|
@@ -138,9 +221,9 @@ export const FORCE_RLS_TABLES = [
|
|
|
138
221
|
"host_export_outbox",
|
|
139
222
|
"image_generation_operations",
|
|
140
223
|
"import_batches",
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
"
|
|
224
|
+
"integration_facet_binding_owners",
|
|
225
|
+
"integration_facet_bindings",
|
|
226
|
+
"integration_facet_definitions",
|
|
144
227
|
"integration_oauth_state_nonces",
|
|
145
228
|
"integration_spec_revisions",
|
|
146
229
|
"integration_tools",
|
|
@@ -180,6 +263,10 @@ export const FORCE_RLS_TABLES = [
|
|
|
180
263
|
"model_call_facts",
|
|
181
264
|
"network_routes",
|
|
182
265
|
"new_session_drafts",
|
|
266
|
+
"organization_memberships",
|
|
267
|
+
"organization_user_resource_authorities",
|
|
268
|
+
"organization_user_resource_grants",
|
|
269
|
+
"organization_user_retention_policies",
|
|
183
270
|
"pack_installation_components",
|
|
184
271
|
"pack_installations",
|
|
185
272
|
"preference_registry_events",
|
|
@@ -205,6 +292,7 @@ export const FORCE_RLS_TABLES = [
|
|
|
205
292
|
"session_attempt_tool_catalogs",
|
|
206
293
|
"session_command_receipts",
|
|
207
294
|
"session_events",
|
|
295
|
+
"session_goal_revisions",
|
|
208
296
|
"session_goals",
|
|
209
297
|
"session_history_items",
|
|
210
298
|
"session_human_input_requests",
|
|
@@ -223,20 +311,30 @@ export const FORCE_RLS_TABLES = [
|
|
|
223
311
|
"session_system_updates",
|
|
224
312
|
"session_turn_attempts",
|
|
225
313
|
"session_turns",
|
|
314
|
+
"session_visibility_write_capabilities",
|
|
226
315
|
"session_workflow_wake_outbox",
|
|
227
316
|
"sessions",
|
|
228
317
|
"site_auth_connections",
|
|
229
318
|
"slack_bot_delete_operations",
|
|
230
319
|
"slack_bot_post_operations",
|
|
320
|
+
"slack_bot_update_operations",
|
|
231
321
|
"slack_bot_user_links",
|
|
232
322
|
"slack_installation_bindings",
|
|
323
|
+
"slack_interaction_action_handles",
|
|
233
324
|
"slack_interaction_inbox",
|
|
234
325
|
"slack_interaction_progress_deliveries",
|
|
235
326
|
"slack_interactions",
|
|
327
|
+
"slack_shared_task_origins",
|
|
328
|
+
"slack_task_policy_activation_events",
|
|
329
|
+
"slack_task_policy_heads",
|
|
330
|
+
"slack_task_policy_revisions",
|
|
236
331
|
"slack_user_link_access_request_operations",
|
|
237
332
|
"slack_user_link_access_requests",
|
|
238
333
|
"social_connections",
|
|
239
334
|
"social_posts",
|
|
335
|
+
"task_note_events",
|
|
336
|
+
"task_note_write_capabilities",
|
|
337
|
+
"task_notes",
|
|
240
338
|
"temporal_schedule_cleanup_outbox",
|
|
241
339
|
"transcription_recording_chunks",
|
|
242
340
|
"transcription_recording_objects",
|
|
@@ -269,6 +367,11 @@ export const FORCE_RLS_TABLES = [
|
|
|
269
367
|
"workspace_variable_sets",
|
|
270
368
|
"workspace_video_generation_policies",
|
|
271
369
|
"workspace_video_generation_quotas",
|
|
370
|
+
"xai_capacity_waiters",
|
|
371
|
+
"xai_credential_leases",
|
|
372
|
+
"xai_rotation_settings",
|
|
373
|
+
"xai_session_account_pins",
|
|
374
|
+
"xai_subscription_credentials",
|
|
272
375
|
] as const;
|
|
273
376
|
|
|
274
377
|
/**
|
|
@@ -312,6 +415,7 @@ export const RUNTIME_FULL_DML_TABLES = [
|
|
|
312
415
|
"capability_installations",
|
|
313
416
|
"capability_operations",
|
|
314
417
|
"capability_plugin_installations",
|
|
418
|
+
"channels",
|
|
315
419
|
"codex_apps_settings",
|
|
316
420
|
"codex_capacity_waiters",
|
|
317
421
|
"codex_credential_leases",
|
|
@@ -339,8 +443,8 @@ export const RUNTIME_FULL_DML_TABLES = [
|
|
|
339
443
|
"github_installations",
|
|
340
444
|
"image_generation_operations",
|
|
341
445
|
"import_batches",
|
|
342
|
-
"
|
|
343
|
-
"
|
|
446
|
+
"integration_facet_binding_owners",
|
|
447
|
+
"integration_facet_bindings",
|
|
344
448
|
"integration_oauth_clients",
|
|
345
449
|
"integration_oauth_state_nonces",
|
|
346
450
|
"knowledge_memories",
|
|
@@ -398,7 +502,9 @@ export const RUNTIME_FULL_DML_TABLES = [
|
|
|
398
502
|
"sessions",
|
|
399
503
|
"slack_bot_delete_operations",
|
|
400
504
|
"slack_bot_post_operations",
|
|
505
|
+
"slack_bot_update_operations",
|
|
401
506
|
"slack_bot_user_links",
|
|
507
|
+
"slack_interaction_action_handles",
|
|
402
508
|
"slack_interaction_inbox",
|
|
403
509
|
"slack_interaction_progress_deliveries",
|
|
404
510
|
"slack_interactions",
|
|
@@ -426,6 +532,11 @@ export const RUNTIME_FULL_DML_TABLES = [
|
|
|
426
532
|
"workspace_video_generation_policies",
|
|
427
533
|
"workspace_video_generation_quotas",
|
|
428
534
|
"workspaces",
|
|
535
|
+
"xai_capacity_waiters",
|
|
536
|
+
"xai_credential_leases",
|
|
537
|
+
"xai_rotation_settings",
|
|
538
|
+
"xai_session_account_pins",
|
|
539
|
+
"xai_subscription_credentials",
|
|
429
540
|
] as const;
|
|
430
541
|
|
|
431
542
|
/** Configuration and lifecycle-owned audit rows are read-only at runtime. */
|
|
@@ -440,6 +551,9 @@ export const RUNTIME_READ_ONLY_TABLES = [
|
|
|
440
551
|
"preference_registry_events",
|
|
441
552
|
"preference_registry_snapshots",
|
|
442
553
|
"slack_installation_bindings",
|
|
554
|
+
"slack_task_policy_activation_events",
|
|
555
|
+
"slack_task_policy_heads",
|
|
556
|
+
"slack_task_policy_revisions",
|
|
443
557
|
"workspace_instruction_policy_snapshots",
|
|
444
558
|
"workspace_learning_policy_activation_events",
|
|
445
559
|
"workspace_learning_policy_heads",
|
|
@@ -483,7 +597,9 @@ export const RUNTIME_READ_INSERT_TABLES = [
|
|
|
483
597
|
"preference_registry_preferences",
|
|
484
598
|
"preference_registry_revisions",
|
|
485
599
|
"session_attempt_tool_catalogs",
|
|
600
|
+
"session_goal_revisions",
|
|
486
601
|
"session_spawn_denials",
|
|
602
|
+
"slack_shared_task_origins",
|
|
487
603
|
"slack_user_link_access_request_operations",
|
|
488
604
|
"temporal_schedule_cleanup_outbox",
|
|
489
605
|
"workspace_artifact_events",
|
|
@@ -502,6 +618,7 @@ export const RUNTIME_READ_INSERT_UPDATE_TABLES = [
|
|
|
502
618
|
"browser_identities",
|
|
503
619
|
"browser_sessions",
|
|
504
620
|
"browser_state_artifacts",
|
|
621
|
+
"browser_state_uploads",
|
|
505
622
|
"capability_api_facets",
|
|
506
623
|
"capability_facets",
|
|
507
624
|
"capability_integration_facets",
|
|
@@ -513,7 +630,7 @@ export const RUNTIME_READ_INSERT_UPDATE_TABLES = [
|
|
|
513
630
|
"computer_sessions",
|
|
514
631
|
"editable_artifact_session_links",
|
|
515
632
|
"editable_artifacts",
|
|
516
|
-
"
|
|
633
|
+
"integration_facet_definitions",
|
|
517
634
|
"integration_spec_revisions",
|
|
518
635
|
"integration_tools",
|
|
519
636
|
"interaction_interventions",
|
|
@@ -531,6 +648,10 @@ export const RUNTIME_READ_INSERT_UPDATE_TABLES = [
|
|
|
531
648
|
* The ordinary application role must have no direct table privileges on them.
|
|
532
649
|
*/
|
|
533
650
|
export const PROTECTED_NO_DIRECT_DML_TABLES = [
|
|
651
|
+
"canonical_human_identities",
|
|
652
|
+
"canonical_human_identity_operations",
|
|
653
|
+
"canonical_human_identity_subjects",
|
|
654
|
+
"canonical_human_login_bindings",
|
|
534
655
|
"editable_artifact_live_tickets",
|
|
535
656
|
"editable_artifact_scope_authorization_heads",
|
|
536
657
|
"host_export_config",
|
|
@@ -538,6 +659,14 @@ export const PROTECTED_NO_DIRECT_DML_TABLES = [
|
|
|
538
659
|
"host_export_cursor_state",
|
|
539
660
|
"host_export_dead_letters",
|
|
540
661
|
"host_export_outbox",
|
|
662
|
+
"organization_memberships",
|
|
663
|
+
"organization_user_resource_authorities",
|
|
664
|
+
"organization_user_resource_grants",
|
|
665
|
+
"organization_user_retention_policies",
|
|
666
|
+
"session_visibility_write_capabilities",
|
|
667
|
+
"task_note_events",
|
|
668
|
+
"task_note_write_capabilities",
|
|
669
|
+
"task_notes",
|
|
541
670
|
] as const;
|
|
542
671
|
|
|
543
672
|
export type RuntimeTableDmlPrivilege = "SELECT" | "INSERT" | "UPDATE" | "DELETE";
|
|
@@ -890,14 +1019,16 @@ export async function inspectRuntimeDatabasePosture(
|
|
|
890
1019
|
p.prosecdef as security_definer
|
|
891
1020
|
from pg_proc p
|
|
892
1021
|
join pg_namespace n on n.oid = p.pronamespace
|
|
893
|
-
where
|
|
894
|
-
format(
|
|
895
|
-
'%I.knowledge_source_sync_lock_authority(uuid,uuid,uuid)',
|
|
896
|
-
${targetSchema}::text
|
|
897
|
-
)
|
|
898
|
-
)
|
|
899
|
-
and n.nspname = ${targetSchema}
|
|
1022
|
+
where n.nspname = ${targetSchema}
|
|
900
1023
|
and p.prokind in ('f', 'p')
|
|
1024
|
+
and (p.proname || '(' || pg_catalog.oidvectortypes(p.proargtypes) || ')') = any(
|
|
1025
|
+
array[
|
|
1026
|
+
${sql.join(
|
|
1027
|
+
RUNTIME_TARGET_SCHEMA_CAPABILITY_ROUTINES.map((name) => sql`${name}`),
|
|
1028
|
+
sql`, `,
|
|
1029
|
+
)}
|
|
1030
|
+
]::text[]
|
|
1031
|
+
)
|
|
901
1032
|
order by p.proname, pg_catalog.oidvectortypes(p.proargtypes)
|
|
902
1033
|
`),
|
|
903
1034
|
).map((row) => ({
|
|
@@ -1120,7 +1251,13 @@ export function evaluateRuntimeDatabasePosture(
|
|
|
1120
1251
|
continue;
|
|
1121
1252
|
}
|
|
1122
1253
|
const routine = matches[0]!;
|
|
1123
|
-
if (
|
|
1254
|
+
if (RUNTIME_TARGET_SCHEMA_INVOKER_ROUTINE_SET.has(routine.name)) {
|
|
1255
|
+
if (routine.securityDefiner) {
|
|
1256
|
+
violations.push(
|
|
1257
|
+
`target-schema runtime capability ${routine.name} must be SECURITY INVOKER`,
|
|
1258
|
+
);
|
|
1259
|
+
}
|
|
1260
|
+
} else if (!routine.securityDefiner) {
|
|
1124
1261
|
violations.push(`target-schema runtime capability ${routine.name} is not SECURITY DEFINER`);
|
|
1125
1262
|
}
|
|
1126
1263
|
if (routine.name === KNOWLEDGE_SOURCE_SYNC_LOCK_AUTHORITY_ROUTINE) {
|
|
@@ -1146,6 +1283,82 @@ export function evaluateRuntimeDatabasePosture(
|
|
|
1146
1283
|
);
|
|
1147
1284
|
}
|
|
1148
1285
|
}
|
|
1286
|
+
} else if (routine.name === MANAGED_HUMAN_PERSONAL_WORKSPACE_ROUTINE) {
|
|
1287
|
+
const authorityTables = MANAGED_HUMAN_PERSONAL_WORKSPACE_AUTHORITY_TABLES.filter(
|
|
1288
|
+
(tableName) => tableByName.has(tableName),
|
|
1289
|
+
).map((tableName) => tableByName.get(tableName)!);
|
|
1290
|
+
const authorityOwners = new Set(authorityTables.map((table) => table.owner));
|
|
1291
|
+
if (authorityOwners.size > 1) {
|
|
1292
|
+
violations.push(
|
|
1293
|
+
`target-schema runtime capability ${routine.name} authority table owners do not match: ${authorityTables.map((table) => `${table.name}=${table.owner}`).join(", ")}`,
|
|
1294
|
+
);
|
|
1295
|
+
} else if (authorityTables[0] && routine.owner !== authorityTables[0].owner) {
|
|
1296
|
+
violations.push(
|
|
1297
|
+
`target-schema runtime capability ${routine.name} owner ${routine.owner} does not match authority table owner ${authorityTables[0].owner}`,
|
|
1298
|
+
);
|
|
1299
|
+
}
|
|
1300
|
+
} else if ((CANONICAL_HUMAN_IDENTITY_ROUTINES as readonly string[]).includes(routine.name)) {
|
|
1301
|
+
const authorityTables = CANONICAL_HUMAN_IDENTITY_AUTHORITY_TABLES.filter((tableName) =>
|
|
1302
|
+
tableByName.has(tableName),
|
|
1303
|
+
).map((tableName) => tableByName.get(tableName)!);
|
|
1304
|
+
const authorityOwners = new Set(authorityTables.map((table) => table.owner));
|
|
1305
|
+
if (authorityTables.length !== CANONICAL_HUMAN_IDENTITY_AUTHORITY_TABLES.length) {
|
|
1306
|
+
violations.push(
|
|
1307
|
+
`target-schema runtime capability ${routine.name} canonical identity authority tables are missing`,
|
|
1308
|
+
);
|
|
1309
|
+
} else if (authorityOwners.size !== 1) {
|
|
1310
|
+
violations.push(
|
|
1311
|
+
`target-schema runtime capability ${routine.name} authority table owners do not match: ${authorityTables.map((table) => `${table.name}=${table.owner}`).join(", ")}`,
|
|
1312
|
+
);
|
|
1313
|
+
} else if (routine.owner !== authorityTables[0]!.owner) {
|
|
1314
|
+
violations.push(
|
|
1315
|
+
`target-schema runtime capability ${routine.name} owner ${routine.owner} does not match authority table owner ${authorityTables[0]!.owner}`,
|
|
1316
|
+
);
|
|
1317
|
+
}
|
|
1318
|
+
} else if (SESSION_AUTHORITY_ROUTINES.has(routine.name)) {
|
|
1319
|
+
const authorityOwner = tableByName.get("sessions")?.owner ?? targetSchemaOwner;
|
|
1320
|
+
if (authorityOwner && routine.owner !== authorityOwner) {
|
|
1321
|
+
violations.push(
|
|
1322
|
+
`target-schema runtime capability ${routine.name} owner ${routine.owner} does not match session authority owner ${authorityOwner}`,
|
|
1323
|
+
);
|
|
1324
|
+
}
|
|
1325
|
+
} else if (routine.name === XAI_SNAPSHOT_VALIDATOR_ROUTINE) {
|
|
1326
|
+
// The immutable SQL validator is invoker-rights and reads no table. Its
|
|
1327
|
+
// exact ACL is posture-checked above; it does not participate in the
|
|
1328
|
+
// SECURITY DEFINER same-owner authority graph.
|
|
1329
|
+
} else if (
|
|
1330
|
+
routine.name === XAI_CREATE_CREDENTIAL_ROUTINE ||
|
|
1331
|
+
routine.name === XAI_DISCONNECT_CREDENTIAL_ROUTINE ||
|
|
1332
|
+
routine.name === XAI_AUTHORITY_LIVE_ROUTINE ||
|
|
1333
|
+
routine.name === XAI_POOL_VISIBLE_ROUTINE ||
|
|
1334
|
+
routine.name === XAI_RESOLVE_POOL_ROUTINE ||
|
|
1335
|
+
routine.name === XAI_REVALIDATE_CREDENTIAL_ROUTINE
|
|
1336
|
+
) {
|
|
1337
|
+
if (!tableByName.has("xai_subscription_credentials")) {
|
|
1338
|
+
continue;
|
|
1339
|
+
}
|
|
1340
|
+
const missingAuthorityTables = XAI_AUTHORITY_TABLES.filter(
|
|
1341
|
+
(tableName) => !tableByName.has(tableName),
|
|
1342
|
+
);
|
|
1343
|
+
if (missingAuthorityTables.length > 0) {
|
|
1344
|
+
violations.push(
|
|
1345
|
+
`target-schema runtime capability ${routine.name} authority tables are missing: ${missingAuthorityTables.join(", ")}`,
|
|
1346
|
+
);
|
|
1347
|
+
} else {
|
|
1348
|
+
const authorityTables = XAI_AUTHORITY_TABLES.map(
|
|
1349
|
+
(tableName) => tableByName.get(tableName)!,
|
|
1350
|
+
);
|
|
1351
|
+
const authorityOwners = new Set(authorityTables.map((table) => table.owner));
|
|
1352
|
+
if (authorityOwners.size !== 1) {
|
|
1353
|
+
violations.push(
|
|
1354
|
+
`target-schema runtime capability ${routine.name} authority table owners do not match: ${authorityTables.map((table) => `${table.name}=${table.owner}`).join(", ")}`,
|
|
1355
|
+
);
|
|
1356
|
+
} else if (routine.owner !== authorityTables[0]!.owner) {
|
|
1357
|
+
violations.push(
|
|
1358
|
+
`target-schema runtime capability ${routine.name} owner ${routine.owner} does not match authority table owner ${authorityTables[0]!.owner}`,
|
|
1359
|
+
);
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1149
1362
|
} else if (targetSchemaOwner && routine.owner !== targetSchemaOwner) {
|
|
1150
1363
|
violations.push(
|
|
1151
1364
|
`target-schema runtime capability ${routine.name} owner ${routine.owner} does not match schema owner ${targetSchemaOwner}`,
|