- graph.json: Canonical dependency graph (10 crates, 16 edges, 76 files) - graph.summary.md: One-page overview with fan-in/fan-out rankings - sccs.md: Strongly Connected Components analysis (no cycles) - layers.observed.md: 5-layer architecture diagram - hotspots.md: Coupling hotspots (g3-config, g3-cli) - limitations.md: Extraction limitations and validity conditions
3.4 KiB
Extraction Limitations
Scope of Analysis
This structural analysis was performed using static extraction methods only.
What Was Observed
| Source | Method | Confidence |
|---|---|---|
| Crate dependencies | Cargo.toml [dependencies] parsing |
High |
| Module structure | pub mod declarations in lib.rs files |
High |
| File inventory | Filesystem traversal of src/ directories |
High |
| Use statements | grep for ^use patterns |
Medium |
| External dependencies | Cargo.toml [dependencies] sections |
High |
What Was NOT Observed
1. Conditional Compilation
#[cfg(...)] attributes were not parsed. Dependencies that only exist under certain feature flags or target platforms are included unconditionally.
Example: g3-computer-control has platform-specific dependencies:
core-graphics,cocoa,objc(macOS only)x11(Linux only)windows(Windows only)
These are all listed as dependencies but only one set compiles per platform.
2. Test Dependencies
[dev-dependencies] were excluded from the graph. Test-only coupling is not represented.
3. Build Dependencies
[build-dependencies] were excluded. Build script dependencies are not represented.
4. Dynamic/Runtime Dependencies
The following cannot be detected statically:
- Process spawning (e.g.,
g3-consolespawnsg3processes) - Plugin loading
- Configuration-driven provider selection
- WebDriver browser automation targets
5. Trait Implementation Coupling
Trait implementations create implicit coupling not captured by use statements:
UiWriterimplementations ing3-cliLLMProviderimplementations ing3-providersComputerControllerimplementations ing3-computer-control
6. Re-exports
pub use re-exports create transitive dependencies not fully traced:
g3-corere-exports types fromg3-providersg3-computer-controlre-exports WebDriver types
7. Macro Expansion
Macro-generated code (e.g., #[derive(...)], async_trait) creates dependencies not visible in source.
8. Workspace Inheritance
workspace = true dependencies inherit versions from root Cargo.toml. The actual version constraints are not captured in crate-level analysis.
Inference Notes
Inferred: g3-console Isolation
g3-console has no internal crate dependencies in its Cargo.toml. It interacts with g3 via:
- Process spawning (
std::process::Command) - Log file parsing
- Filesystem monitoring
This runtime coupling is not represented in the dependency graph.
Inferred: g3 → g3-providers Direct Dependency
The root g3 crate depends directly on g3-providers despite g3-cli also depending on it. This may be for:
- Type re-exports
- Direct provider access in main.rs
- Historical reasons
The actual usage was not verified.
Recommendations for Future Analysis
- cargo-depgraph: Use
cargo depgraphfor authoritative Cargo-resolved dependencies - cargo-tree: Use
cargo treefor transitive dependency analysis - rust-analyzer: Use LSP for precise type-level dependency tracking
- cargo-udeps: Identify unused dependencies
- cargo-machete: Detect potentially unused dependencies
Validity Conditions
This analysis is valid as of the extraction date. It may be invalidated by:
- Adding/removing crates from the workspace
- Changing
[dependencies]in any Cargo.toml - Restructuring module hierarchies
- Adding conditional compilation features