@consiliency/agent-board-schema 1.56.0 → 1.58.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/fixtures/already-applied.json +8 -0
- package/migrations/20261007000100_agent_board_onboard_requests.sql +139 -0
- package/migrations/20261008000100_agent_board_hosted_delegates.sql +3152 -0
- package/package.json +1 -1
- package/schema-manifest.json +21 -3
- package/src/tooling.test.mjs +8 -2
- package/tests/agent_board_atomic_fleet_onboarding.test.sql +13 -0
- package/tests/agent_board_consent_emission.test.sql +4 -2
- package/tests/agent_board_delegate_role_class.test.sql +736 -0
- package/tests/agent_board_federated_identity_injective_slug.test.sql +5 -2
- package/tests/agent_board_fedsession_stored_identity_gate.test.sql +71 -14
- package/tests/agent_board_fk_lock_edges.test.sql +9 -0
- package/tests/agent_board_hosted_delegates.test.sql +1134 -0
- package/tests/agent_board_ledger_authority.test.sql +34 -5
- package/tests/agent_board_membership_current_row_class.test.sql +3 -1
- package/tests/agent_board_onboard_requests.test.sql +353 -0
- package/tests/agent_board_rowid.test.sql +18 -5
- package/tests/agent_board_signer_lifecycle.test.sql +3 -0
- package/tests/agent_board_write_enforcement_class.test.sql +8 -3
- package/tests/catalog/function_execute_privileges.json +278 -2
- package/tests/catalog/p_metadata_parameters.json +48 -0
- package/tests/isolation/expected/hosted_delegate_exchange_race.out +93 -0
- package/tests/isolation/expected/hosted_delegate_first_exchange_race.out +129 -0
- package/tests/isolation/expected/hosted_delegate_owner_provisioning_race.out +91 -0
- package/tests/isolation/expected/hosted_delegate_owner_revoke_race.out +137 -0
- package/tests/isolation/expected/hosted_delegate_revoke_race.out +87 -0
- package/tests/isolation/expected/hosted_delegate_withdraw_evict_race.out +235 -0
- package/tests/isolation/specs/hosted_delegate_exchange_race.spec +64 -0
- package/tests/isolation/specs/hosted_delegate_first_exchange_race.spec +72 -0
- package/tests/isolation/specs/hosted_delegate_owner_provisioning_race.spec +73 -0
- package/tests/isolation/specs/hosted_delegate_owner_revoke_race.spec +93 -0
- package/tests/isolation/specs/hosted_delegate_revoke_race.spec +59 -0
- package/tests/isolation/specs/hosted_delegate_withdraw_evict_race.spec +145 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$comment": "GENERATED by scripts/build-function-privileges-snapshot.mjs from pg_catalog — do not hand-edit. EVERY agent_board function (each overload by signature) with has_function_privilege for the three PostgREST roles, and EVERY agent_board view with has_table_privilege(SELECT). Derived with NO name filter. The MCP tool-group boundary test ranks a tool elevated_admin when it reaches a function or view authenticated cannot use, refuses a name whose overloads disagree, and fails a reachable name with no row here (#425).",
|
|
2
|
+
"$comment": "GENERATED by scripts/build-function-privileges-snapshot.mjs from pg_catalog — do not hand-edit. EVERY agent_board function (each overload by signature) with has_function_privilege for the three PostgREST roles, and EVERY agent_board view with has_table_privilege(SELECT). Derived with NO name filter. The MCP tool-group boundary test ranks a tool elevated_admin when it reaches a function or view authenticated cannot use, refuses a name whose overloads disagree, and fails a reachable name with no row here (#425). The `delegate` block (HOSTED) is additive: the agent_board_delegate allow set as delegate_allowed_operations states it, and what that role can actually EXECUTE (non-definer functions keep PUBLIC EXECUTE and appear too) and SELECT.",
|
|
3
3
|
"functions": [
|
|
4
4
|
{
|
|
5
5
|
"name": "_active_board_membership_id",
|
|
@@ -64,6 +64,15 @@
|
|
|
64
64
|
"authenticated": false
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
+
{
|
|
68
|
+
"name": "_agents_is_delegate_immutable",
|
|
69
|
+
"signature": "_agents_is_delegate_immutable()",
|
|
70
|
+
"executable_by": {
|
|
71
|
+
"anon": false,
|
|
72
|
+
"service_role": false,
|
|
73
|
+
"authenticated": false
|
|
74
|
+
}
|
|
75
|
+
},
|
|
67
76
|
{
|
|
68
77
|
"name": "_append_task_event",
|
|
69
78
|
"signature": "_append_task_event(p_origin_posture text, p_task_id uuid, p_actor_agent_id uuid, p_event_type text, p_payload jsonb, p_status text, p_assigned_agent_id uuid, p_completed_at timestamp with time zone)",
|
|
@@ -325,6 +334,42 @@
|
|
|
325
334
|
"authenticated": false
|
|
326
335
|
}
|
|
327
336
|
},
|
|
337
|
+
{
|
|
338
|
+
"name": "_delegate_instance_slug",
|
|
339
|
+
"signature": "_delegate_instance_slug(p_issuer text, p_instance_id text)",
|
|
340
|
+
"executable_by": {
|
|
341
|
+
"anon": false,
|
|
342
|
+
"service_role": false,
|
|
343
|
+
"authenticated": false
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"name": "_delegate_principal_agent_id",
|
|
348
|
+
"signature": "_delegate_principal_agent_id(p_agent_id uuid)",
|
|
349
|
+
"executable_by": {
|
|
350
|
+
"anon": false,
|
|
351
|
+
"service_role": false,
|
|
352
|
+
"authenticated": false
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"name": "_delegate_visible_agent",
|
|
357
|
+
"signature": "_delegate_visible_agent(p_agent_id uuid)",
|
|
358
|
+
"executable_by": {
|
|
359
|
+
"anon": false,
|
|
360
|
+
"service_role": false,
|
|
361
|
+
"authenticated": false
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"name": "_delegate_visible_board_ids",
|
|
366
|
+
"signature": "_delegate_visible_board_ids()",
|
|
367
|
+
"executable_by": {
|
|
368
|
+
"anon": false,
|
|
369
|
+
"service_role": false,
|
|
370
|
+
"authenticated": false
|
|
371
|
+
}
|
|
372
|
+
},
|
|
328
373
|
{
|
|
329
374
|
"name": "_emit_membership_event",
|
|
330
375
|
"signature": "_emit_membership_event(p_board_id uuid, p_agent_id uuid, p_membership_state text, p_event_kind text)",
|
|
@@ -658,6 +703,24 @@
|
|
|
658
703
|
"authenticated": false
|
|
659
704
|
}
|
|
660
705
|
},
|
|
706
|
+
{
|
|
707
|
+
"name": "_refuse_delegate_addressee",
|
|
708
|
+
"signature": "_refuse_delegate_addressee(p_agent_id uuid, p_board_id uuid, p_what text)",
|
|
709
|
+
"executable_by": {
|
|
710
|
+
"anon": false,
|
|
711
|
+
"service_role": false,
|
|
712
|
+
"authenticated": false
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"name": "_refuse_delegate_membership_target",
|
|
717
|
+
"signature": "_refuse_delegate_membership_target(p_agent_id uuid, p_operation text)",
|
|
718
|
+
"executable_by": {
|
|
719
|
+
"anon": false,
|
|
720
|
+
"service_role": false,
|
|
721
|
+
"authenticated": false
|
|
722
|
+
}
|
|
723
|
+
},
|
|
661
724
|
{
|
|
662
725
|
"name": "_require_platform_admin_user_id",
|
|
663
726
|
"signature": "_require_platform_admin_user_id()",
|
|
@@ -784,6 +847,15 @@
|
|
|
784
847
|
"authenticated": true
|
|
785
848
|
}
|
|
786
849
|
},
|
|
850
|
+
{
|
|
851
|
+
"name": "add_delegate_to_board",
|
|
852
|
+
"signature": "add_delegate_to_board(p_agent_id uuid, p_board_id uuid)",
|
|
853
|
+
"executable_by": {
|
|
854
|
+
"anon": false,
|
|
855
|
+
"service_role": false,
|
|
856
|
+
"authenticated": true
|
|
857
|
+
}
|
|
858
|
+
},
|
|
787
859
|
{
|
|
788
860
|
"name": "agent_liveness_summary",
|
|
789
861
|
"signature": "agent_liveness_summary()",
|
|
@@ -991,6 +1063,15 @@
|
|
|
991
1063
|
"authenticated": false
|
|
992
1064
|
}
|
|
993
1065
|
},
|
|
1066
|
+
{
|
|
1067
|
+
"name": "exchange_delegate_credential",
|
|
1068
|
+
"signature": "exchange_delegate_credential(p_claims jsonb)",
|
|
1069
|
+
"executable_by": {
|
|
1070
|
+
"anon": false,
|
|
1071
|
+
"service_role": true,
|
|
1072
|
+
"authenticated": false
|
|
1073
|
+
}
|
|
1074
|
+
},
|
|
994
1075
|
{
|
|
995
1076
|
"name": "expand_recipients_dry_run",
|
|
996
1077
|
"signature": "expand_recipients_dry_run(p_actor_agent_id uuid, p_recipient_descriptors jsonb, p_thread_idempotency_key text)",
|
|
@@ -1036,6 +1117,15 @@
|
|
|
1036
1117
|
"authenticated": true
|
|
1037
1118
|
}
|
|
1038
1119
|
},
|
|
1120
|
+
{
|
|
1121
|
+
"name": "invite_board_for_display",
|
|
1122
|
+
"signature": "invite_board_for_display(p_code_sha256 text)",
|
|
1123
|
+
"executable_by": {
|
|
1124
|
+
"anon": false,
|
|
1125
|
+
"service_role": true,
|
|
1126
|
+
"authenticated": false
|
|
1127
|
+
}
|
|
1128
|
+
},
|
|
1039
1129
|
{
|
|
1040
1130
|
"name": "invite_board_member",
|
|
1041
1131
|
"signature": "invite_board_member(p_board_id uuid, p_agent_id uuid, p_created_by_agent_id uuid, p_metadata jsonb)",
|
|
@@ -1090,6 +1180,15 @@
|
|
|
1090
1180
|
"authenticated": true
|
|
1091
1181
|
}
|
|
1092
1182
|
},
|
|
1183
|
+
{
|
|
1184
|
+
"name": "list_my_board_requests",
|
|
1185
|
+
"signature": "list_my_board_requests()",
|
|
1186
|
+
"executable_by": {
|
|
1187
|
+
"anon": false,
|
|
1188
|
+
"service_role": false,
|
|
1189
|
+
"authenticated": true
|
|
1190
|
+
}
|
|
1191
|
+
},
|
|
1093
1192
|
{
|
|
1094
1193
|
"name": "mark_read",
|
|
1095
1194
|
"signature": "mark_read(p_thread_id uuid, p_agent_id uuid, p_last_read_message_sequence bigint)",
|
|
@@ -1657,6 +1756,15 @@
|
|
|
1657
1756
|
"authenticated": true
|
|
1658
1757
|
}
|
|
1659
1758
|
},
|
|
1759
|
+
{
|
|
1760
|
+
"name": "tombstone_delegate_instance",
|
|
1761
|
+
"signature": "tombstone_delegate_instance(p_instance_id text, p_issuer text, p_owner_sub text, p_reason text)",
|
|
1762
|
+
"executable_by": {
|
|
1763
|
+
"anon": false,
|
|
1764
|
+
"service_role": true,
|
|
1765
|
+
"authenticated": false
|
|
1766
|
+
}
|
|
1767
|
+
},
|
|
1660
1768
|
{
|
|
1661
1769
|
"name": "unblock_board_inviter",
|
|
1662
1770
|
"signature": "unblock_board_inviter(p_board_id uuid, p_inviter_agent_id uuid, p_target_agent_id uuid)",
|
|
@@ -1937,5 +2045,173 @@
|
|
|
1937
2045
|
"authenticated": true
|
|
1938
2046
|
}
|
|
1939
2047
|
}
|
|
1940
|
-
]
|
|
2048
|
+
],
|
|
2049
|
+
"delegate": {
|
|
2050
|
+
"role": "agent_board_delegate",
|
|
2051
|
+
"allowed_operations": [
|
|
2052
|
+
{
|
|
2053
|
+
"kind": "ambient_rpc",
|
|
2054
|
+
"name": "get_schema_version",
|
|
2055
|
+
"signature": "get_schema_version()"
|
|
2056
|
+
},
|
|
2057
|
+
{
|
|
2058
|
+
"kind": "predicate",
|
|
2059
|
+
"name": "_delegate_visible_agent",
|
|
2060
|
+
"signature": "_delegate_visible_agent(uuid)"
|
|
2061
|
+
},
|
|
2062
|
+
{
|
|
2063
|
+
"kind": "predicate",
|
|
2064
|
+
"name": "_delegate_visible_board_ids",
|
|
2065
|
+
"signature": "_delegate_visible_board_ids()"
|
|
2066
|
+
},
|
|
2067
|
+
{
|
|
2068
|
+
"kind": "predicate",
|
|
2069
|
+
"name": "current_agent_id",
|
|
2070
|
+
"signature": "current_agent_id()"
|
|
2071
|
+
},
|
|
2072
|
+
{
|
|
2073
|
+
"kind": "read_table",
|
|
2074
|
+
"name": "agent_signing_keys",
|
|
2075
|
+
"signature": "agent_signing_keys"
|
|
2076
|
+
},
|
|
2077
|
+
{
|
|
2078
|
+
"kind": "read_table",
|
|
2079
|
+
"name": "agents",
|
|
2080
|
+
"signature": "agents"
|
|
2081
|
+
},
|
|
2082
|
+
{
|
|
2083
|
+
"kind": "read_table",
|
|
2084
|
+
"name": "board_memberships",
|
|
2085
|
+
"signature": "board_memberships"
|
|
2086
|
+
},
|
|
2087
|
+
{
|
|
2088
|
+
"kind": "read_table",
|
|
2089
|
+
"name": "boards",
|
|
2090
|
+
"signature": "boards"
|
|
2091
|
+
},
|
|
2092
|
+
{
|
|
2093
|
+
"kind": "read_table",
|
|
2094
|
+
"name": "claims",
|
|
2095
|
+
"signature": "claims"
|
|
2096
|
+
},
|
|
2097
|
+
{
|
|
2098
|
+
"kind": "read_table",
|
|
2099
|
+
"name": "delivery_recipients",
|
|
2100
|
+
"signature": "delivery_recipients"
|
|
2101
|
+
},
|
|
2102
|
+
{
|
|
2103
|
+
"kind": "read_table",
|
|
2104
|
+
"name": "escalations",
|
|
2105
|
+
"signature": "escalations"
|
|
2106
|
+
},
|
|
2107
|
+
{
|
|
2108
|
+
"kind": "read_table",
|
|
2109
|
+
"name": "inbox_items",
|
|
2110
|
+
"signature": "inbox_items"
|
|
2111
|
+
},
|
|
2112
|
+
{
|
|
2113
|
+
"kind": "read_table",
|
|
2114
|
+
"name": "messages",
|
|
2115
|
+
"signature": "messages"
|
|
2116
|
+
},
|
|
2117
|
+
{
|
|
2118
|
+
"kind": "read_table",
|
|
2119
|
+
"name": "presence",
|
|
2120
|
+
"signature": "presence"
|
|
2121
|
+
},
|
|
2122
|
+
{
|
|
2123
|
+
"kind": "read_table",
|
|
2124
|
+
"name": "signature_evidence",
|
|
2125
|
+
"signature": "signature_evidence"
|
|
2126
|
+
},
|
|
2127
|
+
{
|
|
2128
|
+
"kind": "read_table",
|
|
2129
|
+
"name": "task_events",
|
|
2130
|
+
"signature": "task_events"
|
|
2131
|
+
},
|
|
2132
|
+
{
|
|
2133
|
+
"kind": "read_table",
|
|
2134
|
+
"name": "tasks",
|
|
2135
|
+
"signature": "tasks"
|
|
2136
|
+
},
|
|
2137
|
+
{
|
|
2138
|
+
"kind": "read_view",
|
|
2139
|
+
"name": "v_agent_dashboard",
|
|
2140
|
+
"signature": "v_agent_dashboard"
|
|
2141
|
+
},
|
|
2142
|
+
{
|
|
2143
|
+
"kind": "read_view",
|
|
2144
|
+
"name": "v_agent_inbox",
|
|
2145
|
+
"signature": "v_agent_inbox"
|
|
2146
|
+
},
|
|
2147
|
+
{
|
|
2148
|
+
"kind": "read_view",
|
|
2149
|
+
"name": "v_board_feed",
|
|
2150
|
+
"signature": "v_board_feed"
|
|
2151
|
+
},
|
|
2152
|
+
{
|
|
2153
|
+
"kind": "read_view",
|
|
2154
|
+
"name": "v_board_memberships",
|
|
2155
|
+
"signature": "v_board_memberships"
|
|
2156
|
+
},
|
|
2157
|
+
{
|
|
2158
|
+
"kind": "read_view",
|
|
2159
|
+
"name": "v_thread_feed",
|
|
2160
|
+
"signature": "v_thread_feed"
|
|
2161
|
+
},
|
|
2162
|
+
{
|
|
2163
|
+
"kind": "rpc",
|
|
2164
|
+
"name": "create_or_find_thread",
|
|
2165
|
+
"signature": "create_or_find_thread(uuid, text, text, text, jsonb)"
|
|
2166
|
+
},
|
|
2167
|
+
{
|
|
2168
|
+
"kind": "rpc",
|
|
2169
|
+
"name": "post_board_message",
|
|
2170
|
+
"signature": "post_board_message(uuid, uuid, text, text, text, text, text, text, text, jsonb)"
|
|
2171
|
+
},
|
|
2172
|
+
{
|
|
2173
|
+
"kind": "rpc",
|
|
2174
|
+
"name": "post_board_message",
|
|
2175
|
+
"signature": "post_board_message(uuid, uuid, uuid, text, text, text, text, text, jsonb)"
|
|
2176
|
+
},
|
|
2177
|
+
{
|
|
2178
|
+
"kind": "rpc",
|
|
2179
|
+
"name": "post_message",
|
|
2180
|
+
"signature": "post_message(uuid, uuid, text, text, uuid, jsonb)"
|
|
2181
|
+
}
|
|
2182
|
+
],
|
|
2183
|
+
"executable_functions": [
|
|
2184
|
+
"_addressing_descriptors_array(p_descriptors jsonb)",
|
|
2185
|
+
"_board_membership_events_provenance_guard()",
|
|
2186
|
+
"_delegate_visible_agent(p_agent_id uuid)",
|
|
2187
|
+
"_delegate_visible_board_ids()",
|
|
2188
|
+
"create_or_find_thread(p_created_by_agent_id uuid, p_subject text, p_idempotency_key text, p_thread_type text, p_metadata jsonb)",
|
|
2189
|
+
"current_agent_id()",
|
|
2190
|
+
"get_schema_version()",
|
|
2191
|
+
"post_board_message(p_thread_id uuid, p_author_agent_id uuid, p_board_id uuid, p_subject text, p_body text, p_message_type text, p_priority text, p_idempotency_key text, p_metadata jsonb)",
|
|
2192
|
+
"post_board_message(p_thread_id uuid, p_author_agent_id uuid, p_board_slug text, p_addressing_mode text, p_subject text, p_body text, p_message_type text, p_priority text, p_idempotency_key text, p_metadata jsonb)",
|
|
2193
|
+
"post_message(p_thread_id uuid, p_author_agent_id uuid, p_body text, p_message_type text, p_task_id uuid, p_metadata jsonb)",
|
|
2194
|
+
"sync_agent_principal_columns()"
|
|
2195
|
+
],
|
|
2196
|
+
"selectable_relations": [
|
|
2197
|
+
"agent_signing_keys",
|
|
2198
|
+
"agents",
|
|
2199
|
+
"board_memberships",
|
|
2200
|
+
"boards",
|
|
2201
|
+
"claims",
|
|
2202
|
+
"delivery_recipients",
|
|
2203
|
+
"escalations",
|
|
2204
|
+
"inbox_items",
|
|
2205
|
+
"messages",
|
|
2206
|
+
"presence",
|
|
2207
|
+
"signature_evidence",
|
|
2208
|
+
"task_events",
|
|
2209
|
+
"tasks",
|
|
2210
|
+
"v_agent_dashboard",
|
|
2211
|
+
"v_agent_inbox",
|
|
2212
|
+
"v_board_feed",
|
|
2213
|
+
"v_board_memberships",
|
|
2214
|
+
"v_thread_feed"
|
|
2215
|
+
]
|
|
2216
|
+
}
|
|
1941
2217
|
}
|
|
@@ -29,6 +29,10 @@
|
|
|
29
29
|
"signature": "_agent_principal_active(p_agent_id uuid)",
|
|
30
30
|
"declares_p_metadata": false
|
|
31
31
|
},
|
|
32
|
+
{
|
|
33
|
+
"signature": "_agents_is_delegate_immutable()",
|
|
34
|
+
"declares_p_metadata": false
|
|
35
|
+
},
|
|
32
36
|
{
|
|
33
37
|
"signature": "_append_task_event(p_origin_posture text, p_task_id uuid, p_actor_agent_id uuid, p_event_type text, p_payload jsonb, p_status text, p_assigned_agent_id uuid, p_completed_at timestamp with time zone)",
|
|
34
38
|
"declares_p_metadata": false
|
|
@@ -145,6 +149,22 @@
|
|
|
145
149
|
"signature": "_default_provision_display_name(p_slug text)",
|
|
146
150
|
"declares_p_metadata": false
|
|
147
151
|
},
|
|
152
|
+
{
|
|
153
|
+
"signature": "_delegate_instance_slug(p_issuer text, p_instance_id text)",
|
|
154
|
+
"declares_p_metadata": false
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"signature": "_delegate_principal_agent_id(p_agent_id uuid)",
|
|
158
|
+
"declares_p_metadata": false
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"signature": "_delegate_visible_agent(p_agent_id uuid)",
|
|
162
|
+
"declares_p_metadata": false
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"signature": "_delegate_visible_board_ids()",
|
|
166
|
+
"declares_p_metadata": false
|
|
167
|
+
},
|
|
148
168
|
{
|
|
149
169
|
"signature": "_emit_membership_event(p_board_id uuid, p_agent_id uuid, p_membership_state text, p_event_kind text)",
|
|
150
170
|
"declares_p_metadata": false
|
|
@@ -293,6 +313,14 @@
|
|
|
293
313
|
"signature": "_redeem_unbounded_invite_for_agent(p_code text, p_agent_id uuid)",
|
|
294
314
|
"declares_p_metadata": false
|
|
295
315
|
},
|
|
316
|
+
{
|
|
317
|
+
"signature": "_refuse_delegate_addressee(p_agent_id uuid, p_board_id uuid, p_what text)",
|
|
318
|
+
"declares_p_metadata": false
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"signature": "_refuse_delegate_membership_target(p_agent_id uuid, p_operation text)",
|
|
322
|
+
"declares_p_metadata": false
|
|
323
|
+
},
|
|
296
324
|
{
|
|
297
325
|
"signature": "_require_platform_admin_user_id()",
|
|
298
326
|
"declares_p_metadata": false
|
|
@@ -349,6 +377,10 @@
|
|
|
349
377
|
"signature": "add_artifact(p_created_by_agent_id uuid, p_uri text, p_artifact_type text, p_storage_kind text, p_thread_id uuid, p_task_id uuid, p_message_id uuid, p_task_event_id uuid, p_metadata jsonb)",
|
|
350
378
|
"declares_p_metadata": true
|
|
351
379
|
},
|
|
380
|
+
{
|
|
381
|
+
"signature": "add_delegate_to_board(p_agent_id uuid, p_board_id uuid)",
|
|
382
|
+
"declares_p_metadata": false
|
|
383
|
+
},
|
|
352
384
|
{
|
|
353
385
|
"signature": "agent_liveness_summary()",
|
|
354
386
|
"declares_p_metadata": false
|
|
@@ -441,6 +473,10 @@
|
|
|
441
473
|
"signature": "evaluate_signed_write_fleet_policy(p_operation text, p_payload jsonb, p_gateway_decision jsonb)",
|
|
442
474
|
"declares_p_metadata": false
|
|
443
475
|
},
|
|
476
|
+
{
|
|
477
|
+
"signature": "exchange_delegate_credential(p_claims jsonb)",
|
|
478
|
+
"declares_p_metadata": false
|
|
479
|
+
},
|
|
444
480
|
{
|
|
445
481
|
"signature": "expand_recipients_dry_run(p_actor_agent_id uuid, p_recipient_descriptors jsonb, p_thread_idempotency_key text)",
|
|
446
482
|
"declares_p_metadata": false
|
|
@@ -461,6 +497,10 @@
|
|
|
461
497
|
"signature": "heartbeat(p_agent_id uuid, p_thread_id uuid, p_availability text, p_activity_summary text, p_expires_in interval, p_metadata jsonb)",
|
|
462
498
|
"declares_p_metadata": true
|
|
463
499
|
},
|
|
500
|
+
{
|
|
501
|
+
"signature": "invite_board_for_display(p_code_sha256 text)",
|
|
502
|
+
"declares_p_metadata": false
|
|
503
|
+
},
|
|
464
504
|
{
|
|
465
505
|
"signature": "invite_board_member(p_board_id uuid, p_agent_id uuid, p_created_by_agent_id uuid, p_metadata jsonb)",
|
|
466
506
|
"declares_p_metadata": true
|
|
@@ -485,6 +525,10 @@
|
|
|
485
525
|
"signature": "list_board_pending_memberships(p_board_id uuid)",
|
|
486
526
|
"declares_p_metadata": false
|
|
487
527
|
},
|
|
528
|
+
{
|
|
529
|
+
"signature": "list_my_board_requests()",
|
|
530
|
+
"declares_p_metadata": false
|
|
531
|
+
},
|
|
488
532
|
{
|
|
489
533
|
"signature": "mark_read(p_thread_id uuid, p_agent_id uuid, p_last_read_message_sequence bigint)",
|
|
490
534
|
"declares_p_metadata": false
|
|
@@ -737,6 +781,10 @@
|
|
|
737
781
|
"signature": "sync_agent_principal_columns()",
|
|
738
782
|
"declares_p_metadata": false
|
|
739
783
|
},
|
|
784
|
+
{
|
|
785
|
+
"signature": "tombstone_delegate_instance(p_instance_id text, p_issuer text, p_owner_sub text, p_reason text)",
|
|
786
|
+
"declares_p_metadata": false
|
|
787
|
+
},
|
|
740
788
|
{
|
|
741
789
|
"signature": "unblock_board_inviter(p_board_id uuid, p_inviter_agent_id uuid, p_target_agent_id uuid)",
|
|
742
790
|
"declares_p_metadata": false
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Parsed test spec with 3 sessions
|
|
2
|
+
|
|
3
|
+
starting permutation: new_begin new_exchange old_begin old_exchange new_commit old_commit check
|
|
4
|
+
count
|
|
5
|
+
-----
|
|
6
|
+
1
|
|
7
|
+
(1 row)
|
|
8
|
+
|
|
9
|
+
step new_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
10
|
+
step new_exchange:
|
|
11
|
+
select count(*) as issued from agent_board.exchange_delegate_credential(jsonb_build_object(
|
|
12
|
+
'iss', 'https://iso-portal.test', 'sub', 'iso-owner', 'slot_resource', null,
|
|
13
|
+
'agent_board_delegate_instance', jsonb_build_object(
|
|
14
|
+
'instance_id', 'iso_exchange_race_0001', 'grant_id', 'iso_grant_0000000003', 'generation', 3,
|
|
15
|
+
'owner_sub', 'iso-owner', 'client_id', 'iso-client', 'status', 'active', 'client_change', null)));
|
|
16
|
+
|
|
17
|
+
issued
|
|
18
|
+
------
|
|
19
|
+
1
|
|
20
|
+
(1 row)
|
|
21
|
+
|
|
22
|
+
step old_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
23
|
+
step old_exchange:
|
|
24
|
+
select count(*) as issued from agent_board.exchange_delegate_credential(jsonb_build_object(
|
|
25
|
+
'iss', 'https://iso-portal.test', 'sub', 'iso-owner', 'slot_resource', null,
|
|
26
|
+
'agent_board_delegate_instance', jsonb_build_object(
|
|
27
|
+
'instance_id', 'iso_exchange_race_0001', 'grant_id', 'iso_grant_0000000002', 'generation', 2,
|
|
28
|
+
'owner_sub', 'iso-owner', 'client_id', 'iso-client', 'status', 'active', 'client_change', null)));
|
|
29
|
+
<waiting ...>
|
|
30
|
+
step new_commit: COMMIT;
|
|
31
|
+
step old_exchange: <... completed>
|
|
32
|
+
ERROR: generation_superseded
|
|
33
|
+
step old_commit: COMMIT;
|
|
34
|
+
step check:
|
|
35
|
+
select di.generation as recorded_generation, di.grant_id as recorded_grant,
|
|
36
|
+
(select string_agg(ac.generation::text, ',' order by ac.generation)
|
|
37
|
+
from agent_board.agent_credentials ac where ac.agent_id = di.agent_id and ac.revoked_at is null) as live_generations,
|
|
38
|
+
(select count(*) from agent_board.agents a where a.handle like 'delegate-%') as delegate_agents
|
|
39
|
+
from agent_board.delegate_instances di where di.instance_id = 'iso_exchange_race_0001';
|
|
40
|
+
|
|
41
|
+
recorded_generation|recorded_grant |live_generations|delegate_agents
|
|
42
|
+
-------------------+--------------------+----------------+---------------
|
|
43
|
+
3|iso_grant_0000000003| 3| 1
|
|
44
|
+
(1 row)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
starting permutation: old_begin old_exchange new_begin new_exchange old_commit new_commit check
|
|
48
|
+
count
|
|
49
|
+
-----
|
|
50
|
+
1
|
|
51
|
+
(1 row)
|
|
52
|
+
|
|
53
|
+
step old_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
54
|
+
step old_exchange:
|
|
55
|
+
select count(*) as issued from agent_board.exchange_delegate_credential(jsonb_build_object(
|
|
56
|
+
'iss', 'https://iso-portal.test', 'sub', 'iso-owner', 'slot_resource', null,
|
|
57
|
+
'agent_board_delegate_instance', jsonb_build_object(
|
|
58
|
+
'instance_id', 'iso_exchange_race_0001', 'grant_id', 'iso_grant_0000000002', 'generation', 2,
|
|
59
|
+
'owner_sub', 'iso-owner', 'client_id', 'iso-client', 'status', 'active', 'client_change', null)));
|
|
60
|
+
|
|
61
|
+
issued
|
|
62
|
+
------
|
|
63
|
+
1
|
|
64
|
+
(1 row)
|
|
65
|
+
|
|
66
|
+
step new_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
67
|
+
step new_exchange:
|
|
68
|
+
select count(*) as issued from agent_board.exchange_delegate_credential(jsonb_build_object(
|
|
69
|
+
'iss', 'https://iso-portal.test', 'sub', 'iso-owner', 'slot_resource', null,
|
|
70
|
+
'agent_board_delegate_instance', jsonb_build_object(
|
|
71
|
+
'instance_id', 'iso_exchange_race_0001', 'grant_id', 'iso_grant_0000000003', 'generation', 3,
|
|
72
|
+
'owner_sub', 'iso-owner', 'client_id', 'iso-client', 'status', 'active', 'client_change', null)));
|
|
73
|
+
<waiting ...>
|
|
74
|
+
step old_commit: COMMIT;
|
|
75
|
+
step new_exchange: <... completed>
|
|
76
|
+
issued
|
|
77
|
+
------
|
|
78
|
+
1
|
|
79
|
+
(1 row)
|
|
80
|
+
|
|
81
|
+
step new_commit: COMMIT;
|
|
82
|
+
step check:
|
|
83
|
+
select di.generation as recorded_generation, di.grant_id as recorded_grant,
|
|
84
|
+
(select string_agg(ac.generation::text, ',' order by ac.generation)
|
|
85
|
+
from agent_board.agent_credentials ac where ac.agent_id = di.agent_id and ac.revoked_at is null) as live_generations,
|
|
86
|
+
(select count(*) from agent_board.agents a where a.handle like 'delegate-%') as delegate_agents
|
|
87
|
+
from agent_board.delegate_instances di where di.instance_id = 'iso_exchange_race_0001';
|
|
88
|
+
|
|
89
|
+
recorded_generation|recorded_grant |live_generations|delegate_agents
|
|
90
|
+
-------------------+--------------------+----------------+---------------
|
|
91
|
+
3|iso_grant_0000000003| 3| 1
|
|
92
|
+
(1 row)
|
|
93
|
+
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
Parsed test spec with 4 sessions
|
|
2
|
+
|
|
3
|
+
starting permutation: a_begin a_exchange b_begin b_exchange a_commit b_commit check
|
|
4
|
+
step a_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
5
|
+
step a_exchange:
|
|
6
|
+
select count(*) as issued from agent_board.exchange_delegate_credential(jsonb_build_object(
|
|
7
|
+
'iss', 'https://iso-portal.test', 'sub', 'iso-owner', 'slot_resource', null,
|
|
8
|
+
'agent_board_delegate_instance', jsonb_build_object(
|
|
9
|
+
'instance_id', 'iso_first_exchange_01', 'grant_id', 'iso_grant_0000000001', 'generation', 1,
|
|
10
|
+
'owner_sub', 'iso-owner', 'client_id', 'iso-client', 'status', 'active', 'client_change', null)));
|
|
11
|
+
|
|
12
|
+
issued
|
|
13
|
+
------
|
|
14
|
+
1
|
|
15
|
+
(1 row)
|
|
16
|
+
|
|
17
|
+
step b_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
18
|
+
step b_exchange:
|
|
19
|
+
select count(*) as issued from agent_board.exchange_delegate_credential(jsonb_build_object(
|
|
20
|
+
'iss', 'https://iso-portal.test', 'sub', 'iso-owner', 'slot_resource', null,
|
|
21
|
+
'agent_board_delegate_instance', jsonb_build_object(
|
|
22
|
+
'instance_id', 'iso_first_exchange_01', 'grant_id', 'iso_grant_0000000001', 'generation', 1,
|
|
23
|
+
'owner_sub', 'iso-owner', 'client_id', 'iso-client', 'status', 'active', 'client_change', null)));
|
|
24
|
+
<waiting ...>
|
|
25
|
+
step a_commit: COMMIT;
|
|
26
|
+
step b_exchange: <... completed>
|
|
27
|
+
issued
|
|
28
|
+
------
|
|
29
|
+
1
|
|
30
|
+
(1 row)
|
|
31
|
+
|
|
32
|
+
step b_commit: COMMIT;
|
|
33
|
+
step check:
|
|
34
|
+
select (select count(*) from agent_board.delegate_instances where instance_id = 'iso_first_exchange_01') as instances,
|
|
35
|
+
(select count(*) from agent_board.agents where handle like 'delegate-%') as delegate_agents,
|
|
36
|
+
(select count(*) from auth.users where email like 'agent+delegate-%') as delegate_auth_users,
|
|
37
|
+
(select count(*) from agent_board.agent_credentials ac
|
|
38
|
+
join agent_board.delegate_instances di on di.agent_id = ac.agent_id
|
|
39
|
+
where di.instance_id = 'iso_first_exchange_01' and ac.revoked_at is null) as live_credentials;
|
|
40
|
+
|
|
41
|
+
instances|delegate_agents|delegate_auth_users|live_credentials
|
|
42
|
+
---------+---------------+-------------------+----------------
|
|
43
|
+
1| 1| 1| 2
|
|
44
|
+
(1 row)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
starting permutation: b_begin b_exchange a_begin a_exchange b_commit a_commit check
|
|
48
|
+
step b_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
49
|
+
step b_exchange:
|
|
50
|
+
select count(*) as issued from agent_board.exchange_delegate_credential(jsonb_build_object(
|
|
51
|
+
'iss', 'https://iso-portal.test', 'sub', 'iso-owner', 'slot_resource', null,
|
|
52
|
+
'agent_board_delegate_instance', jsonb_build_object(
|
|
53
|
+
'instance_id', 'iso_first_exchange_01', 'grant_id', 'iso_grant_0000000001', 'generation', 1,
|
|
54
|
+
'owner_sub', 'iso-owner', 'client_id', 'iso-client', 'status', 'active', 'client_change', null)));
|
|
55
|
+
|
|
56
|
+
issued
|
|
57
|
+
------
|
|
58
|
+
1
|
|
59
|
+
(1 row)
|
|
60
|
+
|
|
61
|
+
step a_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
62
|
+
step a_exchange:
|
|
63
|
+
select count(*) as issued from agent_board.exchange_delegate_credential(jsonb_build_object(
|
|
64
|
+
'iss', 'https://iso-portal.test', 'sub', 'iso-owner', 'slot_resource', null,
|
|
65
|
+
'agent_board_delegate_instance', jsonb_build_object(
|
|
66
|
+
'instance_id', 'iso_first_exchange_01', 'grant_id', 'iso_grant_0000000001', 'generation', 1,
|
|
67
|
+
'owner_sub', 'iso-owner', 'client_id', 'iso-client', 'status', 'active', 'client_change', null)));
|
|
68
|
+
<waiting ...>
|
|
69
|
+
step b_commit: COMMIT;
|
|
70
|
+
step a_exchange: <... completed>
|
|
71
|
+
issued
|
|
72
|
+
------
|
|
73
|
+
1
|
|
74
|
+
(1 row)
|
|
75
|
+
|
|
76
|
+
step a_commit: COMMIT;
|
|
77
|
+
step check:
|
|
78
|
+
select (select count(*) from agent_board.delegate_instances where instance_id = 'iso_first_exchange_01') as instances,
|
|
79
|
+
(select count(*) from agent_board.agents where handle like 'delegate-%') as delegate_agents,
|
|
80
|
+
(select count(*) from auth.users where email like 'agent+delegate-%') as delegate_auth_users,
|
|
81
|
+
(select count(*) from agent_board.agent_credentials ac
|
|
82
|
+
join agent_board.delegate_instances di on di.agent_id = ac.agent_id
|
|
83
|
+
where di.instance_id = 'iso_first_exchange_01' and ac.revoked_at is null) as live_credentials;
|
|
84
|
+
|
|
85
|
+
instances|delegate_agents|delegate_auth_users|live_credentials
|
|
86
|
+
---------+---------------+-------------------+----------------
|
|
87
|
+
1| 1| 1| 2
|
|
88
|
+
(1 row)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
starting permutation: a_begin a_exchange i_begin i_exchange a_commit i_commit check
|
|
92
|
+
step a_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
93
|
+
step a_exchange:
|
|
94
|
+
select count(*) as issued from agent_board.exchange_delegate_credential(jsonb_build_object(
|
|
95
|
+
'iss', 'https://iso-portal.test', 'sub', 'iso-owner', 'slot_resource', null,
|
|
96
|
+
'agent_board_delegate_instance', jsonb_build_object(
|
|
97
|
+
'instance_id', 'iso_first_exchange_01', 'grant_id', 'iso_grant_0000000001', 'generation', 1,
|
|
98
|
+
'owner_sub', 'iso-owner', 'client_id', 'iso-client', 'status', 'active', 'client_change', null)));
|
|
99
|
+
|
|
100
|
+
issued
|
|
101
|
+
------
|
|
102
|
+
1
|
|
103
|
+
(1 row)
|
|
104
|
+
|
|
105
|
+
step i_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
106
|
+
step i_exchange:
|
|
107
|
+
select count(*) as issued from agent_board.exchange_delegate_credential(jsonb_build_object(
|
|
108
|
+
'iss', 'https://iso-portal.test', 'sub', 'iso-other-owner', 'slot_resource', null,
|
|
109
|
+
'agent_board_delegate_instance', jsonb_build_object(
|
|
110
|
+
'instance_id', 'iso_first_exchange_01', 'grant_id', 'iso_grant_0000000009', 'generation', 1,
|
|
111
|
+
'owner_sub', 'iso-other-owner', 'client_id', 'iso-client', 'status', 'active', 'client_change', null)));
|
|
112
|
+
<waiting ...>
|
|
113
|
+
step a_commit: COMMIT;
|
|
114
|
+
step i_exchange: <... completed>
|
|
115
|
+
ERROR: owner_mismatch
|
|
116
|
+
step i_commit: COMMIT;
|
|
117
|
+
step check:
|
|
118
|
+
select (select count(*) from agent_board.delegate_instances where instance_id = 'iso_first_exchange_01') as instances,
|
|
119
|
+
(select count(*) from agent_board.agents where handle like 'delegate-%') as delegate_agents,
|
|
120
|
+
(select count(*) from auth.users where email like 'agent+delegate-%') as delegate_auth_users,
|
|
121
|
+
(select count(*) from agent_board.agent_credentials ac
|
|
122
|
+
join agent_board.delegate_instances di on di.agent_id = ac.agent_id
|
|
123
|
+
where di.instance_id = 'iso_first_exchange_01' and ac.revoked_at is null) as live_credentials;
|
|
124
|
+
|
|
125
|
+
instances|delegate_agents|delegate_auth_users|live_credentials
|
|
126
|
+
---------+---------------+-------------------+----------------
|
|
127
|
+
1| 1| 1| 1
|
|
128
|
+
(1 row)
|
|
129
|
+
|