fix(buzz-db): drop stale relationship_revision_floor from invalidation guard

The authorization_invalidation_floor_guard_v1 trigger compared
NEW/OLD.relationship_revision_floor, but authorization_invalidation_floors
has no such column — a later FI-DELEG field correctly trimmed from the
Phase-A table when mining, yet left in the guard body. PL/pgSQL defers
record-field resolution, so the function CREATEs and all catalog/parity
tests pass, but the first real monotonic floor advancement aborts with
'record NEW has no field relationship_revision_floor', making the floor
update path unusable.

Remove both comparisons from the migration and its byte-matched schema.sql
mirror, and add a behavioral regression test that advances a floor through
the live trigger (forward generation and binding_version_floor commit;
equal/regressive updates reject) — coverage a deferred PL/pgSQL failure
structurally evades in catalog tests.

Signed-off-by: Hayt <9e1c23a3fd83f61da34420e4e88ff1b16e45cafcc0cd9019eb07d4ecfa8ca9b0@buzz.block.builderlab.xyz>
This commit is contained in:
Hayt
2026-08-28 13:32:42 -04:00
parent bafdff958a
commit 738655da08
3 changed files with 132 additions and 8 deletions

View File

@@ -3120,14 +3120,10 @@ BEGIN
OR NEW.selector_fingerprint IS DISTINCT FROM OLD.selector_fingerprint
OR NEW.floor_generation < OLD.floor_generation
OR COALESCE(NEW.binding_version_floor, 0) < COALESCE(OLD.binding_version_floor, 0)
OR COALESCE(NEW.relationship_revision_floor, 0)
< COALESCE(OLD.relationship_revision_floor, 0)
OR (
NEW.floor_generation = OLD.floor_generation
AND COALESCE(NEW.binding_version_floor, 0)
= COALESCE(OLD.binding_version_floor, 0)
AND COALESCE(NEW.relationship_revision_floor, 0)
= COALESCE(OLD.relationship_revision_floor, 0)
)
OR NEW.operation_id IS NOT DISTINCT FROM OLD.operation_id
OR NEW.updated_at <= OLD.updated_at