refactor(graph): use shared engine for gate traversals

Merged
TH
2mo ago
+231-228

Summary

  • Closes #3277; umbrella #3276. Twelve files touched; scope includes a separately committed mutation canary budget fix.
  • Moves import-graph SCC, R73 BFS, R76 reverse reachability, mutation ownership and fuzz closure to the shared engine. Preserves first-cycle representatives, BFS origin/order and ownership’s reachability superset over tracked sources.
  • WORKSPACE_SPECIFIER normalizes extracted specifiers. The eager-closure BFS from #3298 remains as explicitly requested. The NUL edge-ID collision fix/test already exists on main; no runtime dependency added.
  • Ownership sets match main exactly. Stryker’s independent Vitest related scope caused the expensive canary lane. snapshot-occlusion replaces it without raising timeouts: prior successful head cf887a45e completed in 19:14 versus kernel-errors cancellations at 30:18/30:20. Failed attempts produced no shard report for per-mutant diagnosis.

Validation

  • Head 8ed2225f0811ad2932c34daf08942dfa20907a17: pnpm check:affected --run passed every runnable check; new CI pending.
  • Against rebased main bf2246499a: all 10,182 resolved edges, 22 depgraph cycles, layering stdout and seven ownership sets (3,813 assignments) match exactly.
  • Chord regression failed before the fix, then passed; 1,024 synthetic cycle comparisons match the old helper.
  • Temporary tracked violations failed with R4 value-import-cycle and R6 type-spine-inversion, then were removed. Chord fixture now claims value-cycle selection only; independent type/dynamic fixtures cover those kinds. Review responses contain the comparison details.