@consiliency/agent-board-schema 1.64.0 → 1.68.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 +19 -0
- package/fixtures/already-applied.json +16 -0
- package/migrations/20261015000100_agent_board_session_provenance.sql +367 -0
- package/migrations/20261015000200_agent_board_request_preserve_removed.sql +87 -0
- package/migrations/20261015000300_agent_board_rls_correlation.sql +132 -0
- package/migrations/20261015000400_agent_board_resolution_authority.sql +146 -0
- package/package.json +1 -1
- package/schema-manifest.json +39 -3
- package/src/deployment-drift-main.test.mjs +156 -0
- package/src/deployment-drift-script.test.mjs +14 -1
- package/src/policy-comment.test.mjs +17 -0
- package/src/tooling.test.mjs +6 -2
- package/tests/agent_board_consent_gating.test.sql +4 -4
- package/tests/agent_board_gatenull_membstate.test.sql +7 -4
- package/tests/agent_board_policy_correlation.test.sql +189 -0
- package/tests/agent_board_request_removed.test.sql +96 -0
- package/tests/agent_board_resolution_authority.test.sql +190 -0
- package/tests/agent_board_session_provenance.test.sql +106 -0
- package/tests/catalog/function_execute_privileges.json +2 -2
- package/tests/isolation/expected/consent_approval_lock.out +1 -1
- package/tests/isolation/specs/consent_approval_lock.spec +13 -7
|
@@ -295,7 +295,7 @@
|
|
|
295
295
|
"executable_by": {
|
|
296
296
|
"anon": false,
|
|
297
297
|
"service_role": true,
|
|
298
|
-
"authenticated":
|
|
298
|
+
"authenticated": true
|
|
299
299
|
}
|
|
300
300
|
},
|
|
301
301
|
{
|
|
@@ -331,7 +331,7 @@
|
|
|
331
331
|
"executable_by": {
|
|
332
332
|
"anon": false,
|
|
333
333
|
"service_role": true,
|
|
334
|
-
"authenticated":
|
|
334
|
+
"authenticated": true
|
|
335
335
|
}
|
|
336
336
|
},
|
|
337
337
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Parsed test spec with 3 sessions
|
|
2
2
|
|
|
3
3
|
starting permutation: a_begin a_resolve w_begin w_leave a_commit w_commit chk
|
|
4
|
-
step a_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = '
|
|
4
|
+
step a_begin: BEGIN; SET LOCAL "request.jwt.claim.role" = 'authenticated'; SET LOCAL "request.jwt.claim.sub" = '115d0000-0000-4000-8000-000000000001';
|
|
5
5
|
step a_resolve:
|
|
6
6
|
select membership_state
|
|
7
7
|
from agent_board.resolve_board_request(
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
# it does to A, isolating the lock as the single variable. The withdrawer withdraws
|
|
25
25
|
# the ACTIVE row A; it blocks on the SET-lock, then applies after commit.
|
|
26
26
|
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
27
|
+
# Consiliency/message-board#668: the approver has a resolved active owner identity,
|
|
28
|
+
# matching the resolver's flat authority gate. The withdrawer remains service_role;
|
|
29
|
+
# the whole-set lock must still serialize the same two physical rows.
|
|
30
30
|
#
|
|
31
31
|
# MUTATION SIGNAL (a TRACE diff): drop the `for update` block, OR narrow it with
|
|
32
32
|
# `and bm.membership_state in ('requested','invited')` — either leaves A unlocked, so
|
|
@@ -35,15 +35,20 @@
|
|
|
35
35
|
|
|
36
36
|
setup
|
|
37
37
|
{
|
|
38
|
-
insert into
|
|
39
|
-
('
|
|
40
|
-
|
|
38
|
+
insert into auth.users(id, instance_id, aud, role, email) values
|
|
39
|
+
('115d0000-0000-4000-8000-000000000001', '00000000-0000-0000-0000-000000000000',
|
|
40
|
+
'authenticated', 'authenticated', 'iso115-owner@example.test');
|
|
41
|
+
insert into agent_board.agents(id, agent_type, handle, display_name, status, auth_user_id, owner_user_id) values
|
|
42
|
+
('115a0000-0000-4000-8000-000000000001', 'agent', 'iso115-owner', 'Iso115 Owner', 'active', '115d0000-0000-4000-8000-000000000001', '115d0000-0000-4000-8000-000000000001'),
|
|
43
|
+
('115a0000-0000-4000-8000-000000000002', 'agent', 'iso115-subject', 'Iso115 Subject', 'active', null, null);
|
|
41
44
|
insert into agent_board.boards(id, slug, name, created_by_agent_id, visibility, status)
|
|
42
45
|
values ('115b0000-0000-4000-8000-000000000001', 'iso115-board', 'Iso115 Board',
|
|
43
46
|
'115a0000-0000-4000-8000-000000000001', 'private', 'active');
|
|
44
47
|
-- Legal (active, pending) duplicate for the subject: A is joined (active), P is a
|
|
45
48
|
-- separate pending request. The active-unique index permits it (only A is active).
|
|
46
49
|
insert into agent_board.board_memberships(id, board_id, agent_id, membership_state, role, created_by_agent_id) values
|
|
50
|
+
('115c0000-0000-4000-8000-000000000001', '115b0000-0000-4000-8000-000000000001',
|
|
51
|
+
'115a0000-0000-4000-8000-000000000001', 'joined', 'owner', '115a0000-0000-4000-8000-000000000001'),
|
|
47
52
|
('115c0000-0000-4000-8000-0000000000aa', '115b0000-0000-4000-8000-000000000001',
|
|
48
53
|
'115a0000-0000-4000-8000-000000000002', 'joined', 'member', '115a0000-0000-4000-8000-000000000002'),
|
|
49
54
|
('115c0000-0000-4000-8000-0000000000bb', '115b0000-0000-4000-8000-000000000001',
|
|
@@ -55,13 +60,14 @@ teardown
|
|
|
55
60
|
delete from agent_board.board_membership_events where board_id = '115b0000-0000-4000-8000-000000000001';
|
|
56
61
|
delete from agent_board.boards where id = '115b0000-0000-4000-8000-000000000001';
|
|
57
62
|
delete from agent_board.agents where id in ('115a0000-0000-4000-8000-000000000001','115a0000-0000-4000-8000-000000000002');
|
|
63
|
+
delete from auth.users where id = '115d0000-0000-4000-8000-000000000001';
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
# approver resolves the subject to 'joined'. With active row A present this is the
|
|
61
67
|
# Option-1 path — it acquires the whole-set `for update` and returns A untouched
|
|
62
68
|
# (retiring the dangling pending row P via the sink, but never writing A).
|
|
63
69
|
session "approver"
|
|
64
|
-
step "a_begin" { BEGIN; SET LOCAL "request.jwt.claim.role" = '
|
|
70
|
+
step "a_begin" { BEGIN; SET LOCAL "request.jwt.claim.role" = 'authenticated'; SET LOCAL "request.jwt.claim.sub" = '115d0000-0000-4000-8000-000000000001'; }
|
|
65
71
|
step "a_resolve" {
|
|
66
72
|
select membership_state
|
|
67
73
|
from agent_board.resolve_board_request(
|