feat: detect_cycles + check_layering — file/crate SCCs and cycle-aware edit checks #28
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
h-dv/code-index#28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rank 7 of the 2026-07-20 index-data brainstorm (
_prdoc/records/brainstorm-2026-07-20-index-data-catalog.md).What: Tarjan SCCs over file-level edges (which files cannot be edited independently) plus a crate-layering conformance mode checked against Cargo.toml workspace deps — an "architectural conscience" an agent consults before adding an import.
Why: 5 real file-level 2-cycles exist right now:
cli/main.rs↔link.rs,cli/main.rs↔doctor.rs,indexer/db.rs↔migrations.rs,daemon/access.rs↔local_index.rs, plus a ruby fixture cycle (proving cross-language detection). Crate layering is perfectly clean (0 violations across 14 boundaries) — so the conformance mode ships as a cheap enforceable CI invariant. Boundary surfaces are strikingly narrow (indexer→plugins crosses through exactly ONE symbol,all_plugins).Cost: small — Tarjan on ~109 file nodes at query time + Cargo.toml parse; no new data.
Triage: P3 — useful analyzer, not the next milestone
Keep open, but schedule after stable handles (#37) and
context_pack(#35). Implement file-level SCC detection first; layering conformance should be a separate mode with explicit configuration rather than inferred architectural policy.Design it as a reusable analyzer consumed by
review_diff(#34) andcontext_pack, not necessarily another frequently invoked top-level tool. Findings must distinguish newly introduced cycles from pre-existing cycles and exclude/label fixtures and generated code.