Generated comprehensive static dependency analysis for g3 workspace: - graph.json: 108 nodes (9 crates, 99 files), 186 edges - graph.summary.md: Overview with metrics, entrypoints, fan-in/fan-out rankings - sccs.md: No cycles detected (DAG structure confirmed) - layers.observed.md: 4-layer crate hierarchy identified - hotspots.md: ui_writer.rs (15 fan-in), agent_mode.rs (13 fan-out) as key nodes - limitations.md: Documents extraction methodology and caveats Updated AGENTS.md with artifact documentation table. Agent: euler
2.5 KiB
2.5 KiB
Analysis Limitations
What Was Observed
| Category | Method | Coverage |
|---|---|---|
| Crate dependencies | Cargo.toml parsing | Complete |
| Module structure | mod declarations in lib.rs/main.rs |
Complete |
| File imports | use g3_* and use crate:: patterns |
Partial |
| Submodule structure | mod.rs file inspection | Complete |
What Could Not Be Observed
1. Implicit Dependencies
- Trait implementations: A file implementing a trait from another module creates a dependency not captured by
usestatements - Type aliases: Types re-exported through
pub usechains - Derive macros: Dependencies introduced by
#[derive(...)]
2. Dynamic Patterns
- Trait objects:
dyn Traitusage creates runtime dependencies - Generic bounds:
T: SomeTraitconstraints - Associated types: Dependencies through associated type resolution
3. Conditional Compilation
- Platform-specific code:
#[cfg(target_os = "...")]blocks not evaluated - Feature flags:
#[cfg(feature = "...")]dependencies not traced - Test-only code:
#[cfg(test)]modules excluded
4. Build System
- build.rs: Build script dependencies not analyzed
- Procedural macros: Macro crate dependencies not traced
- Workspace-level features: Feature unification effects not modeled
5. Excluded Files
| Category | Count | Reason |
|---|---|---|
Test files (/tests/) |
~40 | Out of scope |
Example files (/examples/) |
~10 | Out of scope |
| Worktree copies | ~100 | Duplicates |
What Was Inferred
| Inference | Basis | Confidence |
|---|---|---|
| Layer assignment | Topological sort of crate deps | High |
| Fan-in/fan-out metrics | Edge counting | High |
| Module-to-file mapping | Naming convention (mod.rs, *.rs) | High |
| Entrypoints | lib.rs/main.rs presence | High |
What May Invalidate Conclusions
- Hidden re-exports: If
g3-core/lib.rsre-exports types from submodules, actual coupling may be higher - Macro-generated code: Macros like
#[derive(Serialize)]add implicit serde dependency - Runtime plugin loading: If any crate loads code dynamically, static analysis misses it
- Workspace member changes: Adding/removing crates from workspace invalidates crate-level graph
Recommendations for Improved Analysis
- Use
cargo metadatafor authoritative crate graph - Use
cargo treefor transitive dependency analysis - Use
rust-analyzerfor semantic import resolution - Parse AST for type references beyond
usestatements