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.
P6.18: a uses-imported type’s own combined visible types (one level,
matching combined_types_for’s identical shape) — the narrow resolution
scope a signature-lowering pass needs for that unit’s own attached
methods. Reimplemented against UnitInfo rather than calling
combined_types_for directly: that function takes the flat, project-wide
unit_tables/unit_uses maps a per-unit emission prologue doesn’t thread
this deep (only the coarser, already-merged unit_info reaches there) —
rebuilding those two maps from unit_info on every call would be needless
O(units) cloning for a per-unit prologue already called once per emitted
unit.
P6.x (#1137): one context’s own cron expressions (on cron "expr") and
queue names (from queue("name")), sorted and deduped — the two wrangler.toml
binding lists a context’s own compose entry needs. v0.44: one queue binding
per service, on the from queue(...) header.
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).
Events track, slice 0 (spine #936): project-wide “who subscribes to what”
— for every service ... from Events(E) { on event ... } anywhere in the
project, resolve E to its owning context (the one whose events table
actually declares it — bare-name resolution, since TypeRef has no dotted
form) and group subscribers under (owning_context, event_type_name). No
prior art to reuse: cross-context wiring elsewhere is driven by an
explicit author-written consumes clause, resolved eagerly in
phase_resolve_consumes; this is the first wiring driven by an implicit
relationship (a bare event-type name shared between a publisher’s event
declaration and a subscriber’s from Events(E) header) — the same
ownership resolution build_cross_context_info’s own consumed_event_names
performs above, for the same reason (#936, events track slice 0).
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.