pgapi-referential-integrity-is-database-enforced
OUT derived (depth 2)
PgApi achieves complete referential integrity: application-level bidirectional enforcement (write-time validation and outlist-aware dependent querying) is complemented by database-level foreign key constraints, preventing orphaned justification references even under direct SQL manipulation outside the application layer.
Summary
PgApi was thought to have airtight referential integrity by combining its own validation checks with actual database-level foreign key constraints, so even raw SQL edits couldn't create dangling references. This turned out not to hold — the claim has been retracted, meaning the database-level foreign key constraints are likely missing or incomplete, leaving a gap where direct SQL manipulation could introduce orphaned data that the application-layer checks alone can't prevent.
Justifications
SL — Application-level bidirectional ref enforcement (depth-1) on a SQL-native multi-tenant backend (depth-1) would achieve complete referential integrity IF the FK constraint gap were closed
Antecedents (all must be IN):
- pgapi-enforces-referential-integrity-bidirectionally — PgApi enforces referential integrity in both directions: write-time validation checks all antecedent and outlist IDs exist before inserting justifications, while read-time dependent discovery queries both antecedent and outlist JSONB containment to find all affected nodes.
- pgapi-is-sql-native-multi-tenant — PgApi operates as a SQL-native multi-tenant implementation: all operations execute directly against PostgreSQL with no in-memory Network object constructed, composite primary keys on all tables provide project-level isolation, and each public method is a single committed transaction.
Unless (any of these IN defeats this justification):
- pg-antecedent-refs-have-no-fk-constraints — Antecedent and outlist references in `rms_justifications` are JSONB arrays without foreign key constraints; nonexistent referenced nodes default to truth value OUT via `truth_cache.get(a, "OUT")`.