Refreshed static analysis of workspace dependency structure: - graph.json: 10 crates, 17 crate-level edges, 95 files, 123 file-level edges - graph.summary.md: Updated metrics and fan-in/fan-out rankings - sccs.md: Confirmed no cycles (DAG structure intact) - layers.observed.md: 5-layer hierarchy from binaries to infrastructure - hotspots.md: Identified g3-config, g3-providers as high fan-in; g3-cli as high fan-out - limitations.md: Documented extraction method constraints Agent: euler
2.9 KiB
Analysis Limitations
Extraction Method
Dependencies extracted via:
- Cargo.toml parsing for crate-level dependencies
- Regex-based
useandmodstatement extraction from source files
Known Limitations
1. Conditional Compilation Not Evaluated
#[cfg(target_os = "macos")]
use core_graphics::window::*;
Platform-specific imports in g3-computer-control are included unconditionally. The actual dependency graph varies by target platform.
Affected files:
crates/g3-computer-control/src/platform/macos.rscrates/g3-computer-control/src/platform/linux.rscrates/g3-computer-control/src/platform/windows.rs
2. Macro-Generated Imports Not Detected
Imports generated by procedural macros (e.g., #[derive(...)], #[async_trait]) are not captured. These may introduce implicit dependencies.
Common macros in codebase:
serde::Serialize,serde::Deserializeasync_trait::async_traitclap::Parser
3. Re-Exports Not Fully Traced
pub use some_module::SomeType;
Re-exports create transitive dependencies that are not fully traced. A file importing SomeType from a re-exporting module has an indirect dependency on the original module.
4. Glob Imports Partially Resolved
use crate::types::*;
Glob imports are recorded but individual items are not enumerated. The actual coupling may be higher or lower than represented.
5. Test Code Excluded
Files matching these patterns are excluded:
*_test.rstests/*.rsmod tests { ... }blocks
Test dependencies are not represented in the graph.
6. Build Scripts Not Analyzed
build.rs files are not included. Build-time dependencies (e.g., code generation) are not captured.
Affected:
crates/g3-computer-control/build.rs
7. External Crate Dependencies Not Graphed
Only workspace-internal dependencies are represented. External crates (tokio, serde, etc.) are not included in the graph.
8. Inline Module Definitions
mod foo {
// inline definition
}
Inline module definitions without corresponding files are detected but may not resolve to file edges.
9. Path Aliases Not Resolved
use crate::foo as bar;
Aliased imports are recorded with original path, but alias usage elsewhere is not correlated.
What May Invalidate Conclusions
- Feature flags: Cargo features may enable/disable entire modules
- Workspace changes: Adding/removing crates changes the graph structure
- Refactoring: Moving code between modules changes edges without changing functionality
- Dynamic dispatch: Trait objects create runtime dependencies not visible statically
Confidence Assessment
| Aspect | Confidence |
|---|---|
| Crate-level dependencies | High (from Cargo.toml) |
| Module tree structure | High (from mod declarations) |
| Cross-crate imports | Medium (regex-based) |
| Intra-module coupling | Low (not analyzed) |
| Runtime dependencies | Not captured |