@consiliency/agent-board-schema 1.45.0 → 1.50.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 (35) hide show
  1. package/fixtures/already-applied.json +24 -0
  2. package/migrations/20260926000100_agent_board_ownerless_quota_census.sql +268 -0
  3. package/migrations/20260927000100_agent_board_fleet_domain_no_downgrade.sql +393 -0
  4. package/migrations/20260928000100_agent_board_ownerless_quota_renew_convergence.sql +562 -0
  5. package/migrations/20260929000100_agent_board_advisory_revert_cap_reset.sql +371 -0
  6. package/migrations/20260930000100_agent_board_claim_policy_race.sql +922 -0
  7. package/migrations/20261001000100_agent_board_claimpolicy_lock_grant_revoke.sql +158 -0
  8. package/package.json +1 -1
  9. package/schema-manifest.json +57 -3
  10. package/src/tooling.test.mjs +52 -2
  11. package/tests/agent_board_board_claim_policy.test.sql +261 -1
  12. package/tests/agent_board_claim_subject_gate.test.sql +11 -2
  13. package/tests/agent_board_claimkey.test.sql +17 -2
  14. package/tests/agent_board_claimpolicy_race.test.sql +1374 -0
  15. package/tests/agent_board_fleet_machine_hijack.test.sql +270 -1
  16. package/tests/agent_board_fleet_machine_reclaim.test.sql +28 -2
  17. package/tests/agent_board_ownerless_quota_census.test.sql +406 -0
  18. package/tests/agent_board_ownerless_renew_quota.test.sql +580 -0
  19. package/tests/catalog/p_metadata_parameters.json +28 -0
  20. package/tests/fixtures/test-prereqs.sql +186 -0
  21. package/tests/isolation/expected/claimpolicy_acquire_revert_race.out +66 -0
  22. package/tests/isolation/expected/claimpolicy_board_scope.out +73 -0
  23. package/tests/isolation/expected/claimpolicy_claimrow_lock_order.out +80 -0
  24. package/tests/isolation/expected/claimpolicy_isolation_refusal.out +114 -0
  25. package/tests/isolation/expected/claimpolicy_renew_revert_race.out +66 -0
  26. package/tests/isolation/expected/claimpolicy_writer_keyshare.out +49 -0
  27. package/tests/isolation/expected/fleet_domain_no_downgrade_demote_race.out +447 -0
  28. package/tests/isolation/specs/claimpolicy_acquire_revert_race.spec +118 -0
  29. package/tests/isolation/specs/claimpolicy_board_scope.spec +115 -0
  30. package/tests/isolation/specs/claimpolicy_claimrow_lock_order.spec +200 -0
  31. package/tests/isolation/specs/claimpolicy_isolation_refusal.spec +162 -0
  32. package/tests/isolation/specs/claimpolicy_renew_revert_race.spec +150 -0
  33. package/tests/isolation/specs/claimpolicy_writer_keyshare.spec +107 -0
  34. package/tests/isolation/specs/fleet_domain_no_downgrade_demote_race.spec +292 -0
  35. package/tests/seeds/20261001000100_agent_board_claimpolicy_lock_grant_revoke.sql.pre.sql +99 -0
@@ -211,8 +211,14 @@ select set_eq(
211
211
  -- active machine claim(s) on the reclaimed fingerprint so the new owner can acquire. It routes the
212
212
  -- key through _canonical_claim_key (assertion 25 stays 0); its positive state claim (status set to
213
213
  -- 'released') is pinned in agent_board_fleet_machine_reclaim.test.sql.
214
- array['acquire_claim', 'renew_claim', 'release_claim', 'reclaim_fleet_machine'],
215
- 'exactly acquire/renew/release/reclaim write agent_board.claims (catalog-enumerated writer class)');
214
+ -- set_board_claim_policy (#400) is a fifth writer: an advisory -> inherit revert re-applies the
215
+ -- ownerless TTL cap to that board's active ownerless claims. It is EXEMPT FROM ASSERTION 25 by a
216
+ -- DERIVED property and not by name -- its claims UPDATE sets only lease_expires_at/updated_at and
217
+ -- its body never mentions resource_key at all, so there is no key for the normalizer to canonicalize.
218
+ -- The exemption's positive claim (the reset moves lease timestamps and nothing else) is scored in
219
+ -- agent_board_board_claim_policy.test.sql BCP-11/13/14, which look the claims up BY resource_key.
220
+ array['acquire_claim', 'renew_claim', 'release_claim', 'reclaim_fleet_machine', 'set_board_claim_policy'],
221
+ 'exactly acquire/renew/release/reclaim/set_board_claim_policy write agent_board.claims (catalog-enumerated writer class)');
216
222
  select is(
217
223
  (select count(*)::int
218
224
  from pg_proc p
@@ -220,6 +226,15 @@ select is(
220
226
  where n.nspname = 'agent_board'
221
227
  and p.prokind = 'f'
222
228
  and agent_board_test.stripped_body(p.oid) ~* '(insert\s+into|update)\s+(agent_board\.)?claims\M'
229
+ -- #400: SCOPED TO WRITERS THAT HAVE A KEY TO NORMALIZE. A claims writer whose body never
230
+ -- mentions resource_key cannot set one -- an UPDATE must name the column in its SET list and
231
+ -- an INSERT must name it in its column list (resource_key is NOT NULL) -- so requiring it to
232
+ -- call the normalizer would be dead code added to satisfy a check, which is the anti-pattern
233
+ -- rule 2 names. DERIVED, not a name exemption: a new writer that touches resource_key at all
234
+ -- is still in the population and still fails closed. STATED HOLE: `insert into claims select *
235
+ -- from ...` names no column and would slip past, which is the same shape assertion 24's regex
236
+ -- already cannot see.
237
+ and agent_board_test.stripped_body(p.oid) ~* '\mresource_key\M'
223
238
  -- message-board#196 Bucket B: read RAW, one comment naming _canonical_claim_key
224
239
  -- dropped a bypass writer out of this set and the count went to 0 green.
225
240
  -- anchored to the CALL shape: a bare-substring `!~` is satisfied by any