Files
buzz/crates
Hayt a83d29e2c5 test(buzz-db): add absent-policy FK rejection to provenance regression
Extends identity_binding_provenance_is_independent_of_enrollment_mode with
the negative half required for two-sided mutation sensitivity.

A second deferred transaction inserts an otherwise-valid identity_bindings
row referencing policy_revision 999 (nonexistent in
identity_enrollment_policies) and asserts the INSERT fails with SQLSTATE
23503 from the narrowed FK identity_bindings(community_id, policy_revision)
→ identity_enrollment_policies(community_id, policy_revision).

Non-vacuity verified: removing the FK from the migration causes the
absent-policy INSERT to succeed (rows_affected: 1) and the expect_err
assertion to fire, confirming the negative half detects a dropped or
neutered FK. The existing positive half catches the old composite FK;
together they give full two-sided coverage.

Zero production changes: migrations 0040/0041 and schema.sql are
byte-untouched.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Hayt <9e1c23a3fd83f61da34420e4e88ff1b16e45cafcc0cd9019eb07d4ecfa8ca9b0@buzz.block.builderlab.xyz>
2026-08-31 14:05:38 -04:00
..