Skip to content

[bug] Collection member_of hierarchy has no cycle validation (DAG invariant unenforced) #1427

Closed

Description

@mstomar125

Severity: high · Confidence: high

validate_no_cycle (sqlite_store.rs:1400) runs only for has_child. Collection hierarchy edges (member_of, via create_relationship in services/node_service/relationship.rs:476-606) get no cycle check, so paths like a:b + b:a create a cycle in the supposed DAG (collection_service.rs:340). A dedicated collection_cycle error exists (services/error.rs:194) but is never used. Once the recursive-CTE bug above is fixed, a cycle makes traversal loop (no depth cap).

Fix: validate no cycle before creating member_of collection-hierarchy edges; return collection_cycle.


Found via the 2026-06-18 multi-repo bug-hunt sweep. Confidence/severity from the sweep + spot-verification.

Activity

  1. mstomar125 commented on Jun 24, 2026

    @mstomar125
    ContributorAuthor

    Resolved in #1457. New validate_no_member_of_cycle is called before creating a collection→collection member_of edge and rejects with the existing collection_cycle error. Closes the DAG hole that, post-#1426, would loop the recursive walk. Tests: cycle + self-edge rejected, non-cycle allowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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