@consiliency/agent-board-schema 1.79.0 → 1.81.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fixtures/already-applied.json +8 -0
- package/migrations/20261126000100_agent_board_membership_removal_requires_active.sql +243 -0
- package/migrations/20261201000100_agent_board_reply_to_message.sql +1241 -0
- package/package.json +1 -1
- package/schema-manifest.json +21 -3
- package/src/tooling.test.mjs +6 -2
- package/tests/agent_board_661_reply_delivery.test.sql +12 -12
- package/tests/agent_board_667_history_class.test.sql +31 -13
- package/tests/agent_board_717_message_replay_scope.test.sql +29 -16
- package/tests/agent_board_717_tasking_replay_scope.test.sql +3 -3
- package/tests/agent_board_bundle_endpoint_compat.test.sql +2 -2
- package/tests/agent_board_canary_signed_fleet_enforcement.test.sql +3 -3
- package/tests/agent_board_claim_subject_gate.test.sql +3 -1
- package/tests/agent_board_delegate_role_class.test.sql +1 -1
- package/tests/agent_board_delivery_writer_execute.test.sql +7 -7
- package/tests/agent_board_hosted_delegates.test.sql +3 -3
- package/tests/agent_board_inbox_rpcs.test.sql +6 -6
- package/tests/agent_board_membership_removal_state.test.sql +228 -0
- package/tests/agent_board_refusal_atomicity.test.sql +958 -0
- package/tests/agent_board_reply_to.test.sql +874 -0
- package/tests/agent_board_scoped_send_regrant.test.sql +8 -8
- package/tests/agent_board_send_outcome.test.sql +10 -10
- package/tests/agent_board_send_role_gate.test.sql +2 -2
- package/tests/agent_board_write_enforcement_class.test.sql +7 -7
- package/tests/catalog/function_execute_privileges.json +23 -14
- package/tests/catalog/p_metadata_parameters.json +12 -8
- package/tests/isolation/expected/reply_parent_vs_thread_delete.out +55 -0
- package/tests/isolation/expected/reply_vs_parent_author_delete.out +56 -0
- package/tests/isolation/specs/reply_parent_vs_thread_delete.spec +42 -0
- package/tests/isolation/specs/reply_vs_parent_author_delete.spec +46 -0
- package/tests/mutations/655/M01_no_writer_check.sql +22 -0
- package/tests/mutations/655/M02_drop_fk.sql +2 -0
- package/tests/mutations/655/M03_existence_only.sql +13 -0
- package/tests/mutations/655/M04_distinct_cross_thread_error.sql +17 -0
- package/tests/mutations/655/M05_view_no_thread_conjunct.sql +46 -0
- package/tests/mutations/655/M06_thread_feed_not_invoker.sql +46 -0
- package/tests/mutations/655/M06b_board_feed_not_invoker.sql +49 -0
- package/tests/mutations/655/M07_excerpt_via_definer.sql +49 -0
- package/tests/mutations/655/M08_excerpt_200.sql +46 -0
- package/tests/mutations/655/M09_fk_restrict.sql +4 -0
- package/tests/mutations/655/M10_post_message_drops_arg.sql +13 -0
- package/tests/mutations/655/M10b_post_message_passes_null.sql +12 -0
- package/tests/mutations/655/M11_slug_drops_arg.sql +15 -0
- package/tests/mutations/655/M11b_dm_descriptor_positional.sql +31 -0
- package/tests/mutations/655/M12_signed_pbm_nine_args.sql +19 -0
- package/tests/mutations/655/M12b_signed_mc_one_branch.sql +15 -0
- package/tests/mutations/655/M13_undriven_entrypoint.sql +8 -0
- package/tests/mutations/655/M14_second_writer.sql +6 -0
- package/tests/mutations/655/M15_insert_primitive_public.sql +2 -0
- package/tests/mutations/655/M16_comment_missing.sql +2 -0
- package/tests/mutations/655/M17_old_allow_set_rows.sql +5 -0
- package/tests/mutations/655/M18_board_excerpt_139.sql +49 -0
- package/tests/mutations/655/M19_column_in_middle.sql +47 -0
- package/tests/mutations/655/M20_projects_parent_id.sql +46 -0
- package/tests/mutations/655/M21_replay_applies_new_parent.sql +22 -0
- package/tests/mutations/655/M22_fk_not_valid.sql +4 -0
- package/tests/mutations/655/MB4a_no_readability.sql +13 -0
- package/tests/mutations/655/MB4b_own_readability_message.sql +20 -0
- package/tests/mutations/655/MB4c_service_role_reads_all.sql +12 -0
- package/tests/mutations/655/MB4d_delegate_uses_authenticated_arm.sql +12 -0
- package/tests/mutations/655/MB4f_no_board_member_branch.sql +14 -0
- package/tests/mutations/655/MB4g_helper_granted_authenticated.sql +2 -0
- package/tests/mutations/655/MB4j_writer_uses_current_agent.sql +12 -0
- package/tests/mutations/655/MB4k_delegate_policy_loses_initplan.sql +5 -0
- package/tests/mutations/655/MB4l_board_memberships_policy_narrowed.sql +3 -0
- package/tests/mutations/655/W1_auth_no_membership_state.sql +13 -0
- package/tests/mutations/655/W2_auth_no_agent_binding.sql +13 -0
- package/tests/mutations/655/W3_delivery_no_recipient_binding.sql +12 -0
- package/tests/mutations/655/W4_delegate_no_board_conjunct.sql +18 -0
- package/tests/mutations/655/W5_boardset_no_membership_state.sql +13 -0
- package/tests/mutations/655/W6_boardset_no_agent_binding.sql +14 -0
- package/tests/mutations/655/run.sh +93 -0
- package/tests/mutations/670/M10_lock_removed.sql +2 -2
- package/tests/mutations/670/M14_post_message_mints_from_metadata.sql +2 -2
- package/tests/mutations/670/M3-DM_helper_on_replay_branch.sql +2 -2
- package/tests/mutations/670/M3-MC_helper_on_replay_branch.sql +2 -2
- package/tests/mutations/670/M3_helper_on_replay_branch.sql +2 -2
- package/tests/mutations/670/M8_delivery_swallows_errors.sql +2 -2
- package/tests/mutations/670/M9_lock_key_includes_board.sql +2 -2
- package/tests/mutations/670/run.sh +1 -1
- package/tests/mutations/717-f1/M10_wrapper_stops_delegating.sql +1 -1
- package/tests/mutations/717-f1/M9_public_route_revoked_from_service_role.sql +1 -1
- package/tests/mutations/717-f2b/L1_dm_lock_split_by_recipient.sql +2 -2
- package/tests/mutations/717-f2b/L2_dm_lock_removed.sql +2 -2
- package/tests/mutations/717-f2b/L3_mc_lock_split_by_recipients.sql +2 -2
- package/tests/mutations/717-f2b/L4_mc_lock_removed.sql +2 -2
- package/tests/mutations/717-f2b/M0_prefix_definitions.sql +1 -1
- package/tests/mutations/717-f2b/M10_mc_lookup_any_author.sql +2 -2
- package/tests/mutations/717-f2b/M11_dm_swallow_refusal.sql +2 -2
- package/tests/mutations/717-f2b/M12_mc_swallow_refusal.sql +2 -2
- package/tests/mutations/717-f2b/M15_mc_any_source.sql +1 -1
- package/tests/mutations/717-f2b/M1_dm_drop_recipient_proof.sql +2 -2
- package/tests/mutations/717-f2b/M2_mc_drop_recipient_proof.sql +2 -2
- package/tests/mutations/717-f2b/M3_dm_metadata_as_proof.sql +2 -2
- package/tests/mutations/717-f2b/M4_mc_metadata_as_proof.sql +2 -2
- package/tests/mutations/717-f2b/M5_dm_any_mode.sql +2 -2
- package/tests/mutations/717-f2b/M6_dm_board_delivery_counts.sql +2 -2
- package/tests/mutations/717-f2b/M7_mc_any_mode.sql +2 -2
- package/tests/mutations/717-f2b/M8_dm_thread_stamp_as_proof.sql +2 -2
- package/tests/mutations/717-f2b/M9_dm_lookup_any_author.sql +2 -2
- package/tests/mutations/717-f2b/run.sh +2 -2
- package/tests/mutations/919/M10_quoted_net_http_post_scratch.sql +5 -0
- package/tests/mutations/919/M11_pbm_calls_public.sql +11 -0
- package/tests/mutations/919/M1_pbm_refusal_swallowed_after_write.sql +14 -0
- package/tests/mutations/919/M2_cof_refusal_swallowed_after_write.sql +13 -0
- package/tests/mutations/919/M3_pbm_receipt_fault_swallowed.sql +10 -0
- package/tests/mutations/919/M4_pg_notify_scratch.sql +5 -0
- package/tests/mutations/919/M5_dynamic_notify_scratch.sql +5 -0
- package/tests/mutations/919/M6_trigger_outside_schema.sql +3 -0
- package/tests/mutations/919/M7_pbm_step_up_gate.sql +10 -0
- package/tests/mutations/919/M8_pbm_positive_writes_nothing.sql +10 -0
- package/tests/mutations/919/M9_cof_positive_writes_nothing.sql +10 -0
- package/tests/mutations/919/run.sh +81 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@consiliency/agent-board-schema",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.81.0",
|
|
4
4
|
"description": "Canonical, immutable, exact-pinnable agent_board schema bundle: ordered SQL migrations, digest + compatibility manifest, and deterministic materialize/plan/check tooling for adopters.",
|
|
5
5
|
"repository": "https://github.com/Consiliency/message-board.git",
|
|
6
6
|
"type": "module",
|
package/schema-manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schema": "agent_board_schema_manifest.v1",
|
|
3
3
|
"interface": "IF-0-MBPLANE-BUNDLE-1",
|
|
4
4
|
"package": "@consiliency/agent-board-schema",
|
|
5
|
-
"packageVersion": "1.
|
|
5
|
+
"packageVersion": "1.81.0",
|
|
6
6
|
"schemaVersion": 8,
|
|
7
7
|
"minClientVersion": "1.1.0",
|
|
8
8
|
"source": {
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"usage": "upsert (retention/monitoring defaults; on conflict do nothing)"
|
|
47
47
|
}
|
|
48
48
|
],
|
|
49
|
-
"migrationCount":
|
|
50
|
-
"aggregateSha256": "
|
|
49
|
+
"migrationCount": 179,
|
|
50
|
+
"aggregateSha256": "445c0de25941205b986c148b76db54c3edbcf3d3321bb5d8e419781a138b4679",
|
|
51
51
|
"migrations": [
|
|
52
52
|
{
|
|
53
53
|
"order": 0,
|
|
@@ -1641,6 +1641,24 @@
|
|
|
1641
1641
|
"sourceRef": "message-board",
|
|
1642
1642
|
"bytes": 78249,
|
|
1643
1643
|
"sha256": "26c02cb8797d059b18f5e81d1db0be237126f48a0598b30e36e683763021384a"
|
|
1644
|
+
},
|
|
1645
|
+
{
|
|
1646
|
+
"order": 177,
|
|
1647
|
+
"id": "20261126000100_agent_board_membership_removal_requires_active",
|
|
1648
|
+
"filename": "20261126000100_agent_board_membership_removal_requires_active.sql",
|
|
1649
|
+
"origin": "message-board-forward",
|
|
1650
|
+
"sourceRef": "message-board",
|
|
1651
|
+
"bytes": 14912,
|
|
1652
|
+
"sha256": "295eb0cd22598b6ee45dd5ccaae7290834131b9eb98e286fe91856abf90dd1ac"
|
|
1653
|
+
},
|
|
1654
|
+
{
|
|
1655
|
+
"order": 178,
|
|
1656
|
+
"id": "20261201000100_agent_board_reply_to_message",
|
|
1657
|
+
"filename": "20261201000100_agent_board_reply_to_message.sql",
|
|
1658
|
+
"origin": "message-board-forward",
|
|
1659
|
+
"sourceRef": "message-board",
|
|
1660
|
+
"bytes": 64189,
|
|
1661
|
+
"sha256": "1687e08c4a24af412f10b99e031e0c5e7b592b9b0f74989abff65fa56d3cd00b"
|
|
1644
1662
|
}
|
|
1645
1663
|
],
|
|
1646
1664
|
"excludedBridge": {
|
package/src/tooling.test.mjs
CHANGED
|
@@ -41,9 +41,9 @@ describe('manifest integrity', () => {
|
|
|
41
41
|
expect(manifest.schemaVersion).toBe(8);
|
|
42
42
|
expect(manifest.minClientVersion).toMatch(/^\d+\.\d+\.\d+$/);
|
|
43
43
|
});
|
|
44
|
-
it('registers the four MBAUTHZ + four MBSENDAUTHZ + four MBSESSION + four MBDELEG + three MBFED + three MBHARDEN + two MBPORTALGATE + two MBPORTAL-PR32 + two ROOMOWN + two ROOMLINK + one ROOMDELEG + one LOCALAUTH + one ROOMUIAPI + one FEDSESSION + one FEDSESSION-AUTOJOIN + one GATENULL + one MEMBSTATE + one AGENTSDIR + one LEAVEIDEM + one ROLERESET + one MBROWID + one MBHYGIENE + one MBCONSENT-A + one MBCONSENT-B(a) + one MBCONSENT-B(i) + one MBCONSENT-B(ii) + one MBCONSENT-B(iii) + one MBHARDEN-#97 + one MBHARDEN-#118 + one INVITEPOLICY + one OBSGATE + one OBSGATE-2 + one OBSGATE-3 + one OBSGATE-4 + one FLEETMACHINERLS + one RESOLVENOOP + one ROOMDELEG-LANEB + one CLAIMKEY + two MINTHARDEN + one FLEETMACHINEHIJACK + one CLAIMGATE-SHADOW + one CLAIMGATE-ENFORCE + one FLEETMACHINEREACTIVATION + one DELEGCAPCEILING + one FLEETMACHINERECLAIM + one DELEGSOLEWRITER + one FLEETDOMAINRECLAIM + five ATOMICFLEETONBOARDING (onboarding + ceiling-lock + revocation-evidence + fedsession-gate + fedsession-lock-order) + one OUTBOXWAKE + one ENROLLLOCKORDER + one FEDPROVIDERABSENCE + one WAKERECOVERY + one CONSENTRECONCILE + one ENROLLRESUMPTION + one SIGNEDAUTHORITY + one SIGNERLIFECYCLE + one LEDGERAUTHORITY + one CEILINGLOCKCOMMENT + one LEDGERBOARDCREATE + one RECEIPTSUBJECTGATE + one TASKTHREADLOCKORDER + one CLAIMSUBJECTGATE + one FEDSESSIONIDENTITYGATE + one FEDIDENTITYSLUG + one INVITENODOWNGRADE + one SIGNEDWRITEFLAG + one SIGNEDWRITEMODEL + one RTCREDCLAIM + one ORIGINPOSTURE + one BOARDCLAIMPOLICY + one HEARTBEATPRESERVE + one LIVENESSDENOM + one OWNERLESSRENEWTTL + one OWNERLESSQUOTACENSUS + one FLEETDOMAINNODOWNGRADE + one OWNERLESSQUOTACONVERGE + one ADVISORYREVERTRESET + one CLAIMPOLICYRACE + one CLAIMPOLICYLOCKGRANT + one SESSIONCHALLENGESUPERSEDE + one ROOMCONTRACT + one CALLBACKCONSUMER + one ENROLLTOKENSINGLEUSE + one ROOMCONTRACT-ACTIVEFIRST + one ONBOARD + one HOSTED + one HOSTED-FOLLOWUPS + one OWNPOST + one SIDSCHEMA + one SIDOWNER + one GRANTTARGETROLE (#674) + one LASTOWNER (Consiliency/message-board#675) + one SESSIONPROVENANCE (Consiliency/message-board#665) + one REQUESTREMOVED (Consiliency/message-board#680) + one RLSCORRELATION (Consiliency/message-board#589) + one RESOLUTIONAUTHORITY (Consiliency/message-board#668) + one THREADASSOCIATION checkpoint (#667) + one SIDSERVER-MEASUREDMINT (Consiliency/message-board#653) + one REPLYDELIVERY (#661) + one DELIVERYWRITEREXEC (#717 F1) + one REPLAYSCOPE (#717 F2) + one MESSAGEREPLAYSCOPE (#717 F2b) + one SENDOUTCOME (#670) + one STEPUP-PR-A (#669) + one THREADKEYSERIALIZE (S-12) + one THREADKEYGUARDS (S-12 #815/#816) + one STEPUP-PR-B (#669) forward migrations (migrationCount = prior 113 + 5 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 =
|
|
44
|
+
it('registers the four MBAUTHZ + four MBSENDAUTHZ + four MBSESSION + four MBDELEG + three MBFED + three MBHARDEN + two MBPORTALGATE + two MBPORTAL-PR32 + two ROOMOWN + two ROOMLINK + one ROOMDELEG + one LOCALAUTH + one ROOMUIAPI + one FEDSESSION + one FEDSESSION-AUTOJOIN + one GATENULL + one MEMBSTATE + one AGENTSDIR + one LEAVEIDEM + one ROLERESET + one MBROWID + one MBHYGIENE + one MBCONSENT-A + one MBCONSENT-B(a) + one MBCONSENT-B(i) + one MBCONSENT-B(ii) + one MBCONSENT-B(iii) + one MBHARDEN-#97 + one MBHARDEN-#118 + one INVITEPOLICY + one OBSGATE + one OBSGATE-2 + one OBSGATE-3 + one OBSGATE-4 + one FLEETMACHINERLS + one RESOLVENOOP + one ROOMDELEG-LANEB + one CLAIMKEY + two MINTHARDEN + one FLEETMACHINEHIJACK + one CLAIMGATE-SHADOW + one CLAIMGATE-ENFORCE + one FLEETMACHINEREACTIVATION + one DELEGCAPCEILING + one FLEETMACHINERECLAIM + one DELEGSOLEWRITER + one FLEETDOMAINRECLAIM + five ATOMICFLEETONBOARDING (onboarding + ceiling-lock + revocation-evidence + fedsession-gate + fedsession-lock-order) + one OUTBOXWAKE + one ENROLLLOCKORDER + one FEDPROVIDERABSENCE + one WAKERECOVERY + one CONSENTRECONCILE + one ENROLLRESUMPTION + one SIGNEDAUTHORITY + one SIGNERLIFECYCLE + one LEDGERAUTHORITY + one CEILINGLOCKCOMMENT + one LEDGERBOARDCREATE + one RECEIPTSUBJECTGATE + one TASKTHREADLOCKORDER + one CLAIMSUBJECTGATE + one FEDSESSIONIDENTITYGATE + one FEDIDENTITYSLUG + one INVITENODOWNGRADE + one SIGNEDWRITEFLAG + one SIGNEDWRITEMODEL + one RTCREDCLAIM + one ORIGINPOSTURE + one BOARDCLAIMPOLICY + one HEARTBEATPRESERVE + one LIVENESSDENOM + one OWNERLESSRENEWTTL + one OWNERLESSQUOTACENSUS + one FLEETDOMAINNODOWNGRADE + one OWNERLESSQUOTACONVERGE + one ADVISORYREVERTRESET + one CLAIMPOLICYRACE + one CLAIMPOLICYLOCKGRANT + one SESSIONCHALLENGESUPERSEDE + one ROOMCONTRACT + one CALLBACKCONSUMER + one ENROLLTOKENSINGLEUSE + one ROOMCONTRACT-ACTIVEFIRST + one ONBOARD + one HOSTED + one HOSTED-FOLLOWUPS + one OWNPOST + one SIDSCHEMA + one SIDOWNER + one GRANTTARGETROLE (#674) + one LASTOWNER (Consiliency/message-board#675) + one SESSIONPROVENANCE (Consiliency/message-board#665) + one REQUESTREMOVED (Consiliency/message-board#680) + one RLSCORRELATION (Consiliency/message-board#589) + one RESOLUTIONAUTHORITY (Consiliency/message-board#668) + one THREADASSOCIATION checkpoint (#667) + one SIDSERVER-MEASUREDMINT (Consiliency/message-board#653) + one REPLYDELIVERY (#661) + one DELIVERYWRITEREXEC (#717 F1) + one REPLAYSCOPE (#717 F2) + one MESSAGEREPLAYSCOPE (#717 F2b) + one SENDOUTCOME (#670) + one STEPUP-PR-A (#669) + one THREADKEYSERIALIZE (S-12) + one THREADKEYGUARDS (S-12 #815/#816) + one STEPUP-PR-B (#669) + one REMOVALSTATE (#906) + one REPLYTO (#655) forward migrations (migrationCount = prior 113 + 5 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 179)', () => {
|
|
45
45
|
expect(manifest.migrationCount).toBe(manifest.migrations.length);
|
|
46
|
-
expect(manifest.migrationCount).toBe(
|
|
46
|
+
expect(manifest.migrationCount).toBe(179);
|
|
47
47
|
// MBSESSION switched enforcement on (scoped-send re-grant): the client-visible
|
|
48
48
|
// schema version bumped to 8. MBDELEG tightens delegation and MBFED adds only
|
|
49
49
|
// enrollment-only additive surface (identity_providers registry, enrollment audit,
|
|
@@ -383,6 +383,10 @@ describe('manifest integrity', () => {
|
|
|
383
383
|
// #669 PR-B: step-up enforcement on the gated conferral routes (renamed from 20261120000100
|
|
384
384
|
// when refreshed onto main, so it sorts after the S-12 migrations).
|
|
385
385
|
'20261124000100_agent_board_step_up_enforcement.sql',
|
|
386
|
+
// #906: update_board_membership(..., 'removed') by another actor requires an active target.
|
|
387
|
+
'20261126000100_agent_board_membership_removal_requires_active.sql',
|
|
388
|
+
// #655: reply to a specific message (reply_to_message_id, same-thread FK, feed columns).
|
|
389
|
+
'20261201000100_agent_board_reply_to_message.sql',
|
|
386
390
|
]) {
|
|
387
391
|
expect(names.has(f)).toBe(true);
|
|
388
392
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
create extension if not exists pgtap with schema extensions;
|
|
2
2
|
set search_path=extensions,public,agent_board;
|
|
3
3
|
begin;
|
|
4
|
-
select no_plan()
|
|
4
|
+
select plan(57); -- #655: counted, not no_plan(), so a class census that aborts cannot read as passing (rule 3)
|
|
5
5
|
create temp table f(a uuid,b uuid,ua uuid,ub uuid,board uuid,thread uuid, outsider uuid, uo uuid, private_thread uuid);
|
|
6
6
|
grant select on f to authenticated;
|
|
7
7
|
do $$
|
|
@@ -87,13 +87,13 @@ select is((select board_id from agent_board.threads where id=(select thread from
|
|
|
87
87
|
select is((select visibility from agent_board.boards where id=(select board from f)),'private','661 replies preserve private board');
|
|
88
88
|
-- Catalog census: new direct writers or overloads name themselves. Internal
|
|
89
89
|
-- helpers have no API grants; their callers must remain the reviewed routes.
|
|
90
|
-
select is((select string_agg(p.oid::regprocedure::text,', ' order by p.oid::regprocedure::text) from pg_proc p where p.pronamespace='agent_board'::regnamespace and agent_board_test.stripped_body(p.oid) ~ agent_board_test.
|
|
91
|
-
'_insert_thread_message(uuid,uuid,text,text,uuid,jsonb)','661 catalog message insertion has one authorized primitive');
|
|
90
|
+
select is((select string_agg(p.oid::regprocedure::text,', ' order by p.oid::regprocedure::text) from pg_proc p where p.pronamespace='agent_board'::regnamespace and agent_board_test.stripped_body(p.oid) ~ agent_board_test.writes_any_re(array['messages'])),
|
|
91
|
+
'_insert_thread_message(uuid,uuid,text,text,uuid,jsonb,uuid)','661 catalog message insertion has one authorized primitive (#655 RT-CLASS-1: every write form, INSERT/UPDATE/MERGE/DELETE/TRUNCATE/COPY/SELECT INTO)');
|
|
92
92
|
select is((select string_agg(p.oid::regprocedure::text,', ' order by p.oid::regprocedure::text) from pg_proc p where p.pronamespace='agent_board'::regnamespace and agent_board_test.stripped_body(p.oid) ~ agent_board_test.call_re('_insert_thread_message')),
|
|
93
|
-
'post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb), post_message(uuid,uuid,text,text,uuid,jsonb), send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb), send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb)',
|
|
93
|
+
'post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid), post_message(uuid,uuid,text,text,uuid,jsonb,uuid), send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid), send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb,uuid)',
|
|
94
94
|
'661 catalog insertion callers name every route and overload');
|
|
95
95
|
select is((select string_agg(p.oid::regprocedure::text,', ' order by p.oid::regprocedure::text) from pg_proc p where p.pronamespace='agent_board'::regnamespace and agent_board_test.stripped_body(p.oid) ~ agent_board_test.call_re('_deliver_board_message')),
|
|
96
|
-
'post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb), post_message(uuid,uuid,text,text,uuid,jsonb)',
|
|
96
|
+
'post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid), post_message(uuid,uuid,text,text,uuid,jsonb,uuid)',
|
|
97
97
|
'661 catalog fan-out callers are canonical board post and reply');
|
|
98
98
|
select is((select string_agg(p.oid::regprocedure::text||':'||r,', ' order by p.oid,r) from pg_proc p cross join unnest(array['anon','authenticated','service_role','agent_board_delegate']) r where p.pronamespace='agent_board'::regnamespace and p.proname in ('_insert_thread_message','_deliver_board_message') and has_function_privilege(r,p.oid,'execute')),null::text,'661 internal insertion and delivery helpers are not API callable');
|
|
99
99
|
|
|
@@ -125,13 +125,13 @@ select is((select array_agg(distinct p.proname||'('||oidvectortypes(p.proargtype
|
|
|
125
125
|
from agent_board_test.fn_call_closure() c join pg_proc p on p.oid=c.root_oid
|
|
126
126
|
where c.reached_name='_insert_thread_message' and (has_function_privilege('authenticated',p.oid,'execute') or has_function_privilege('service_role',p.oid,'execute') or has_function_privilege('agent_board_delegate',p.oid,'execute'))),
|
|
127
127
|
array[
|
|
128
|
-
'post_board_message(uuid, uuid, text, text, text, text, text, text, text, jsonb)',
|
|
129
|
-
'post_board_message(uuid, uuid, uuid, text, text, text, text, text, jsonb)',
|
|
130
|
-
'post_message(uuid, uuid, text, text, uuid, jsonb)',
|
|
131
|
-
'send_direct_message(uuid, uuid, jsonb, text, text, text, text, text, text, jsonb)',
|
|
132
|
-
'send_direct_message(uuid, uuid, uuid, text, text, text, text, text, jsonb)',
|
|
133
|
-
'send_multicast_message(uuid, uuid, jsonb, text, text, text, text, text, text, jsonb)',
|
|
134
|
-
'send_multicast_message(uuid, uuid, uuid[], text, text, text, text, text, jsonb)',
|
|
128
|
+
'post_board_message(uuid, uuid, text, text, text, text, text, text, text, jsonb, uuid)',
|
|
129
|
+
'post_board_message(uuid, uuid, uuid, text, text, text, text, text, jsonb, uuid)',
|
|
130
|
+
'post_message(uuid, uuid, text, text, uuid, jsonb, uuid)',
|
|
131
|
+
'send_direct_message(uuid, uuid, jsonb, text, text, text, text, text, text, jsonb, uuid)',
|
|
132
|
+
'send_direct_message(uuid, uuid, uuid, text, text, text, text, text, jsonb, uuid)',
|
|
133
|
+
'send_multicast_message(uuid, uuid, jsonb, text, text, text, text, text, text, jsonb, uuid)',
|
|
134
|
+
'send_multicast_message(uuid, uuid, uuid[], text, text, text, text, text, jsonb, uuid)',
|
|
135
135
|
'signed_post_board_message(jsonb, jsonb)',
|
|
136
136
|
'signed_send_direct_message(jsonb, jsonb)',
|
|
137
137
|
'signed_send_multicast_message(jsonb, jsonb)']::text[],
|
|
@@ -12,7 +12,7 @@ begin
|
|
|
12
12
|
execute 'create extension if not exists plpgsql_check with schema extensions';
|
|
13
13
|
end if;
|
|
14
14
|
end $$;
|
|
15
|
-
select plan(
|
|
15
|
+
select plan(62);
|
|
16
16
|
-- Procedure bodies and CALL edges are outside the function parsers below.
|
|
17
17
|
-- Fail closed on every non-extension application procedure until its complete
|
|
18
18
|
-- history and caller effects receive an explicit positive disposition.
|
|
@@ -85,12 +85,29 @@ select is(
|
|
|
85
85
|
where a.attrelid='agent_board.read_receipts'::regclass and a.attnum>0 and not a.attisdropped),
|
|
86
86
|
array['thread_id','agent_id','last_read_message_sequence','last_read_at']::text[],
|
|
87
87
|
'XB receipt exemption has only subject, bounded sequence and timestamp columns');
|
|
88
|
+
-- #655 XB-SELF: a composite SELF-FK of a direct thread-FK relation whose leading referencing column
|
|
89
|
+
-- is the child's OWN thread-FK column, matched to the same column of the parent, is anchored by the
|
|
90
|
+
-- child's own thread_id (the composite forces it to equal the parent's), not derived from the
|
|
91
|
+
-- parent. It is exempt from the single-column rule below, by OID, and the exemption is derived
|
|
92
|
+
-- from those properties and asserted positively: exactly the #655 same-thread reply FK, validated.
|
|
93
|
+
create temp table xb_samethread_exempt on commit drop as
|
|
94
|
+
select f.oid, f.conrelid, f.conname::text as conname, f.convalidated
|
|
95
|
+
from pg_constraint f
|
|
96
|
+
where f.contype='f' and f.conrelid=f.confrelid and cardinality(f.conkey)=2
|
|
97
|
+
and exists (select 1 from pg_constraint t
|
|
98
|
+
where t.contype='f' and t.conrelid=f.conrelid and t.confrelid='agent_board.threads'::regclass
|
|
99
|
+
and cardinality(t.conkey)=1 and t.conkey[1]=f.conkey[1] and t.conkey[1]=f.confkey[1]);
|
|
100
|
+
select is(
|
|
101
|
+
(select string_agg(format('%s.%I valid=%s', conrelid::regclass, conname, convalidated::text), ', ' order by conname) from xb_samethread_exempt),
|
|
102
|
+
'messages.messages_reply_to_same_thread_fkey valid=true',
|
|
103
|
+
'XB-SELF (#655): the only same-thread composite self-FK is messages_reply_to_same_thread_fkey, keyed on the child''s own thread column, validated');
|
|
88
104
|
-- Every catalog-discovered one-hop edge must be an enforced, validated single-column
|
|
89
105
|
-- FK to its parent. This pins parent existence, not the remaining writer closure.
|
|
90
106
|
select is(
|
|
91
107
|
(with direct as (select distinct conrelid from pg_constraint where contype='f' and confrelid='agent_board.threads'::regclass), edges as (
|
|
92
108
|
select f.oid, f.conrelid, f.conname, f.convalidated, cardinality(f.conkey) as nkeys
|
|
93
|
-
from pg_constraint f join direct d on d.conrelid=f.confrelid where f.contype='f'
|
|
109
|
+
from pg_constraint f join direct d on d.conrelid=f.confrelid where f.contype='f'
|
|
110
|
+
and f.oid not in (select oid from xb_samethread_exempt))
|
|
94
111
|
select string_agg(format('%s.%I',conrelid::regclass,conname), ', ' order by conrelid::regclass::text, conname)
|
|
95
112
|
from edges where not convalidated or nkeys<>1),
|
|
96
113
|
null::text, 'XB one-hop parent-existence FKs are validated and single-column');
|
|
@@ -115,6 +132,7 @@ insert into xb_onehop_reviewed values
|
|
|
115
132
|
('agent_board.inbox_items'::regclass,'agent_board.messages'::regclass,'inbox_items_source_message_id_fkey'),
|
|
116
133
|
('agent_board.inbox_items'::regclass,'agent_board.tasks'::regclass,'inbox_items_source_task_id_fkey'),
|
|
117
134
|
('agent_board.messages'::regclass,'agent_board.tasks'::regclass,'messages_task_id_fkey'),
|
|
135
|
+
('agent_board.messages'::regclass,'agent_board.messages'::regclass,'messages_reply_to_same_thread_fkey'),
|
|
118
136
|
('agent_board.send_outcomes'::regclass,'agent_board.messages'::regclass,'send_outcomes_message_id_fkey'),
|
|
119
137
|
('agent_board.signature_evidence'::regclass,'agent_board.artifacts'::regclass,'signature_evidence_source_artifact_id_fkey'),
|
|
120
138
|
('agent_board.signature_evidence'::regclass,'agent_board.messages'::regclass,'signature_evidence_source_message_id_fkey'),
|
|
@@ -330,7 +348,7 @@ where f.body ~ agent_board_test.stmt_re('insert into',d.relname);
|
|
|
330
348
|
create temp table xb_direct_insert_reviewed(fn oid,relid oid,mechanism text,primary key(fn,relid)) on commit drop;
|
|
331
349
|
insert into xb_direct_insert_reviewed values
|
|
332
350
|
('agent_board.heartbeat(uuid,uuid,text,text,interval,jsonb)'::regprocedure,'agent_board.presence'::regclass,'locked_post'),
|
|
333
|
-
('agent_board._insert_thread_message(uuid,uuid,text,text,uuid,jsonb)'::regprocedure,'agent_board.messages'::regclass,'message_sequence'),
|
|
351
|
+
('agent_board._insert_thread_message(uuid,uuid,text,text,uuid,jsonb,uuid)'::regprocedure,'agent_board.messages'::regclass,'message_sequence'),
|
|
334
352
|
('agent_board.create_task(uuid,uuid,text,text,uuid,uuid,text,text,jsonb)'::regprocedure,'agent_board.tasks'::regclass,'locked_post'),
|
|
335
353
|
('agent_board.create_task(uuid,uuid,text,text,uuid,uuid,text,text,jsonb)'::regprocedure,'agent_board.task_events'::regclass,'locked_post'),
|
|
336
354
|
('agent_board.acquire_claim(uuid,text,text,timestamptz,uuid,uuid,jsonb)'::regprocedure,'agent_board.claims'::regclass,'locked_post'),
|
|
@@ -645,7 +663,7 @@ select is((select string_agg(distinct c.oid::regprocedure::text, ', ' order by c
|
|
|
645
663
|
select is((select string_agg(format('%I.%I(%s)[%s]',n.nspname,p.proname,replace(oidvectortypes(p.proargtypes), ', ', ','),c.board_arg), ', '
|
|
646
664
|
order by n.nspname::text collate "C",p.proname::text collate "C",oidvectortypes(p.proargtypes),c.board_arg)
|
|
647
665
|
from xb_sink_calls c join pg_proc p on p.oid=c.oid join pg_namespace n on n.oid=p.pronamespace),
|
|
648
|
-
'agent_board._deliver_board_message(uuid,text,text,text)[p_board_id], agent_board.create_tasking_delivery(uuid,uuid,text,text,uuid[],uuid,text,text,text,jsonb)[null], agent_board.create_tasking_delivery(uuid,uuid,text,text,uuid[],uuid,text,text,text,jsonb)[p_board_id], agent_board.send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)[null], agent_board.send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb)[null]',
|
|
666
|
+
'agent_board._deliver_board_message(uuid,text,text,text)[p_board_id], agent_board.create_tasking_delivery(uuid,uuid,text,text,uuid[],uuid,text,text,text,jsonb)[null], agent_board.create_tasking_delivery(uuid,uuid,text,text,uuid[],uuid,text,text,text,jsonb)[p_board_id], agent_board.send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid)[null], agent_board.send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb,uuid)[null]',
|
|
649
667
|
'XB every delivery-sink call has an explicitly classified board argument');
|
|
650
668
|
select is((select string_agg(oid::regprocedure::text, ', ' order by oid::regprocedure::text)
|
|
651
669
|
from (select distinct c.oid from xb_sink_calls c where c.board_arg<>'null') c
|
|
@@ -663,18 +681,18 @@ with recursive t(oid) as (select distinct oid from xb_sink_calls
|
|
|
663
681
|
select oid from t;
|
|
664
682
|
create temp table xb_sink_wrapper_reviewed(fn oid not null,target oid not null,primary key(fn,target)) on commit drop;
|
|
665
683
|
insert into xb_sink_wrapper_reviewed values
|
|
666
|
-
('agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)'::regprocedure,'agent_board._deliver_board_message(uuid,text,text,text)'::regprocedure),
|
|
667
|
-
('agent_board.post_message(uuid,uuid,text,text,uuid,jsonb)'::regprocedure,'agent_board._deliver_board_message(uuid,text,text,text)'::regprocedure),
|
|
668
|
-
('agent_board.post_board_message(uuid,uuid,text,text,text,text,text,text,text,jsonb)'::regprocedure,'agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)'::regprocedure),
|
|
684
|
+
('agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid)'::regprocedure,'agent_board._deliver_board_message(uuid,text,text,text)'::regprocedure),
|
|
685
|
+
('agent_board.post_message(uuid,uuid,text,text,uuid,jsonb,uuid)'::regprocedure,'agent_board._deliver_board_message(uuid,text,text,text)'::regprocedure),
|
|
686
|
+
('agent_board.post_board_message(uuid,uuid,text,text,text,text,text,text,text,jsonb,uuid)'::regprocedure,'agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid)'::regprocedure),
|
|
669
687
|
('agent_board.create_tasking_delivery(uuid,uuid,text,text,jsonb,text,text,text,text,text,jsonb)'::regprocedure,'agent_board.create_tasking_delivery(uuid,uuid,text,text,uuid[],uuid,text,text,text,jsonb)'::regprocedure),
|
|
670
|
-
('agent_board.send_direct_message(uuid,uuid,jsonb,text,text,text,text,text,text,jsonb)'::regprocedure,'agent_board.send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)'::regprocedure),
|
|
671
|
-
('agent_board.send_multicast_message(uuid,uuid,jsonb,text,text,text,text,text,text,jsonb)'::regprocedure,'agent_board.send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb)'::regprocedure),
|
|
672
|
-
('agent_board.signed_post_board_message(jsonb,jsonb)'::regprocedure,'agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)'::regprocedure),
|
|
688
|
+
('agent_board.send_direct_message(uuid,uuid,jsonb,text,text,text,text,text,text,jsonb,uuid)'::regprocedure,'agent_board.send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid)'::regprocedure),
|
|
689
|
+
('agent_board.send_multicast_message(uuid,uuid,jsonb,text,text,text,text,text,text,jsonb,uuid)'::regprocedure,'agent_board.send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb,uuid)'::regprocedure),
|
|
690
|
+
('agent_board.signed_post_board_message(jsonb,jsonb)'::regprocedure,'agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid)'::regprocedure),
|
|
673
691
|
('agent_board.signed_create_tasking_delivery(jsonb,jsonb)'::regprocedure,'agent_board.create_tasking_delivery(uuid,uuid,text,text,uuid[],uuid,text,text,text,jsonb)'::regprocedure),
|
|
674
|
-
('agent_board.signed_send_direct_message(jsonb,jsonb)'::regprocedure,'agent_board.send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)'::regprocedure),
|
|
675
|
-
('agent_board.signed_send_multicast_message(jsonb,jsonb)'::regprocedure,'agent_board.send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb)'::regprocedure),
|
|
692
|
+
('agent_board.signed_send_direct_message(jsonb,jsonb)'::regprocedure,'agent_board.send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid)'::regprocedure),
|
|
693
|
+
('agent_board.signed_send_multicast_message(jsonb,jsonb)'::regprocedure,'agent_board.send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb,uuid)'::regprocedure),
|
|
676
694
|
('agent_board.signed_create_tasking_delivery(jsonb,jsonb)'::regprocedure,'agent_board.create_tasking_delivery(uuid,uuid,text,text,jsonb,text,text,text,text,text,jsonb)'::regprocedure),
|
|
677
|
-
('agent_board.signed_send_multicast_message(jsonb,jsonb)'::regprocedure,'agent_board.send_multicast_message(uuid,uuid,jsonb,text,text,text,text,text,text,jsonb)'::regprocedure);
|
|
695
|
+
('agent_board.signed_send_multicast_message(jsonb,jsonb)'::regprocedure,'agent_board.send_multicast_message(uuid,uuid,jsonb,text,text,text,text,text,text,jsonb,uuid)'::regprocedure);
|
|
678
696
|
select is((select string_agg(format('%I.%I(%s)',n.nspname,p.proname,oidvectortypes(p.proargtypes)), ', '
|
|
679
697
|
order by n.nspname,p.proname,oidvectortypes(p.proargtypes))
|
|
680
698
|
from xb_sink_caller_closure t join pg_proc p on p.oid=t.oid join pg_namespace n on n.oid=p.pronamespace
|
|
@@ -29,7 +29,7 @@ set search_path = extensions, public, agent_board;
|
|
|
29
29
|
|
|
30
30
|
begin;
|
|
31
31
|
|
|
32
|
-
select plan(
|
|
32
|
+
select plan(70);
|
|
33
33
|
|
|
34
34
|
create temp table _h(k text primary key, v text);
|
|
35
35
|
create function pg_temp.v(p_k text) returns text language sql as $$ select v from _h where k = p_k $$;
|
|
@@ -593,15 +593,15 @@ select is(
|
|
|
593
593
|
|| ' ' || (select string_agg(r || '=' || has_function_privilege(r, p.oid, 'EXECUTE')::text, ' ' order by r)
|
|
594
594
|
from unnest(array['anon', 'authenticated', 'agent_board_delegate', 'service_role']) r), ' | ' order by p.proname)
|
|
595
595
|
from pg_proc p
|
|
596
|
-
where p.oid in ('agent_board.send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)'::regprocedure,
|
|
597
|
-
'agent_board.send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb)'::regprocedure)),
|
|
596
|
+
where p.oid in ('agent_board.send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid)'::regprocedure,
|
|
597
|
+
'agent_board.send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb,uuid)'::regprocedure)),
|
|
598
598
|
'send_direct_message:true/search_path=agent_board, public agent_board_delegate=false anon=false authenticated=true service_role=true'
|
|
599
599
|
|| ' | send_multicast_message:true/search_path=agent_board, public agent_board_delegate=false anon=false authenticated=true service_role=true',
|
|
600
600
|
'both cores stay SECURITY DEFINER with their search_path, EXECUTE for authenticated and service_role only');
|
|
601
601
|
-- 48
|
|
602
602
|
select ok(
|
|
603
|
-
obj_description('agent_board.send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)'::regprocedure, 'pg_proc') ~ 'cannot widen the message''s audience'
|
|
604
|
-
and obj_description('agent_board.send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb)'::regprocedure, 'pg_proc') ~ 'cannot widen the message''s audience',
|
|
603
|
+
obj_description('agent_board.send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid)'::regprocedure, 'pg_proc') ~ 'cannot widen the message''s audience'
|
|
604
|
+
and obj_description('agent_board.send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb,uuid)'::regprocedure, 'pg_proc') ~ 'cannot widen the message''s audience',
|
|
605
605
|
'both cores'' comments state the replay ceiling');
|
|
606
606
|
|
|
607
607
|
-- ===========================================================================
|
|
@@ -637,19 +637,19 @@ select ok(
|
|
|
637
637
|
-- of one (68), and two same-key calls create one thread and no other row (69)
|
|
638
638
|
create temp table _class(signature text primary key, disposition text not null);
|
|
639
639
|
insert into _class values
|
|
640
|
-
('send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)', 'ceiling'),
|
|
641
|
-
('send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb)', 'ceiling'),
|
|
642
|
-
('send_direct_message(uuid,uuid,jsonb,text,text,text,text,text,text,jsonb)', 'routes-core:send_direct_message'),
|
|
643
|
-
('send_multicast_message(uuid,uuid,jsonb,text,text,text,text,text,text,jsonb)', 'routes-core:send_multicast_message'),
|
|
640
|
+
('send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid)', 'ceiling'),
|
|
641
|
+
('send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb,uuid)', 'ceiling'),
|
|
642
|
+
('send_direct_message(uuid,uuid,jsonb,text,text,text,text,text,text,jsonb,uuid)', 'routes-core:send_direct_message'),
|
|
643
|
+
('send_multicast_message(uuid,uuid,jsonb,text,text,text,text,text,text,jsonb,uuid)', 'routes-core:send_multicast_message'),
|
|
644
644
|
('signed_send_direct_message(jsonb,jsonb)', 'routes-core:send_direct_message'),
|
|
645
645
|
('signed_send_multicast_message(jsonb,jsonb)', 'routes-core:send_multicast_message'),
|
|
646
646
|
('_upsert_delivery_recipient(text,uuid,text,uuid,uuid,uuid,uuid,uuid,jsonb)', 'internal'),
|
|
647
647
|
('_upsert_inbox_item(uuid,uuid,uuid,text,text,uuid,uuid,uuid,text,text,text,boolean,boolean,jsonb,jsonb)', 'internal'),
|
|
648
648
|
('_deliver_board_message(uuid,text,text,text)', 'internal'),
|
|
649
|
-
('post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)', 'one-board'),
|
|
650
|
-
('post_board_message(uuid,uuid,text,text,text,text,text,text,text,jsonb)', 'one-board'),
|
|
649
|
+
('post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid)', 'one-board'),
|
|
650
|
+
('post_board_message(uuid,uuid,text,text,text,text,text,text,text,jsonb,uuid)', 'one-board'),
|
|
651
651
|
('signed_post_board_message(jsonb,jsonb)', 'one-board'),
|
|
652
|
-
('post_message(uuid,uuid,text,text,uuid,jsonb)', 'no-replay'),
|
|
652
|
+
('post_message(uuid,uuid,text,text,uuid,jsonb,uuid)', 'no-replay'),
|
|
653
653
|
('update_inbox_item_state(uuid,uuid,text,jsonb)', 'recipient-state'),
|
|
654
654
|
('create_tasking_delivery(uuid,uuid,text,text,uuid[],uuid,text,text,text,jsonb)', 'tasking-f2'),
|
|
655
655
|
('create_tasking_delivery(uuid,uuid,text,text,jsonb,text,text,text,text,text,jsonb)', 'tasking-f2'),
|
|
@@ -754,16 +754,16 @@ select is(
|
|
|
754
754
|
from pg_constraint c
|
|
755
755
|
where c.contype = 'f' and c.confrelid = 'agent_board.messages'::regclass
|
|
756
756
|
and has_table_privilege('authenticated', c.conrelid, 'SELECT')),
|
|
757
|
-
'artifacts callback_outbox_events delivery_recipients inbox_items signature_evidence',
|
|
758
|
-
'CLASS: the authenticated-readable tables referencing messages, from pg_constraint: each one is counted by sees()');
|
|
757
|
+
'artifacts callback_outbox_events delivery_recipients inbox_items messages signature_evidence',
|
|
758
|
+
'CLASS: the authenticated-readable tables referencing messages, from pg_constraint: each one is counted by sees() (#655: messages itself is sees() field 1)');
|
|
759
759
|
-- 57 -- the same for hosted delegates (they cannot be addressed privately; their read paths are board-scoped)
|
|
760
760
|
select is(
|
|
761
761
|
(select coalesce(string_agg(distinct c.conrelid::regclass::text, ' ' order by c.conrelid::regclass::text), '(none)')
|
|
762
762
|
from pg_constraint c
|
|
763
763
|
where c.contype = 'f' and c.confrelid = 'agent_board.messages'::regclass
|
|
764
764
|
and has_table_privilege('agent_board_delegate', c.conrelid, 'SELECT')),
|
|
765
|
-
'delivery_recipients inbox_items signature_evidence',
|
|
766
|
-
'CLASS: the delegate-readable tables referencing messages are a subset of what sees() counts');
|
|
765
|
+
'delivery_recipients inbox_items messages signature_evidence',
|
|
766
|
+
'CLASS: the delegate-readable tables referencing messages are a subset of what sees() counts (#655: messages itself is sees() field 1)');
|
|
767
767
|
-- 58
|
|
768
768
|
select is(pg_temp.sees('X', 'DM.a2') || ' | ' || pg_temp.sees('X', 'MC.a2'),
|
|
769
769
|
'1/0/1/1/1/0 A2-BODY | 1/0/1/1/1/0 A2-MC',
|
|
@@ -861,5 +861,18 @@ select is(
|
|
|
861
861
|
'false/true threads=1 rows-unchanged',
|
|
862
862
|
'thread-only disposition: two same-key calls create one thread and write no message, task, delivery, inbox, callback or evidence row');
|
|
863
863
|
|
|
864
|
+
-- 70 -- #655 (plan §8.5.1): the messages self-reference added to 56/57 carries IDS ONLY. The one FK
|
|
865
|
+
-- from messages to messages is the same-thread reply FK, and its referencing columns are exactly
|
|
866
|
+
-- (thread_id, reply_to_message_id): a reply holds its parent's id, never any of its content, so
|
|
867
|
+
-- the self-edge adds no read path beyond the messages policy sees() already counts.
|
|
868
|
+
select is(
|
|
869
|
+
(select string_agg(c.conname || ' (' || (select string_agg(a.attname, ', ' order by k.o)
|
|
870
|
+
from unnest(c.conkey) with ordinality k(n, o)
|
|
871
|
+
join pg_attribute a on a.attrelid = c.conrelid and a.attnum = k.n) || ')', '; ')
|
|
872
|
+
from pg_constraint c
|
|
873
|
+
where c.contype = 'f' and c.conrelid = 'agent_board.messages'::regclass and c.confrelid = 'agent_board.messages'::regclass),
|
|
874
|
+
'messages_reply_to_same_thread_fkey (thread_id, reply_to_message_id)',
|
|
875
|
+
'CLASS (#655): the only messages->messages FK is the same-thread reply FK, keyed on ids only');
|
|
876
|
+
|
|
864
877
|
select * from finish();
|
|
865
878
|
rollback;
|
|
@@ -632,9 +632,9 @@ select ok(obj_description('agent_board.create_tasking_delivery(uuid,uuid,text,te
|
|
|
632
632
|
create temp table _replay_class(signature text primary key, disposition text not null);
|
|
633
633
|
insert into _replay_class values
|
|
634
634
|
('create_tasking_delivery(uuid,uuid,text,text,uuid[],uuid,text,text,text,jsonb)', 'ceiling'),
|
|
635
|
-
('post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)', 'one-board'),
|
|
636
|
-
('send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)', 'fixed-717-F2b-740'),
|
|
637
|
-
('send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb)', 'fixed-717-F2b-740'),
|
|
635
|
+
('post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid)', 'one-board'),
|
|
636
|
+
('send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid)', 'fixed-717-F2b-740'),
|
|
637
|
+
('send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb,uuid)', 'fixed-717-F2b-740'),
|
|
638
638
|
('create_or_find_thread(uuid,text,text,text,jsonb)', 'thread-only');
|
|
639
639
|
-- 54
|
|
640
640
|
select is(
|
|
@@ -59,11 +59,11 @@ select is((agent_board.get_bundle_compatibility() ->> 'signed_write_enforced'),
|
|
|
59
59
|
-- This REVOKES and RE-GRANTS a send overload so it observes a genuine state change; the earlier
|
|
60
60
|
-- draft asserted the same value twice with nothing happening in between, which documented the
|
|
61
61
|
-- claim rather than probing it.
|
|
62
|
-
revoke execute on function agent_board.send_multicast_message(uuid, uuid, uuid[], text, text, text, text, text, jsonb) from authenticated;
|
|
62
|
+
revoke execute on function agent_board.send_multicast_message(uuid, uuid, uuid[], text, text, text, text, text, jsonb, uuid) from authenticated;
|
|
63
63
|
select is((agent_board.get_bundle_compatibility() ->> 'signed_write_enforced'), 'true',
|
|
64
64
|
'#310: REVOKING a send RPC from authenticated does not move the flag — the retired predicate would have flipped to true here, which is precisely what it got wrong');
|
|
65
65
|
|
|
66
|
-
grant execute on function agent_board.send_multicast_message(uuid, uuid, uuid[], text, text, text, text, text, jsonb) to authenticated;
|
|
66
|
+
grant execute on function agent_board.send_multicast_message(uuid, uuid, uuid[], text, text, text, text, text, jsonb, uuid) to authenticated;
|
|
67
67
|
select is((agent_board.get_bundle_compatibility() ->> 'signed_write_enforced'), 'true',
|
|
68
68
|
'#310: and RE-GRANTING it does not move the flag either — authenticated holding EXECUTE on the unsigned send path is the shipped model, not a lapse');
|
|
69
69
|
|
|
@@ -12,7 +12,7 @@ select has_function('agent_board', 'signed_create_tasking_delivery', array['json
|
|
|
12
12
|
select function_privs_are(
|
|
13
13
|
'agent_board',
|
|
14
14
|
'send_direct_message',
|
|
15
|
-
array['uuid','uuid','uuid','text','text','text','text','text','jsonb'],
|
|
15
|
+
array['uuid','uuid','uuid','text','text','text','text','text','jsonb','uuid'],
|
|
16
16
|
'authenticated',
|
|
17
17
|
array['EXECUTE'],
|
|
18
18
|
'authenticated may execute direct scoped send on the MBSESSION re-granted path'
|
|
@@ -21,7 +21,7 @@ select function_privs_are(
|
|
|
21
21
|
select function_privs_are(
|
|
22
22
|
'agent_board',
|
|
23
23
|
'send_multicast_message',
|
|
24
|
-
array['uuid','uuid','uuid[]','text','text','text','text','text','jsonb'],
|
|
24
|
+
array['uuid','uuid','uuid[]','text','text','text','text','text','jsonb','uuid'],
|
|
25
25
|
'authenticated',
|
|
26
26
|
array['EXECUTE'],
|
|
27
27
|
'authenticated may execute multicast scoped send on the MBSESSION re-granted path'
|
|
@@ -30,7 +30,7 @@ select function_privs_are(
|
|
|
30
30
|
select function_privs_are(
|
|
31
31
|
'agent_board',
|
|
32
32
|
'post_board_message',
|
|
33
|
-
array['uuid','uuid','uuid','text','text','text','text','text','jsonb'],
|
|
33
|
+
array['uuid','uuid','uuid','text','text','text','text','text','jsonb','uuid'],
|
|
34
34
|
'authenticated',
|
|
35
35
|
array['EXECUTE'],
|
|
36
36
|
'authenticated may execute board scoped send on the MBSESSION re-granted path'
|
|
@@ -665,12 +665,14 @@ select set_config('request.jwt.claim.sub', '', true);
|
|
|
665
665
|
-- both reviewed read-only bodies, not just their names: allowing the wrapper's
|
|
666
666
|
-- name alone would admit a future access_mode write inside that volatile RPC.
|
|
667
667
|
-- The reply suite separately executes inherit/restricted preservation cases.
|
|
668
|
+
-- #655 re-pinned post_message's digest: its body changed only by the reply argument it forwards to
|
|
669
|
+
-- _insert_thread_message by name; its access_mode read is untouched (reviewed against the diff).
|
|
668
670
|
select is(
|
|
669
671
|
(select coalesce(string_agg(p.proname || ':' || md5(agent_board_test.stripped_body(p.oid, true)), ',' order by p.proname), '(none)')
|
|
670
672
|
from pg_proc p
|
|
671
673
|
where p.pronamespace = 'agent_board'::regnamespace
|
|
672
674
|
and lower(agent_board_test.stripped_body(p.oid, true)) ~ 'access_mode'),
|
|
673
|
-
'_agent_can_access_thread:84a666a661c89a8338225155add8660f,post_message:
|
|
675
|
+
'_agent_can_access_thread:84a666a661c89a8338225155add8660f,post_message:12ca5c553e304167713163825c42dad1',
|
|
674
676
|
'catalog: every access_mode site matches its reviewed read-only definition; new sites and changed bodies name themselves');
|
|
675
677
|
|
|
676
678
|
select is(
|
|
@@ -86,7 +86,7 @@ select is(
|
|
|
86
86
|
select is(
|
|
87
87
|
(select string_agg(kind || ':' || signature, ' | ' order by kind, signature)
|
|
88
88
|
from agent_board.delegate_allowed_operations where kind in ('rpc', 'ambient_rpc', 'predicate')),
|
|
89
|
-
'ambient_rpc:get_schema_version() | predicate:_delegate_visible_agent(uuid) | predicate:_delegate_visible_board_ids() | predicate:current_agent_id() | rpc:create_or_find_thread(uuid, text, text, text, jsonb) | rpc:get_send_outcome(uuid, text, text) | rpc:post_board_message(uuid, uuid, text, text, text, text, text, text, text, jsonb) | rpc:post_board_message(uuid, uuid, uuid, text, text, text, text, text, jsonb) | rpc:post_message(uuid, uuid, text, text, uuid, jsonb)',
|
|
89
|
+
'ambient_rpc:get_schema_version() | predicate:_delegate_visible_agent(uuid) | predicate:_delegate_visible_board_ids() | predicate:current_agent_id() | rpc:create_or_find_thread(uuid, text, text, text, jsonb) | rpc:get_send_outcome(uuid, text, text) | rpc:post_board_message(uuid, uuid, text, text, text, text, text, text, text, jsonb, uuid) | rpc:post_board_message(uuid, uuid, uuid, text, text, text, text, text, jsonb, uuid) | rpc:post_message(uuid, uuid, text, text, uuid, jsonb, uuid)',
|
|
90
90
|
'the allow set''s functions are exactly the contract''s first membership (D4), widened additively by #670''s get_send_outcome: read, post and recover an own post''s outcome, nothing else');
|
|
91
91
|
|
|
92
92
|
-- ===========================================================================
|
|
@@ -107,14 +107,14 @@ create temp table dwx_class on commit drop as
|
|
|
107
107
|
|
|
108
108
|
create temp table dwx_exempt(sig text primary key, kind text not null) on commit drop;
|
|
109
109
|
insert into dwx_exempt values
|
|
110
|
-
('agent_board.post_message(uuid,uuid,text,text,uuid,jsonb)', 'session_send'),
|
|
111
|
-
('agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)', 'session_send'),
|
|
112
|
-
('agent_board.send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)', 'session_send'),
|
|
113
|
-
('agent_board.send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb)', 'session_send'),
|
|
110
|
+
('agent_board.post_message(uuid,uuid,text,text,uuid,jsonb,uuid)', 'session_send'),
|
|
111
|
+
('agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid)', 'session_send'),
|
|
112
|
+
('agent_board.send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid)', 'session_send'),
|
|
113
|
+
('agent_board.send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb,uuid)', 'session_send'),
|
|
114
114
|
('agent_board.create_tasking_delivery(uuid,uuid,text,text,uuid[],uuid,text,text,text,jsonb)', 'session_send'),
|
|
115
|
-
('agent_board.post_board_message(uuid,uuid,text,text,text,text,text,text,text,jsonb)', 'wrapper'),
|
|
116
|
-
('agent_board.send_direct_message(uuid,uuid,jsonb,text,text,text,text,text,text,jsonb)', 'wrapper'),
|
|
117
|
-
('agent_board.send_multicast_message(uuid,uuid,jsonb,text,text,text,text,text,text,jsonb)', 'wrapper'),
|
|
115
|
+
('agent_board.post_board_message(uuid,uuid,text,text,text,text,text,text,text,jsonb,uuid)', 'wrapper'),
|
|
116
|
+
('agent_board.send_direct_message(uuid,uuid,jsonb,text,text,text,text,text,text,jsonb,uuid)', 'wrapper'),
|
|
117
|
+
('agent_board.send_multicast_message(uuid,uuid,jsonb,text,text,text,text,text,text,jsonb,uuid)', 'wrapper'),
|
|
118
118
|
('agent_board.create_tasking_delivery(uuid,uuid,text,text,jsonb,text,text,text,text,text,jsonb)', 'wrapper'),
|
|
119
119
|
('agent_board.signed_post_board_message(jsonb,jsonb)', 'signed'),
|
|
120
120
|
('agent_board.signed_send_direct_message(jsonb,jsonb)', 'signed'),
|
|
@@ -342,7 +342,7 @@ select is(
|
|
|
342
342
|
pg_temp.v('T1'), pg_temp.v('BX'))),
|
|
343
343
|
'ok',
|
|
344
344
|
'allow set: post_board_message(by id) lives as a delegate');
|
|
345
|
-
insert into _ex values ('post_board_message(uuid, uuid, uuid, text, text, text, text, text, jsonb)');
|
|
345
|
+
insert into _ex values ('post_board_message(uuid, uuid, uuid, text, text, text, text, text, jsonb, uuid)');
|
|
346
346
|
-- 19
|
|
347
347
|
select is(
|
|
348
348
|
(select count(*)::int from agent_board.messages m
|
|
@@ -356,7 +356,7 @@ select is(
|
|
|
356
356
|
pg_temp.v('T1'))),
|
|
357
357
|
'ok',
|
|
358
358
|
'allow set: post_board_message(by slug) lives as a delegate');
|
|
359
|
-
insert into _ex values ('post_board_message(uuid, uuid, text, text, text, text, text, text, text, jsonb)');
|
|
359
|
+
insert into _ex values ('post_board_message(uuid, uuid, text, text, text, text, text, text, text, jsonb, uuid)');
|
|
360
360
|
-- 21
|
|
361
361
|
select is(
|
|
362
362
|
(select count(*)::int from agent_board.messages where thread_id::text = pg_temp.v('T1') and author_agent_id = pg_temp.u('I1.agent') and body = 'delegate post two'),
|
|
@@ -367,7 +367,7 @@ select is(
|
|
|
367
367
|
pg_temp.as_d(format($$ select agent_board.post_message(%L::uuid, null, 'delegate reply') $$, pg_temp.v('T1'))),
|
|
368
368
|
'ok',
|
|
369
369
|
'allow set: post_message (reply in a thread) lives as a delegate');
|
|
370
|
-
insert into _ex values ('post_message(uuid, uuid, text, text, uuid, jsonb)');
|
|
370
|
+
insert into _ex values ('post_message(uuid, uuid, text, text, uuid, jsonb, uuid)');
|
|
371
371
|
-- 23
|
|
372
372
|
select is(
|
|
373
373
|
(select count(*)::int from agent_board.messages m where m.thread_id::text = pg_temp.v('T1') and m.author_agent_id = pg_temp.u('I1.agent') and m.body = 'delegate reply'
|
|
@@ -12,19 +12,19 @@ create temp table _tap (seq serial primary key, line text) on commit drop;
|
|
|
12
12
|
select has_function(
|
|
13
13
|
'agent_board',
|
|
14
14
|
'send_direct_message',
|
|
15
|
-
array['uuid', 'uuid', 'uuid', 'text', 'text', 'text', 'text', 'text', 'jsonb'],
|
|
15
|
+
array['uuid', 'uuid', 'uuid', 'text', 'text', 'text', 'text', 'text', 'jsonb', 'uuid'],
|
|
16
16
|
'send_direct_message rpc exists'
|
|
17
17
|
);
|
|
18
18
|
select has_function(
|
|
19
19
|
'agent_board',
|
|
20
20
|
'send_multicast_message',
|
|
21
|
-
array['uuid', 'uuid', 'uuid[]', 'text', 'text', 'text', 'text', 'text', 'jsonb'],
|
|
21
|
+
array['uuid', 'uuid', 'uuid[]', 'text', 'text', 'text', 'text', 'text', 'jsonb', 'uuid'],
|
|
22
22
|
'send_multicast_message rpc exists'
|
|
23
23
|
);
|
|
24
24
|
select has_function(
|
|
25
25
|
'agent_board',
|
|
26
26
|
'post_board_message',
|
|
27
|
-
array['uuid', 'uuid', 'uuid', 'text', 'text', 'text', 'text', 'text', 'jsonb'],
|
|
27
|
+
array['uuid', 'uuid', 'uuid', 'text', 'text', 'text', 'text', 'text', 'jsonb', 'uuid'],
|
|
28
28
|
'post_board_message rpc exists'
|
|
29
29
|
);
|
|
30
30
|
select has_function(
|
|
@@ -161,9 +161,9 @@ select ok(
|
|
|
161
161
|
and grantee = 'authenticated'
|
|
162
162
|
and privilege_type = 'EXECUTE'
|
|
163
163
|
)
|
|
164
|
-
and has_function_privilege('authenticated', 'agent_board.send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)', 'EXECUTE')
|
|
165
|
-
and has_function_privilege('authenticated', 'agent_board.send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb)', 'EXECUTE')
|
|
166
|
-
and has_function_privilege('authenticated', 'agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)', 'EXECUTE')
|
|
164
|
+
and has_function_privilege('authenticated', 'agent_board.send_direct_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid)', 'EXECUTE')
|
|
165
|
+
and has_function_privilege('authenticated', 'agent_board.send_multicast_message(uuid,uuid,uuid[],text,text,text,text,text,jsonb,uuid)', 'EXECUTE')
|
|
166
|
+
and has_function_privilege('authenticated', 'agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb,uuid)', 'EXECUTE')
|
|
167
167
|
and has_function_privilege('authenticated', 'agent_board.create_tasking_delivery(uuid,uuid,text,text,uuid[],uuid,text,text,text,jsonb)', 'EXECUTE'),
|
|
168
168
|
'authenticated keeps non-delivery inbox RPCs and holds the MBSESSION re-granted scoped-send RPCs'
|
|
169
169
|
);
|