Skip to content

pm validate does not detect circular parent references (hierarchy cycles) #280

Closed

Description

@unbraind

Bug description

pm validate reports dependency_cycle_count: 0 and no warnings, but circular parent references can exist between two items and corrupt the hierarchy. The lifecycle validator detects blocked_by/definition_of_ready dependency cycles (per #271) but does NOT detect cycles in the parent relationship.

Reproduction (observed in the 2d-bots project tracker)

Two Epic items reference each other as parent:

.agents/pm/epics/pm-jxyj.toon  (PILLAR-2: Agentic NPC Believability)
  line 17: parent: pm-k10o

.agents/pm/epics/pm-k10o.toon  (E05 Pi-Agent NPC Intelligence Platform)
  line 22: parent: pm-jxyj

pm-jxyj → parent → pm-k10o → parent → pm-jxyj is a cycle.

pm validate output (lifecycle section):

dependency_cycle_severity_policy: "warn"
dependency_cycle_count: 0
dependency_cycle_item_count: 0

No warning/error is emitted about the parent cycle. pm list --tree rendering and any recursive hierarchy walk (orphan detection, rollup) will misbehave or infinite-loop on such a structure.

Expected behavior

pm validate should traverse the parent graph and flag any cycle, e.g. a new check validate_hierarchy_parent_cycle emitting the offending item ids + path, severity warn (or error). Distinct from the existing dependency_cycle check (which covers blocked_by/deps), this covers the parent (composition) graph.

Actual behavior

dependency_cycle_count: 0, no parent-cycle detection, silent hierarchy corruption.

Impact

Medium-high. A parent cycle silently breaks hierarchy rendering, orphan analysis, and progress rollups. It is easy to introduce accidentally (e.g. when reparenting two related epics) and currently has no automated guard.

Notes

The 2d-bots tracker instance had this exact pm-jxyj ↔ pm-k10o cycle (now being corrected manually). Detection should cover cycles of any length (A→B→A and A→B→C→A).

Activity

  1. unbraind commented on Jul 11, 2026

    @unbraind
    OwnerAuthor

    pm tracker item:

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

    bugSomething isn't workingpm-cli

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions