import-agent-topo-sort-breaks-cycles

IN premise

`_topo_sort_claims` breaks dependency cycles by appending all remaining unsorted nodes after `max_passes = len(remaining) + 1` iterations rather than raising an error, ensuring import always completes.

Summary

When the import agent encounters circular dependencies between claims, it doesn't fail or raise an error. Instead, after exhausting a bounded number of sorting attempts, it simply appends whatever nodes are still unsorted to the end of the list. This means imports will always succeed even with tangled dependency graphs, though the ordering of cycle-involved nodes may not reflect their logical dependencies.

Details

Sourceentries/2026/05/08/reasons_lib-import_agent.md