Skip to content

No guard against deleting a schema with extended_by children — descendants silently lose all inherited fields/relationships #2889

Closed

Description

@mstomar125

Context

Surfaced by a codebase scan focused on the extends-chain/ADR-078 bug class. This may be an explicitly out-of-scope/accepted gap for ADR-078 rather than a bug — filed as a decision item for a maintainer to weigh in on, not prescribed for auto-implementation.

Problem

delete_node (packages/core/src/services/node_service/crud.rs:1882+) has no schema-specific guard for a schema node that has extended_by children or live subtype instances. Every chain-walking resolver in the codebase (resolve_field_owners schema.rs:552-557, resolve_relationships schema.rs:632-636, resolve_effective_fields schema/mod.rs:780-786, resolve_declared_relationship relationship.rs:493-495) treats a missing mid-chain schema the same way: continue past it silently.

Consequence: deleting the task schema while issue extends task nodes exist makes every issue instance silently lose all inherited fields and relationships, with no error raised anywhere in the delete path or afterward.

There IS an existing precedent for this kind of delete-side dependency guard: plays_referencing_schema (packages/core/src/playbook/engine.rs:957) already blocks/warns on deleting a schema that Plays reference.

Suggested approach

Not prescribed — needs a maintainer decision on the right UX (block the delete outright if descendants exist? cascade-delete descendants? require an explicit --force?), following the same pattern plays_referencing_schema already established for a different dependency kind (Plays, not extends children).

Non-goals

Not proposing an implementation — this needs product/architecture input on intended behavior before any code changes.

Activity

  1. malibio commented on Sep 26, 2026

    @malibio
    Collaborator

    Frontend baseline: 5405 passed, 1 failed (architecture-benchmarks perf threshold — known machine-load flake). Decision: refuse delete_node on a schema that other schemas extend (typed error naming children), and refuse deleting core schemas.

  2. self-assigned this
    on Sep 26, 2026
  3. added a commit that references this issue on Sep 26, 2026
    342e3cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions