@consiliency/agent-board-schema 1.60.0 → 1.64.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 (100) hide show
  1. package/README.md +86 -0
  2. package/fixtures/already-applied.json +16 -0
  3. package/migrations/20261011000100_agent_board_session_identities.sql +1964 -0
  4. package/migrations/20261012000100_agent_board_sidowner.sql +209 -0
  5. package/migrations/20261014000100_agent_board_grant_target_role.sql +218 -0
  6. package/migrations/20261014000200_agent_board_last_owner.sql +239 -0
  7. package/package.json +1 -1
  8. package/schema-manifest.json +39 -3
  9. package/src/tooling.test.mjs +10 -2
  10. package/tests/agent_board_atomic_fleet_onboarding.test.sql +15 -4
  11. package/tests/agent_board_atomic_fleet_onboarding_runtime.test.sql +7 -0
  12. package/tests/agent_board_consent_emission.test.sql +30 -11
  13. package/tests/agent_board_consent_gating.test.sql +16 -2
  14. package/tests/agent_board_delegate_role_class.test.sql +1 -1
  15. package/tests/agent_board_delegation_cap_ceiling.test.sql +26 -15
  16. package/tests/agent_board_delegation_enforcement.test.sql +1 -1
  17. package/tests/agent_board_enroll_resumption.test.sql +22 -4
  18. package/tests/agent_board_enroll_token_single_use.test.sql +18 -3
  19. package/tests/agent_board_federated_lock_order_class.test.sql +2 -2
  20. package/tests/agent_board_fk_lock_edges.test.sql +77 -16
  21. package/tests/agent_board_grant_target_role.test.sql +1118 -0
  22. package/tests/agent_board_hosted_delegates.test.sql +5 -3
  23. package/tests/agent_board_invite_no_downgrade.test.sql +15 -11
  24. package/tests/agent_board_ledger_authority.test.sql +77 -12
  25. package/tests/agent_board_membership_current_row_class.test.sql +9 -1
  26. package/tests/agent_board_mint_fleet_agent_session.test.sql +2 -2
  27. package/tests/agent_board_mint_harden.test.sql +38 -27
  28. package/tests/agent_board_role_guard.test.sql +319 -0
  29. package/tests/agent_board_rolereset.test.sql +25 -29
  30. package/tests/agent_board_roomdeleg.test.sql +8 -0
  31. package/tests/agent_board_roomdeleg_lane_b.test.sql +6 -6
  32. package/tests/agent_board_roomown.test.sql +3 -1
  33. package/tests/agent_board_rowid.test.sql +7 -2
  34. package/tests/agent_board_session_identity_approval_revocation.test.sql +334 -0
  35. package/tests/agent_board_session_identity_backfill.test.sql +82 -0
  36. package/tests/agent_board_session_identity_backfill_refusal.test.sql +14 -0
  37. package/tests/agent_board_session_identity_behavior_classes.test.sql +176 -0
  38. package/tests/agent_board_session_identity_class.test.sql +118 -0
  39. package/tests/agent_board_session_identity_fingerprint.test.sql +271 -0
  40. package/tests/agent_board_session_identity_labels_limits.test.sql +205 -0
  41. package/tests/agent_board_session_identity_lease.test.sql +235 -0
  42. package/tests/agent_board_session_identity_lifetime.test.sql +230 -0
  43. package/tests/agent_board_session_identity_limits.test.sql +208 -0
  44. package/tests/agent_board_session_identity_lineage.test.sql +64 -0
  45. package/tests/agent_board_session_identity_link.test.sql +201 -0
  46. package/tests/agent_board_session_identity_mint.test.sql +233 -0
  47. package/tests/agent_board_session_identity_panel_r1.test.sql +194 -0
  48. package/tests/agent_board_session_identity_panel_r2.test.sql +174 -0
  49. package/tests/agent_board_session_identity_protected_actions.test.sql +156 -0
  50. package/tests/agent_board_session_identity_revoke_closure.test.sql +131 -0
  51. package/tests/agent_board_sidowner_leases.test.sql +107 -0
  52. package/tests/agent_board_sidowner_owner_required.test.sql +97 -0
  53. package/tests/agent_board_sidowner_read_class.test.sql +171 -0
  54. package/tests/agent_board_sidowner_reads.test.sql +136 -0
  55. package/tests/agent_board_signer_lifecycle.test.sql +26 -4
  56. package/tests/agent_board_signing_challenge_pending_cap.test.sql +1 -1
  57. package/tests/agent_board_write_enforcement_class.test.sql +74 -15
  58. package/tests/catalog/function_execute_privileges.json +227 -2
  59. package/tests/catalog/p_metadata_parameters.json +102 -2
  60. package/tests/isolation/expected/grant_target_role_race.out +348 -0
  61. package/tests/isolation/expected/last_owner_departure.out +562 -0
  62. package/tests/isolation/expected/session_identity_limits.out +165 -0
  63. package/tests/isolation/expected/session_identity_links.out +235 -0
  64. package/tests/isolation/expected/session_identity_reclaim.out +253 -0
  65. package/tests/isolation/expected/session_identity_renew_revoke.out +115 -0
  66. package/tests/isolation/expected/session_identity_renew_revoke_key_gate.out +138 -0
  67. package/tests/isolation/expected/session_identity_tombstone_onboarding.out +247 -0
  68. package/tests/isolation/specs/atomic_fleet_authority_races.spec +8 -3
  69. package/tests/isolation/specs/atomic_fleet_binding_revoke.spec +0 -3
  70. package/tests/isolation/specs/atomic_fleet_board_archive.spec +0 -3
  71. package/tests/isolation/specs/atomic_fleet_human_fresh_revoke.spec +0 -3
  72. package/tests/isolation/specs/atomic_fleet_identity_disposition.spec +0 -3
  73. package/tests/isolation/specs/atomic_fleet_lifecycle_races.spec +0 -3
  74. package/tests/isolation/specs/atomic_fleet_subtree_lock_order.spec +0 -3
  75. package/tests/isolation/specs/ceiling_setter_lock_before_upsert.spec +0 -3
  76. package/tests/isolation/specs/claimpolicy_acquire_revert_race.spec +0 -2
  77. package/tests/isolation/specs/claimpolicy_board_scope.spec +0 -2
  78. package/tests/isolation/specs/claimpolicy_claimrow_lock_order.spec +0 -2
  79. package/tests/isolation/specs/claimpolicy_isolation_refusal.spec +0 -2
  80. package/tests/isolation/specs/claimpolicy_renew_revert_race.spec +0 -2
  81. package/tests/isolation/specs/claimpolicy_writer_keyshare.spec +0 -2
  82. package/tests/isolation/specs/consent_approval_lock.spec +0 -1
  83. package/tests/isolation/specs/consent_emit_actual_state.spec +0 -1
  84. package/tests/isolation/specs/grant_target_role_race.spec +206 -0
  85. package/tests/isolation/specs/hosted_delegate_add_tombstone_race.spec +0 -1
  86. package/tests/isolation/specs/hosted_delegate_tombstone_revoke_race.spec +0 -1
  87. package/tests/isolation/specs/hosted_delegate_withdraw_evict_race.spec +0 -1
  88. package/tests/isolation/specs/last_owner_departure.spec +137 -0
  89. package/tests/isolation/specs/ledger_authority_revoke.spec +0 -3
  90. package/tests/isolation/specs/onboarding_ceiling_lock_order.spec +0 -3
  91. package/tests/isolation/specs/outbox_wake_ordering.spec +0 -1
  92. package/tests/isolation/specs/session_identity_limits.spec +81 -0
  93. package/tests/isolation/specs/session_identity_links.spec +82 -0
  94. package/tests/isolation/specs/session_identity_reclaim.spec +125 -0
  95. package/tests/isolation/specs/session_identity_renew_revoke.spec +84 -0
  96. package/tests/isolation/specs/session_identity_renew_revoke_key_gate.spec +94 -0
  97. package/tests/isolation/specs/session_identity_tombstone_onboarding.spec +107 -0
  98. package/tests/isolation/specs/signed_grant_onboarding_deadlock.spec +0 -1
  99. package/tests/isolation/specs/signer_lifecycle_revoke.spec +0 -1
  100. package/tests/seeds/20261011000100_agent_board_session_identities.sql.pre.sql +47 -0
package/README.md CHANGED
@@ -7,6 +7,12 @@ and materialize it — they do not author `agent_board` DDL.
7
7
 
8
8
  ## What's in the bundle
9
9
 
10
+ Schema 1.64.0 adds `20261014000200_agent_board_last_owner.sql`: a refusal-only
11
+ table-level last-active-owner invariant, preserving the 1.63.0 role-grant policy.
12
+ Concurrent departures serialize per board; recovery remains service_role-only.
13
+ SQL schema version remains 8. See `specs/rpc-contracts.md` for refusal/retry
14
+ semantics. This is the working-tree contract, not a deployment receipt.
15
+
10
16
  - `migrations/` — the ordered, immutable SQL union (frozen baseline + lane
11
17
  migrations + the Message Board-owned endpoint compatibility migration).
12
18
  - `schema-manifest.json` — package version, `agent_board.schema_version`, ordered
@@ -17,6 +23,86 @@ and materialize it — they do not author `agent_board` DDL.
17
23
  - `tests/` — the pgTAP suite + `tests/fixtures/` (adopter-base + test/operator prerequisites).
18
24
  - `fixtures/` — plan/check history snapshots.
19
25
 
26
+ ## SIDSCHEMA foundation (as built 2026-10-08)
27
+
28
+ SIDOWNER prepares schema package 1.62.0 with
29
+ `20261012000100_agent_board_sidowner.sql`: scoped normalized identity-state and
30
+ strict-lineage child-list reads. SQL schema version remains 8.
31
+
32
+ Schema package 1.63.0 adds `20261014000100_agent_board_grant_target_role.sql`
33
+ (#674): `grant_board_role` refuses a non-self grant unless the grantor is an owner
34
+ or admin AND strictly outranks the target's current role. SQL schema version
35
+ remains 8.
36
+
37
+ | Package release | SQL schema version | Forward migration |
38
+ | --- | --- | --- |
39
+ | 1.61.1 | 8 | `20261011000100_agent_board_session_identities.sql` |
40
+
41
+ The 1.61.1 patch makes seeded migration apply transaction-safe. Each repository
42
+ applier uses one transaction per migration with ON_ERROR_STOP=1; pre-migration
43
+ seed hooks remain separate. A post-backfill flush of only
44
+ `agent_board.session_identities_lease_alias_fkey` precedes later index/trigger/RLS
45
+ DDL, preserving unrelated deferred constraints even for following statements in
46
+ the same transaction. A catalog/event-class pin and whole-file composition
47
+ probe verify that scope; the ALL mutation fails the later deferred-FK assertion.
48
+ A git-derived executable guard enforces transactional appliers in the aggregate
49
+ and CI, names offending sites, and states its scanner limits in its header. The
50
+ failed 1.61.0 production apply rolled back; 1.61.0 was never deployed or published.
51
+ This patch changes apply-ability, not runtime behavior.
52
+
53
+ The bundle now contains durable session identities/aliases, immutable lineage,
54
+ one-live-holder leases with epoch fencing, depth-two bounded delegation,
55
+ shrink-only continuity, fingerprint approval/freeze, total family revocation and
56
+ fresh-principal owner readmission. Existing principals are backfilled as legacy,
57
+ with actual parent/root/depth and no implicit lease or approval. Excessive or
58
+ cyclic pre-existing lineage refuses instead of being flattened. Backfill also
59
+ refuses a stored-root/computed-root mismatch, reporting the offending ids.
60
+
61
+ Explicit freeze gates apply to both legacy mint paths and all ancestors without
62
+ requiring implicit approval for never-frozen legacy principals. Approval requires
63
+ exactly resolved readings; human-owner writers enforce the locked permanent
64
+ revocation ledger. Unclaimed supersede revokes only its target; ordinary revoke
65
+ still closes descendants/forks; public fleet/admin/subtree revocation rejects
66
+ the reserved supersede reason. Both human-owner and ancestor approval enforce
67
+ the locked permanent ledger. Tombstone refusal takes precedence over freeze.
68
+ Platform-admin revoke requires a resolved actor only for a family containing a
69
+ session identity; legacy service scripts without `sub` and Portal admins without
70
+ board principals remain supported, never using the target as a fallback actor.
71
+ Local board labels are bounded to 200 characters. CI rechecks the actual
72
+ backfill stored/computed-root refusal, not only driver-local evidence.
73
+
74
+ Verified instance tombstoning takes every existing board advisory mutex in UUID
75
+ order before owner/instance and identity-family row locks, preserving onboarding
76
+ and placement's board-first ordering. The lock class has no withdrawal-state
77
+ exemption. A new three-permutation isolation spec races actual withdrawal and a
78
+ minted session descendant against onboarding's documented lock-equivalent
79
+ acquisitions; all pre-existing isolation specs and goldens remain unchanged.
80
+ Plan amendment 3 records the catalog-proven nullable/default-free omitted-FK
81
+ INSERT filter, with positive constructor/revoke pins and a non-NULL ledger FK
82
+ mutation that restores the relation pair in FKL-10.
83
+
84
+ Lease heartbeat/lapse is 60/180 seconds; an approved session grant is at most
85
+ seven days under tighter ancestor/policy/operator ceilings; each issued token
86
+ remains at most 900 seconds. Root limits are 200 active/60 hourly and depth-one
87
+ parent limits 20 active/10 hourly, with mixed legacy/session accounting.
88
+ Legacy operator mints also refuse requests above the tighter operator TTL;
89
+ renewals clamp to that ceiling. Root limits are unconditional, including legacy
90
+ operator-approved mints.
91
+
92
+ Session-form attestation RPCs are service-role-only. Current public Edge handlers
93
+ do not forward asserted harness/session/fingerprint fields; measured transport,
94
+ extended PoP, holder-secret storage and epoch-bearing JWTs remain SIDSERVER work.
95
+ No hosted-delegate authority is broadened and the client compatibility minimum
96
+ is unchanged. This is a bundle change, not a production deployment or publication.
97
+
98
+ The transactional-apply patch passes all twelve Verification commands, 181/181 fresh
99
+ caught mutation rows, full pgTAP 148 files/3943 assertions and isolation 60 specs
100
+ at ITER=10. Canonical comparison preserves the accepted Session identities text.
101
+
102
+ See the [as-built client contract](../../specs/agent-client-contract.md#sidschema-as-built--2026-10-08),
103
+ [exact catalog RPC matrix](../../specs/rpc-contracts.md#sidschema-as-built--2026-10-08),
104
+ and [schema evidence closeout](../../plans/evidence/sid/schema-closeout.md).
105
+
20
106
  ## Adopter CLI (the only supported path)
21
107
 
22
108
  ```bash
@@ -632,6 +632,22 @@
632
632
  {
633
633
  "id": "20261010000100_agent_board_own_post_not_delivered",
634
634
  "sha256": "6cbbe0bb9ccf7ab65402a58de145ee21bc2158ddc7502671ea13a98415ca6421"
635
+ },
636
+ {
637
+ "id": "20261011000100_agent_board_session_identities",
638
+ "sha256": "0f429d2b7c2a361741fb00019a173c82024a59362ea2d3a70cb11ab594b1d055"
639
+ },
640
+ {
641
+ "id": "20261012000100_agent_board_sidowner",
642
+ "sha256": "e18fb5a7ce0b00e9cccf12a60cbad49d820612c2c50f65c648d4105c80fbc921"
643
+ },
644
+ {
645
+ "id": "20261014000100_agent_board_grant_target_role",
646
+ "sha256": "4a6c00546a1d2837f88eece1de082cc76eec1f85cce8cf9ac7998e42bf32a5c5"
647
+ },
648
+ {
649
+ "id": "20261014000200_agent_board_last_owner",
650
+ "sha256": "2fed8fc5a2c7c0ba9acbb12872b329db3f0902d96597c52cc50e21e4682c2fff"
635
651
  }
636
652
  ]
637
653
  }