Skip to content

Detect cycles in non-hierarchy relationships #118

Open

Description

@mindsocket

Problem

The hierarchy is validated as a layered DAG, but other relationships (e.g. a node type that composes or uses other nodes of the same type) have no cycle detection. The only cycle guard today is for allOf recursion during schema resolution (src/schema/schema-refs.ts). A cycle in a composition relationship can't be reliably expressed as a JSONata rule, since it needs recursive traversal.

Proposal

A generic deterministic check: a relationship can be declared acyclic in the schema, and validation reports any cycle as an error, listing the nodes in the cycle.

Relates

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions