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
update_schema's remove_relationships can silently clear the extends edge #2873
Surfaced during review of PR #2866 (core#2829 — ADR-078 extends-chain shadowing enforcement).
Problem
UpdateSchemaParams::extends's own doc comment (packages/core/src/schema/mod.rs) states: "Absent leaves the current extends edge untouched; there is no way to clear one." That's true of the dedicated extends param — but remove_relationships is a generic by-name removal over the same relationship-table-backed declaration list, and nothing stops a caller from passing remove_relationships: ["extends"]. reject_reserved_relationship_names (which blocks a hand-declared relationship literally named extends) is only applied to add_relationships, not to remove_relationships's name list, so this back door isn't blocked.
Result: a schema's extends edge CAN be cleared via update_schema, contradicting the documented "no way to clear one" contract, and doing so through a generic path with no extends-specific guardrails (e.g. no re-validation that the now-unextended schema's own fields/relationships are still well-formed on their own).
Impact
Narrow — requires deliberately naming the internal extends relationship in a remove_relationships call, which no normal schema-authoring flow does. Not currently known to be exploited or hit accidentally.
Suggested approach
Not prescribed. Likely either: (a) reject "extends"/"extended_by" in remove_relationships's name list the same way add_relationships already rejects them via reject_reserved_relationship_names, forcing the edge to only ever be re-targeted (never cleared) as the doc comment claims, or (b) if clearing is meant to be legal, update the doc comment and add the same kind of validation extends re-targeting already gets (impact analysis, etc.) to the removal path.
Non-goals
No change to remove_relationships's behavior for ordinary (non-extends) declarations.
Activity
mstomar125 commentedon Sep 23, 2026
Frontend: 5264 passed