Expand description
Resource graph: flatten module bodies into their callers, expand
count / for_each, and emit a Workspace.
Phase 5 lands module expansion (closes M2). Dependency-edge collection
and the secondary Parquet tables (dependencies.parquet,
components.parquet, modules.parquet) are Phase 8 / M5 work — they
consume the same Workspace, so the contract pinned here does not need
to change when they arrive.
Per 15-resource-graph.md.
§Public surface
GraphBuilder/DefaultGraphBuilder: the trait + default impl that flattens module bodies into their callers.ModuleRegistry: canonical-path-keyed index of local module bodies; the orchestrator (Phase 5 pipeline wiring) builds this by evaluating everyDirKind::Moduledirectory the discoverer emitted.GraphContext: per-build context (workspace root, recursion / expansion caps).GraphError: errors emitted by the graph phase. Spec § 7UnresolvableModuleSource/DepthExceededare recorded ascrate::Diagnostics in practice (the builder method signature reservesErrfor fatal IR-construction failures).
Structs§
- Default
Graph Builder - Default builder.
- External
Module Ref - An external module reference captured for the dependency graph but not walked source-only (Registry, Git, or generic External source).
- Graph
Context - Per-
buildcontext: workspace root, recursion / expansion caps. - Module
Registry - Map of local module dirs (canonical paths) to their evaluator output.
Enums§
- Graph
Error - Errors the graph builder can surface.
Traits§
- Graph
Builder - Trait the orchestrator calls to build a
Workspace. Phase 5 ships exactly one implementation,DefaultGraphBuilder; downstream tests may swap an in-memory variant.
Functions§
- collect_
edges_ in_ place - Walk
wsand append every inferred edge tows.edges. Existing edges (e.g. populated by a future phase) are preserved; duplicates are removed in the final sort.