@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,490 @@
|
|
|
1
|
+
-- OWN POST NOT DELIVERED pgTAP (Consiliency/message-board#608, migration 20261010000100).
|
|
2
|
+
--
|
|
3
|
+
-- The owner's rule (2026-10-03): an agent does not receive its own room post as an inbox item,
|
|
4
|
+
-- and its own writes do not wake it. The wake side reads v_agent_wake_recovery, so "no inbox item
|
|
5
|
+
-- for the author" is asserted on that view, as the author, through a real authenticated session.
|
|
6
|
+
--
|
|
7
|
+
-- THE CLASS COMES FROM THE CATALOG (AGENTS.md rule 1). A recipient set can reach its own sender in
|
|
8
|
+
-- two ways, and each is derived from pg_proc so a new site fails here BY NAME:
|
|
9
|
+
-- * a BOARD expansion -- OPN-01 finds every inbox_items inserter; OPN-02 every caller of it that
|
|
10
|
+
-- reads board_memberships; OPN-03 the callers that do not (asserted positively, OPN-18..22, 29, 33);
|
|
11
|
+
-- * a DESCRIPTOR expansion -- OPN-34 finds every caller of the descriptor resolver; the only one that
|
|
12
|
+
-- delivers is _addressing_agent_ids_or_raise, asserted through both its overload callers (OPN-25..32).
|
|
13
|
+
-- Each member is asserted behaviourally, as an authenticated session; each exemption POSITIVELY.
|
|
14
|
+
--
|
|
15
|
+
-- Mutation controls (measured 2026-10-03, each run counting all 40 assertions):
|
|
16
|
+
-- * post_board_message writes the author's row visible_in_inbox = true -> OPN-06, 07, 09, 10, 14
|
|
17
|
+
-- * post_board_message skips the author's row entirely -> OPN-09, 13
|
|
18
|
+
-- * post_board_message counts the author in delivered_recipient_count -> OPN-05
|
|
19
|
+
-- * _queue_inbox_callbacks loses its visible_in_inbox filter -> OPN-10
|
|
20
|
+
-- * create_tasking_delivery writes the creator's row visible_in_inbox -> OPN-16
|
|
21
|
+
-- * create_tasking_delivery skips the creator (the round-1 shape) -> OPN-16, 24
|
|
22
|
+
-- * the board loop demotes an explicit self-listing (the round-2 shape) -> OPN-35, 39 (abort), 37, 40
|
|
23
|
+
-- * the board loop skips an explicitly listed creator (round-3 T1 shape) -> OPN-40
|
|
24
|
+
-- * _addressing_agent_ids_or_raise keeps the sender for a set descriptor -> OPN-28, 30, 32
|
|
25
|
+
-- * ... and drops it even when named explicitly -> OPN-31, 38
|
|
26
|
+
-- * a new function that calls _upsert_inbox_item over board_memberships -> OPN-02
|
|
27
|
+
-- * a new caller of _resolve_addressing_recipient_rows -> OPN-34
|
|
28
|
+
-- (create_tasking_delivery counting its creator is pinned by inbox_rpcs and v2_invariants.)
|
|
29
|
+
-- TAP numbers follow EMISSION order, not labels (OPN-34 is emitted last): cite by label.
|
|
30
|
+
--
|
|
31
|
+
-- HAND-COUNTED plan: OPN-01..OPN-40 = 40 assertions. The runner checks the emitted count.
|
|
32
|
+
create extension if not exists pgtap with schema extensions;
|
|
33
|
+
set search_path = extensions, public, agent_board;
|
|
34
|
+
|
|
35
|
+
begin;
|
|
36
|
+
|
|
37
|
+
select plan(40);
|
|
38
|
+
|
|
39
|
+
-- ---------------------------------------------------------------------------
|
|
40
|
+
-- The class, derived from pg_proc.
|
|
41
|
+
-- ---------------------------------------------------------------------------
|
|
42
|
+
select is(
|
|
43
|
+
(select array_agg(p.proname::text order by p.proname)
|
|
44
|
+
from pg_proc p join pg_namespace n on n.oid = p.pronamespace
|
|
45
|
+
where n.nspname = 'agent_board'
|
|
46
|
+
and agent_board_test.stripped_body(p.oid) ~ agent_board_test.stmt_re('insert into|merge into', 'inbox_items')),
|
|
47
|
+
array['_upsert_inbox_item'],
|
|
48
|
+
'OPN-01: _upsert_inbox_item is the only function that inserts into inbox_items');
|
|
49
|
+
|
|
50
|
+
select is(
|
|
51
|
+
(select array_agg(p.proname::text order by p.proname)
|
|
52
|
+
from pg_proc p join pg_namespace n on n.oid = p.pronamespace
|
|
53
|
+
where n.nspname = 'agent_board'
|
|
54
|
+
and agent_board_test.stripped_body(p.oid) ~ agent_board_test.call_re('_upsert_inbox_item')
|
|
55
|
+
and agent_board_test.stripped_body(p.oid) ~ agent_board_test.qname_re('board_memberships')
|
|
56
|
+
and p.proname <> '_upsert_inbox_item'),
|
|
57
|
+
array['create_tasking_delivery', 'post_board_message'],
|
|
58
|
+
'OPN-02: the board-expanding delivery writers are exactly the two this file asserts behaviourally');
|
|
59
|
+
|
|
60
|
+
select is(
|
|
61
|
+
(select array_agg(p.proname::text order by p.proname)
|
|
62
|
+
from pg_proc p join pg_namespace n on n.oid = p.pronamespace
|
|
63
|
+
where n.nspname = 'agent_board'
|
|
64
|
+
and agent_board_test.stripped_body(p.oid) ~ agent_board_test.call_re('_upsert_inbox_item')
|
|
65
|
+
and agent_board_test.stripped_body(p.oid) !~ agent_board_test.qname_re('board_memberships')
|
|
66
|
+
and p.proname <> '_upsert_inbox_item'),
|
|
67
|
+
array['send_direct_message', 'send_multicast_message'],
|
|
68
|
+
'OPN-03: the non-expanding delivery writers are exactly the two exemptions asserted below');
|
|
69
|
+
|
|
70
|
+
-- ---------------------------------------------------------------------------
|
|
71
|
+
-- Fixture: author A, member B; board AB (A owner, B joined) and board S (A alone).
|
|
72
|
+
-- ---------------------------------------------------------------------------
|
|
73
|
+
create temp table _opn (
|
|
74
|
+
a_user uuid, b_user uuid,
|
|
75
|
+
a_agent uuid, b_agent uuid,
|
|
76
|
+
board_ab uuid, board_s uuid, thread uuid, thread_unlinked uuid, thread_unlinked2 uuid
|
|
77
|
+
) on commit drop;
|
|
78
|
+
create temp table _opn_post (message_id uuid, board_id uuid, delivered_recipient_count integer,
|
|
79
|
+
callback_outbox_count integer, created_at timestamptz) on commit drop;
|
|
80
|
+
create temp table _opn_sole (like _opn_post) on commit drop;
|
|
81
|
+
create temp table _opn_task (task_id uuid, task_event_id uuid, delivered_recipient_count integer,
|
|
82
|
+
inbox_item_count integer, callback_outbox_count integer, created_at timestamptz,
|
|
83
|
+
updated_at timestamptz) on commit drop;
|
|
84
|
+
create temp table _opn_self_task (like _opn_task) on commit drop;
|
|
85
|
+
create temp table _opn_sole_task (like _opn_task) on commit drop;
|
|
86
|
+
create temp table _opn_desc_task (like _opn_task) on commit drop;
|
|
87
|
+
create temp table _opn_both_task (like _opn_task) on commit drop;
|
|
88
|
+
create temp table _opn_both_sole (like _opn_task) on commit drop;
|
|
89
|
+
create temp table _opn_multi (message_id uuid, delivered_recipient_count integer, inbox_item_count integer,
|
|
90
|
+
callback_outbox_count integer, created_at timestamptz) on commit drop;
|
|
91
|
+
create temp table _opn_group (like _opn_multi) on commit drop;
|
|
92
|
+
create temp table _opn_group_self (like _opn_multi) on commit drop;
|
|
93
|
+
create temp table _opn_nested (like _opn_multi) on commit drop;
|
|
94
|
+
create temp table _opn_direct (message_id uuid, delivery_recipient_id uuid, inbox_item_id uuid,
|
|
95
|
+
callback_outbox_count integer, created_at timestamptz) on commit drop;
|
|
96
|
+
grant all on table _opn, _opn_post, _opn_sole, _opn_task, _opn_self_task, _opn_multi,
|
|
97
|
+
_opn_sole_task, _opn_desc_task, _opn_group, _opn_group_self, _opn_direct, _opn_both_task, _opn_nested, _opn_both_sole
|
|
98
|
+
to authenticated, service_role;
|
|
99
|
+
|
|
100
|
+
do $$
|
|
101
|
+
declare
|
|
102
|
+
v_a_user uuid := public.ensure_github_user('opn-author', 'opn-author@example.test', 'opn-author', 'OPN Author');
|
|
103
|
+
v_b_user uuid := public.ensure_github_user('opn-member', 'opn-member@example.test', 'opn-member', 'OPN Member');
|
|
104
|
+
v_a uuid := '76080000-0000-4000-8000-000000000001';
|
|
105
|
+
v_b uuid := '76080000-0000-4000-8000-000000000002';
|
|
106
|
+
v_thread uuid := '76080000-0000-4000-8000-000000000010';
|
|
107
|
+
v_thread_unlinked uuid := '76080000-0000-4000-8000-000000000011';
|
|
108
|
+
v_thread_unlinked2 uuid := '76080000-0000-4000-8000-000000000012';
|
|
109
|
+
v_board_ab uuid;
|
|
110
|
+
v_board_s uuid;
|
|
111
|
+
v_endpoint uuid;
|
|
112
|
+
begin
|
|
113
|
+
-- Both agents are in the group alias `opn-team` and carry the role `opn-role`, so a set-naming
|
|
114
|
+
-- descriptor resolves to BOTH of them -- the author included -- before the #608 rule applies.
|
|
115
|
+
insert into agent_board.agents(id, agent_type, handle, display_name, status, auth_user_id, owner_user_id, metadata)
|
|
116
|
+
values
|
|
117
|
+
(v_a, 'agent', 'opn-author', 'OPN Author', 'active', v_a_user, v_a_user, '{"groupAliases":["opn-team","opn-solo"],"roles":["opn-role"]}'::jsonb),
|
|
118
|
+
(v_b, 'agent', 'opn-member', 'OPN Member', 'active', v_b_user, v_b_user, '{"groupAliases":["opn-team"],"roles":["opn-role"]}'::jsonb);
|
|
119
|
+
|
|
120
|
+
insert into agent_board.threads(id, thread_type, created_by_agent_id, subject)
|
|
121
|
+
values (v_thread, 'coordination', v_a, 'OPN thread'),
|
|
122
|
+
(v_thread_unlinked, 'coordination', v_a, 'OPN unlinked thread'),
|
|
123
|
+
(v_thread_unlinked2, 'coordination', v_a, 'OPN second unlinked thread');
|
|
124
|
+
|
|
125
|
+
select board_id into v_board_ab
|
|
126
|
+
from agent_board.create_board(v_a, 'opn-board-ab', 'OPN AB', 'two members', '{}'::jsonb, 'private');
|
|
127
|
+
perform agent_board.join_board(v_board_ab, v_b, 'joined', v_a, '{}'::jsonb);
|
|
128
|
+
select board_id into v_board_s
|
|
129
|
+
from agent_board.create_board(v_a, 'opn-board-s', 'OPN S', 'author alone', '{}'::jsonb, 'private');
|
|
130
|
+
|
|
131
|
+
-- Both agents subscribe their own inbox to delivered callbacks: B's is the positive control
|
|
132
|
+
-- for OPN-10, so a zero for A cannot come from a fixture that queues nothing for anyone.
|
|
133
|
+
select endpoint_id into v_endpoint from agent_board.register_callback_endpoint(v_a, 'https://example.test/opn-a', '{}'::jsonb);
|
|
134
|
+
perform agent_board.verify_callback_endpoint(v_endpoint, v_a, '{"controlProofRef":"opn/a"}'::jsonb);
|
|
135
|
+
perform agent_board.subscribe_callback_endpoint(v_endpoint, v_a, 'own_inbox', 'inbox.item.delivered', null, '{}'::jsonb);
|
|
136
|
+
select endpoint_id into v_endpoint from agent_board.register_callback_endpoint(v_b, 'https://example.test/opn-b', '{}'::jsonb);
|
|
137
|
+
perform agent_board.verify_callback_endpoint(v_endpoint, v_b, '{"controlProofRef":"opn/b"}'::jsonb);
|
|
138
|
+
perform agent_board.subscribe_callback_endpoint(v_endpoint, v_b, 'own_inbox', 'inbox.item.delivered', null, '{}'::jsonb);
|
|
139
|
+
|
|
140
|
+
insert into _opn values (v_a_user, v_b_user, v_a, v_b, v_board_ab, v_board_s, v_thread, v_thread_unlinked, v_thread_unlinked2);
|
|
141
|
+
end;
|
|
142
|
+
$$;
|
|
143
|
+
|
|
144
|
+
-- ---------------------------------------------------------------------------
|
|
145
|
+
-- A posts to AB, through its own authenticated session.
|
|
146
|
+
-- ---------------------------------------------------------------------------
|
|
147
|
+
select set_config('request.jwt.claim.role', 'authenticated', true);
|
|
148
|
+
select set_config('request.jwt.claim.sub', (select a_user::text from _opn), true);
|
|
149
|
+
set local role authenticated;
|
|
150
|
+
|
|
151
|
+
select lives_ok(
|
|
152
|
+
$$ insert into _opn_post
|
|
153
|
+
select * from agent_board.post_board_message(
|
|
154
|
+
(select thread from _opn), null, (select board_ab from _opn),
|
|
155
|
+
'opn post', 'the author posts to a two-member board', 'comment', 'medium', null, '{}'::jsonb) $$,
|
|
156
|
+
'OPN-04: the author can post to a board it owns');
|
|
157
|
+
|
|
158
|
+
select is((select delivered_recipient_count from _opn_post), 1,
|
|
159
|
+
'OPN-05: delivered_recipient_count counts the other member only, not the author');
|
|
160
|
+
|
|
161
|
+
select is(
|
|
162
|
+
(select count(*)::int from agent_board.v_agent_wake_recovery
|
|
163
|
+
where source_message_id = (select message_id from _opn_post)),
|
|
164
|
+
0,
|
|
165
|
+
'OPN-06: the author''s own post is not in the author''s v_agent_wake_recovery');
|
|
166
|
+
|
|
167
|
+
select is(
|
|
168
|
+
(select count(*)::int from agent_board.v_agent_inbox
|
|
169
|
+
where source_message_id = (select message_id from _opn_post)
|
|
170
|
+
and recipient_agent_id = (select a_agent from _opn)),
|
|
171
|
+
0,
|
|
172
|
+
'OPN-07: the author''s own post is not in the author''s v_agent_inbox');
|
|
173
|
+
|
|
174
|
+
reset role;
|
|
175
|
+
select set_config('request.jwt.claim.sub', (select b_user::text from _opn), true);
|
|
176
|
+
set local role authenticated;
|
|
177
|
+
|
|
178
|
+
select is(
|
|
179
|
+
(select count(*)::int from agent_board.v_agent_wake_recovery
|
|
180
|
+
where source_message_id = (select message_id from _opn_post)),
|
|
181
|
+
1,
|
|
182
|
+
'OPN-08: the other member does receive the post as an unhandled item');
|
|
183
|
+
|
|
184
|
+
reset role;
|
|
185
|
+
select set_config('request.jwt.claim.role', '', true);
|
|
186
|
+
select set_config('request.jwt.claim.sub', '', true);
|
|
187
|
+
|
|
188
|
+
select is(
|
|
189
|
+
(select array_agg(array[ii.visible_in_inbox, ii.visible_in_board_feed])
|
|
190
|
+
from agent_board.inbox_items ii
|
|
191
|
+
where ii.source_message_id = (select message_id from _opn_post)
|
|
192
|
+
and ii.recipient_agent_id = (select a_agent from _opn)),
|
|
193
|
+
array[array[false, true]],
|
|
194
|
+
'OPN-09: the author keeps exactly one row for its post, and it is feed-only');
|
|
195
|
+
|
|
196
|
+
select is(
|
|
197
|
+
(select count(*)::int from agent_board.callback_outbox_events
|
|
198
|
+
where source_message_id = (select message_id from _opn_post)
|
|
199
|
+
and event_category = 'inbox.item.delivered'
|
|
200
|
+
and recipient_agent_id = (select a_agent from _opn)),
|
|
201
|
+
0,
|
|
202
|
+
'OPN-10: no own_inbox delivered callback is queued to the author for its own post');
|
|
203
|
+
|
|
204
|
+
select is(
|
|
205
|
+
(select count(*)::int from agent_board.callback_outbox_events
|
|
206
|
+
where source_message_id = (select message_id from _opn_post)
|
|
207
|
+
and event_category = 'inbox.item.delivered'
|
|
208
|
+
and recipient_agent_id = (select b_agent from _opn)),
|
|
209
|
+
1,
|
|
210
|
+
'OPN-11: the other member''s own_inbox delivered callback is queued (control for OPN-10)');
|
|
211
|
+
|
|
212
|
+
-- ---------------------------------------------------------------------------
|
|
213
|
+
-- A posts to S, where it is the only member: the post must stay in the feed.
|
|
214
|
+
-- ---------------------------------------------------------------------------
|
|
215
|
+
select set_config('request.jwt.claim.role', 'authenticated', true);
|
|
216
|
+
select set_config('request.jwt.claim.sub', (select a_user::text from _opn), true);
|
|
217
|
+
set local role authenticated;
|
|
218
|
+
|
|
219
|
+
select lives_ok(
|
|
220
|
+
$$ insert into _opn_sole
|
|
221
|
+
select * from agent_board.post_board_message(
|
|
222
|
+
(select thread from _opn), null, (select board_s from _opn),
|
|
223
|
+
'opn sole post', 'the author posts to a board it is alone on', 'comment', 'medium', null, '{}'::jsonb) $$,
|
|
224
|
+
'OPN-12: the author can post to a board it is the only member of');
|
|
225
|
+
|
|
226
|
+
select is(
|
|
227
|
+
(select count(*)::int from agent_board.v_board_feed
|
|
228
|
+
where message_id = (select message_id from _opn_sole)),
|
|
229
|
+
1,
|
|
230
|
+
'OPN-13: a post on a board whose only member is its author is still in that board''s feed');
|
|
231
|
+
|
|
232
|
+
select is(
|
|
233
|
+
(select count(*)::int from agent_board.v_agent_wake_recovery
|
|
234
|
+
where source_message_id = (select message_id from _opn_sole)),
|
|
235
|
+
0,
|
|
236
|
+
'OPN-14: the sole-member post is not in the author''s v_agent_wake_recovery either');
|
|
237
|
+
|
|
238
|
+
-- ---------------------------------------------------------------------------
|
|
239
|
+
-- A creates a board-wide task on AB.
|
|
240
|
+
-- ---------------------------------------------------------------------------
|
|
241
|
+
select lives_ok(
|
|
242
|
+
$$ insert into _opn_task
|
|
243
|
+
select * from agent_board.create_tasking_delivery(
|
|
244
|
+
(select thread from _opn), null, 'opn task', 'a board-wide task', null,
|
|
245
|
+
(select board_ab from _opn), 'medium', 'distributed', null, '{}'::jsonb) $$,
|
|
246
|
+
'OPN-15: the creator can deliver a task to its board');
|
|
247
|
+
|
|
248
|
+
reset role;
|
|
249
|
+
select set_config('request.jwt.claim.role', '', true);
|
|
250
|
+
select set_config('request.jwt.claim.sub', '', true);
|
|
251
|
+
|
|
252
|
+
select is(
|
|
253
|
+
(select array_agg(array[ii.visible_in_inbox, ii.visible_in_board_feed])
|
|
254
|
+
from agent_board.inbox_items ii
|
|
255
|
+
where ii.source_task_id = (select task_id from _opn_task)
|
|
256
|
+
and ii.recipient_agent_id = (select a_agent from _opn)),
|
|
257
|
+
array[array[false, true]],
|
|
258
|
+
'OPN-16: the board fan-out of a task gives its creator one feed-only row, not an inbox item');
|
|
259
|
+
|
|
260
|
+
select is(
|
|
261
|
+
(select count(*)::int from agent_board.inbox_items
|
|
262
|
+
where source_task_id = (select task_id from _opn_task)
|
|
263
|
+
and recipient_agent_id = (select b_agent from _opn)
|
|
264
|
+
and visible_in_inbox),
|
|
265
|
+
1,
|
|
266
|
+
'OPN-17: the board fan-out of a task delivers it to the other member');
|
|
267
|
+
|
|
268
|
+
-- ---------------------------------------------------------------------------
|
|
269
|
+
-- Exemptions, asserted positively: the explicit-recipient paths deliver what the caller lists.
|
|
270
|
+
-- ---------------------------------------------------------------------------
|
|
271
|
+
select set_config('request.jwt.claim.role', 'authenticated', true);
|
|
272
|
+
select set_config('request.jwt.claim.sub', (select a_user::text from _opn), true);
|
|
273
|
+
set local role authenticated;
|
|
274
|
+
|
|
275
|
+
select lives_ok(
|
|
276
|
+
$$ insert into _opn_multi
|
|
277
|
+
select * from agent_board.send_multicast_message(
|
|
278
|
+
(select thread from _opn), null, array[(select b_agent from _opn)],
|
|
279
|
+
'opn multicast', 'listed recipients only', 'comment', 'medium', null, '{}'::jsonb) $$,
|
|
280
|
+
'OPN-18: the author can multicast to a listed recipient');
|
|
281
|
+
|
|
282
|
+
select lives_ok(
|
|
283
|
+
$$ insert into _opn_self_task
|
|
284
|
+
select * from agent_board.create_tasking_delivery(
|
|
285
|
+
(select thread from _opn), null, 'opn self task', 'the creator lists itself',
|
|
286
|
+
array[(select a_agent from _opn)], null, 'medium', 'distributed', null, '{}'::jsonb) $$,
|
|
287
|
+
'OPN-19: the creator can list itself as an explicit task recipient');
|
|
288
|
+
|
|
289
|
+
reset role;
|
|
290
|
+
select set_config('request.jwt.claim.role', '', true);
|
|
291
|
+
select set_config('request.jwt.claim.sub', '', true);
|
|
292
|
+
|
|
293
|
+
select is(
|
|
294
|
+
(select array_agg(recipient_agent_id order by recipient_agent_id)
|
|
295
|
+
from agent_board.inbox_items
|
|
296
|
+
where source_message_id = (select message_id from _opn_multi)),
|
|
297
|
+
array[(select b_agent from _opn)],
|
|
298
|
+
'OPN-20: a multicast delivers to exactly the listed recipients, so not to an unlisted author');
|
|
299
|
+
|
|
300
|
+
select is(
|
|
301
|
+
(select count(*)::int from agent_board.inbox_items
|
|
302
|
+
where source_task_id = (select task_id from _opn_self_task)
|
|
303
|
+
and recipient_agent_id = (select a_agent from _opn)
|
|
304
|
+
and visible_in_inbox),
|
|
305
|
+
1,
|
|
306
|
+
'OPN-21: an explicit recipient list naming the creator still delivers to it');
|
|
307
|
+
|
|
308
|
+
select is(
|
|
309
|
+
(select delivered_recipient_count from _opn_self_task),
|
|
310
|
+
1,
|
|
311
|
+
'OPN-22: the explicit self-addressed task counts its one listed recipient');
|
|
312
|
+
|
|
313
|
+
-- ---------------------------------------------------------------------------
|
|
314
|
+
-- Round 1 of the PR #615 board: the creator-only task, the descriptor expansions, a direct send.
|
|
315
|
+
-- ---------------------------------------------------------------------------
|
|
316
|
+
select set_config('request.jwt.claim.role', 'authenticated', true);
|
|
317
|
+
select set_config('request.jwt.claim.sub', (select a_user::text from _opn), true);
|
|
318
|
+
set local role authenticated;
|
|
319
|
+
|
|
320
|
+
-- A board-wide task on a board whose only member is its creator. Skipping the creator's delivery
|
|
321
|
+
-- would skip the only write that stamps threads.board_id (OBSGATE #78), leaving the thread on the
|
|
322
|
+
-- access-only branch of post_message's observer gate. Mutation: exclude the creator from the loop.
|
|
323
|
+
select lives_ok(
|
|
324
|
+
$$ insert into _opn_sole_task
|
|
325
|
+
select * from agent_board.create_tasking_delivery(
|
|
326
|
+
(select thread_unlinked from _opn), null, 'opn sole task', 'creator alone', null,
|
|
327
|
+
(select board_s from _opn), 'medium', 'distributed', null, '{}'::jsonb) $$,
|
|
328
|
+
'OPN-23: the creator can deliver a task to a board it is alone on');
|
|
329
|
+
|
|
330
|
+
reset role;
|
|
331
|
+
select set_config('request.jwt.claim.role', '', true);
|
|
332
|
+
select set_config('request.jwt.claim.sub', '', true);
|
|
333
|
+
|
|
334
|
+
select is(
|
|
335
|
+
(select board_id from agent_board.threads where id = (select thread_unlinked from _opn)),
|
|
336
|
+
(select board_s from _opn),
|
|
337
|
+
'OPN-24: a creator-only board task still links its thread to the board');
|
|
338
|
+
|
|
339
|
+
select set_config('request.jwt.claim.role', 'authenticated', true);
|
|
340
|
+
select set_config('request.jwt.claim.sub', (select a_user::text from _opn), true);
|
|
341
|
+
set local role authenticated;
|
|
342
|
+
|
|
343
|
+
-- A multicast to a group alias the author belongs to.
|
|
344
|
+
select lives_ok(
|
|
345
|
+
$$ insert into _opn_group
|
|
346
|
+
select * from agent_board.send_multicast_message(
|
|
347
|
+
(select thread from _opn), null, '[{"kind":"group_alias","groupAlias":"opn-team"}]'::jsonb,
|
|
348
|
+
'addressing_v1', 'opn group', 'to a group the author is in', 'comment', 'medium', null, '{}'::jsonb) $$,
|
|
349
|
+
'OPN-25: the author can multicast to a group alias it belongs to');
|
|
350
|
+
|
|
351
|
+
-- The same group, plus an explicit agent_id naming the author AFTER it: the explicit mention wins.
|
|
352
|
+
select lives_ok(
|
|
353
|
+
$$ insert into _opn_group_self
|
|
354
|
+
select * from agent_board.send_multicast_message(
|
|
355
|
+
(select thread from _opn), null,
|
|
356
|
+
jsonb_build_array(
|
|
357
|
+
jsonb_build_object('kind', 'group_alias', 'groupAlias', 'opn-team'),
|
|
358
|
+
jsonb_build_object('kind', 'agent_id', 'agentId', (select a_agent from _opn)::text)),
|
|
359
|
+
'addressing_v1', 'opn group self', 'the group, and the author by id', 'comment', 'medium', null, '{}'::jsonb) $$,
|
|
360
|
+
'OPN-26: the author can multicast to a group and name itself explicitly');
|
|
361
|
+
|
|
362
|
+
-- A task to a role selector the creator carries.
|
|
363
|
+
select lives_ok(
|
|
364
|
+
$$ insert into _opn_desc_task
|
|
365
|
+
select * from agent_board.create_tasking_delivery(
|
|
366
|
+
(select thread from _opn), null, 'opn role task', 'to a role the creator has',
|
|
367
|
+
'[{"kind":"role_selector","role":"opn-role"}]'::jsonb, null, 'addressing_v1',
|
|
368
|
+
'medium', 'distributed', null, '{}'::jsonb) $$,
|
|
369
|
+
'OPN-27: the creator can deliver a task to a role selector it matches');
|
|
370
|
+
|
|
371
|
+
-- A group whose only member is the sender resolves to nobody else: refused, not self-delivered.
|
|
372
|
+
select throws_ok(
|
|
373
|
+
$$ select * from agent_board.send_multicast_message(
|
|
374
|
+
(select thread from _opn), null, '[{"kind":"group_alias","groupAlias":"opn-solo"}]'::jsonb,
|
|
375
|
+
'addressing_v1', 'opn solo', 'a group of one', 'comment', 'medium', null, '{}'::jsonb) $$,
|
|
376
|
+
'22023',
|
|
377
|
+
'recipient descriptors resolved only the sender',
|
|
378
|
+
'OPN-28: a set descriptor that resolves only to the sender is refused');
|
|
379
|
+
|
|
380
|
+
select lives_ok(
|
|
381
|
+
$$ insert into _opn_direct
|
|
382
|
+
select * from agent_board.send_direct_message(
|
|
383
|
+
(select thread from _opn), null, (select b_agent from _opn),
|
|
384
|
+
'opn direct', 'to the member', 'comment', 'medium', null, '{}'::jsonb) $$,
|
|
385
|
+
'OPN-29: the author can send a direct message');
|
|
386
|
+
|
|
387
|
+
reset role;
|
|
388
|
+
select set_config('request.jwt.claim.role', '', true);
|
|
389
|
+
select set_config('request.jwt.claim.sub', '', true);
|
|
390
|
+
|
|
391
|
+
select is(
|
|
392
|
+
(select array_agg(recipient_agent_id order by recipient_agent_id)
|
|
393
|
+
from agent_board.inbox_items
|
|
394
|
+
where source_message_id = (select message_id from _opn_group)),
|
|
395
|
+
array[(select b_agent from _opn)],
|
|
396
|
+
'OPN-30: a group alias the author belongs to delivers to the other member only');
|
|
397
|
+
|
|
398
|
+
select is(
|
|
399
|
+
(select array_agg(recipient_agent_id order by recipient_agent_id)
|
|
400
|
+
from agent_board.inbox_items
|
|
401
|
+
where source_message_id = (select message_id from _opn_group_self)
|
|
402
|
+
and visible_in_inbox),
|
|
403
|
+
array[(select a_agent from _opn), (select b_agent from _opn)],
|
|
404
|
+
'OPN-31: an explicit agent_id naming the author delivers to it even beside a group that contains it');
|
|
405
|
+
|
|
406
|
+
select is(
|
|
407
|
+
(select array_agg(recipient_agent_id order by recipient_agent_id)
|
|
408
|
+
from agent_board.inbox_items
|
|
409
|
+
where source_task_id = (select task_id from _opn_desc_task)),
|
|
410
|
+
array[(select b_agent from _opn)],
|
|
411
|
+
'OPN-32: a role selector the creator matches delivers the task to the other member only');
|
|
412
|
+
|
|
413
|
+
select is(
|
|
414
|
+
(select array_agg(recipient_agent_id order by recipient_agent_id)
|
|
415
|
+
from agent_board.inbox_items
|
|
416
|
+
where source_message_id = (select message_id from _opn_direct)),
|
|
417
|
+
array[(select b_agent from _opn)],
|
|
418
|
+
'OPN-33: a direct message delivers to exactly its recipient');
|
|
419
|
+
|
|
420
|
+
-- Round 2 of the PR #615 board: the creator lists itself AND targets a board it is on. Both loops
|
|
421
|
+
-- reach the same delivery row; the board loop must not demote the explicit one (which aborted the
|
|
422
|
+
-- whole task on inbox_items_visibility_shape). And an explicit self-mention nested in an
|
|
423
|
+
-- explicit_set, by handle, beside a group that contains the author.
|
|
424
|
+
select set_config('request.jwt.claim.role', 'authenticated', true);
|
|
425
|
+
select set_config('request.jwt.claim.sub', (select a_user::text from _opn), true);
|
|
426
|
+
set local role authenticated;
|
|
427
|
+
|
|
428
|
+
select lives_ok(
|
|
429
|
+
$$ insert into _opn_both_task
|
|
430
|
+
select * from agent_board.create_tasking_delivery(
|
|
431
|
+
(select thread from _opn), null, 'opn both task', 'the creator lists itself and its board',
|
|
432
|
+
array[(select a_agent from _opn)], (select board_ab from _opn), 'medium', 'distributed', null, '{}'::jsonb) $$,
|
|
433
|
+
'OPN-35: the creator can list itself and target a board it is on, in one task');
|
|
434
|
+
|
|
435
|
+
select lives_ok(
|
|
436
|
+
$$ insert into _opn_nested
|
|
437
|
+
select * from agent_board.send_multicast_message(
|
|
438
|
+
(select thread from _opn), null,
|
|
439
|
+
'[{"kind":"group_alias","groupAlias":"opn-team"},{"kind":"explicit_set","recipients":[{"kind":"agent_handle","handle":"opn-author"}]}]'::jsonb,
|
|
440
|
+
'addressing_v1', 'opn nested', 'a group, and the author by handle inside an explicit set', 'comment', 'medium', null, '{}'::jsonb) $$,
|
|
441
|
+
'OPN-36: the author can multicast to a group and name itself by handle inside an explicit_set');
|
|
442
|
+
|
|
443
|
+
-- Round 3 (correctness T1): the creator lists itself AND targets a board it is ALONE on, from an
|
|
444
|
+
-- unlinked thread. A fix that skipped the creator in the board loop would pass every assertion above
|
|
445
|
+
-- and leave this thread unlinked.
|
|
446
|
+
select lives_ok(
|
|
447
|
+
$$ insert into _opn_both_sole
|
|
448
|
+
select * from agent_board.create_tasking_delivery(
|
|
449
|
+
(select thread_unlinked2 from _opn), null, 'opn both sole', 'the creator lists itself; board of one',
|
|
450
|
+
array[(select a_agent from _opn)], (select board_s from _opn), 'medium', 'distributed', null, '{}'::jsonb) $$,
|
|
451
|
+
'OPN-39: the creator can list itself and target a board it is alone on');
|
|
452
|
+
|
|
453
|
+
reset role;
|
|
454
|
+
select set_config('request.jwt.claim.role', '', true);
|
|
455
|
+
select set_config('request.jwt.claim.sub', '', true);
|
|
456
|
+
|
|
457
|
+
select is(
|
|
458
|
+
(select board_id from agent_board.threads where id = (select thread_unlinked2 from _opn)),
|
|
459
|
+
(select board_s from _opn),
|
|
460
|
+
'OPN-40: that task still links its thread to the board');
|
|
461
|
+
|
|
462
|
+
select is(
|
|
463
|
+
(select array_agg(array[ii.visible_in_inbox::text, (ii.recipient_agent_id = (select a_agent from _opn))::text] order by ii.recipient_agent_id)
|
|
464
|
+
from agent_board.inbox_items ii
|
|
465
|
+
where ii.source_task_id = (select task_id from _opn_both_task)),
|
|
466
|
+
array[array['true', 'true'], array['true', 'false']],
|
|
467
|
+
'OPN-37: an explicit self-listing survives a board fan-out the creator is in, and the other member is reached');
|
|
468
|
+
|
|
469
|
+
select is(
|
|
470
|
+
(select array_agg(recipient_agent_id order by recipient_agent_id)
|
|
471
|
+
from agent_board.inbox_items
|
|
472
|
+
where source_message_id = (select message_id from _opn_nested)
|
|
473
|
+
and visible_in_inbox),
|
|
474
|
+
array[(select a_agent from _opn), (select b_agent from _opn)],
|
|
475
|
+
'OPN-38: an agent_handle naming the author inside an explicit_set is an explicit self-mention');
|
|
476
|
+
|
|
477
|
+
-- The descriptor class, from the catalog: every function that resolves recipient descriptors does so
|
|
478
|
+
-- through _resolve_addressing_recipient_rows, and the only callers of it are the resolver itself
|
|
479
|
+
-- (explicit_set recursion), the read-only resolve_recipients, and _addressing_agent_ids_or_raise --
|
|
480
|
+
-- the one delivery path, where the #608 rule lives. A new caller that delivers fails this by name.
|
|
481
|
+
select is(
|
|
482
|
+
(select array_agg(p.proname::text order by p.proname)
|
|
483
|
+
from pg_proc p join pg_namespace n on n.oid = p.pronamespace
|
|
484
|
+
where n.nspname = 'agent_board'
|
|
485
|
+
and agent_board_test.stripped_body(p.oid) ~ agent_board_test.call_re('_resolve_addressing_recipient_rows')),
|
|
486
|
+
array['_addressing_agent_ids_or_raise', '_resolve_addressing_recipient_rows', 'resolve_recipients'],
|
|
487
|
+
'OPN-34: descriptor expansion reaches a delivery only through _addressing_agent_ids_or_raise');
|
|
488
|
+
|
|
489
|
+
select * from finish();
|
|
490
|
+
rollback;
|
|
@@ -265,6 +265,12 @@ select is(
|
|
|
265
265
|
-- behavioural assertion above, because the UPDATE is never reached with a non-active row
|
|
266
266
|
-- unless an eviction lands between the pre-check and the UPDATE (the TOCTOU window).
|
|
267
267
|
-- Both review seats flagged this independently; assert the predicate structurally.
|
|
268
|
+
--
|
|
269
|
+
-- #674 rewrote this from `>= 2` to `= 3` ON PURPOSE (plan-674 D5, Gemini G001). The step-6
|
|
270
|
+
-- pre-check is now ONE locked statement that also LEFT JOINs the grantor's active row, so the
|
|
271
|
+
-- body carries the predicate exactly three times: the target in step 6, the grantor join in
|
|
272
|
+
-- step 6, and the UPDATE. `>= 2` would stay green if either step-6 site were deleted, and a
|
|
273
|
+
-- later fourth reader would hide behind it; `= 3` turns red on either, forcing re-review.
|
|
268
274
|
select ok(
|
|
269
275
|
(select (
|
|
270
276
|
select count(*) from regexp_matches(
|
|
@@ -272,11 +278,11 @@ select ok(
|
|
|
272
278
|
-- the column qualified or bare (`bm.membership_state` is the UPDATE's spelling)
|
|
273
279
|
agent_board_test.re(agent_board_test.col_ref_frag('membership_state')
|
|
274
280
|
|| '\s+' || agent_board_test.ci_re('in') || '\s*\(\s*''joined''\s*,\s*''subscribed''\s*\)'),
|
|
275
|
-
'g'))
|
|
281
|
+
'g')) = 3
|
|
276
282
|
from pg_proc p join pg_namespace n on n.oid = p.pronamespace
|
|
277
283
|
where n.nspname = 'agent_board' and p.proname = 'grant_board_role'
|
|
278
284
|
limit 1),
|
|
279
|
-
'grant_board_role carries the active-state predicate
|
|
285
|
+
'grant_board_role carries the active-state predicate exactly THREE times (#674: step-6 target, step-6 grantor join, UPDATE -- the TOCTOU half)');
|
|
280
286
|
|
|
281
287
|
-- 16. STRUCTURAL: the clamp lives in the mutator, not in a trigger. A BEFORE UPDATE
|
|
282
288
|
-- trigger on board_memberships would also fire for the four raw-insert seeders and
|
|
@@ -65,7 +65,7 @@ select set_config('request.jwt.claim.sub', (select root_user from _lb_fx)::text,
|
|
|
65
65
|
-- M3: the self-service write stamps scope_attestation='self_declared' (advisory).
|
|
66
66
|
-- M1: require_child_signing_key is PINNED true even though false was requested.
|
|
67
67
|
-- M2a: max_active_children null is CLAMPED to the non-null default (5).
|
|
68
|
-
-- M6a: child_ttl_ceiling 12h is accepted and stored;
|
|
68
|
+
-- M6a: child_ttl_ceiling 12h is accepted and stored; SIDSCHEMA allows depth two.
|
|
69
69
|
select lives_ok(
|
|
70
70
|
format($$ select agent_board.upsert_delegation_policy(%L::uuid, 'root_minted', jsonb_build_array('scope:a'), null, interval '12 hours', false) $$,
|
|
71
71
|
(select root from _lb_fx)),
|
|
@@ -78,14 +78,14 @@ select is((select require_child_signing_key from agent_board.delegation_policies
|
|
|
78
78
|
select is((select max_active_children from agent_board.delegation_policies where root_agent_id = (select root from _lb_fx) and revoked_at is null order by created_at desc limit 1),
|
|
79
79
|
5, 'M2a: null max_active_children clamped to non-null default 5');
|
|
80
80
|
select is((select max_depth from agent_board.delegation_policies where root_agent_id = (select root from _lb_fx) and revoked_at is null order by created_at desc limit 1),
|
|
81
|
-
|
|
81
|
+
2, 'SIDSCHEMA max_depth supports depth two');
|
|
82
82
|
select is((select child_ttl_ceiling from agent_board.delegation_policies where root_agent_id = (select root from _lb_fx) and revoked_at is null order by created_at desc limit 1),
|
|
83
83
|
interval '12 hours', 'M6: within-cap ttl (12h) stored');
|
|
84
84
|
|
|
85
85
|
-- M2b/M2c: out-of-range child cap rejected (both ends).
|
|
86
86
|
select throws_ok(
|
|
87
|
-
format($$ select agent_board.upsert_delegation_policy(%L::uuid, 'root_minted', jsonb_build_array('scope:a'),
|
|
88
|
-
'22023', null, 'M2b: max_active_children
|
|
87
|
+
format($$ select agent_board.upsert_delegation_policy(%L::uuid, 'root_minted', jsonb_build_array('scope:a'), 201) $$, (select root from _lb_fx)),
|
|
88
|
+
'22023', null, 'M2b: max_active_children 201 (> 200) rejected');
|
|
89
89
|
select throws_ok(
|
|
90
90
|
format($$ select agent_board.upsert_delegation_policy(%L::uuid, 'root_minted', jsonb_build_array('scope:a'), 0) $$, (select root from _lb_fx)),
|
|
91
91
|
'22023', null, 'M2c: max_active_children 0 (< 1) rejected');
|
|
@@ -131,10 +131,10 @@ select ok(not has_function_privilege('anon',
|
|
|
131
131
|
'agent_board.upsert_delegation_policy(uuid, text, jsonb, integer, interval, boolean)', 'EXECUTE'),
|
|
132
132
|
'M5: anon may NOT EXECUTE upsert_delegation_policy');
|
|
133
133
|
select ok(not has_function_privilege('authenticated',
|
|
134
|
-
'agent_board.mint_delegated_child(uuid, text, jsonb, text, interval, boolean)', 'EXECUTE'),
|
|
134
|
+
'agent_board.mint_delegated_child(uuid, text, jsonb, text, interval, boolean, text, text, text, jsonb, jsonb, uuid)', 'EXECUTE'),
|
|
135
135
|
'M5: mint_delegated_child stays service_role-only — authenticated has NO EXECUTE (deferred to #138)');
|
|
136
136
|
select ok(not has_function_privilege('anon',
|
|
137
|
-
'agent_board.mint_delegated_child(uuid, text, jsonb, text, interval, boolean)', 'EXECUTE'),
|
|
137
|
+
'agent_board.mint_delegated_child(uuid, text, jsonb, text, interval, boolean, text, text, text, jsonb, jsonb, uuid)', 'EXECUTE'),
|
|
138
138
|
'M5: anon may NOT EXECUTE mint_delegated_child');
|
|
139
139
|
|
|
140
140
|
select set_config('request.jwt.claim.role', '', true);
|
|
@@ -518,15 +518,17 @@ select is(
|
|
|
518
518
|
'_upsert_board_membership_state',
|
|
519
519
|
'create_tasking_delivery',
|
|
520
520
|
'join_board',
|
|
521
|
+
'link_session_alias',
|
|
521
522
|
'list_board_members',
|
|
522
523
|
'list_board_pending_memberships',
|
|
523
524
|
'list_my_board_requests',
|
|
524
525
|
'post_board_message',
|
|
526
|
+
'readmit_session_identity',
|
|
525
527
|
'request_join_board',
|
|
526
528
|
'resolve_board_request',
|
|
527
529
|
'update_board_membership'
|
|
528
530
|
]::text[],
|
|
529
|
-
'live catalog exposes
|
|
531
|
+
'live catalog exposes every membership total-order reader, including SID link/readmission, plus task/message readers');
|
|
530
532
|
|
|
531
533
|
-- 3-10. COUNT-EQUALITY, never substring containment.
|
|
532
534
|
select is(
|