The patched COW branch trigger generator now carries source FK metadata into the branch view triggers. Child writes are checked against the branch-local parent view, deferrable checks run on the overlay at transaction end, and parent updates/deletes apply the configured FK action to branch-local child rows.
This keeps the article chain honest: the 1B article proves the original branch lifecycle, the 5B article records the scale upgrade and FK gap, and this article records the fix.
The FK fix is branch-local.
The source database is not mutated to make the branch work. Imladri creates overlay/deleted tables and view triggers inside the branch schema, then enforces FK behavior at that boundary.
| Problem | Copy-on-write branch views protected the source table but did not automatically inherit table-level FK behavior. |
|---|---|
| Fix | Generated branch triggers now check outgoing FK writes, deferred overlay checks, and parent-side referential actions against the cloned branch views. |
| Rerun | The patched benchmark rejected orphan children, rejected restricted parent changes, cascaded branch-local children, applied set-null/default, honored composite MATCH FULL, deferred repair/rejection, self-reference, and multi-branch isolation without source mutations. |
| Concurrency hardening | A first 100-way FK regression exposed connection acquisition timeouts under burst load. The benchmark now uses bounded shared verification and configurable target pool timeouts; the rerun completed 100/100 concurrent FK branches with no deadlocks and zero source mutations. |
| Hardening complete | The listed FK gaps are now covered by the public boundary benchmark. Future work is broader production schema coverage, not this specific gap list. |
The full boundary benchmark passed after the patch.
The rerun kept the broader database-agent checks intact: concurrent branches, heavy branch writes, cleanup, source isolation, composite keys, deferred checks, self-references, and separate branch visibility all passed while the FK behavior moved from a known gap to a passing proof. The latest artifact adds the missing concurrency answer: 100 simultaneous FK branches completed valid writes, denied orphan writes, applied update/delete cascades, and cleaned up with zero source mutations.
| Check | Result | Status | Timing | Source state |
|---|---|---|---|---|
| Concurrent branches | 100 / 100 succeeded | 0 deadlocks | 2339.46ms p50 / 4030.78ms p95 create | 0 source mutations |
| 1M branch writes | 1,000,000 overlay rows | 20,924 rows/sec | 35.58ms cleanup | 0 source mutations |
| 10M branch writes | 10,000,000 overlay rows | 15,797 rows/sec | 434.34ms cleanup | 0 source mutations |
| Multi-table FK actions | 10 related tables | restrict, cascade, set-null, set-default, MATCH FULL, deferred, self-ref, multi-branch passed | 7/7 proof | 0 source mutations |
| Concurrent FK branches | 100 / 100 succeeded | valid writes, denied orphans, update/delete cascade | 0 deadlocks | 0 source mutations |
The named FK gap list is now covered.
This closes the previously listed FK hardening targets: deferred constraints, composite MATCH FULL keys, self-referential foreign keys, and multi-branch regressions. The May 15 concurrency rerun also closed the pool-timeout issue found by the first 100-way FK attempt. It does not claim every possible production schema shape is exhausted; it claims this named gap set now has passing artifact-backed coverage.
Artifact is public.
The JSON artifact records the full fixed run, including the parent-side FK action booleans, deferred/MATCH FULL/self-ref/ multi-branch booleans, the 100-way FK concurrency result, and0 source mutations.
