You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Loader error for an enforced reference/relationship to a non-persisted (sourceless) target #250
After #248, an object that declares no source.* is correctly not persisted. But an @enforce'd identity.reference (or an enforced relationship FK) from a persisted entity to a sourceless target now produces divergent, silently-wrong downstream behavior:
migrate-tssilently skips the FK — the target has no table, so buildForeignKeys hits its existing if (!refTable) continue; and emits no constraint.
codegen-tsdrizzle-schema.ts still emits a .references() against a table const that doesn't exist → broken generated code.
A physical foreign key needs a physical target. The right fix is a loader error — cross-port (all four loaders + a shared conformance fixture) — rejecting an enforced reference/relationship whose target declares no persistence source. This was deliberately out of scope for #248 (too big for a PATCH).
Closing — not tracking as a separate issue. This deferred item remains documented in the #248 design spec (docs/superpowers/specs/2026-08-01-issue-248-persistability-from-source-design.md §9) on main.
Activity
dmealing commentedon Aug 2, 2026
Closing — not tracking as a separate issue. This deferred item remains documented in the #248 design spec (docs/superpowers/specs/2026-08-01-issue-248-persistability-from-source-design.md §9) on main.