feat: enforce workspace-scoped resource references

This commit is contained in:
2026-08-20 10:42:57 +09:00
parent 2315c69f0a
commit 223a6ed011
4 changed files with 887 additions and 118 deletions
+4 -6
View File
@@ -848,18 +848,16 @@ fn collect_foreign_key_diagnostics(
)
})
.collect::<BTreeSet<_>>();
// The Ticket component owns its required foreign keys, while an integrated host may
// strengthen Workspace/domain boundaries with additional references to host-owned
// tables. Reject missing component constraints, but do not treat those host extensions
// as Ticket schema drift.
for missing in expected.difference(&actual) {
push_diagnostic(
diagnostics,
format!("table {table:?} is missing foreign key {missing:?}"),
);
}
for unexpected in actual.difference(&expected) {
push_diagnostic(
diagnostics,
format!("table {table:?} has unexpected foreign key {unexpected:?}"),
);
}
}
fn collect_foreign_key_check_diagnostics(