crates.sage_ir.resolution.lookup.dependencies

Resolution dependencies follow the lookup actually performed. The owning phase observes only searched lexical/module scopes and keyed external membership. Provider discovery enumerates identities before loading selected signatures, and resolution never reads a checked body. This is the resolution consequence of Cross-item dependencies stop at semantic interfaces.

Read in specification context · design/crates/sage_ir/resolution.sage

Implementation

Implemented crates/sage-ir/src/check/resolve/ribs.rs:67–72

sage_ir::check::resolve::ribs · lib:sage_ir

#![allow(unused)]
fn main() {
    // {anchor}`crates.sage_ir.resolution.lookup.dependencies`
    // {anchor}`crates.sage_ir.resolution.lookup.identity_only`
    pub fn lookup(&self, name: Name<'db>, ns: Namespace) -> Option<Resolution<'db>> {
        for scope in self.scopes.iter().rev() {
            for (n, entry_ns, entry) in scope.iter().rev() {
                if *n == name && *entry_ns == ns {

}

See more source ↗

Implemented crates/sage-ir/src/check/resolve/mod.rs:132–137

sage_ir::check::resolve · lib:sage_ir

#![allow(unused)]
fn main() {
    // {anchor}`crates.sage_ir.resolution.lookup.dependencies`
    pub fn resolve_path(
        &mut self,
        stash: &Stash,
        path: Path<'db>,
        namespace: Namespace,

}

See more source ↗

Implemented crates/sage-ir/src/symbol/mod.rs:119–124

sage_ir::symbol · lib:sage_ir

#![allow(unused)]
fn main() {
    // {anchor}`crates.sage_ir.resolution.lookup.dependencies`
    pub fn trait_children(self, db: &'db dyn Db) -> Vec<TraitSymbol<'db>> {
        db.tcx()
            .module_children(self.crate_num(db), self.def_index(db))
            .into_iter()
            .filter(|raw_child| raw_child.kind == SymExtKind::Trait)

}

See more source ↗

Implemented crates/sage-ir/src/symbol/mod.rs:139–144

sage_ir::symbol · lib:sage_ir

#![allow(unused)]
fn main() {
    // {anchor}`crates.sage_ir.resolution.lookup.dependencies`
    // {anchor}`crates.sage_ir.resolution.lookup.identity_only`
    pub fn named_children(
        self,
        db: &'db dyn Db,
        name: Name<'db>,

}

See more source ↗

Implemented crates/sage-ir/src/symbol/mod.rs:558–563

sage_ir::symbol · lib:sage_ir

#![allow(unused)]
fn main() {
    // {anchor}`crates.sage_ir.resolution.lookup.dependencies`
    pub fn expanded_module_items(self, db: &'db dyn Db) -> &'db [Symbol<'db>] {
        match self {
            ModSymbol::Local(sym) => local_expanded_module_items(db, sym),
            ModSymbol::Ext(sym_ext) => sym_ext.expanded_module_items(db),
        }

}

See more source ↗

Tests and review

Indexed tests and the implementation-completeness and test-adequacy review; no test run is implied.

TODO sage_meta::todo::resolution_lookup_dependencies

crates/sage-meta/tests/semantic_spec.rs · test:semantic_spec

#![allow(unused)]
fn main() {
#[test]
    #[sage::test(crates.sage_ir.resolution.lookup.dependencies)]
    fn resolution_lookup_dependencies() {
        // TODO: Complete the claim-specific verification matrix:
        // Cold and warm query traces show the exact scopes and external keys read for a lookup, exclude
        // unsearched modules, unrelated associated-item signatures, and all checked bodies, and show
        // reuse when those unrelated inputs change.
    }
}

See more source ↗

Review: Accepted · macro_fix_precedence/dependencies.

Reviewed the complete dependency claim and all five ordinary implementation associations in resolve/mod.rs, resolve/ribs.rs, and symbol/mod.rs, plus the sole associated TODO test. Additional local module expansion/completeness source is captured as a dependency. This remains explicitly test-TODO: no passing no-op is treated as dependency or incremental-reuse evidence.

The requirements are that lookup observes searched lexical/module scopes and external membership keys, provider discovery produces identities before selected signatures are loaded, and resolution does not read checked bodies. Ribs::lookup only examines the current in-memory scope stack in reverse precedence order. Resolver::resolve_path returns a rib hit before module lookup; relative multi-segment and anchored paths follow selected module/enum children, and fallback preludes are searched only after the preceding bucket is empty. resolve_name_from_module tracks module/name/namespace in-flight keys to avoid recursive imports and selects the phase-appropriate bucket. The owning phase therefore acquires dependencies through the lookup branches it actually traverses. The new import_root_is_expansion_ambiguous audit deliberately reads generated named candidates and, only when present, competing glob routes; these are necessary scopes for that separate ambiguity check, not unconditional dependencies added to every normal lookup. It uses span provenance/identity and does not demand signatures or checked bodies.

Symbol::expanded_module_items dispatches to local expanded membership or external module membership. SymExt::named_children is a tracked lookup keyed by external symbol, name, and namespace; it filters raw exported edges before creating matching identities. Its underlying module_children access is module membership rather than a checked body or an unrelated function signature. SymExt::trait_children similarly enumerates trait identities from external membership without signatures. Resolver::traits_in_method_scope first collects local/imported/prelude trait identities and completeness flags; it does not call trait or function signature lowering. The unrelated signature accessor methods in symbol/mod.rs are separate operations, not calls made by these identity enumeration paths. Captured local expansion code explains that module enumeration may require macro resolution/expansion and completeness traversal of relevant providers; this is not checked-function-body evaluation. Macro body tokens needed to expand declarations are distinct from checked bodies. No checked-body call appears in the reviewed resolution paths.

The only associated test, semantic_spec::todo::resolution_lookup_dependencies, explicitly defers cold/warm query traces, exact scope and external-key assertions, exclusions of unrelated modules/signatures/checked bodies, and reuse after unrelated edits. It covers every empirical dimension still missing: source inspection cannot prove absence of hidden query dependencies or incremental reuse. Completing this anchor requires instrumented traced fixtures exercising hits, fallbacks, import cycles, provider discovery, and edits to unrelated inputs. This accepted deferral retains TODO status and does not certify the complete dependency guarantee as tested. There are no N/A entries. No new regression or additional implementation change was required by the reviewed import audit. This review executed start/read/record only; it makes no claim that a dependency trace test was run. The separately run lookup and macro behavioral tests are not substituted for such evidence.

Browse crates anchors

139 anchors

Specification anchors and declared coverage
AnchorImplementationTests
crates (139)114 Implemented37 TODO2 N/A74 Implemented107 TODO
crates.sage_inspector (15)13 Implemented1 TODO2 N/A3 Implemented15 TODO
crates.sage_inspector.inspection (15)13 Implemented1 TODO2 N/A3 Implemented15 TODO
balanced_tracesImplementedTODO
canonical_ownershipImplementedImplementedTODO
derive_reflectionImplementedImplementedTODO
detail_free_indexImplementedTODO
deterministic_traceImplementedTODO
durable_navigationN/ATODO
generic_browserN/ATODO
owned_reflectionImplementedImplementedTODO
product_availabilityImplementedTODO
revision_and_demandImplementedTODO
semantic_phase_boundaryImplementedTODO
source_evidenceImplementedTODO
typed_serviceImplementedTODO
unknown_workImplementedTODOTODO
workspace_actorImplementedTODO
crates.sage_ir (90)67 Implemented34 TODO40 Implemented88 TODO
crates.sage_ir.checking (12)12 Implemented3 TODO5 Implemented12 TODO
crates.sage_ir.checking.body (5)5 Implemented2 TODO3 Implemented5 TODO
elaborationImplementedImplementedTODO
expected_typesImplementedTODOTODO
interface_dependenciesImplementedImplementedTODO
isolated_completionImplementedImplementedTODO
operator_callsImplementedTODOTODO
identity_mintingImplementedTODO
owned_productsImplementedImplementedTODO
crates.sage_ir.checking.signature (4)4 Implemented1 TODO1 Implemented4 TODO
body_independenceImplementedTODO
narrow_detailImplementedTODOTODO
owner_binderImplementedImplementedTODO
storageImplementedTODO
symbol_keyed_interfacesImplementedTODO
crates.sage_ir.crate (9)9 TODO9 TODO
explicit_restrictionsTODOTODO
identity_before_detailTODOTODO
incremental_evidenceTODOTODO
narrow_demandsTODOTODO
reexecution_and_invalidationTODOTODO
represented_completenessTODOTODO
restrictions_and_gapsTODOTODO
semantic_query_boundariesTODOTODO
terminal_incompletenessTODOTODO
crates.sage_ir.inference (8)8 Implemented6 Implemented8 TODO
atomic_checkingImplementedImplementedTODO
body_local_quiescenceImplementedImplementedTODO
canonical_boundaryImplementedImplementedTODO
completed_body_boundaryImplementedTODO
numeric_domainsImplementedImplementedTODO
subtyping_and_coercionImplementedImplementedTODO
terminal_obligationsImplementedTODO
transaction_isolationImplementedImplementedTODO
crates.sage_ir.metadata (4)4 Implemented1 TODO4 TODO
explicit_incompletenessImplementedTODO
keyed_reuseImplementedTODOTODO
product_boundariesImplementedTODO
provider_authorityImplementedTODO
crates.sage_ir.modules (8)7 Implemented1 TODO4 Implemented8 TODO
crates.sage_ir.modules.expand (4)4 Implemented2 Implemented4 TODO
completenessImplementedImplementedTODO
dependenciesImplementedTODO
direct_membersImplementedTODO
recursion_and_fixpointImplementedImplementedTODO
crates.sage_ir.modules.parse (4)3 Implemented1 TODO2 Implemented4 TODO
dependenciesImplementedTODO
detail_firewallImplementedImplementedTODO
recovery_completenessTODOTODO
syntax_identitiesImplementedImplementedTODO
crates.sage_ir.resolution (5)5 Implemented1 TODO3 Implemented4 TODO
crates.sage_ir.resolution.lookup (5)5 Implemented1 TODO3 Implemented4 TODO
completenessImplementedTODOImplementedTODO
dependenciesImplementedTODO
expansion_import_ambiguityImplementedImplemented
identity_onlyImplementedTODO
precedenceImplementedImplementedTODO
crates.sage_ir.solver (9)7 Implemented7 TODO5 Implemented9 TODO
alternative_isolationImplementedTODOImplementedTODO
bounded_completenessImplementedTODOTODO
candidate_completenessImplementedTODO
canonical_cyclesTODOTODO
canonical_outputsImplementedImplementedTODO
local_index_firewallTODOTODO
normalization_demandImplementedTODOImplementedTODO
schedule_independenceImplementedTODOImplementedTODO
shared_final_resultImplementedTODOImplementedTODO
crates.sage_ir.symbols (8)8 Implemented4 Implemented7 TODO
associated_identityImplementedImplemented
associated_interfacesImplementedTODO
body_interfacesImplementedImplementedTODO
definition_identityImplementedTODO
external_fact_queriesImplementedTODO
external_identityImplementedTODO
kind_wrappersImplementedImplementedTODO
local_identityImplementedImplementedTODO
crates.sage_ir.types (27)16 Implemented12 TODO13 Implemented27 TODO
crates.sage_ir.types.aliases (2)1 Implemented1 TODO1 Implemented2 TODO
identityImplementedImplementedTODO
revelationTODOTODO
crates.sage_ir.types.binder (1)1 Implemented1 TODO1 Implemented1 TODO
owner_parametersImplementedTODOImplementedTODO
crates.sage_ir.types.body (13)4 Implemented9 TODO3 Implemented13 TODO
awaitTODOTODO
closuresTODOTODO
conditional_patternsTODOTODO
coroutinesTODOTODO
diagnosed_recoveryImplementedImplementedTODO
elaboratedTODOImplementedTODO
for_iterationTODOTODO
indexingTODOTODO
macro_expansionTODOTODO
no_inferenceImplementedImplementedTODO
resolved_referencesImplementedTODO
try_residualTODOTODO
typed_provenanceImplementedTODO
crates.sage_ir.types.calls (2)1 Implemented1 TODO1 Implemented2 TODO
dispatch_familiesTODOTODO
selected_semanticsImplementedImplementedTODO
crates.sage_ir.types.lifetimes (2)2 Implemented2 Implemented2 TODO
dummyImplementedImplementedTODO
unchecked_borrowsImplementedImplementedTODO
crates.sage_ir.types.operators (2)2 Implemented1 Implemented2 TODO
lazy_control_flowImplementedTODO
trait_callsImplementedImplementedTODO
scoped_identitiesImplementedTODO
crates.sage_ir.types.spans (4)4 Implemented4 Implemented4 TODO
generated_identityImplementedImplementedTODO
item_originImplementedImplementedTODO
offset_reuseImplementedImplementedTODO
relative_compositionImplementedImplementedTODO
crates.sage_oracle_harness (4)4 Implemented2 TODO1 Implemented4 TODO
crates.sage_oracle_harness.crate (4)4 Implemented2 TODO1 Implemented4 TODO
deterministic_emissionImplementedTODO
exact_comparisonImplementedTODOImplementedTODO
fixed_projectionImplementedTODO
independent_coverageImplementedTODOTODO
crates.sage_stash (5)5 Implemented5 Implemented
crates.sage_stash.storage (5)5 Implemented5 Implemented
handle_ownershipImplementedImplemented
immutable_entriesImplementedImplemented
query_valueImplementedImplemented
rooted_equalityImplementedImplemented
typed_interningImplementedImplemented
crates.sage_test_harness (25)25 Implemented25 Implemented
crates.sage_test_harness.compile_tests (25)25 Implemented25 Implemented
annotation_validationImplementedImplemented
blessing_gateImplementedImplemented
callsite_updatesImplementedImplemented
checking_scopeImplementedImplemented
compiler_conditionsImplementedImplemented
completed_typesImplementedImplemented
coordinatesImplementedImplemented
dependenciesImplementedImplemented
diagnostic_countsImplementedImplemented
diagnostic_locationsImplementedImplemented
editionImplementedImplemented
fixturesImplementedImplemented
grouped_observationsImplementedImplemented
invocationImplementedImplemented
production_executionImplementedImplemented
project_isolationImplementedImplemented
query_captureImplementedImplemented
query_projectionImplementedImplemented
renderingImplementedImplemented
resolved_symbolsImplementedImplemented
review_visibilityImplementedImplemented
rustc_executionImplementedImplemented
rustc_lintsImplementedImplemented
starting_expressionsImplementedImplemented
target_lineImplementedImplemented