Repository navigation
Open
Description
Ground-up rebuild of codeanalyzer-rust as the CLDK schema-v2 backend: one additive CPG (L1 symbol table → L2 call graph → L3 intraprocedural dataflow → L4 interprocedural SDG) emitted as analysis.json + a Neo4j projection.
Design summary
- Stack: rustc internals (HIR/THIR/MIR + TyCtxt) on a pinned nightly (Clippy/Flowistry pattern), bumped per Rust release.
- Architecture: extractor + stable core —
canrs-extractor(only nightly crate, runs as RUSTC_WORKSPACE_WRAPPER undercargo check) serializes versioned per-crate IR;canrs(stable) builds all levels from IR. Core tests run from recorded-IR fixtures on stable. - Schema (Rust expansion): seven typed entities (RsStruct, RsEnum, RsUnion, RsTrait, RsTypeAlias, RsImpl, RsMacro) over the kind-tagged v2 wire; unified impl-facet rule (methods live where the impl is written; facets keyed by target type, base_classes = [type, …traits]); macros first-class with from_macro attribution; closures materialized with rustc naming; fully-qualified signature paths; structured attributes; is_unsafe statement flag; unwind CFG edges for diverging sites only.
- Dispatch: exact static (prov rustc) + CHA baseline ∪ RTA confirmation (prov merge). L4 oracle: ownership + MIR loans (Flowistry-style), weak updates.
- Distribution: native-runner matrix → thin codeanalyzer-rust PyPI wheels (binary + bin_path()), GitHub Release assets, homebrew-tap formula, tag-triggered release.yml. Runtime requires rustup (pinned toolchain auto-installed).
Full spec: docs/superpowers/specs/2026-07-09-codeanalyzer-rust-v2-design.md (local drafting doc).
Milestones
- M1 Scaffold: workspace, three crates, pinned nightly, fixture, CI #28 M1 Scaffold
- M2 Materialization + extractor MVP: cargo integration, crate-ir, recorded fixtures #29 M2 Materialization + extractor MVP
- M3 L1 symbol table: tree build, impl-facet rule, JSON emission, L1 gate #30 M3 L1 symbol table
- M4 Neo4j projection at L1 depth: rows, cypher/bolt writers, schema catalog #31 M4 Neo4j projection (L1 depth)
- M5 L2 call graph: entrypoint finders, exact static + CHA, RTA merge, L2 gate #32 M5 L2 call graph
- M6 L3 dataflow: CFG/CDG/DDG from MIR, -j parallelism, L3 slice gate #33 M6 L3 dataflow
- M7 L4 SDG: ownership+loans oracle, synthetic vertices, summaries, L4 gate #34 M7 L4 SDG
- M8 CLI polish + three-layer caching + flag validation hardening #35 M8 CLI + caching
- M9 Packaging & release: PyPI wheels, homebrew, tag-triggered release.yml #36 M9 Packaging & release
- M10 Docs: README, CLAUDE.md + AGENTS.md agent guide, SCHEMA_DECISIONS.md #37 M10 Docs
Metadata
Metadata
Assignees
Labels
No labels
Activity