@consiliency/agent-board-schema 1.56.0 → 1.58.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.
Files changed (33) hide show
  1. package/fixtures/already-applied.json +8 -0
  2. package/migrations/20261007000100_agent_board_onboard_requests.sql +139 -0
  3. package/migrations/20261008000100_agent_board_hosted_delegates.sql +3152 -0
  4. package/package.json +1 -1
  5. package/schema-manifest.json +21 -3
  6. package/src/tooling.test.mjs +8 -2
  7. package/tests/agent_board_atomic_fleet_onboarding.test.sql +13 -0
  8. package/tests/agent_board_consent_emission.test.sql +4 -2
  9. package/tests/agent_board_delegate_role_class.test.sql +736 -0
  10. package/tests/agent_board_federated_identity_injective_slug.test.sql +5 -2
  11. package/tests/agent_board_fedsession_stored_identity_gate.test.sql +71 -14
  12. package/tests/agent_board_fk_lock_edges.test.sql +9 -0
  13. package/tests/agent_board_hosted_delegates.test.sql +1134 -0
  14. package/tests/agent_board_ledger_authority.test.sql +34 -5
  15. package/tests/agent_board_membership_current_row_class.test.sql +3 -1
  16. package/tests/agent_board_onboard_requests.test.sql +353 -0
  17. package/tests/agent_board_rowid.test.sql +18 -5
  18. package/tests/agent_board_signer_lifecycle.test.sql +3 -0
  19. package/tests/agent_board_write_enforcement_class.test.sql +8 -3
  20. package/tests/catalog/function_execute_privileges.json +278 -2
  21. package/tests/catalog/p_metadata_parameters.json +48 -0
  22. package/tests/isolation/expected/hosted_delegate_exchange_race.out +93 -0
  23. package/tests/isolation/expected/hosted_delegate_first_exchange_race.out +129 -0
  24. package/tests/isolation/expected/hosted_delegate_owner_provisioning_race.out +91 -0
  25. package/tests/isolation/expected/hosted_delegate_owner_revoke_race.out +137 -0
  26. package/tests/isolation/expected/hosted_delegate_revoke_race.out +87 -0
  27. package/tests/isolation/expected/hosted_delegate_withdraw_evict_race.out +235 -0
  28. package/tests/isolation/specs/hosted_delegate_exchange_race.spec +64 -0
  29. package/tests/isolation/specs/hosted_delegate_first_exchange_race.spec +72 -0
  30. package/tests/isolation/specs/hosted_delegate_owner_provisioning_race.spec +73 -0
  31. package/tests/isolation/specs/hosted_delegate_owner_revoke_race.spec +93 -0
  32. package/tests/isolation/specs/hosted_delegate_revoke_race.spec +59 -0
  33. package/tests/isolation/specs/hosted_delegate_withdraw_evict_race.spec +145 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consiliency/agent-board-schema",
3
- "version": "1.56.0",
3
+ "version": "1.58.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",
@@ -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.56.0",
5
+ "packageVersion": "1.58.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": 154,
50
- "aggregateSha256": "d0b74be9b41032a78ad45227706a48283f931b40cd6350c63c619a0e153c0cee",
49
+ "migrationCount": 156,
50
+ "aggregateSha256": "2ad57215f17554d6ceb6ec1b7987f0e705cbc1c24e0411214be93dc2a2018315",
51
51
  "migrations": [
52
52
  {
53
53
  "order": 0,
@@ -1434,6 +1434,24 @@
1434
1434
  "sourceRef": "message-board",
1435
1435
  "bytes": 5470,
1436
1436
  "sha256": "637480feeca07dbb2fe7a4624dc6d063d0c1f23e6ea3c3ee9a946ad43de4e34e"
1437
+ },
1438
+ {
1439
+ "order": 154,
1440
+ "id": "20261007000100_agent_board_onboard_requests",
1441
+ "filename": "20261007000100_agent_board_onboard_requests.sql",
1442
+ "origin": "message-board-forward",
1443
+ "sourceRef": "message-board",
1444
+ "bytes": 7655,
1445
+ "sha256": "fbdbecfb1c78e2d1b16b37845a74082dcdf1241c61c0356b992e1e01baddc41c"
1446
+ },
1447
+ {
1448
+ "order": 155,
1449
+ "id": "20261008000100_agent_board_hosted_delegates",
1450
+ "filename": "20261008000100_agent_board_hosted_delegates.sql",
1451
+ "origin": "message-board-forward",
1452
+ "sourceRef": "message-board",
1453
+ "bytes": 166072,
1454
+ "sha256": "ef57647e29b8afc788dc8c481a0165b10a3c448aae12b8901901b653216bc3a8"
1437
1455
  }
1438
1456
  ],
1439
1457
  "excludedBridge": {
@@ -38,9 +38,9 @@ describe('manifest integrity', () => {
38
38
  expect(manifest.schemaVersion).toBe(8);
39
39
  expect(manifest.minClientVersion).toMatch(/^\d+\.\d+\.\d+$/);
40
40
  });
41
- 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 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 = 154)', () => {
41
+ 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 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 = 156)', () => {
42
42
  expect(manifest.migrationCount).toBe(manifest.migrations.length);
43
- expect(manifest.migrationCount).toBe(154);
43
+ expect(manifest.migrationCount).toBe(156);
44
44
  // MBSESSION switched enforcement on (scoped-send re-grant): the client-visible
45
45
  // schema version bumped to 8. MBDELEG tightens delegation and MBFED adds only
46
46
  // enrollment-only additive surface (identity_providers registry, enrollment audit,
@@ -343,6 +343,12 @@ describe('manifest integrity', () => {
343
343
  // ROOMCONTRACT-ACTIVEFIRST (#542): list_board_members chooses current standing
344
344
  // active-first (MBROWID 3a) at both its authorization and projection sites.
345
345
  '20261006000100_agent_board_room_roster_active_first.sql',
346
+ // ONBOARD (v11): list_my_board_requests (IF-0-ONBOARD-4) and the service-only
347
+ // invite_board_for_display digest lookup (IF-0-ONBOARD-11).
348
+ '20261007000100_agent_board_onboard_requests.sql',
349
+ // HOSTED (v11): the agent_board_delegate role, delegate instances, the exchange and
350
+ // tombstone RPCs, add_delegate_to_board, the D14 read predicates and the D16 refusals.
351
+ '20261008000100_agent_board_hosted_delegates.sql',
346
352
  ]) {
347
353
  expect(names.has(f)).toBe(true);
348
354
  }
@@ -546,6 +546,11 @@ select is( -- pgtap-allow-raise-checked: catalog read only; the RPC names below
546
546
  from _ceiling_class where is_reader),
547
547
  array[
548
548
  'agent_board._redeem_unbounded_invite_for_agent(text,uuid) => UNSERIALIZED',
549
+ -- HOSTED (20261008000100): the owner's member-invite gate. It row-locks both agents (the
550
+ -- fleet-ledger gate) and board_memberships, so it takes this lock as grant_board_role does
551
+ -- (agent_board_signer_lifecycle section 9), after its delegate_instances row and before any
552
+ -- agents or board_memberships row lock.
553
+ 'agent_board.add_delegate_to_board(uuid,uuid) => serialized',
549
554
  'agent_board.create_invite_link(uuid,text,text,integer,timestamp with time zone,uuid,jsonb) => UNSERIALIZED',
550
555
  -- Retired from UNSERIALIZED by #276 (20260909000100). Adding the fleet-ledger gate made
551
556
  -- grant_board_role row-lock both agents and board_memberships, which section 9 of
@@ -696,10 +701,18 @@ select is( -- pgtap-allow-raise-checked: catalog read only; the RPC names below
696
701
  'agent_board._redeem_fleet_invite_for_agent(text,uuid) [definer] => service_role',
697
702
  'agent_board._redeem_invite_for_agent(text,uuid) [definer] => service_role',
698
703
  'agent_board._revoke_agent_principal(uuid,uuid,text) [definer] => service_role',
704
+ -- HOSTED (20261008000100): joined because it takes _lock_board_authority_ceiling (the owner's
705
+ -- member-invite gate, serialised as grant_board_role is). authenticated only: the owner calls
706
+ -- it; service_role has no resolved actor and could not pass its owner check anyway.
707
+ 'agent_board.add_delegate_to_board(uuid,uuid) [definer] => authenticated',
699
708
  'agent_board.create_fleet_onboarding_invite(uuid,uuid,text,text,text,text,text,text,text,integer,timestamp with time zone,uuid,jsonb) [definer] => authenticated,service_role',
700
709
  'agent_board.enroll_federated_human(text,text,text,jsonb,text) [definer] => service_role',
701
710
  'agent_board.enroll_federated_identity(text,text,text,jsonb,text,text,text,text,boolean,text,timestamp with time zone,text,text,text[],text[],text) [definer] => service_role',
702
711
  'agent_board.evaluate_fleet_sender_policy(uuid,uuid,uuid,uuid,text,uuid,boolean) [definer] => authenticated,service_role',
712
+ -- HOSTED fix lane (PR #590, N2): joined because it reads fleet_human_revocations, refusing a
713
+ -- durably revoked owner (owner_inactive) as enroll_federated_human does. service_role only:
714
+ -- the delegate-exchange Edge Function calls it.
715
+ 'agent_board.exchange_delegate_credential(jsonb) [definer] => service_role',
703
716
  -- Joined this class in #276: the live grant chokepoint now takes _lock_board_authority_ceiling
704
717
  -- (forced by the section-9 agents/board_memberships class in agent_board_signer_lifecycle.test.sql
705
718
  -- once the ledger gate made it lock both). Still authenticated,service_role — #276 removes
@@ -580,8 +580,10 @@ select is(
580
580
  and p.prolang <> (select oid from pg_language where lanname = 'internal')
581
581
  and has_function_privilege('authenticated', p.oid, 'EXECUTE')
582
582
  and agent_board_test.stripped_body(p.oid) ~ agent_board_test.call_re('_membership_consent_present')),
583
- 'resolve_board_request, update_board_membership',
584
- 'scope: exactly TWO authenticated routes read the predicate');
583
+ -- HOSTED (20261008000100) added add_delegate_to_board: it places a hosted delegate as
584
+ -- `joined` on its principal's act and requires the predicate to agree afterwards (D2).
585
+ 'add_delegate_to_board, resolve_board_request, update_board_membership',
586
+ 'scope: exactly THREE authenticated routes read the predicate');
585
587
 
586
588
  -- ...and the ledger it fills is the one MBCONSENT-A froze.
587
589
  -- The refused write must leave NO trace. Asserted against the SUBJECT of the refused attempt