Skip to content

fix(processor): bound dependency-cycle detection - #1126

Merged
Brad-Edwards merged 1 commit into
devfrom
RUN-303-bounded-dependency-cycles-pr
Aug 13, 2026
Merged

fix(processor): bound dependency-cycle detection#1126
Brad-Edwards merged 1 commit into
devfrom
RUN-303-bounded-dependency-cycles-pr

Conversation

@doublewhy

Copy link
Copy Markdown

Plain-language summary

  • Context: OpenRAE plans resources in dependency order.
  • Problem: A valid scenario with a very long dependency chain can exhaust Python's call stack and stop planning.
  • Fix: Replace recursive cycle checking with an explicit work stack while preserving the same ordering and cycle reports.

Summary

Drive the existing Tarjan strongly connected component traversal with explicit DFS frames. The normalized graph, canonical cycle identities, self-cycle handling, component grouping, and planner diagnostics remain unchanged; only interpreter call-stack dependence is removed.

This is the independent RUN-303 cycle-detection scope currently bundled with unrelated runtime work in #1086. Scheduler, timeout, control-plane, schema, and public API changes are excluded.

Related issues

Closes #1103

Changes

  • Traverse each normalized dependency node and edge with an explicit (node, remaining-dependencies) frame stack.
  • Preserve unknown-reference filtering and deterministic strongly connected component output.
  • Remove the unused local _ordering_graph() wrapper in favor of the established shared semantic adapter.
  • Compare against a simple recursive oracle for every directed graph through three nodes and 400 denser generated examples through 18 nodes.
  • Cover a 5,000-edge acyclic chain, a 3,000-node cycle, unknown references, and input-order independence.
  • Record the algorithmic lineage, alternatives, compatibility boundary, and RUN-303 traceability.

Test plan

  • Python 3.12.13 focused RUN-303 planner/runtime suite: 77 passed.
  • Exhaustive, oracle, dense-property, and deep-chain/cycle regressions passed.
  • Branch-instrumented coverage plus diff-cover: 100% of 25 changed executable lines; every newly added branch site exercised both outcomes (97% aggregate coverage across the two focused planner modules).
  • Final verify-static-lane -- --include-policy --base-rev origin/dev: all hygiene, repository policy, semantic/assurance/authority checks, and Ruff checks passed.
  • Canonical Python 3.12 verification attempt: integration, contracts, static, and docs-local lanes passed.
  • Canonical verification is not fully green locally: the unit lane reaches libvirt guest-certification failures outside this PR's five changed files, and participant-opacity proof replay requires the pinned Isabelle archive that is not installed in this worktree. Requirement governance also reported the Ground Control service unavailable and used its documented skip path.

Checklist

  • Code follows the project coding standards.
  • FM classification is not applicable because dependency semantics and diagnostics do not change.
  • Published contract schemas are unchanged.
  • PR title is a Conventional Commit.
  • The focused preflight note and RUN-303 traceability are updated.

Notes for review

@doublewhy
doublewhy marked this pull request as ready for review August 12, 2026 20:30
@Brad-Edwards
Brad-Edwards merged commit d4b4432 into dev Aug 13, 2026
16 of 17 checks passed
@Brad-Edwards
Brad-Edwards deleted the RUN-303-bounded-dependency-cycles-pr branch August 13, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants