Litany.NamingCanonical names and their resolution to declaration UIDs.
Identity, not spelling: semantic matching in Litany compares the declaration Shape.Uid.t a use site carries against the UID a canonical name denotes. This module owns the three pieces of that story: the name grammar (Name), resolution of a name to the UIDs use sites actually carry (Resolver), and the per-unit identity view matching consults (Scope).
Resolution is signature walking over .cmi files, each mechanism verified against compiled fixtures: read the defining compilation unit's cmi_sign and walk items by name — Sig_value yields val_uid (Sig_type yields type_uid in the type namespace); Sig_module descends Mty_signature, hops Mty_alias to its target (the aliased unit's cmi when the head is a persistent unit, the enclosing signature for a local alias), expands Mty_ident via Sig_modtype, and descends Mty_functor results for functor-body names. External use sites carry exactly the UID stored in the defining unit's cmi, with or without an .mli, so the walk cannot disagree with them. No Env, no Load_path, no compiler-libs global state is touched, and only .cmi files — which installed dependencies always have — are read.
Documented limits of the matching relation (verified against compiled fixtures): a module ascription (module M : S = List) mints fresh UIDs — M.length and List.length are distinct identities, each nameable, neither matching the other; all instances of a functor application share the functor body's interface UIDs, so a canonical name into a functor body matches every instance; a functor parameter typed module type of M receives M's signature with M's declaration UIDs, so uses of the parameter match canonical names into M for every instantiation (an explicitly written parameter signature mints parameter-local UIDs and stays distinct); values not exported through an .mli are unreachable by canonical name.
module Name : sig ... endCanonical names.
module Module_path : sig ... endModule paths — the module-shaped complement of Name.
module Ref : sig ... endReferences — the union of the two identity grammars.
module Resolver : sig ... endPer-run name resolution.
module Scope : sig ... endThe identity view one unit is matched under.