Locale capability track, slice 2 (#882): the message bundle a context’s
Locale.current() negotiates against, auto-detected from the context’s
directuses (one level, not transitive — see combined_types_for
just above, the precedent for this rule). None/One/Many drive three
different behaviours: unchanged fixed-default Locale, real negotiation
wiring, or (when the context also consumes Locale)
bynk.messages.multiple_message_bundles — see check_locale_bundle_ambiguity
(bynk-emit/src/project/validate.rs) and the per-Worker composition loop
(bynk-emit/src/project.rs).
v0.25 (ADR 0053): walk every parsed file’s top-level declarations into
the def table (synthetic first-party units and test files excluded —
neither declares user-editable symbols), then qualify and attach the
recorded edges. Methods register as owners only (attribution), not as
symbols — they are deferred along with fields and op names.
Build the resolver::CrossContextInfo for a given consuming context.
Used by both the resolver/checker (per-file processing) and the emitter
(composition root + boundary casts).
Tree-relative, deliberately. This is an emit structure, not an index:
record_name_ref compares these paths against ctx.source_path
(emitter.rs), which is the file’s include-root-relative path. Keying it
by identity_path (ADR 0198) makes path != &ctx.source_path always true
for a split project, so a name declared in the same file is emitted as a
sibling import of itself — the module then cannot load, and a workers
runtime test hangs rather than fails. See ADR 0201 (E).
#696: each table-construction diagnostic is attributed to the project-relative
identity_path of the file whose item produced it. Every error-producing loop
below iterates for &i in indices, so it shadows a local errors vec and
drains it into out, tagged with parsed[i].identity_path(), at the end of each
file’s pass — leaving the many inner errors.push(…) sites untouched.
Build the combined type table for unit: its own types merged with the
types of every commons it uses. Used by cross-context resolution so we
can resolve a consumed context’s service signatures against that context’s
own view of types (v0.6 §4.5).
v0.177 (#643): the callee’s own type namespace — its local declarations plus
the commons types it uses.
Walks ctx’s own direct uses list for commons declaring a messages
bundle with exactly one @reference block (a bundle missing or
duplicating its own reference is already diagnosed by
check_messages_bundles — this function simply doesn’t count it as
“found”, rather than compounding an already-reported error).
v0.15: validate one given capability reference. A bare reference must name
a capability declared in this context; a cross-context reference (given B.Cap) must name a capability the consumed context exports. Returns the
local CapabilityInfo to add to the in-scope map for bare references;
cross-context references return None (their calls are type-checked via
consumed_capabilities at the call site) but are still validated here.
v0.25: record a clause-position capability reference (provides Cap,
bare given Cap), qualifying a flattened bare name to its providing
unit. The span is the name segment only.
v0.35 (ADR 0068): the Cap of a provides Cap = Provider clause — a
capability reference and an implementation edge (the ambient owner is the
provider). Flagged so assembly can tell it apart from the provider’s own
given deps, which are capability refs owned by the same provider.