integrated 14 into specs

This commit is contained in:
2026-03-24 13:42:18 +00:00
parent 1cacbd4f9a
commit 4b44674907
16 changed files with 2455 additions and 856 deletions
@@ -141,5 +141,3 @@ This workshop should produce:
- `docs/pbs/specs/13. Conformance Test Specification.md`
- `docs/pbs/specs/14. Name Resolution and Module Linking Specification.md`
- `docs/pbs/agendas/11. Diagnostics Agenda.md`
- `docs/pbs/agendas/14.4. Name Resolution Workshop 4 - Linking Phase Boundary.md`
@@ -114,5 +114,3 @@ Rationale:
- `docs/pbs/specs/12. IR and Lowering Specification.md`
- `docs/pbs/specs/15. Bytecode and PBX Mapping Specification.md`
- `docs/pbs/agendas/12. IR and Lowering Agenda.md`
- `docs/pbs/agendas/14.4. Name Resolution Workshop 4 - Linking Phase Boundary.md`
@@ -1,117 +0,0 @@
# PBS Name Resolution and Module Linking Agenda
Status: Active
## Purpose
Drive the closure of `14. Name Resolution and Module Linking Specification.md` so frontend implementation can proceed without inventing lookup or linking rules.
## Context
This is the main unresolved frontend-facing spec. The current skeleton still leaves open:
- exact lookup order across locals, top-level declarations, imports, builtin shells, and reserved surfaces,
- shadowing and duplicate rules by namespace,
- import alias and barrel-export matching behavior,
- cross-module callable and overload visibility,
- and the resolution model for builtin and host-backed stdlib shells.
Without this closure, parser and AST work can proceed only as exploratory implementation rather than normative frontend work.
## Decisions To Produce
1. Decide deterministic lookup order for every relevant namespace.
2. Decide shadowing, duplicate, and ambiguity rules for local, module, and imported names.
3. Decide import alias resolution and barrel matching rules in enough detail for implementation.
4. Decide the resolution model for builtin shells, builtin constants, intrinsic members, and host owners.
5. Decide which rejections belong to static semantics and which belong to a distinct linking phase.
## Core Questions
1. What is the exact lookup order in value position, type position, callable position, and host-owner position?
2. Do shadowing rules differ between locals, imports, top-level declarations, and builtin surfaces?
3. How are callable overload sets formed across local module declarations and imports?
4. When two imported modules make the same name visible, what is the exact ambiguity and rejection rule?
5. Are reserved stdlib shells resolved as ordinary visible declarations with metadata, or do they have any special priority?
## Proposed Workshop Sequence
### Workshop 1: Scope, Lookup, and Imports
Purpose:
- close module scope construction,
- close lookup order by namespace,
- and close import alias and ambiguity rules.
Reference:
- `docs/pbs/agendas/14.1. Name Resolution Workshop 1 - Scope, Lookup, and Imports.md`
### Workshop 2: Builtin Shells and Host Owners
Purpose:
- close how reserved stdlib shells enter resolution,
- and close lookup and collision policy for builtin types, builtin constants, intrinsic members, and host owners.
Expected decisions:
- reserved-shell visibility model,
- builtin and host-owner lookup interaction,
- and canonical identity versus local aliasing boundaries.
### Workshop 3: Callable Sets and Cross-Module Linking
Purpose:
- close overload-set formation across module boundaries,
- and decide ambiguity and rejection rules for imported callable sets.
Expected decisions:
- callable-set merge rules,
- barrel-matching consequences for imported overloads,
- and cross-module ambiguity failures.
### Workshop 4: Linking Phase Boundary
Purpose:
- decide which rules belong to static semantics versus a distinct linking phase.
Expected decisions:
- phase split or collapse,
- rejection ownership by phase,
- and inputs needed by `11`, `12`, and frontend conformance.
## Expected Spec Material
The resulting spec work should be able to add or close sections for:
- scope construction,
- namespace-specific lookup order,
- import and alias resolution,
- barrel export matching,
- overload-set visibility across modules,
- builtin and host-shell resolution,
- linking-phase versus static-phase rejection boundaries,
- and deterministic cross-module failure cases.
## Non-Goals
- Redefining grammar already fixed in core syntax.
- Designing runtime loader behavior.
- Freezing one symbol-table implementation.
- Designing IDE auto-import behavior.
## Inputs
- `docs/pbs/specs/3. Core Syntax Specification.md`
- `docs/pbs/specs/4. Static Semantics Specification.md`
- `docs/pbs/specs/5. Manifest, Stdlib, and SDK Resolution Specification.md`
- `docs/pbs/specs/6.1. Intrinsics and Builtin Types Specification.md`
- `docs/pbs/specs/8. Stdlib Environment Packaging and Loading Specification.md`
- `docs/pbs/specs/14. Name Resolution and Module Linking Specification.md`
- `docs/pbs/specs/18. Standard Library Surface Specification.md`
@@ -1,184 +0,0 @@
# PBS Name Resolution Workshop 1
Status: Active
## Purpose
Run the first focused discussion for `14. Name Resolution and Module Linking Specification.md` on the smallest set of decisions that unlocks normative frontend work:
- scope construction,
- namespace-specific lookup order,
- import visibility,
- and ambiguity rejection.
## Why This Slice First
This slice is the best first cut because it does not require full lowering closure, but it does unblock:
- parser and binder architecture,
- symbol-table modeling,
- deterministic frontend diagnostics,
- and the later discussion of overload visibility and reserved stdlib shells.
It should intentionally avoid trying to close every linking edge case in one meeting.
## Proposed Meeting Order
1. Confirm already-settled inputs that are not up for debate.
2. Close scope-construction rules inside one module.
3. Close lookup order by namespace.
4. Close import visibility and alias rules.
5. Close ambiguity and duplicate rejection rules.
6. Record deferred items for a second workshop.
## Already-Settled Inputs To Reconfirm
The meeting should start by explicitly reaffirming:
- `mod.barrel` is the single source of module visibility.
- Imports target modules, not files.
- Only `pub` names are importable from another module.
- PBS has distinct type, value, callable, and host-owner namespaces.
- Builtin simple types `int`, `float`, `bool`, and `str` are always present in type position.
- Reserved stdlib spaces resolve from the selected stdlib environment, not from ordinary dependencies.
These points already come from existing specs and should not be reopened in this workshop.
## Decisions To Produce
1. Scope construction inside a module.
2. Lookup order in value, type, callable, and host-owner position.
3. Import alias behavior and collisions.
4. Ambiguity rules when multiple imports expose the same visible name.
5. The phase boundary between syntax, static semantics, and linking for these failures.
## Candidate Decisions
### 1. Scope Construction Inside One Module
Candidate direction:
- File-local top-level declarations are collected first from all `.pbs` files in the module.
- `mod.barrel` is then applied as a visibility filter over the already-collected top-level declarations.
- Top-level declaration availability inside the same module does not depend on source-file order.
- Local block scopes nest normally over module scope.
Rationale:
- This matches the existing module model.
- It prevents file-order-dependent lookup.
- It keeps barrel as a visibility mechanism, not as the source of declaration existence.
### 2. Lookup Order By Namespace
Candidate direction:
Value position:
- nearest local bindings,
- parameters,
- visible `declare const`,
- visible imported values,
- service singleton values introduced by visible service declarations.
Type position:
- nearest type declarations visible in module scope,
- visible imported type declarations,
- builtin simple types.
Callable position:
- nearest callable declarations visible in module scope,
- then visible imported callable declarations,
- with overload sets formed after visibility filtering.
Host-owner position:
- visible host owners in module scope,
- then visible imported host owners.
Open point for discussion:
- whether builtin simple types should be treated as implicit outermost scope or as a final fallback outside ordinary visible declarations.
### 3. Import Alias Rules
Candidate direction:
- `import @project:mod;` imports the module itself as a module-qualified reference surface only if another spec later defines such a surface.
- For current v1 name resolution, named imports are the only source of imported visible names.
- `import { X } from ...;` introduces `X` in the matching namespace of the exported declaration.
- `import { X as Y } from ...;` introduces only `Y` locally.
- Alias spelling affects only the local visible name, never canonical builtin or host identity.
Rationale:
- Keeps current source behavior conservative.
- Avoids inventing module-as-value semantics accidentally.
- Matches the existing distinction between source-visible spelling and canonical metadata identity.
### 4. Collision And Ambiguity Rules
Candidate direction:
- Two local declarations in the same namespace that produce the same non-overload identity are duplicates.
- A local declaration and an imported declaration with the same visible name in the same namespace are a deterministic conflict unless one rule explicitly allows shadowing.
- Two imported declarations with the same visible name in the same namespace are a deterministic ambiguity unless they are the same declaration reached through the same canonical module resolution.
- Callable overload sets may merge only when their callable identities remain distinct after tuple-shape identity rules are applied.
- Non-callable namespaces do not merge by name.
Open point for discussion:
- whether local declarations should fully shadow imports in value, type, callable, and host-owner namespaces, or whether PBS should reject such shadowing to keep lookup simpler for beginners.
### 5. Diagnostic Phase Boundary
Candidate direction:
- malformed import syntax remains syntax-phase.
- unresolved module path remains manifest/import-resolution phase.
- import of non-exported symbol remains linking-phase or manifest/import-resolution-adjacent phase, but not syntax-phase.
- duplicate local declarations remain static-semantics phase.
- ambiguous visible names after import resolution remain linking-phase unless the project later collapses linking into static semantics explicitly.
Rationale:
- This preserves a clean split between parsing, declaration validity, and cross-module resolution.
- It gives `11. Diagnostics Specification.md` a concrete input rather than forcing that spec to invent phases in isolation.
## Questions To Resolve In The Room
1. Do local top-level declarations shadow imported names, or is any such collision rejected?
2. Are parameters and local `let` bindings one combined nearest-scope value layer, or should parameters be modeled separately for diagnostics only?
3. Can imported overloads and local overloads merge into one callable set, or must that be rejected?
4. Is `import @project:module;` currently just side-effect-free validation, or should it create any usable source-visible surface in v1?
5. Do builtin simple types behave like reserved final fallback names or like ordinary always-visible type declarations?
## Expected Outputs
This workshop should produce:
1. a decision record for scope and lookup order,
2. a decision record for import alias and ambiguity policy,
3. a concrete update plan for `14. Name Resolution and Module Linking Specification.md`,
4. and a list of deferred issues for Workshop 2.
## Explicit Deferrals For Workshop 2
The following topics should be deferred unless they become unavoidable:
- reserved stdlib shell priority versus ordinary imports,
- member lookup on builtin receivers,
- contract and method dispatch lookup details,
- barrel matching of callable overload sets across module boundaries,
- and whether linking is its own normative phase or is folded fully into static semantics.
## Inputs
- `docs/pbs/specs/3. Core Syntax Specification.md`
- `docs/pbs/specs/4. Static Semantics Specification.md`
- `docs/pbs/specs/5. Manifest, Stdlib, and SDK Resolution Specification.md`
- `docs/pbs/specs/14. Name Resolution and Module Linking Specification.md`
- `docs/pbs/specs/18. Standard Library Surface Specification.md`
- `docs/pbs/agendas/14. Name Resolution and Module Linking Agenda.md`
@@ -1,159 +0,0 @@
# PBS Name Resolution Workshop 2
Status: Active
## Purpose
Run the second focused discussion for `14. Name Resolution and Module Linking Specification.md` on reserved stdlib shells and host-owner resolution:
- builtin type shells,
- builtin constants,
- intrinsic member surfaces,
- and `declare host` owners imported from reserved stdlib modules.
## Why This Slice Second
This slice should come after Workshop 1 because it builds on already-closed rules for:
- module scope construction,
- ordinary import visibility,
- aliasing,
- and namespace-specific lookup order.
It also prepares the ground for later lowering by making the resolution contract explicit without prematurely defining artifact shape.
## Proposed Meeting Order
1. Reconfirm already-settled ownership and stdlib-loading rules.
2. Close the visibility model for builtin and host shells.
3. Close lookup behavior for builtin types, builtin constants, and host owners.
4. Close member resolution on builtin receivers.
5. Close collision and ambiguity rules involving reserved shells.
6. Record deferred callable-linking issues for Workshop 3.
## Already-Settled Inputs To Reconfirm
The meeting should explicitly reaffirm:
- reserved stdlib project spaces include `@core:*` and `@sdk:*`,
- reserved stdlib spaces resolve only from the selected stdlib environment,
- source-visible builtin names resolve through imported builtin shell declarations,
- builtin intrinsic members are not imported as free functions,
- canonical builtin and host identities come from metadata rather than local alias spelling,
- and host-owner namespace remains distinct from type, value, and callable namespaces.
These are already fixed elsewhere and should not be reopened here.
## Decisions To Produce
1. Visibility rules for builtin shells and host owners imported from reserved stdlib modules.
2. Lookup rules for builtin types, builtin constants, intrinsic members, and host owners.
3. Collision and ambiguity rules when reserved shells overlap with ordinary user-visible declarations.
4. Diagnostic ownership for reserved-shell resolution failures.
5. Deferred boundary between source resolution and later lowering.
## Candidate Decisions
### 1. Reserved Shells Enter Resolution As Ordinary Visible Declarations
Candidate direction:
- Imported builtin type shells become visible in the type namespace like other imported type declarations.
- Imported builtin constants become visible in the value namespace like other imported constants.
- Imported host owners become visible in the host-owner namespace like other imported host declarations.
- Reserved metadata changes canonical lowering identity, not the ordinary namespace they enter.
Rationale:
- This keeps the source model uniform.
- It avoids a hidden parallel lookup system just for reserved stdlib surfaces.
- It matches the current specs that describe shells as imported declarations with metadata.
### 2. Builtin Simple Types Remain Separate From Imported Builtin Shells
Candidate direction:
- `int`, `float`, `bool`, and `str` remain always-available builtin simple types.
- Imported builtin shells such as `Vec2` or `Color` are ordinary visible type declarations and do not share special priority with builtin simple types.
- User-authored declarations still cannot reuse builtin simple type names.
Rationale:
- Separates the small predeclared core from stdlib-delivered builtin shells.
- Prevents `@core:*` imports from acting like implicit language keywords.
### 3. Intrinsic Members Resolve Through Receiver Type, Never Through Free Lookup
Candidate direction:
- Builtin intrinsic methods are resolved only during member lookup on a builtin-typed receiver.
- They do not appear in top-level callable lookup.
- They do not become visible through named import by method name.
- Alias changes to the builtin type affect only source spelling of the owner type, not intrinsic canonical identity.
Rationale:
- This matches the existing builtin and intrinsics spec.
- It prevents accidental confusion between member semantics and free functions.
### 4. Collision Policy For Reserved Shells
Candidate direction:
- Namespace collisions are handled by the same visibility rules used for ordinary declarations.
- A user-visible imported builtin type colliding with another visible type name is a deterministic conflict unless an already-closed shadowing rule says otherwise.
- A host owner colliding with a type or value name is not a conflict by itself because host-owner namespace is distinct.
- Duplicate canonical builtin identities in one resolved environment remain rejection cases even if local aliases differ.
Open point for discussion:
- whether conflicts involving reserved shells should be rejected more aggressively than ordinary import conflicts to preserve beginner clarity.
### 5. Diagnostic Ownership
Candidate direction:
- failure to resolve the reserved module remains manifest/import-resolution phase,
- import of a non-exported builtin or host shell remains linking or resolution-phase rejection,
- member lookup failure on a builtin receiver remains static-semantics or linking-phase depending on the final phase model,
- duplicate canonical builtin or host identities in one resolved environment remain deterministic compile-time rejection.
Rationale:
- This keeps module loading, visibility, and member resolution separate.
- It gives `11` a concrete discussion input later.
## Questions To Resolve In The Room
1. Should reserved shells be completely ordinary imported declarations at source level, or do any of them need special lookup priority?
2. Can an ordinary user declaration shadow an imported builtin shell, or should that always be rejected?
3. Is member lookup on builtin receivers purely a type-driven operation after receiver typing, or does name resolution need a separate reserved-shell step?
4. Should `@sdk:*` be allowed to expose builtin shells, or should builtin shells remain policy-preferred under `@core:*` only?
5. Which failures around canonical builtin identity belong to resolution, static semantics, or environment validation?
## Expected Outputs
This workshop should produce:
1. a decision record for reserved-shell visibility and lookup,
2. a decision record for collision policy involving builtin and host shells,
3. a concrete update plan for the reserved-shell sections of `14`,
4. and a deferred list for cross-module callable-set discussion in Workshop 3.
## Explicit Deferrals For Workshop 3
The following topics should be deferred unless unavoidable:
- imported callable-set merging across modules,
- overload resolution across ordinary and reserved callable surfaces,
- contract dispatch lookup,
- and whether linking is fully distinct from static semantics.
## Inputs
- `docs/pbs/specs/5. Manifest, Stdlib, and SDK Resolution Specification.md`
- `docs/pbs/specs/6.1. Intrinsics and Builtin Types Specification.md`
- `docs/pbs/specs/14. Name Resolution and Module Linking Specification.md`
- `docs/pbs/specs/18. Standard Library Surface Specification.md`
- `docs/pbs/agendas/14. Name Resolution and Module Linking Agenda.md`
- `docs/pbs/agendas/14.1. Name Resolution Workshop 1 - Scope, Lookup, and Imports.md`
@@ -1,160 +0,0 @@
# PBS Name Resolution Workshop 3
Status: Active
## Purpose
Run the third focused discussion for `14. Name Resolution and Module Linking Specification.md` on callable visibility and cross-module linking:
- imported callable sets,
- overload-set formation across module boundaries,
- barrel matching consequences for imported overloads,
- and deterministic ambiguity rejection.
## Why This Slice Third
This slice should come after Workshops 1 and 2 because it depends on already-closed rules for:
- scope construction,
- namespace-specific lookup order,
- import aliasing,
- reserved-shell visibility,
- and ordinary collision handling.
It is also the last major source-facing step before deciding whether linking is a separate normative phase.
## Proposed Meeting Order
1. Reconfirm callable identity and barrel visibility rules that are already fixed.
2. Close how imported callable declarations become visible.
3. Close overload-set formation across local and imported declarations.
4. Close ambiguity and conflict rules for cross-module callable sets.
5. Close barrel-matching consequences for imported overload visibility.
6. Record phase-boundary questions for Workshop 4.
## Already-Settled Inputs To Reconfirm
The meeting should explicitly reaffirm:
- callable identity ignores parameter labels and output labels,
- overloaded functions differ by input/output tuple shape rather than parameter spelling,
- only `pub` callable entries are importable from another module,
- each exported overload must appear explicitly in `mod.barrel`,
- and `mod.barrel` matches callables by callable identity rather than by label spelling alone.
These points are already fixed and should not be reopened here.
## Decisions To Produce
1. Visibility rules for imported callable declarations and callable sets.
2. Merge or no-merge policy between local and imported overloads.
3. Ambiguity and rejection rules for callable sets visible from multiple modules.
4. Barrel consequences for callable visibility across modules.
5. Diagnostic ownership for callable-linking failures.
## Candidate Decisions
### 1. Imported Callables Enter Ordinary Callable Lookup
Candidate direction:
- `import { f } from @project:mod;` introduces the exported callable set named `f` into local callable lookup.
- If the source module exports multiple overloads of `f`, the imported surface initially brings in that visible overload set, not only one declaration.
- Alias spelling changes only the local visible callable name, not callable identity.
Rationale:
- This keeps imported callables aligned with existing callable namespace rules.
- It avoids inventing per-overload import syntax before it is needed.
### 2. Local And Imported Overloads Do Not Merge Implicitly
Candidate direction:
- A local callable set and an imported callable set with the same visible name do not silently merge.
- Such a collision is a deterministic ambiguity unless both sets resolve to the same canonical underlying declarations.
- Overload merging is allowed only within one declaration origin set already sanctioned by module visibility and barrel rules.
Rationale:
- Silent merging across modules makes beginner reasoning harder.
- It also makes diagnostics and compatibility more fragile.
- Rejecting cross-origin merges keeps overload sets traceable.
Open point for discussion:
- whether there is any narrow exception for identical re-exported declarations reached through more than one import path.
### 3. Cross-Module Callable Ambiguity Is Rejected Before Overload Resolution
Candidate direction:
- If two different imported modules make the same callable name visible locally, and they do not denote the same canonical declarations, the program is rejected before ordinary overload resolution.
- Overload resolution should not be used as a tie-breaker between different imported origin sets.
- Callable ambiguity is resolved structurally by import visibility, not opportunistically by the later callsite.
Rationale:
- This keeps lookup deterministic and simple.
- It avoids context-sensitive import ambiguity that changes across callsites.
### 4. Barrel Visibility Defines The Imported Callable Set Boundary
Candidate direction:
- Only overloads exported through the source module's `mod.barrel` are part of the importable callable set.
- Non-exported local overloads in the source module do not participate in imported callable visibility.
- A named import of `f` from another module is therefore a request for that module's exported `f` set, filtered by barrel visibility.
Rationale:
- This makes cross-module callable linking a direct consequence of barrel policy rather than an extra ad hoc rule.
### 5. Diagnostic Ownership
Candidate direction:
- duplicate callable declarations inside one module remain static-semantics rejection,
- failure of a barrel callable entry to resolve inside its own module remains a module-linking or static-semantics-adjacent rejection depending on the final phase split,
- cross-module callable-name ambiguity remains linking-phase rejection,
- and overload-resolution failure at a callsite remains static semantics rather than module linking.
Rationale:
- This preserves a useful distinction between visible-set formation and callsite selection.
## Questions To Resolve In The Room
1. Should local and imported callable sets ever merge automatically under the same name?
2. Should two imported callable sets with the same name be rejected immediately, or only when actually referenced?
3. If the same declaration becomes reachable through two import paths, should that still be rejected or canonicalized as one visible origin?
4. Is there any need for per-overload import control in v1, or is barrel-level export enough?
5. Where exactly is the line between callable-set formation and ordinary overload resolution?
## Expected Outputs
This workshop should produce:
1. a decision record for imported callable-set visibility,
2. a decision record for callable ambiguity and merge policy,
3. a concrete update plan for the callable-linking sections of `14`,
4. and a narrow carry-forward list for phase-boundary cleanup in Workshop 4.
## Explicit Deferrals For Workshop 4
The following topics should be deferred unless unavoidable:
- whether linking is a formally distinct phase or folded into static semantics,
- diagnostic naming and code stability,
- source-to-artifact mapping concerns,
- and backend consequences of callable linking.
## Inputs
- `docs/pbs/specs/3. Core Syntax Specification.md`
- `docs/pbs/specs/4. Static Semantics Specification.md`
- `docs/pbs/specs/14. Name Resolution and Module Linking Specification.md`
- `docs/pbs/agendas/14. Name Resolution and Module Linking Agenda.md`
- `docs/pbs/agendas/14.1. Name Resolution Workshop 1 - Scope, Lookup, and Imports.md`
- `docs/pbs/agendas/14.2. Name Resolution Workshop 2 - Builtin Shells and Host Owners.md`
@@ -1,144 +0,0 @@
# PBS Name Resolution Workshop 4
Status: Active
## Purpose
Run the fourth focused discussion for `14. Name Resolution and Module Linking Specification.md` on phase ownership:
- what belongs to syntax,
- what belongs to static semantics,
- what belongs to module/linking,
- and whether PBS keeps linking as a distinct normative phase at all.
## Why This Slice Last
This slice should come last because it is mostly a boundary-setting exercise over decisions already made in Workshops 1 through 3.
Trying to close it earlier would force abstract phase arguments before the actual failure classes were concrete.
## Proposed Meeting Order
1. Reconfirm the concrete failure categories identified in earlier workshops.
2. Group those failures by source-only, module-resolution, and cross-module visibility concerns.
3. Decide whether PBS names linking as a distinct normative phase.
4. Decide how this boundary feeds diagnostics, conformance, and frontend implementation claims.
5. Record any residual editorial cleanup for the spec integration pass.
## Failure Classes To Sort
This workshop should explicitly sort at least the following classes:
- malformed import syntax,
- unresolved module path,
- import of non-exported symbol,
- duplicate local declarations,
- ambiguous imported names,
- callable-set ambiguity across modules,
- builtin-receiver member lookup failure,
- duplicate canonical builtin or host identities in one resolved environment,
- and barrel entries that fail to resolve against module declarations.
## Decisions To Produce
1. Whether linking is a distinct normative phase in PBS v1.
2. Ownership of the major failure classes already identified.
3. The minimum phase vocabulary needed by diagnostics and conformance.
4. The frontend implementation consequences of the chosen phase model.
## Candidate Decisions
### 1. Keep Linking As A Distinct Normative Phase
Candidate direction:
- syntax owns grammar and token-shape failures,
- static semantics owns declaration validity, typing, and callsite selection,
- linking owns cross-file and cross-module visible-set formation and barrel/import matching.
Rationale:
- This gives a clean home to failures that are neither purely syntactic nor ordinary local typing.
- It matches the practical compiler architecture implied by module loading and barrel visibility.
- It gives `11` and `13` a usable phase vocabulary.
Alternative to discuss:
- collapse linking into static semantics and treat "linking" only as an implementation detail.
### 2. Module-Visibility And Import Failures Belong To Linking
Candidate direction:
- unresolved exported-name lookup after the target module is loaded belongs to linking,
- ambiguous imported visible names belong to linking,
- callable-set ambiguity across modules belongs to linking,
- and unresolved barrel entries belong to linking or module-linking rather than to syntax.
Rationale:
- These failures arise from assembling visible declarations across files or modules, not from parsing isolated declarations.
### 3. Callsite Selection Remains Static Semantics
Candidate direction:
- once visible callable sets are formed, overload resolution at a callsite remains static semantics,
- member lookup driven by the known receiver type also remains static semantics unless it fails earlier due to unresolved imported shell visibility.
Rationale:
- This keeps typing and callable selection together.
- It prevents linking from becoming a catch-all bucket for any failure that mentions imports.
### 4. Diagnostics And Conformance Need Only A Small Stable Vocabulary
Candidate direction:
- the minimum normative phase vocabulary is:
syntax,
static semantics,
manifest/import resolution,
linking,
and host-binding/capability admission.
- tools may subdivide internally, but they should map back to that stable external vocabulary.
Rationale:
- This is enough for source-facing determinism without overfitting to one compiler pipeline.
## Questions To Resolve In The Room
1. Is there real value in naming linking as its own normative phase, or does that add conceptual weight without enough payoff?
2. Should unresolved barrel entries be considered module-internal static invalidity or linking invalidity?
3. Should builtin-receiver member lookup failure always stay in static semantics once receiver type is known?
4. Do diagnostics and conformance need the word `linking`, or only a broader `resolution` bucket?
5. Does the chosen phase model help or hinder future lowering and verifier specs?
## Expected Outputs
This workshop should produce:
1. a decision record for the PBS phase model around name resolution and linking,
2. a sorted matrix of failure classes by phase,
3. a concrete update plan for `14`,
4. and explicit follow-ups for `11` and `13`.
## Explicit Deferrals
The following topics should be deferred unless unavoidable:
- detailed diagnostic code design,
- artifact-level failure surfacing,
- verifier and loader phase internals,
- and optimizer or backend pipeline naming.
## Inputs
- `docs/pbs/specs/11. Diagnostics Specification.md`
- `docs/pbs/specs/13. Conformance Test Specification.md`
- `docs/pbs/specs/14. Name Resolution and Module Linking Specification.md`
- `docs/pbs/agendas/14. Name Resolution and Module Linking Agenda.md`
- `docs/pbs/agendas/14.1. Name Resolution Workshop 1 - Scope, Lookup, and Imports.md`
- `docs/pbs/agendas/14.2. Name Resolution Workshop 2 - Builtin Shells and Host Owners.md`
- `docs/pbs/agendas/14.3. Name Resolution Workshop 3 - Callable Sets and Cross-Module Linking.md`