Skip to content

bd export omits parent-to-child dependency rows #1926

@Jonathan-A-White

Description

@Jonathan-A-White

Bug

bd export only includes dependency rows where the exported issue is the child (issue_id). Dependencies where the exported issue is the parent (depends_on_id) are silently dropped.

This means a bd push / bd pull roundtrip loses parent-to-child relationships in epic trees. The child→parent direction survives, but the parent→child direction does not.

Root cause

In cmd/bd/export.go, the dependency population loop only indexes by issue_id:

for _, issue := range issues {
    issue.Dependencies = allDeps[issue.ID]  // only child→parent direction
}

GetAllDependencyRecords returns dependencies keyed by issue_id, so any row where the issue is the depends_on_id (i.e. it's the parent) is never attached to that issue's export.

Impact

  • Epic trees exported via bd export or bd push lose their parent→child edges
  • bd pull on the receiving end sees fewer dependencies than the source
  • Affects any workflow relying on JSONL roundtrip fidelity (multi-agent sync, backup/restore)

Fix

Build a reverse index (parentDeps[dep.DependsOnID]) and populate both directions when attaching dependencies to issues before export.

Fix: #1927

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