Skip to content

move_node_unchecked omits the container-type check its OCC-checked sibling move_node enforces #3011

Closed

Description

@mstomar125

Problem

No user or developer is currently affected — move_node_unchecked has zero production callers (verified repo-wide), so this is a latent inconsistency/doc-comment mismatch, not an active bug, unless someone later wires it into a real code path.

Root cause

move_node (packages/core/src/services/node_service/hierarchy.rs, ~line 434) explicitly rejects moving a node under a parent whose behavior returns can_have_children() == false. move_node_unchecked (line 333), documented as "for internal operations (imports, type conversions)," performs the same existence/circular-reference checks but has no equivalent container-type check. A repo-wide grep shows every call site is in tests//benches/ or a #[cfg(test)] unit test — this codebase's own mod.rs even documents "move_node_unchecked has no production caller." The daemon's actual import path (import_service.rs) calls create_node_with_parent, which does have the check, not this function.

Suggested fix

Add the same can_have_children() check to move_node_unchecked, or update its doc comment to stop claiming production use and gate it behind test/bench-only visibility.


Found via the 2026-09-25 full-repo code sweep (finding #68 of 84 in CODE_SWEEP_FINDINGS_2026-09-25.md). Severity: low. Category: risky.

Activity

  1. self-assigned this
    on Sep 25, 2026
  2. removed their assignment
    on Sep 25, 2026
  3. malibio commented on Sep 26, 2026

    @malibio
    Collaborator

    Frontend baseline: 5391 passed, 1 failed (known flaky core-plugins viewer timeout)

  4. self-assigned this
    on Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

foundationsweepFound via the 2026-09-25 full-repo code sweep

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions