pgapi-validates-refs-before-justification-insert

IN premise

PgApi's `_validate_refs` checks all antecedent and outlist node IDs exist in `rms_nodes` before inserting a justification, providing application-level referential integrity that compensates for JSONB arrays' inability to enforce foreign key constraints.

Summary

When adding a justification that references other nodes, the system first verifies those nodes actually exist in the database. This is necessary because justifications store their references as JSON arrays rather than proper foreign key columns, so the database itself cannot enforce that referenced nodes are real — the application code has to do that check manually to prevent dangling references.

Dependents

These beliefs depend on this one:

Details

Sourceentries/2026/04/29/session-summary.md