@consiliency/agent-board-schema 1.59.0 → 1.63.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/README.md +80 -0
- package/fixtures/already-applied.json +16 -0
- package/migrations/20261010000100_agent_board_own_post_not_delivered.sql +637 -0
- package/migrations/20261011000100_agent_board_session_identities.sql +1964 -0
- package/migrations/20261012000100_agent_board_sidowner.sql +209 -0
- package/migrations/20261014000100_agent_board_grant_target_role.sql +218 -0
- package/package.json +1 -1
- package/schema-manifest.json +39 -3
- package/src/tooling.test.mjs +9 -2
- package/tests/agent_board_addressing.test.sql +3 -1
- package/tests/agent_board_atomic_fleet_onboarding.test.sql +13 -4
- package/tests/agent_board_consent_emission.test.sql +30 -11
- package/tests/agent_board_consent_gating.test.sql +16 -2
- package/tests/agent_board_delegate_role_class.test.sql +1 -1
- package/tests/agent_board_delegation_cap_ceiling.test.sql +26 -15
- package/tests/agent_board_delegation_enforcement.test.sql +1 -1
- package/tests/agent_board_enroll_resumption.test.sql +22 -4
- package/tests/agent_board_enroll_token_single_use.test.sql +18 -3
- package/tests/agent_board_federated_lock_order_class.test.sql +2 -2
- package/tests/agent_board_fk_lock_edges.test.sql +74 -14
- package/tests/agent_board_grant_target_role.test.sql +1118 -0
- package/tests/agent_board_inbox_rpcs.test.sql +5 -2
- package/tests/agent_board_invite_no_downgrade.test.sql +10 -8
- package/tests/agent_board_ledger_authority.test.sql +70 -12
- package/tests/agent_board_membership_current_row_class.test.sql +9 -1
- package/tests/agent_board_mint_fleet_agent_session.test.sql +2 -2
- package/tests/agent_board_mint_harden.test.sql +38 -27
- package/tests/agent_board_own_post_not_delivered.test.sql +490 -0
- package/tests/agent_board_rolereset.test.sql +8 -2
- package/tests/agent_board_roomdeleg_lane_b.test.sql +6 -6
- package/tests/agent_board_rowid.test.sql +3 -1
- package/tests/agent_board_session_identity_approval_revocation.test.sql +334 -0
- package/tests/agent_board_session_identity_backfill.test.sql +82 -0
- package/tests/agent_board_session_identity_backfill_refusal.test.sql +14 -0
- package/tests/agent_board_session_identity_behavior_classes.test.sql +176 -0
- package/tests/agent_board_session_identity_class.test.sql +118 -0
- package/tests/agent_board_session_identity_fingerprint.test.sql +271 -0
- package/tests/agent_board_session_identity_labels_limits.test.sql +205 -0
- package/tests/agent_board_session_identity_lease.test.sql +235 -0
- package/tests/agent_board_session_identity_lifetime.test.sql +230 -0
- package/tests/agent_board_session_identity_limits.test.sql +208 -0
- package/tests/agent_board_session_identity_lineage.test.sql +64 -0
- package/tests/agent_board_session_identity_link.test.sql +201 -0
- package/tests/agent_board_session_identity_mint.test.sql +233 -0
- package/tests/agent_board_session_identity_panel_r1.test.sql +194 -0
- package/tests/agent_board_session_identity_panel_r2.test.sql +174 -0
- package/tests/agent_board_session_identity_protected_actions.test.sql +156 -0
- package/tests/agent_board_session_identity_revoke_closure.test.sql +131 -0
- package/tests/agent_board_sidowner_leases.test.sql +107 -0
- package/tests/agent_board_sidowner_owner_required.test.sql +97 -0
- package/tests/agent_board_sidowner_read_class.test.sql +171 -0
- package/tests/agent_board_sidowner_reads.test.sql +136 -0
- package/tests/agent_board_signer_lifecycle.test.sql +26 -4
- package/tests/agent_board_signing_challenge_pending_cap.test.sql +1 -1
- package/tests/agent_board_v2_invariants.test.sql +4 -4
- package/tests/agent_board_write_enforcement_class.test.sql +74 -15
- package/tests/catalog/function_execute_privileges.json +218 -2
- package/tests/catalog/p_metadata_parameters.json +98 -2
- package/tests/isolation/expected/grant_target_role_race.out +348 -0
- package/tests/isolation/expected/session_identity_limits.out +165 -0
- package/tests/isolation/expected/session_identity_links.out +235 -0
- package/tests/isolation/expected/session_identity_reclaim.out +253 -0
- package/tests/isolation/expected/session_identity_renew_revoke.out +115 -0
- package/tests/isolation/expected/session_identity_renew_revoke_key_gate.out +138 -0
- package/tests/isolation/expected/session_identity_tombstone_onboarding.out +247 -0
- package/tests/isolation/specs/grant_target_role_race.spec +207 -0
- package/tests/isolation/specs/session_identity_limits.spec +81 -0
- package/tests/isolation/specs/session_identity_links.spec +80 -0
- package/tests/isolation/specs/session_identity_reclaim.spec +125 -0
- package/tests/isolation/specs/session_identity_renew_revoke.spec +84 -0
- package/tests/isolation/specs/session_identity_renew_revoke_key_gate.spec +94 -0
- package/tests/isolation/specs/session_identity_tombstone_onboarding.spec +108 -0
- package/tests/seeds/20261011000100_agent_board_session_identities.sql.pre.sql +47 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Parsed test spec with 3 sessions
|
|
2
|
+
|
|
3
|
+
starting permutation: renew_begin renew revoke_begin revoke renew_commit revoke_commit check
|
|
4
|
+
step renew_begin:
|
|
5
|
+
BEGIN;
|
|
6
|
+
select set_config('request.jwt.claim.sub', (select auth_user_id::text from agent_board.agents where handle = 'sid-renew-child'), true) is not null as holder_forwarded;
|
|
7
|
+
SET LOCAL ROLE service_role;
|
|
8
|
+
SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
9
|
+
SET LOCAL "request.jwt.claim.identity_lease_epoch" = '0';
|
|
10
|
+
|
|
11
|
+
holder_forwarded
|
|
12
|
+
----------------
|
|
13
|
+
t
|
|
14
|
+
(1 row)
|
|
15
|
+
|
|
16
|
+
step renew:
|
|
17
|
+
select agent_board.renew_session_identity((select id from agent_board.agents where handle = 'sid-renew-child'), 'approved');
|
|
18
|
+
|
|
19
|
+
renew_session_identity
|
|
20
|
+
----------------------
|
|
21
|
+
|
|
22
|
+
(1 row)
|
|
23
|
+
|
|
24
|
+
step revoke_begin:
|
|
25
|
+
BEGIN;
|
|
26
|
+
SET LOCAL ROLE authenticated;
|
|
27
|
+
SET LOCAL "request.jwt.claim.role" = 'authenticated';
|
|
28
|
+
SET LOCAL "request.jwt.claim.sub" = '81000000-0000-4000-8000-000000000001';
|
|
29
|
+
|
|
30
|
+
step revoke:
|
|
31
|
+
select agent_board.revoke_session_identity((select id from agent_board.agents where handle = 'sid-renew-child'));
|
|
32
|
+
<waiting ...>
|
|
33
|
+
step renew_commit: COMMIT;
|
|
34
|
+
step revoke: <... completed>
|
|
35
|
+
revoke_session_identity
|
|
36
|
+
-----------------------
|
|
37
|
+
|
|
38
|
+
(1 row)
|
|
39
|
+
|
|
40
|
+
step revoke_commit: COMMIT;
|
|
41
|
+
step check:
|
|
42
|
+
select si.tombstone_reason, si.credential_epoch, a.status, g.revoked_at is not null as grant_revoked,
|
|
43
|
+
g.last_renewed_at is not null as renewal_preceded_revoke,
|
|
44
|
+
(select count(*) from agent_board.fleet_revocation_events e where e.subject_id = a.id) as permanent_revocations,
|
|
45
|
+
(select count(*) from agent_board.agent_signing_keys k where k.agent_id = a.id and k.status <> 'revoked') as active_keys
|
|
46
|
+
from agent_board.agents a join agent_board.session_identities si on si.agent_id = a.id
|
|
47
|
+
join agent_board.delegation_grants g on g.child_agent_id = a.id where a.handle = 'sid-renew-child';
|
|
48
|
+
select bool_and(expires_at <= issued_at + interval '900 seconds') as bounded_pre_revoke_tokens
|
|
49
|
+
from agent_board.nonfleet_sessions where agent_id = (select id from agent_board.agents where handle = 'sid-renew-child');
|
|
50
|
+
|
|
51
|
+
tombstone_reason|credential_epoch|status |grant_revoked|renewal_preceded_revoke|permanent_revocations|active_keys
|
|
52
|
+
----------------+----------------+-------+-------------+-----------------------+---------------------+-----------
|
|
53
|
+
revoked | 1|revoked|t |t | 1| 0
|
|
54
|
+
(1 row)
|
|
55
|
+
|
|
56
|
+
bounded_pre_revoke_tokens
|
|
57
|
+
-------------------------
|
|
58
|
+
t
|
|
59
|
+
(1 row)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
starting permutation: revoke_begin revoke renew_begin renew revoke_commit renew_commit check
|
|
63
|
+
step revoke_begin:
|
|
64
|
+
BEGIN;
|
|
65
|
+
SET LOCAL ROLE authenticated;
|
|
66
|
+
SET LOCAL "request.jwt.claim.role" = 'authenticated';
|
|
67
|
+
SET LOCAL "request.jwt.claim.sub" = '81000000-0000-4000-8000-000000000001';
|
|
68
|
+
|
|
69
|
+
step revoke:
|
|
70
|
+
select agent_board.revoke_session_identity((select id from agent_board.agents where handle = 'sid-renew-child'));
|
|
71
|
+
|
|
72
|
+
revoke_session_identity
|
|
73
|
+
-----------------------
|
|
74
|
+
|
|
75
|
+
(1 row)
|
|
76
|
+
|
|
77
|
+
step renew_begin:
|
|
78
|
+
BEGIN;
|
|
79
|
+
select set_config('request.jwt.claim.sub', (select auth_user_id::text from agent_board.agents where handle = 'sid-renew-child'), true) is not null as holder_forwarded;
|
|
80
|
+
SET LOCAL ROLE service_role;
|
|
81
|
+
SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
82
|
+
SET LOCAL "request.jwt.claim.identity_lease_epoch" = '0';
|
|
83
|
+
|
|
84
|
+
holder_forwarded
|
|
85
|
+
----------------
|
|
86
|
+
t
|
|
87
|
+
(1 row)
|
|
88
|
+
|
|
89
|
+
step renew:
|
|
90
|
+
select agent_board.renew_session_identity((select id from agent_board.agents where handle = 'sid-renew-child'), 'approved');
|
|
91
|
+
<waiting ...>
|
|
92
|
+
step revoke_commit: COMMIT;
|
|
93
|
+
step renew: <... completed>
|
|
94
|
+
ERROR: identity_tombstoned
|
|
95
|
+
step renew_commit: COMMIT;
|
|
96
|
+
step check:
|
|
97
|
+
select si.tombstone_reason, si.credential_epoch, a.status, g.revoked_at is not null as grant_revoked,
|
|
98
|
+
g.last_renewed_at is not null as renewal_preceded_revoke,
|
|
99
|
+
(select count(*) from agent_board.fleet_revocation_events e where e.subject_id = a.id) as permanent_revocations,
|
|
100
|
+
(select count(*) from agent_board.agent_signing_keys k where k.agent_id = a.id and k.status <> 'revoked') as active_keys
|
|
101
|
+
from agent_board.agents a join agent_board.session_identities si on si.agent_id = a.id
|
|
102
|
+
join agent_board.delegation_grants g on g.child_agent_id = a.id where a.handle = 'sid-renew-child';
|
|
103
|
+
select bool_and(expires_at <= issued_at + interval '900 seconds') as bounded_pre_revoke_tokens
|
|
104
|
+
from agent_board.nonfleet_sessions where agent_id = (select id from agent_board.agents where handle = 'sid-renew-child');
|
|
105
|
+
|
|
106
|
+
tombstone_reason|credential_epoch|status |grant_revoked|renewal_preceded_revoke|permanent_revocations|active_keys
|
|
107
|
+
----------------+----------------+-------+-------------+-----------------------+---------------------+-----------
|
|
108
|
+
revoked | 1|revoked|t |f | 1| 0
|
|
109
|
+
(1 row)
|
|
110
|
+
|
|
111
|
+
bounded_pre_revoke_tokens
|
|
112
|
+
-------------------------
|
|
113
|
+
t
|
|
114
|
+
(1 row)
|
|
115
|
+
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
Parsed test spec with 4 sessions
|
|
2
|
+
|
|
3
|
+
starting permutation: key_begin key_hold revoke_begin revoke renew_begin renew key_commit revoke_commit renew_commit check
|
|
4
|
+
step key_begin: BEGIN;
|
|
5
|
+
step key_hold:
|
|
6
|
+
select 1 as held from agent_board.agent_signing_keys
|
|
7
|
+
where agent_id = (select id from agent_board.agents where handle = 'sid-renew-child') for update;
|
|
8
|
+
|
|
9
|
+
held
|
|
10
|
+
----
|
|
11
|
+
1
|
|
12
|
+
(1 row)
|
|
13
|
+
|
|
14
|
+
step revoke_begin:
|
|
15
|
+
BEGIN;
|
|
16
|
+
SET LOCAL ROLE authenticated;
|
|
17
|
+
SET LOCAL "request.jwt.claim.role" = 'authenticated';
|
|
18
|
+
SET LOCAL "request.jwt.claim.sub" = '81000000-0000-4000-8000-000000000001';
|
|
19
|
+
|
|
20
|
+
step revoke:
|
|
21
|
+
select agent_board.revoke_session_identity((select id from agent_board.agents where handle = 'sid-renew-child'));
|
|
22
|
+
<waiting ...>
|
|
23
|
+
step renew_begin:
|
|
24
|
+
BEGIN;
|
|
25
|
+
select set_config('request.jwt.claim.sub', (select auth_user_id::text from agent_board.agents where handle = 'sid-renew-child'), true) is not null as holder_forwarded;
|
|
26
|
+
SET LOCAL ROLE service_role;
|
|
27
|
+
SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
28
|
+
SET LOCAL "request.jwt.claim.identity_lease_epoch" = '0';
|
|
29
|
+
|
|
30
|
+
holder_forwarded
|
|
31
|
+
----------------
|
|
32
|
+
t
|
|
33
|
+
(1 row)
|
|
34
|
+
|
|
35
|
+
step renew:
|
|
36
|
+
select agent_board.renew_session_identity((select id from agent_board.agents where handle = 'sid-renew-child'), 'approved');
|
|
37
|
+
<waiting ...>
|
|
38
|
+
step key_commit: COMMIT;
|
|
39
|
+
step revoke: <... completed>
|
|
40
|
+
revoke_session_identity
|
|
41
|
+
-----------------------
|
|
42
|
+
|
|
43
|
+
(1 row)
|
|
44
|
+
|
|
45
|
+
step revoke_commit: COMMIT;
|
|
46
|
+
step renew: <... completed>
|
|
47
|
+
ERROR: identity_tombstoned
|
|
48
|
+
step renew_commit: COMMIT;
|
|
49
|
+
step check:
|
|
50
|
+
select si.tombstone_reason, si.credential_epoch, a.status, g.revoked_at is not null as grant_revoked,
|
|
51
|
+
g.last_renewed_at is not null as renewal_preceded_revoke,
|
|
52
|
+
(select count(*) from agent_board.fleet_revocation_events e where e.subject_id = a.id) as permanent_revocations,
|
|
53
|
+
(select count(*) from agent_board.agent_signing_keys k where k.agent_id = a.id and k.status <> 'revoked') as active_keys
|
|
54
|
+
from agent_board.agents a join agent_board.session_identities si on si.agent_id = a.id
|
|
55
|
+
join agent_board.delegation_grants g on g.child_agent_id = a.id where a.handle = 'sid-renew-child';
|
|
56
|
+
select bool_and(expires_at <= issued_at + interval '900 seconds') as bounded_pre_revoke_tokens
|
|
57
|
+
from agent_board.nonfleet_sessions where agent_id = (select id from agent_board.agents where handle = 'sid-renew-child');
|
|
58
|
+
|
|
59
|
+
tombstone_reason|credential_epoch|status |grant_revoked|renewal_preceded_revoke|permanent_revocations|active_keys
|
|
60
|
+
----------------+----------------+-------+-------------+-----------------------+---------------------+-----------
|
|
61
|
+
revoked | 1|revoked|t |f | 1| 0
|
|
62
|
+
(1 row)
|
|
63
|
+
|
|
64
|
+
bounded_pre_revoke_tokens
|
|
65
|
+
-------------------------
|
|
66
|
+
t
|
|
67
|
+
(1 row)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
starting permutation: key_begin key_hold renew_begin renew revoke_begin revoke key_commit renew_commit revoke_commit check
|
|
71
|
+
step key_begin: BEGIN;
|
|
72
|
+
step key_hold:
|
|
73
|
+
select 1 as held from agent_board.agent_signing_keys
|
|
74
|
+
where agent_id = (select id from agent_board.agents where handle = 'sid-renew-child') for update;
|
|
75
|
+
|
|
76
|
+
held
|
|
77
|
+
----
|
|
78
|
+
1
|
|
79
|
+
(1 row)
|
|
80
|
+
|
|
81
|
+
step renew_begin:
|
|
82
|
+
BEGIN;
|
|
83
|
+
select set_config('request.jwt.claim.sub', (select auth_user_id::text from agent_board.agents where handle = 'sid-renew-child'), true) is not null as holder_forwarded;
|
|
84
|
+
SET LOCAL ROLE service_role;
|
|
85
|
+
SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
86
|
+
SET LOCAL "request.jwt.claim.identity_lease_epoch" = '0';
|
|
87
|
+
|
|
88
|
+
holder_forwarded
|
|
89
|
+
----------------
|
|
90
|
+
t
|
|
91
|
+
(1 row)
|
|
92
|
+
|
|
93
|
+
step renew:
|
|
94
|
+
select agent_board.renew_session_identity((select id from agent_board.agents where handle = 'sid-renew-child'), 'approved');
|
|
95
|
+
|
|
96
|
+
renew_session_identity
|
|
97
|
+
----------------------
|
|
98
|
+
|
|
99
|
+
(1 row)
|
|
100
|
+
|
|
101
|
+
step revoke_begin:
|
|
102
|
+
BEGIN;
|
|
103
|
+
SET LOCAL ROLE authenticated;
|
|
104
|
+
SET LOCAL "request.jwt.claim.role" = 'authenticated';
|
|
105
|
+
SET LOCAL "request.jwt.claim.sub" = '81000000-0000-4000-8000-000000000001';
|
|
106
|
+
|
|
107
|
+
step revoke:
|
|
108
|
+
select agent_board.revoke_session_identity((select id from agent_board.agents where handle = 'sid-renew-child'));
|
|
109
|
+
<waiting ...>
|
|
110
|
+
step key_commit: COMMIT;
|
|
111
|
+
step renew_commit: COMMIT;
|
|
112
|
+
step revoke: <... completed>
|
|
113
|
+
revoke_session_identity
|
|
114
|
+
-----------------------
|
|
115
|
+
|
|
116
|
+
(1 row)
|
|
117
|
+
|
|
118
|
+
step revoke_commit: COMMIT;
|
|
119
|
+
step check:
|
|
120
|
+
select si.tombstone_reason, si.credential_epoch, a.status, g.revoked_at is not null as grant_revoked,
|
|
121
|
+
g.last_renewed_at is not null as renewal_preceded_revoke,
|
|
122
|
+
(select count(*) from agent_board.fleet_revocation_events e where e.subject_id = a.id) as permanent_revocations,
|
|
123
|
+
(select count(*) from agent_board.agent_signing_keys k where k.agent_id = a.id and k.status <> 'revoked') as active_keys
|
|
124
|
+
from agent_board.agents a join agent_board.session_identities si on si.agent_id = a.id
|
|
125
|
+
join agent_board.delegation_grants g on g.child_agent_id = a.id where a.handle = 'sid-renew-child';
|
|
126
|
+
select bool_and(expires_at <= issued_at + interval '900 seconds') as bounded_pre_revoke_tokens
|
|
127
|
+
from agent_board.nonfleet_sessions where agent_id = (select id from agent_board.agents where handle = 'sid-renew-child');
|
|
128
|
+
|
|
129
|
+
tombstone_reason|credential_epoch|status |grant_revoked|renewal_preceded_revoke|permanent_revocations|active_keys
|
|
130
|
+
----------------+----------------+-------+-------------+-----------------------+---------------------+-----------
|
|
131
|
+
revoked | 1|revoked|t |t | 1| 0
|
|
132
|
+
(1 row)
|
|
133
|
+
|
|
134
|
+
bounded_pre_revoke_tokens
|
|
135
|
+
-------------------------
|
|
136
|
+
t
|
|
137
|
+
(1 row)
|
|
138
|
+
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
Parsed test spec with 3 sessions
|
|
2
|
+
|
|
3
|
+
starting permutation: o_begin o_advisory o_agents t_begin t_tomb o_membership o_commit t_commit check
|
|
4
|
+
step o_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
5
|
+
step o_advisory:
|
|
6
|
+
select agent_board._lock_board_authority_ceiling('85000000-0000-4000-8000-000000000002') is null as advisory_taken;
|
|
7
|
+
|
|
8
|
+
advisory_taken
|
|
9
|
+
--------------
|
|
10
|
+
f
|
|
11
|
+
(1 row)
|
|
12
|
+
|
|
13
|
+
step o_agents:
|
|
14
|
+
select count(*)::int as locked_agents from (
|
|
15
|
+
select 1 from agent_board.agents where id='85000000-0000-4000-8000-000000000001' for update) s;
|
|
16
|
+
|
|
17
|
+
locked_agents
|
|
18
|
+
-------------
|
|
19
|
+
1
|
|
20
|
+
(1 row)
|
|
21
|
+
|
|
22
|
+
step t_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
23
|
+
step t_tomb:
|
|
24
|
+
select first from agent_board.tombstone_delegate_instance(
|
|
25
|
+
'sid_ti_instance_00001','urn:sid-ti:issuer','sid-ti-owner','owner_revoked');
|
|
26
|
+
<waiting ...>
|
|
27
|
+
step o_membership:
|
|
28
|
+
select count(*)::int as locked_memberships from (
|
|
29
|
+
select 1 from agent_board.board_memberships
|
|
30
|
+
where board_id='85000000-0000-4000-8000-000000000002'
|
|
31
|
+
and agent_id='85000000-0000-4000-8000-000000000001' for update) s;
|
|
32
|
+
|
|
33
|
+
locked_memberships
|
|
34
|
+
------------------
|
|
35
|
+
1
|
|
36
|
+
(1 row)
|
|
37
|
+
|
|
38
|
+
step o_commit: COMMIT;
|
|
39
|
+
step t_tomb: <... completed>
|
|
40
|
+
first
|
|
41
|
+
-----
|
|
42
|
+
t
|
|
43
|
+
(1 row)
|
|
44
|
+
|
|
45
|
+
step t_commit: COMMIT;
|
|
46
|
+
step check:
|
|
47
|
+
select tombstoned_at is not null as instance_tombstoned from agent_board.delegate_instances
|
|
48
|
+
where instance_id='sid_ti_instance_00001';
|
|
49
|
+
select status from agent_board.agents where id='85000000-0000-4000-8000-000000000001';
|
|
50
|
+
select membership_state from agent_board.board_memberships
|
|
51
|
+
where board_id='85000000-0000-4000-8000-000000000002'
|
|
52
|
+
and agent_id='85000000-0000-4000-8000-000000000001';
|
|
53
|
+
select si.tombstoned_at is not null as child_tombstoned,si.credential_epoch,
|
|
54
|
+
(select count(*) from agent_board.agent_credentials ac where ac.agent_id=si.agent_id and ac.revoked_at is null) as live_credentials
|
|
55
|
+
from agent_board.session_identities si join agent_board.agents a on a.id=si.agent_id where a.handle='sid-ti-child';
|
|
56
|
+
select count(*) as withdrawal_events from agent_board.board_membership_events
|
|
57
|
+
where board_id='85000000-0000-4000-8000-000000000002' and event_kind='operator_removal';
|
|
58
|
+
|
|
59
|
+
instance_tombstoned
|
|
60
|
+
-------------------
|
|
61
|
+
t
|
|
62
|
+
(1 row)
|
|
63
|
+
|
|
64
|
+
status
|
|
65
|
+
-------
|
|
66
|
+
revoked
|
|
67
|
+
(1 row)
|
|
68
|
+
|
|
69
|
+
membership_state
|
|
70
|
+
----------------
|
|
71
|
+
left
|
|
72
|
+
(1 row)
|
|
73
|
+
|
|
74
|
+
child_tombstoned|credential_epoch|live_credentials
|
|
75
|
+
----------------+----------------+----------------
|
|
76
|
+
t | 1| 0
|
|
77
|
+
(1 row)
|
|
78
|
+
|
|
79
|
+
withdrawal_events
|
|
80
|
+
-----------------
|
|
81
|
+
1
|
|
82
|
+
(1 row)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
starting permutation: t_begin t_tomb o_begin o_advisory t_commit o_agents o_membership o_commit check
|
|
86
|
+
step t_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
87
|
+
step t_tomb:
|
|
88
|
+
select first from agent_board.tombstone_delegate_instance(
|
|
89
|
+
'sid_ti_instance_00001','urn:sid-ti:issuer','sid-ti-owner','owner_revoked');
|
|
90
|
+
|
|
91
|
+
first
|
|
92
|
+
-----
|
|
93
|
+
t
|
|
94
|
+
(1 row)
|
|
95
|
+
|
|
96
|
+
step o_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
97
|
+
step o_advisory:
|
|
98
|
+
select agent_board._lock_board_authority_ceiling('85000000-0000-4000-8000-000000000002') is null as advisory_taken;
|
|
99
|
+
<waiting ...>
|
|
100
|
+
step t_commit: COMMIT;
|
|
101
|
+
step o_advisory: <... completed>
|
|
102
|
+
advisory_taken
|
|
103
|
+
--------------
|
|
104
|
+
f
|
|
105
|
+
(1 row)
|
|
106
|
+
|
|
107
|
+
step o_agents:
|
|
108
|
+
select count(*)::int as locked_agents from (
|
|
109
|
+
select 1 from agent_board.agents where id='85000000-0000-4000-8000-000000000001' for update) s;
|
|
110
|
+
|
|
111
|
+
locked_agents
|
|
112
|
+
-------------
|
|
113
|
+
1
|
|
114
|
+
(1 row)
|
|
115
|
+
|
|
116
|
+
step o_membership:
|
|
117
|
+
select count(*)::int as locked_memberships from (
|
|
118
|
+
select 1 from agent_board.board_memberships
|
|
119
|
+
where board_id='85000000-0000-4000-8000-000000000002'
|
|
120
|
+
and agent_id='85000000-0000-4000-8000-000000000001' for update) s;
|
|
121
|
+
|
|
122
|
+
locked_memberships
|
|
123
|
+
------------------
|
|
124
|
+
1
|
|
125
|
+
(1 row)
|
|
126
|
+
|
|
127
|
+
step o_commit: COMMIT;
|
|
128
|
+
step check:
|
|
129
|
+
select tombstoned_at is not null as instance_tombstoned from agent_board.delegate_instances
|
|
130
|
+
where instance_id='sid_ti_instance_00001';
|
|
131
|
+
select status from agent_board.agents where id='85000000-0000-4000-8000-000000000001';
|
|
132
|
+
select membership_state from agent_board.board_memberships
|
|
133
|
+
where board_id='85000000-0000-4000-8000-000000000002'
|
|
134
|
+
and agent_id='85000000-0000-4000-8000-000000000001';
|
|
135
|
+
select si.tombstoned_at is not null as child_tombstoned,si.credential_epoch,
|
|
136
|
+
(select count(*) from agent_board.agent_credentials ac where ac.agent_id=si.agent_id and ac.revoked_at is null) as live_credentials
|
|
137
|
+
from agent_board.session_identities si join agent_board.agents a on a.id=si.agent_id where a.handle='sid-ti-child';
|
|
138
|
+
select count(*) as withdrawal_events from agent_board.board_membership_events
|
|
139
|
+
where board_id='85000000-0000-4000-8000-000000000002' and event_kind='operator_removal';
|
|
140
|
+
|
|
141
|
+
instance_tombstoned
|
|
142
|
+
-------------------
|
|
143
|
+
t
|
|
144
|
+
(1 row)
|
|
145
|
+
|
|
146
|
+
status
|
|
147
|
+
-------
|
|
148
|
+
revoked
|
|
149
|
+
(1 row)
|
|
150
|
+
|
|
151
|
+
membership_state
|
|
152
|
+
----------------
|
|
153
|
+
left
|
|
154
|
+
(1 row)
|
|
155
|
+
|
|
156
|
+
child_tombstoned|credential_epoch|live_credentials
|
|
157
|
+
----------------+----------------+----------------
|
|
158
|
+
t | 1| 0
|
|
159
|
+
(1 row)
|
|
160
|
+
|
|
161
|
+
withdrawal_events
|
|
162
|
+
-----------------
|
|
163
|
+
1
|
|
164
|
+
(1 row)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
starting permutation: o_begin o_advisory t_begin t_tomb o_agents o_membership o_commit t_commit check
|
|
168
|
+
step o_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
169
|
+
step o_advisory:
|
|
170
|
+
select agent_board._lock_board_authority_ceiling('85000000-0000-4000-8000-000000000002') is null as advisory_taken;
|
|
171
|
+
|
|
172
|
+
advisory_taken
|
|
173
|
+
--------------
|
|
174
|
+
f
|
|
175
|
+
(1 row)
|
|
176
|
+
|
|
177
|
+
step t_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
178
|
+
step t_tomb:
|
|
179
|
+
select first from agent_board.tombstone_delegate_instance(
|
|
180
|
+
'sid_ti_instance_00001','urn:sid-ti:issuer','sid-ti-owner','owner_revoked');
|
|
181
|
+
<waiting ...>
|
|
182
|
+
step o_agents:
|
|
183
|
+
select count(*)::int as locked_agents from (
|
|
184
|
+
select 1 from agent_board.agents where id='85000000-0000-4000-8000-000000000001' for update) s;
|
|
185
|
+
|
|
186
|
+
locked_agents
|
|
187
|
+
-------------
|
|
188
|
+
1
|
|
189
|
+
(1 row)
|
|
190
|
+
|
|
191
|
+
step o_membership:
|
|
192
|
+
select count(*)::int as locked_memberships from (
|
|
193
|
+
select 1 from agent_board.board_memberships
|
|
194
|
+
where board_id='85000000-0000-4000-8000-000000000002'
|
|
195
|
+
and agent_id='85000000-0000-4000-8000-000000000001' for update) s;
|
|
196
|
+
|
|
197
|
+
locked_memberships
|
|
198
|
+
------------------
|
|
199
|
+
1
|
|
200
|
+
(1 row)
|
|
201
|
+
|
|
202
|
+
step o_commit: COMMIT;
|
|
203
|
+
step t_tomb: <... completed>
|
|
204
|
+
first
|
|
205
|
+
-----
|
|
206
|
+
t
|
|
207
|
+
(1 row)
|
|
208
|
+
|
|
209
|
+
step t_commit: COMMIT;
|
|
210
|
+
step check:
|
|
211
|
+
select tombstoned_at is not null as instance_tombstoned from agent_board.delegate_instances
|
|
212
|
+
where instance_id='sid_ti_instance_00001';
|
|
213
|
+
select status from agent_board.agents where id='85000000-0000-4000-8000-000000000001';
|
|
214
|
+
select membership_state from agent_board.board_memberships
|
|
215
|
+
where board_id='85000000-0000-4000-8000-000000000002'
|
|
216
|
+
and agent_id='85000000-0000-4000-8000-000000000001';
|
|
217
|
+
select si.tombstoned_at is not null as child_tombstoned,si.credential_epoch,
|
|
218
|
+
(select count(*) from agent_board.agent_credentials ac where ac.agent_id=si.agent_id and ac.revoked_at is null) as live_credentials
|
|
219
|
+
from agent_board.session_identities si join agent_board.agents a on a.id=si.agent_id where a.handle='sid-ti-child';
|
|
220
|
+
select count(*) as withdrawal_events from agent_board.board_membership_events
|
|
221
|
+
where board_id='85000000-0000-4000-8000-000000000002' and event_kind='operator_removal';
|
|
222
|
+
|
|
223
|
+
instance_tombstoned
|
|
224
|
+
-------------------
|
|
225
|
+
t
|
|
226
|
+
(1 row)
|
|
227
|
+
|
|
228
|
+
status
|
|
229
|
+
-------
|
|
230
|
+
revoked
|
|
231
|
+
(1 row)
|
|
232
|
+
|
|
233
|
+
membership_state
|
|
234
|
+
----------------
|
|
235
|
+
left
|
|
236
|
+
(1 row)
|
|
237
|
+
|
|
238
|
+
child_tombstoned|credential_epoch|live_credentials
|
|
239
|
+
----------------+----------------+----------------
|
|
240
|
+
t | 1| 0
|
|
241
|
+
(1 row)
|
|
242
|
+
|
|
243
|
+
withdrawal_events
|
|
244
|
+
-----------------
|
|
245
|
+
1
|
|
246
|
+
(1 row)
|
|
247
|
+
|