* fix(ado): map parent-child deps to hierarchy links (not Related)
beads stores hierarchy as dependency type "parent-child", but the ADO
adapter only matched the unreachable alias "parent". Push therefore
emitted System.LinkTypes.Related and never set System.Parent; pull
wrote the non-canonical "parent" type back into beads.
Map both directions to parent-child (canonical) and keep "parent" as a
push-side alias for safety.
Fixes#4961
* fix(ado): correct hierarchy link direction for parent-child push/pull
The GH#4961 fix renamed the mapped literal to "parent-child" but kept
the old link-type/swap wiring, which pointed the wrong direction on
both sides (review by maphew, PR #5129):
- Push (beadsDepToADORel): the desired set is built from the child's
own outgoing dependency row (IssueID=child, DependsOnID=parent), so
PushLinks always runs with workItemID as the child and the target as
the parent. Emitting RelChild (Hierarchy-Forward) from the child
asserted the child is the parent's parent, reparenting the target
backwards on push. Now emits RelParent (Hierarchy-Reverse).
- Pull (adoRelToBeadsDep): the swap flags for RelChild/RelParent were
inverted relative to beads' child-to-parent storage convention.
Flipped both so the resulting dep always points child -> parent.
- removableRelTypes now tracks RelParent instead of RelChild, since
beads owns the Hierarchy-Reverse link on the child after this fix.
Added TestPushLinks_HierarchyDirection and
TestPullLinks_HierarchyChildDirection to pin the emitted/parsed
relation type in each direction; updated existing tests whose fixtures
and assertions encoded the old (backwards) direction.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015AfaSMkMRF5BTzuPNFnqHY
* fix(ado): stop mapping the legacy "parent" dep type to a hierarchy link
DependencyType.IsValid accepts any non-empty string, so "parent"-typed
rows written by the pre-fix pull path really do persist. Both old pull
branches stored them parent -> child, backwards relative to the
convention this PR standardises on, so mapping the alias to RelParent
would assert the child is the parent's parent and reparent real
hierarchies -- the exact corruption this PR fixes, arriving via the
legacy path.
Drop the alias so those rows fall through to RelRelated (inert), where
they have effectively been all along. Retyping and reversing them needs
a migration with its own tests, tracked separately.
Reported by maphew on PR #5129.
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>