@consiliency/agent-board-schema 1.22.0 → 1.23.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 +36 -0
- package/migrations/20260901000100_agent_board_atomic_fleet_onboarding.sql +1496 -0
- package/migrations/20260901000110_agent_board_fleet_onboarding_ceiling_lock.sql +604 -0
- package/migrations/20260901000120_agent_board_human_revocation_evidence_completeness.sql +78 -0
- package/migrations/20260901000130_agent_board_fedsession_human_revocation_gate.sql +74 -0
- package/migrations/20260901000140_agent_board_fedsession_board_owner_lock_order.sql +102 -0
- package/migrations/20260902000100_agent_board_outbox_wake_ordering.sql +184 -0
- package/migrations/20260903000100_agent_board_enroll_identity_board_owner_lock_order.sql +604 -0
- package/migrations/20260903000200_agent_board_fedsession_provider_absence_gate.sql +177 -0
- package/migrations/20260904000100_agent_board_wake_recovery_surface.sql +155 -0
- package/package.json +1 -1
- package/schema-manifest.json +84 -3
- package/src/tooling.test.mjs +2 -2
- package/tests/agent_board_atomic_fleet_onboarding.test.sql +623 -0
- package/tests/agent_board_atomic_fleet_onboarding_backfill.test.sql +142 -0
- package/tests/agent_board_atomic_fleet_onboarding_runtime.test.sql +1250 -0
- package/tests/agent_board_enroll_federated_identity.test.sql +3 -3
- package/tests/agent_board_enroll_pop_binding.test.sql +13 -3
- package/tests/agent_board_enrollment_audit_content.test.sql +11 -7
- package/tests/agent_board_federated_lock_order_class.test.sql +390 -0
- package/tests/agent_board_fedsession.test.sql +46 -2
- package/tests/agent_board_fedsession_provider_absence_gate.test.sql +170 -0
- package/tests/agent_board_inbox_reads.test.sql +16 -19
- package/tests/agent_board_outbox_wake_ordering.test.sql +452 -0
- package/tests/agent_board_portal_offline_invariant.test.sql +1 -1
- package/tests/agent_board_roomlink.test.sql +2 -2
- package/tests/agent_board_wake_recovery.test.sql +756 -0
- package/tests/isolation/expected/atomic_fedsession_fleet_lock_order.out +79 -0
- package/tests/isolation/expected/atomic_fedsession_human_revoke.out +87 -0
- package/tests/isolation/expected/atomic_fleet_authority_races.out +469 -0
- package/tests/isolation/expected/atomic_fleet_binding_revoke.out +103 -0
- package/tests/isolation/expected/atomic_fleet_board_archive.out +117 -0
- package/tests/isolation/expected/atomic_fleet_human_fresh_revoke.out +136 -0
- package/tests/isolation/expected/atomic_fleet_identity_disposition.out +61 -0
- package/tests/isolation/expected/atomic_fleet_lifecycle_races.out +1479 -0
- package/tests/isolation/expected/atomic_fleet_onboarding.out +75 -0
- package/tests/isolation/expected/atomic_fleet_subtree_lock_order.out +60 -0
- package/tests/isolation/expected/ceiling_setter_lock_before_upsert.out +95 -0
- package/tests/isolation/expected/enroll_identity_board_owner_lock_order.out +55 -0
- package/tests/isolation/expected/fedsession_provider_absent_owner_lock.out +37 -0
- package/tests/isolation/expected/onboarding_ceiling_lock_order.out +123 -0
- package/tests/isolation/expected/outbox_wake_ordering.out +86 -0
- package/tests/isolation/expected/wake_recovery_late_commit.out +89 -0
- package/tests/isolation/specs/atomic_fedsession_fleet_lock_order.spec +117 -0
- package/tests/isolation/specs/atomic_fedsession_human_revoke.spec +66 -0
- package/tests/isolation/specs/atomic_fleet_authority_races.spec +235 -0
- package/tests/isolation/specs/atomic_fleet_binding_revoke.spec +127 -0
- package/tests/isolation/specs/atomic_fleet_board_archive.spec +134 -0
- package/tests/isolation/specs/atomic_fleet_human_fresh_revoke.spec +142 -0
- package/tests/isolation/specs/atomic_fleet_identity_disposition.spec +118 -0
- package/tests/isolation/specs/atomic_fleet_lifecycle_races.spec +244 -0
- package/tests/isolation/specs/atomic_fleet_onboarding.spec +106 -0
- package/tests/isolation/specs/atomic_fleet_subtree_lock_order.spec +147 -0
- package/tests/isolation/specs/ceiling_setter_lock_before_upsert.spec +117 -0
- package/tests/isolation/specs/enroll_identity_board_owner_lock_order.spec +117 -0
- package/tests/isolation/specs/fedsession_provider_absent_owner_lock.spec +63 -0
- package/tests/isolation/specs/onboarding_ceiling_lock_order.spec +183 -0
- package/tests/isolation/specs/outbox_wake_ordering.spec +202 -0
- package/tests/isolation/specs/wake_recovery_late_commit.spec +207 -0
- package/tests/seeds/20260901000100_agent_board_atomic_fleet_onboarding.sql.pre.sql +110 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Parsed test spec with 4 sessions
|
|
2
|
+
|
|
3
|
+
starting permutation: guard_begin guard_board_key_share fleet_begin fleet_onboard portal_begin portal_enroll guard_commit fleet_commit portal_commit check
|
|
4
|
+
count
|
|
5
|
+
-----
|
|
6
|
+
1
|
|
7
|
+
(1 row)
|
|
8
|
+
|
|
9
|
+
step guard_begin: BEGIN;
|
|
10
|
+
step guard_board_key_share:
|
|
11
|
+
select slug from agent_board.boards
|
|
12
|
+
where slug='atomic-cross-board' for key share;
|
|
13
|
+
|
|
14
|
+
slug
|
|
15
|
+
------------------
|
|
16
|
+
atomic-cross-board
|
|
17
|
+
(1 row)
|
|
18
|
+
|
|
19
|
+
step fleet_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
20
|
+
step fleet_onboard:
|
|
21
|
+
select identity_disposition, membership_disposition, binding_disposition
|
|
22
|
+
from agent_board.onboard_federated_fleet_agent(
|
|
23
|
+
'https://atomic-cross.test', 'message-board', 'cross-human',
|
|
24
|
+
jsonb_build_object('iss','https://atomic-cross.test','aud','message-board','sub','cross-human','iat',100),
|
|
25
|
+
'atomic-cross-agent',
|
|
26
|
+
'eRHZmllEy_TZHAG2zB-Qe_a5BFLkaavMTazWWfaE3f0',
|
|
27
|
+
'raw_ed25519_base64url',
|
|
28
|
+
'sha256:z8d5LQPfBMYnfZfvu8wVz684_jkp578-SPDU2OMObS8',
|
|
29
|
+
true, null, 'agent', ARRAY['board:send'], ARRAY[]::text[],
|
|
30
|
+
(select code from agent_board.board_invite_tokens where created_by_agent_id='162a0000-0000-0000-0000-000000000001'),
|
|
31
|
+
(select id from agent_board.boards where slug='atomic-cross-board'),
|
|
32
|
+
'162a0000-0000-0000-0000-000000000003',
|
|
33
|
+
'codex', 'phase-loop', 'message-board', 'sha256:atomic-cross-repo',
|
|
34
|
+
'worker', 'phase_worker', 'atomic-cross-agent'
|
|
35
|
+
);
|
|
36
|
+
<waiting ...>
|
|
37
|
+
step portal_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
38
|
+
step portal_enroll:
|
|
39
|
+
select status from agent_board.enroll_federated_human(
|
|
40
|
+
'https://atomic-cross.test', 'message-board', 'cross-human',
|
|
41
|
+
jsonb_build_object('sub','cross-human','iat',200), 'Cross Human'
|
|
42
|
+
);
|
|
43
|
+
<waiting ...>
|
|
44
|
+
step guard_commit: COMMIT;
|
|
45
|
+
step fleet_onboard: <... completed>
|
|
46
|
+
identity_disposition|membership_disposition|binding_disposition
|
|
47
|
+
--------------------+----------------------+-------------------
|
|
48
|
+
created |created |created
|
|
49
|
+
(1 row)
|
|
50
|
+
|
|
51
|
+
step fleet_commit: COMMIT;
|
|
52
|
+
step portal_enroll: <... completed>
|
|
53
|
+
status
|
|
54
|
+
------
|
|
55
|
+
active
|
|
56
|
+
(1 row)
|
|
57
|
+
|
|
58
|
+
step portal_commit: COMMIT;
|
|
59
|
+
step check:
|
|
60
|
+
select
|
|
61
|
+
(select count(*) from agent_board.agents
|
|
62
|
+
where owner_user_id=(select auth_user_id from agent_board.agents
|
|
63
|
+
where metadata #>> ARRAY['federation','subject']='cross-human'
|
|
64
|
+
order by kind='human' desc limit 1)) as owned_agents,
|
|
65
|
+
(select count(*) from agent_board.board_memberships m
|
|
66
|
+
join agent_board.agents a on a.id=m.agent_id
|
|
67
|
+
where m.board_id=(select id from agent_board.boards where slug='atomic-cross-board')
|
|
68
|
+
and a.owner_user_id=(select auth_user_id from agent_board.agents
|
|
69
|
+
where metadata #>> ARRAY['federation','subject']='cross-human'
|
|
70
|
+
order by kind='human' desc limit 1)) as memberships,
|
|
71
|
+
(select count(*) from agent_board.fleet_machine_agents b
|
|
72
|
+
join agent_board.agents a on a.id=b.agent_id
|
|
73
|
+
where a.handle='atomic-cross-agent') as bindings;
|
|
74
|
+
|
|
75
|
+
owned_agents|memberships|bindings
|
|
76
|
+
------------+-----------+--------
|
|
77
|
+
2| 2| 1
|
|
78
|
+
(1 row)
|
|
79
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
Parsed test spec with 3 sessions
|
|
2
|
+
|
|
3
|
+
starting permutation: portal_begin portal_enroll revoke_begin revoke_human portal_commit revoke_commit check
|
|
4
|
+
count
|
|
5
|
+
-----
|
|
6
|
+
1
|
|
7
|
+
(1 row)
|
|
8
|
+
|
|
9
|
+
step portal_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
10
|
+
step portal_enroll:
|
|
11
|
+
select status from agent_board.enroll_federated_human(
|
|
12
|
+
'https://atomic-fedsession.test', 'message-board', 'portal-human-race',
|
|
13
|
+
jsonb_build_object('sub','portal-human-race','iat',200), 'Portal Human Race'
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
status
|
|
17
|
+
------
|
|
18
|
+
active
|
|
19
|
+
(1 row)
|
|
20
|
+
|
|
21
|
+
step revoke_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
22
|
+
step revoke_human:
|
|
23
|
+
select revoked_agent_count from agent_board.revoke_human_subtree(
|
|
24
|
+
(select auth_user_id from agent_board.agents where metadata #>> ARRAY['federation','subject'] = 'portal-human-race'),
|
|
25
|
+
'16290000-0000-0000-0000-000000000001', 'portal race revoke'
|
|
26
|
+
);
|
|
27
|
+
<waiting ...>
|
|
28
|
+
step portal_commit: COMMIT;
|
|
29
|
+
step revoke_human: <... completed>
|
|
30
|
+
revoked_agent_count
|
|
31
|
+
-------------------
|
|
32
|
+
1
|
|
33
|
+
(1 row)
|
|
34
|
+
|
|
35
|
+
step revoke_commit: COMMIT;
|
|
36
|
+
step check:
|
|
37
|
+
select
|
|
38
|
+
(select count(*) from agent_board.fleet_human_revocations where issuer='https://atomic-fedsession.test') as markers,
|
|
39
|
+
(select count(*) from agent_board.agents where metadata #>> ARRAY['federation','subject'] = 'portal-human-race' and status='active') as active_humans,
|
|
40
|
+
(select count(*) from agent_board.enrollment_federation_audit where issuer='https://atomic-fedsession.test') as audits;
|
|
41
|
+
|
|
42
|
+
markers|active_humans|audits
|
|
43
|
+
-------+-------------+------
|
|
44
|
+
1| 0| 2
|
|
45
|
+
(1 row)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
starting permutation: revoke_begin revoke_human portal_begin portal_enroll revoke_commit portal_commit check
|
|
49
|
+
count
|
|
50
|
+
-----
|
|
51
|
+
1
|
|
52
|
+
(1 row)
|
|
53
|
+
|
|
54
|
+
step revoke_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
55
|
+
step revoke_human:
|
|
56
|
+
select revoked_agent_count from agent_board.revoke_human_subtree(
|
|
57
|
+
(select auth_user_id from agent_board.agents where metadata #>> ARRAY['federation','subject'] = 'portal-human-race'),
|
|
58
|
+
'16290000-0000-0000-0000-000000000001', 'portal race revoke'
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
revoked_agent_count
|
|
62
|
+
-------------------
|
|
63
|
+
1
|
|
64
|
+
(1 row)
|
|
65
|
+
|
|
66
|
+
step portal_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
67
|
+
step portal_enroll:
|
|
68
|
+
select status from agent_board.enroll_federated_human(
|
|
69
|
+
'https://atomic-fedsession.test', 'message-board', 'portal-human-race',
|
|
70
|
+
jsonb_build_object('sub','portal-human-race','iat',200), 'Portal Human Race'
|
|
71
|
+
);
|
|
72
|
+
<waiting ...>
|
|
73
|
+
step revoke_commit: COMMIT;
|
|
74
|
+
step portal_enroll: <... completed>
|
|
75
|
+
ERROR: human identity is durably revoked
|
|
76
|
+
step portal_commit: COMMIT;
|
|
77
|
+
step check:
|
|
78
|
+
select
|
|
79
|
+
(select count(*) from agent_board.fleet_human_revocations where issuer='https://atomic-fedsession.test') as markers,
|
|
80
|
+
(select count(*) from agent_board.agents where metadata #>> ARRAY['federation','subject'] = 'portal-human-race' and status='active') as active_humans,
|
|
81
|
+
(select count(*) from agent_board.enrollment_federation_audit where issuer='https://atomic-fedsession.test') as audits;
|
|
82
|
+
|
|
83
|
+
markers|active_humans|audits
|
|
84
|
+
-------+-------------+------
|
|
85
|
+
1| 0| 1
|
|
86
|
+
(1 row)
|
|
87
|
+
|
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
Parsed test spec with 4 sessions
|
|
2
|
+
|
|
3
|
+
starting permutation: retry_begin retry_onboard invalidator_begin remove_member retry_commit invalidator_commit check
|
|
4
|
+
step retry_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
5
|
+
step retry_onboard:
|
|
6
|
+
select identity_disposition, membership_disposition, binding_disposition
|
|
7
|
+
from agent_board.onboard_federated_fleet_agent(
|
|
8
|
+
'https://atomic-authority.test', 'message-board', 'human-authority',
|
|
9
|
+
jsonb_build_object('iss','https://atomic-authority.test','aud','message-board','sub','human-authority','iat',200),
|
|
10
|
+
'atomic-authority-agent',
|
|
11
|
+
'yd_DIFGWGusVg3SbktDJQ1bE5UWvtR33xln4b05JIhk',
|
|
12
|
+
'raw_ed25519_base64url',
|
|
13
|
+
'sha256:NeVC2vx1MbTY56jUwJcLLr6YwB4IKCERsXWbUwhf5pA',
|
|
14
|
+
true, null, 'agent', ARRAY['board:send'], ARRAY[]::text[],
|
|
15
|
+
(select code from agent_board.board_invite_tokens where created_by_agent_id='16250000-0000-0000-0000-000000000001'),
|
|
16
|
+
(select id from agent_board.boards where slug='atomic-authority-board'),
|
|
17
|
+
'16250000-0000-0000-0000-000000000003', 'codex', 'phase-loop',
|
|
18
|
+
'message-board', 'sha256:atomic-authority-repo', 'worker', 'phase_worker',
|
|
19
|
+
'atomic-authority-agent'
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
identity_disposition|membership_disposition|binding_disposition
|
|
23
|
+
--------------------+----------------------+-------------------
|
|
24
|
+
reused |reused |reused
|
|
25
|
+
(1 row)
|
|
26
|
+
|
|
27
|
+
step invalidator_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
28
|
+
step remove_member:
|
|
29
|
+
select membership_state from agent_board.update_board_membership(
|
|
30
|
+
(select id from agent_board.boards where slug='atomic-authority-board'),
|
|
31
|
+
(select id from agent_board.agents where handle='atomic-authority-agent'),
|
|
32
|
+
'removed', jsonb_build_object('reason','isolation member removal')
|
|
33
|
+
);
|
|
34
|
+
<waiting ...>
|
|
35
|
+
step retry_commit: COMMIT;
|
|
36
|
+
step remove_member: <... completed>
|
|
37
|
+
membership_state
|
|
38
|
+
----------------
|
|
39
|
+
removed
|
|
40
|
+
(1 row)
|
|
41
|
+
|
|
42
|
+
step invalidator_commit: COMMIT;
|
|
43
|
+
step check:
|
|
44
|
+
select
|
|
45
|
+
(select status from agent_board.agents where id='16250000-0000-0000-0000-000000000001') as creator_status,
|
|
46
|
+
(select role || '/' || membership_state from agent_board.board_memberships
|
|
47
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')
|
|
48
|
+
and agent_id='16250000-0000-0000-0000-000000000001'
|
|
49
|
+
and membership_state in ('joined','subscribed')) as creator_authority,
|
|
50
|
+
(select membership_state from agent_board.board_memberships
|
|
51
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')
|
|
52
|
+
and agent_id=(select id from agent_board.agents where handle='atomic-authority-agent')
|
|
53
|
+
order by (membership_state in ('joined','subscribed')) desc, created_at desc, id desc limit 1) as member_state,
|
|
54
|
+
(select max_grantable_role from agent_board.board_authority_ceilings
|
|
55
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')) as board_ceiling;
|
|
56
|
+
|
|
57
|
+
creator_status|creator_authority|member_state|board_ceiling
|
|
58
|
+
--------------+-----------------+------------+-------------
|
|
59
|
+
active |owner/joined |removed |
|
|
60
|
+
(1 row)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
starting permutation: retry_begin retry_onboard invalidator_begin revoke_creator retry_commit invalidator_commit check
|
|
64
|
+
step retry_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
65
|
+
step retry_onboard:
|
|
66
|
+
select identity_disposition, membership_disposition, binding_disposition
|
|
67
|
+
from agent_board.onboard_federated_fleet_agent(
|
|
68
|
+
'https://atomic-authority.test', 'message-board', 'human-authority',
|
|
69
|
+
jsonb_build_object('iss','https://atomic-authority.test','aud','message-board','sub','human-authority','iat',200),
|
|
70
|
+
'atomic-authority-agent',
|
|
71
|
+
'yd_DIFGWGusVg3SbktDJQ1bE5UWvtR33xln4b05JIhk',
|
|
72
|
+
'raw_ed25519_base64url',
|
|
73
|
+
'sha256:NeVC2vx1MbTY56jUwJcLLr6YwB4IKCERsXWbUwhf5pA',
|
|
74
|
+
true, null, 'agent', ARRAY['board:send'], ARRAY[]::text[],
|
|
75
|
+
(select code from agent_board.board_invite_tokens where created_by_agent_id='16250000-0000-0000-0000-000000000001'),
|
|
76
|
+
(select id from agent_board.boards where slug='atomic-authority-board'),
|
|
77
|
+
'16250000-0000-0000-0000-000000000003', 'codex', 'phase-loop',
|
|
78
|
+
'message-board', 'sha256:atomic-authority-repo', 'worker', 'phase_worker',
|
|
79
|
+
'atomic-authority-agent'
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
identity_disposition|membership_disposition|binding_disposition
|
|
83
|
+
--------------------+----------------------+-------------------
|
|
84
|
+
reused |reused |reused
|
|
85
|
+
(1 row)
|
|
86
|
+
|
|
87
|
+
step invalidator_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
88
|
+
step revoke_creator:
|
|
89
|
+
select status from agent_board.revoke_agent(
|
|
90
|
+
'16250000-0000-0000-0000-000000000001', 'isolation creator revoke'
|
|
91
|
+
);
|
|
92
|
+
<waiting ...>
|
|
93
|
+
step retry_commit: COMMIT;
|
|
94
|
+
step revoke_creator: <... completed>
|
|
95
|
+
status
|
|
96
|
+
---------
|
|
97
|
+
suspended
|
|
98
|
+
(1 row)
|
|
99
|
+
|
|
100
|
+
step invalidator_commit: COMMIT;
|
|
101
|
+
step check:
|
|
102
|
+
select
|
|
103
|
+
(select status from agent_board.agents where id='16250000-0000-0000-0000-000000000001') as creator_status,
|
|
104
|
+
(select role || '/' || membership_state from agent_board.board_memberships
|
|
105
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')
|
|
106
|
+
and agent_id='16250000-0000-0000-0000-000000000001'
|
|
107
|
+
and membership_state in ('joined','subscribed')) as creator_authority,
|
|
108
|
+
(select membership_state from agent_board.board_memberships
|
|
109
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')
|
|
110
|
+
and agent_id=(select id from agent_board.agents where handle='atomic-authority-agent')
|
|
111
|
+
order by (membership_state in ('joined','subscribed')) desc, created_at desc, id desc limit 1) as member_state,
|
|
112
|
+
(select max_grantable_role from agent_board.board_authority_ceilings
|
|
113
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')) as board_ceiling;
|
|
114
|
+
|
|
115
|
+
creator_status|creator_authority|member_state|board_ceiling
|
|
116
|
+
--------------+-----------------+------------+-------------
|
|
117
|
+
suspended |owner/joined |joined |
|
|
118
|
+
(1 row)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
starting permutation: retry_begin retry_onboard invalidator_begin demote_creator retry_commit invalidator_commit check
|
|
122
|
+
step retry_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
123
|
+
step retry_onboard:
|
|
124
|
+
select identity_disposition, membership_disposition, binding_disposition
|
|
125
|
+
from agent_board.onboard_federated_fleet_agent(
|
|
126
|
+
'https://atomic-authority.test', 'message-board', 'human-authority',
|
|
127
|
+
jsonb_build_object('iss','https://atomic-authority.test','aud','message-board','sub','human-authority','iat',200),
|
|
128
|
+
'atomic-authority-agent',
|
|
129
|
+
'yd_DIFGWGusVg3SbktDJQ1bE5UWvtR33xln4b05JIhk',
|
|
130
|
+
'raw_ed25519_base64url',
|
|
131
|
+
'sha256:NeVC2vx1MbTY56jUwJcLLr6YwB4IKCERsXWbUwhf5pA',
|
|
132
|
+
true, null, 'agent', ARRAY['board:send'], ARRAY[]::text[],
|
|
133
|
+
(select code from agent_board.board_invite_tokens where created_by_agent_id='16250000-0000-0000-0000-000000000001'),
|
|
134
|
+
(select id from agent_board.boards where slug='atomic-authority-board'),
|
|
135
|
+
'16250000-0000-0000-0000-000000000003', 'codex', 'phase-loop',
|
|
136
|
+
'message-board', 'sha256:atomic-authority-repo', 'worker', 'phase_worker',
|
|
137
|
+
'atomic-authority-agent'
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
identity_disposition|membership_disposition|binding_disposition
|
|
141
|
+
--------------------+----------------------+-------------------
|
|
142
|
+
reused |reused |reused
|
|
143
|
+
(1 row)
|
|
144
|
+
|
|
145
|
+
step invalidator_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
146
|
+
step demote_creator:
|
|
147
|
+
select role from agent_board.grant_board_role(
|
|
148
|
+
(select id from agent_board.boards where slug='atomic-authority-board'),
|
|
149
|
+
'16250000-0000-0000-0000-000000000001', 'observer',
|
|
150
|
+
'16250000-0000-0000-0000-000000000001'
|
|
151
|
+
);
|
|
152
|
+
<waiting ...>
|
|
153
|
+
step retry_commit: COMMIT;
|
|
154
|
+
step demote_creator: <... completed>
|
|
155
|
+
role
|
|
156
|
+
--------
|
|
157
|
+
observer
|
|
158
|
+
(1 row)
|
|
159
|
+
|
|
160
|
+
step invalidator_commit: COMMIT;
|
|
161
|
+
step check:
|
|
162
|
+
select
|
|
163
|
+
(select status from agent_board.agents where id='16250000-0000-0000-0000-000000000001') as creator_status,
|
|
164
|
+
(select role || '/' || membership_state from agent_board.board_memberships
|
|
165
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')
|
|
166
|
+
and agent_id='16250000-0000-0000-0000-000000000001'
|
|
167
|
+
and membership_state in ('joined','subscribed')) as creator_authority,
|
|
168
|
+
(select membership_state from agent_board.board_memberships
|
|
169
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')
|
|
170
|
+
and agent_id=(select id from agent_board.agents where handle='atomic-authority-agent')
|
|
171
|
+
order by (membership_state in ('joined','subscribed')) desc, created_at desc, id desc limit 1) as member_state,
|
|
172
|
+
(select max_grantable_role from agent_board.board_authority_ceilings
|
|
173
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')) as board_ceiling;
|
|
174
|
+
|
|
175
|
+
creator_status|creator_authority|member_state|board_ceiling
|
|
176
|
+
--------------+-----------------+------------+-------------
|
|
177
|
+
active |observer/joined |joined |
|
|
178
|
+
(1 row)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
starting permutation: invalidator_begin remove_member retry_begin retry_onboard invalidator_commit retry_commit check
|
|
182
|
+
step invalidator_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
183
|
+
step remove_member:
|
|
184
|
+
select membership_state from agent_board.update_board_membership(
|
|
185
|
+
(select id from agent_board.boards where slug='atomic-authority-board'),
|
|
186
|
+
(select id from agent_board.agents where handle='atomic-authority-agent'),
|
|
187
|
+
'removed', jsonb_build_object('reason','isolation member removal')
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
membership_state
|
|
191
|
+
----------------
|
|
192
|
+
removed
|
|
193
|
+
(1 row)
|
|
194
|
+
|
|
195
|
+
step retry_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
196
|
+
step retry_onboard:
|
|
197
|
+
select identity_disposition, membership_disposition, binding_disposition
|
|
198
|
+
from agent_board.onboard_federated_fleet_agent(
|
|
199
|
+
'https://atomic-authority.test', 'message-board', 'human-authority',
|
|
200
|
+
jsonb_build_object('iss','https://atomic-authority.test','aud','message-board','sub','human-authority','iat',200),
|
|
201
|
+
'atomic-authority-agent',
|
|
202
|
+
'yd_DIFGWGusVg3SbktDJQ1bE5UWvtR33xln4b05JIhk',
|
|
203
|
+
'raw_ed25519_base64url',
|
|
204
|
+
'sha256:NeVC2vx1MbTY56jUwJcLLr6YwB4IKCERsXWbUwhf5pA',
|
|
205
|
+
true, null, 'agent', ARRAY['board:send'], ARRAY[]::text[],
|
|
206
|
+
(select code from agent_board.board_invite_tokens where created_by_agent_id='16250000-0000-0000-0000-000000000001'),
|
|
207
|
+
(select id from agent_board.boards where slug='atomic-authority-board'),
|
|
208
|
+
'16250000-0000-0000-0000-000000000003', 'codex', 'phase-loop',
|
|
209
|
+
'message-board', 'sha256:atomic-authority-repo', 'worker', 'phase_worker',
|
|
210
|
+
'atomic-authority-agent'
|
|
211
|
+
);
|
|
212
|
+
<waiting ...>
|
|
213
|
+
step invalidator_commit: COMMIT;
|
|
214
|
+
step retry_onboard: <... completed>
|
|
215
|
+
ERROR: fleet onboarding invite is not usable
|
|
216
|
+
step retry_commit: COMMIT;
|
|
217
|
+
step check:
|
|
218
|
+
select
|
|
219
|
+
(select status from agent_board.agents where id='16250000-0000-0000-0000-000000000001') as creator_status,
|
|
220
|
+
(select role || '/' || membership_state from agent_board.board_memberships
|
|
221
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')
|
|
222
|
+
and agent_id='16250000-0000-0000-0000-000000000001'
|
|
223
|
+
and membership_state in ('joined','subscribed')) as creator_authority,
|
|
224
|
+
(select membership_state from agent_board.board_memberships
|
|
225
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')
|
|
226
|
+
and agent_id=(select id from agent_board.agents where handle='atomic-authority-agent')
|
|
227
|
+
order by (membership_state in ('joined','subscribed')) desc, created_at desc, id desc limit 1) as member_state,
|
|
228
|
+
(select max_grantable_role from agent_board.board_authority_ceilings
|
|
229
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')) as board_ceiling;
|
|
230
|
+
|
|
231
|
+
creator_status|creator_authority|member_state|board_ceiling
|
|
232
|
+
--------------+-----------------+------------+-------------
|
|
233
|
+
active |owner/joined |removed |
|
|
234
|
+
(1 row)
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
starting permutation: invalidator_begin revoke_creator retry_begin retry_onboard invalidator_commit retry_commit check
|
|
238
|
+
step invalidator_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
239
|
+
step revoke_creator:
|
|
240
|
+
select status from agent_board.revoke_agent(
|
|
241
|
+
'16250000-0000-0000-0000-000000000001', 'isolation creator revoke'
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
status
|
|
245
|
+
---------
|
|
246
|
+
suspended
|
|
247
|
+
(1 row)
|
|
248
|
+
|
|
249
|
+
step retry_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
250
|
+
step retry_onboard:
|
|
251
|
+
select identity_disposition, membership_disposition, binding_disposition
|
|
252
|
+
from agent_board.onboard_federated_fleet_agent(
|
|
253
|
+
'https://atomic-authority.test', 'message-board', 'human-authority',
|
|
254
|
+
jsonb_build_object('iss','https://atomic-authority.test','aud','message-board','sub','human-authority','iat',200),
|
|
255
|
+
'atomic-authority-agent',
|
|
256
|
+
'yd_DIFGWGusVg3SbktDJQ1bE5UWvtR33xln4b05JIhk',
|
|
257
|
+
'raw_ed25519_base64url',
|
|
258
|
+
'sha256:NeVC2vx1MbTY56jUwJcLLr6YwB4IKCERsXWbUwhf5pA',
|
|
259
|
+
true, null, 'agent', ARRAY['board:send'], ARRAY[]::text[],
|
|
260
|
+
(select code from agent_board.board_invite_tokens where created_by_agent_id='16250000-0000-0000-0000-000000000001'),
|
|
261
|
+
(select id from agent_board.boards where slug='atomic-authority-board'),
|
|
262
|
+
'16250000-0000-0000-0000-000000000003', 'codex', 'phase-loop',
|
|
263
|
+
'message-board', 'sha256:atomic-authority-repo', 'worker', 'phase_worker',
|
|
264
|
+
'atomic-authority-agent'
|
|
265
|
+
);
|
|
266
|
+
<waiting ...>
|
|
267
|
+
step invalidator_commit: COMMIT;
|
|
268
|
+
step retry_onboard: <... completed>
|
|
269
|
+
ERROR: fleet onboarding invite is not usable
|
|
270
|
+
step retry_commit: COMMIT;
|
|
271
|
+
step check:
|
|
272
|
+
select
|
|
273
|
+
(select status from agent_board.agents where id='16250000-0000-0000-0000-000000000001') as creator_status,
|
|
274
|
+
(select role || '/' || membership_state from agent_board.board_memberships
|
|
275
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')
|
|
276
|
+
and agent_id='16250000-0000-0000-0000-000000000001'
|
|
277
|
+
and membership_state in ('joined','subscribed')) as creator_authority,
|
|
278
|
+
(select membership_state from agent_board.board_memberships
|
|
279
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')
|
|
280
|
+
and agent_id=(select id from agent_board.agents where handle='atomic-authority-agent')
|
|
281
|
+
order by (membership_state in ('joined','subscribed')) desc, created_at desc, id desc limit 1) as member_state,
|
|
282
|
+
(select max_grantable_role from agent_board.board_authority_ceilings
|
|
283
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')) as board_ceiling;
|
|
284
|
+
|
|
285
|
+
creator_status|creator_authority|member_state|board_ceiling
|
|
286
|
+
--------------+-----------------+------------+-------------
|
|
287
|
+
suspended |owner/joined |joined |
|
|
288
|
+
(1 row)
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
starting permutation: invalidator_begin demote_creator retry_begin retry_onboard invalidator_commit retry_commit check
|
|
292
|
+
step invalidator_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
293
|
+
step demote_creator:
|
|
294
|
+
select role from agent_board.grant_board_role(
|
|
295
|
+
(select id from agent_board.boards where slug='atomic-authority-board'),
|
|
296
|
+
'16250000-0000-0000-0000-000000000001', 'observer',
|
|
297
|
+
'16250000-0000-0000-0000-000000000001'
|
|
298
|
+
);
|
|
299
|
+
|
|
300
|
+
role
|
|
301
|
+
--------
|
|
302
|
+
observer
|
|
303
|
+
(1 row)
|
|
304
|
+
|
|
305
|
+
step retry_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
306
|
+
step retry_onboard:
|
|
307
|
+
select identity_disposition, membership_disposition, binding_disposition
|
|
308
|
+
from agent_board.onboard_federated_fleet_agent(
|
|
309
|
+
'https://atomic-authority.test', 'message-board', 'human-authority',
|
|
310
|
+
jsonb_build_object('iss','https://atomic-authority.test','aud','message-board','sub','human-authority','iat',200),
|
|
311
|
+
'atomic-authority-agent',
|
|
312
|
+
'yd_DIFGWGusVg3SbktDJQ1bE5UWvtR33xln4b05JIhk',
|
|
313
|
+
'raw_ed25519_base64url',
|
|
314
|
+
'sha256:NeVC2vx1MbTY56jUwJcLLr6YwB4IKCERsXWbUwhf5pA',
|
|
315
|
+
true, null, 'agent', ARRAY['board:send'], ARRAY[]::text[],
|
|
316
|
+
(select code from agent_board.board_invite_tokens where created_by_agent_id='16250000-0000-0000-0000-000000000001'),
|
|
317
|
+
(select id from agent_board.boards where slug='atomic-authority-board'),
|
|
318
|
+
'16250000-0000-0000-0000-000000000003', 'codex', 'phase-loop',
|
|
319
|
+
'message-board', 'sha256:atomic-authority-repo', 'worker', 'phase_worker',
|
|
320
|
+
'atomic-authority-agent'
|
|
321
|
+
);
|
|
322
|
+
<waiting ...>
|
|
323
|
+
step invalidator_commit: COMMIT;
|
|
324
|
+
step retry_onboard: <... completed>
|
|
325
|
+
ERROR: fleet onboarding invite is not usable
|
|
326
|
+
step retry_commit: COMMIT;
|
|
327
|
+
step check:
|
|
328
|
+
select
|
|
329
|
+
(select status from agent_board.agents where id='16250000-0000-0000-0000-000000000001') as creator_status,
|
|
330
|
+
(select role || '/' || membership_state from agent_board.board_memberships
|
|
331
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')
|
|
332
|
+
and agent_id='16250000-0000-0000-0000-000000000001'
|
|
333
|
+
and membership_state in ('joined','subscribed')) as creator_authority,
|
|
334
|
+
(select membership_state from agent_board.board_memberships
|
|
335
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')
|
|
336
|
+
and agent_id=(select id from agent_board.agents where handle='atomic-authority-agent')
|
|
337
|
+
order by (membership_state in ('joined','subscribed')) desc, created_at desc, id desc limit 1) as member_state,
|
|
338
|
+
(select max_grantable_role from agent_board.board_authority_ceilings
|
|
339
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')) as board_ceiling;
|
|
340
|
+
|
|
341
|
+
creator_status|creator_authority|member_state|board_ceiling
|
|
342
|
+
--------------+-----------------+------------+-------------
|
|
343
|
+
active |observer/joined |joined |
|
|
344
|
+
(1 row)
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
starting permutation: retry_begin retry_onboard ceiling_begin set_ceiling retry_commit ceiling_commit check
|
|
348
|
+
step retry_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
349
|
+
step retry_onboard:
|
|
350
|
+
select identity_disposition, membership_disposition, binding_disposition
|
|
351
|
+
from agent_board.onboard_federated_fleet_agent(
|
|
352
|
+
'https://atomic-authority.test', 'message-board', 'human-authority',
|
|
353
|
+
jsonb_build_object('iss','https://atomic-authority.test','aud','message-board','sub','human-authority','iat',200),
|
|
354
|
+
'atomic-authority-agent',
|
|
355
|
+
'yd_DIFGWGusVg3SbktDJQ1bE5UWvtR33xln4b05JIhk',
|
|
356
|
+
'raw_ed25519_base64url',
|
|
357
|
+
'sha256:NeVC2vx1MbTY56jUwJcLLr6YwB4IKCERsXWbUwhf5pA',
|
|
358
|
+
true, null, 'agent', ARRAY['board:send'], ARRAY[]::text[],
|
|
359
|
+
(select code from agent_board.board_invite_tokens where created_by_agent_id='16250000-0000-0000-0000-000000000001'),
|
|
360
|
+
(select id from agent_board.boards where slug='atomic-authority-board'),
|
|
361
|
+
'16250000-0000-0000-0000-000000000003', 'codex', 'phase-loop',
|
|
362
|
+
'message-board', 'sha256:atomic-authority-repo', 'worker', 'phase_worker',
|
|
363
|
+
'atomic-authority-agent'
|
|
364
|
+
);
|
|
365
|
+
|
|
366
|
+
identity_disposition|membership_disposition|binding_disposition
|
|
367
|
+
--------------------+----------------------+-------------------
|
|
368
|
+
reused |reused |reused
|
|
369
|
+
(1 row)
|
|
370
|
+
|
|
371
|
+
step ceiling_begin:
|
|
372
|
+
BEGIN;
|
|
373
|
+
SET LOCAL ROLE authenticated;
|
|
374
|
+
SET LOCAL "request.jwt.claim.role" = 'authenticated';
|
|
375
|
+
SET LOCAL "request.jwt.claim.sub" = '16250000-0000-0000-0000-0000000000a1';
|
|
376
|
+
|
|
377
|
+
step set_ceiling:
|
|
378
|
+
select ceiling_max_grantable_role from agent_board.set_board_authority_ceiling(
|
|
379
|
+
(select id from agent_board.boards where slug='atomic-authority-board'),
|
|
380
|
+
'observer'
|
|
381
|
+
);
|
|
382
|
+
<waiting ...>
|
|
383
|
+
step retry_commit: COMMIT;
|
|
384
|
+
step set_ceiling: <... completed>
|
|
385
|
+
ceiling_max_grantable_role
|
|
386
|
+
--------------------------
|
|
387
|
+
observer
|
|
388
|
+
(1 row)
|
|
389
|
+
|
|
390
|
+
step ceiling_commit: COMMIT;
|
|
391
|
+
step check:
|
|
392
|
+
select
|
|
393
|
+
(select status from agent_board.agents where id='16250000-0000-0000-0000-000000000001') as creator_status,
|
|
394
|
+
(select role || '/' || membership_state from agent_board.board_memberships
|
|
395
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')
|
|
396
|
+
and agent_id='16250000-0000-0000-0000-000000000001'
|
|
397
|
+
and membership_state in ('joined','subscribed')) as creator_authority,
|
|
398
|
+
(select membership_state from agent_board.board_memberships
|
|
399
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')
|
|
400
|
+
and agent_id=(select id from agent_board.agents where handle='atomic-authority-agent')
|
|
401
|
+
order by (membership_state in ('joined','subscribed')) desc, created_at desc, id desc limit 1) as member_state,
|
|
402
|
+
(select max_grantable_role from agent_board.board_authority_ceilings
|
|
403
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')) as board_ceiling;
|
|
404
|
+
|
|
405
|
+
creator_status|creator_authority|member_state|board_ceiling
|
|
406
|
+
--------------+-----------------+------------+-------------
|
|
407
|
+
active |owner/joined |joined |observer
|
|
408
|
+
(1 row)
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
starting permutation: ceiling_begin set_ceiling retry_begin retry_onboard ceiling_commit retry_commit check
|
|
412
|
+
step ceiling_begin:
|
|
413
|
+
BEGIN;
|
|
414
|
+
SET LOCAL ROLE authenticated;
|
|
415
|
+
SET LOCAL "request.jwt.claim.role" = 'authenticated';
|
|
416
|
+
SET LOCAL "request.jwt.claim.sub" = '16250000-0000-0000-0000-0000000000a1';
|
|
417
|
+
|
|
418
|
+
step set_ceiling:
|
|
419
|
+
select ceiling_max_grantable_role from agent_board.set_board_authority_ceiling(
|
|
420
|
+
(select id from agent_board.boards where slug='atomic-authority-board'),
|
|
421
|
+
'observer'
|
|
422
|
+
);
|
|
423
|
+
|
|
424
|
+
ceiling_max_grantable_role
|
|
425
|
+
--------------------------
|
|
426
|
+
observer
|
|
427
|
+
(1 row)
|
|
428
|
+
|
|
429
|
+
step retry_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'service_role';
|
|
430
|
+
step retry_onboard:
|
|
431
|
+
select identity_disposition, membership_disposition, binding_disposition
|
|
432
|
+
from agent_board.onboard_federated_fleet_agent(
|
|
433
|
+
'https://atomic-authority.test', 'message-board', 'human-authority',
|
|
434
|
+
jsonb_build_object('iss','https://atomic-authority.test','aud','message-board','sub','human-authority','iat',200),
|
|
435
|
+
'atomic-authority-agent',
|
|
436
|
+
'yd_DIFGWGusVg3SbktDJQ1bE5UWvtR33xln4b05JIhk',
|
|
437
|
+
'raw_ed25519_base64url',
|
|
438
|
+
'sha256:NeVC2vx1MbTY56jUwJcLLr6YwB4IKCERsXWbUwhf5pA',
|
|
439
|
+
true, null, 'agent', ARRAY['board:send'], ARRAY[]::text[],
|
|
440
|
+
(select code from agent_board.board_invite_tokens where created_by_agent_id='16250000-0000-0000-0000-000000000001'),
|
|
441
|
+
(select id from agent_board.boards where slug='atomic-authority-board'),
|
|
442
|
+
'16250000-0000-0000-0000-000000000003', 'codex', 'phase-loop',
|
|
443
|
+
'message-board', 'sha256:atomic-authority-repo', 'worker', 'phase_worker',
|
|
444
|
+
'atomic-authority-agent'
|
|
445
|
+
);
|
|
446
|
+
<waiting ...>
|
|
447
|
+
step ceiling_commit: COMMIT;
|
|
448
|
+
step retry_onboard: <... completed>
|
|
449
|
+
ERROR: fleet onboarding invite is not usable
|
|
450
|
+
step retry_commit: COMMIT;
|
|
451
|
+
step check:
|
|
452
|
+
select
|
|
453
|
+
(select status from agent_board.agents where id='16250000-0000-0000-0000-000000000001') as creator_status,
|
|
454
|
+
(select role || '/' || membership_state from agent_board.board_memberships
|
|
455
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')
|
|
456
|
+
and agent_id='16250000-0000-0000-0000-000000000001'
|
|
457
|
+
and membership_state in ('joined','subscribed')) as creator_authority,
|
|
458
|
+
(select membership_state from agent_board.board_memberships
|
|
459
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')
|
|
460
|
+
and agent_id=(select id from agent_board.agents where handle='atomic-authority-agent')
|
|
461
|
+
order by (membership_state in ('joined','subscribed')) desc, created_at desc, id desc limit 1) as member_state,
|
|
462
|
+
(select max_grantable_role from agent_board.board_authority_ceilings
|
|
463
|
+
where board_id=(select id from agent_board.boards where slug='atomic-authority-board')) as board_ceiling;
|
|
464
|
+
|
|
465
|
+
creator_status|creator_authority|member_state|board_ceiling
|
|
466
|
+
--------------+-----------------+------------+-------------
|
|
467
|
+
active |owner/joined |joined |observer
|
|
468
|
+
(1 row)
|
|
469
|
+
|