derive-depth-cycle-guard
IN premise
`_get_depth` sets `memo[node_id] = 0` before recursing to prevent infinite recursion on cyclic justification chains; cycles resolve to depth 0
Summary
When the system calculates how deep a node sits in the justification chain, it protects itself from getting stuck in loops by temporarily assuming any node it is currently visiting has depth zero. This means circular dependency chains will not cause the system to hang or crash — they just bottom out at zero, letting the depth calculation complete gracefully.
Dependents
These beliefs depend on this one:
- derive-pipeline-is-exhaustive-and-terminating — The derive pipeline supports exhaustive exploration mode while guaranteeing termination: `--exhaust` enables automatic application of all discovered proposals, and depth-based cycle detection with pre-recursion memoization prevents infinite loops even when justification chains are cyclic.
- propagation-is-crash-free — Truth propagation completes without runtime errors across all reachable nodes
Details
| Source | entries/2026/04/23/reasons_lib-derive.md |