0077. Package-level coherence reporting
- Status: Accepted
- Date: 2026-10-31
- Plan: M9.4 Step 2
- Review: Making Tenon plugin-first
Context
Global interface coherence permits bridge packages because Harness checks a whole loaded program (ADR-0027). Package-qualified identities and logical source names distinguish dependencies without making diagnostics depend on checkout paths (ADR-0069, ADR-0071). When one exact interface/type pair has implementations in different packages, E0650 must identify both owners and provide stable, actionable locations.
Decision
Extend ADR-0027's cross-file E0650 reporting to package-level conflicts:
- Render interface and type identities as dotted names, e.g.
traits.lib.Areaandshapes.lib.Square, never internal::names. - Identify each implementation by package and version, followed
by its logical source location. Render the root as
root package `app` 1.0.0; dependencies usepackage `left` 0.1.0and locations such as[email protected]/lib.hn:4:1. - Order locations root first, then by package name, independent of the current working directory. Within one package, retain the existing deterministic source-location ordering.
- Help text is exactly
keep one implementation, in one package. - Apply the package wording only when implementations belong to different packages. Same-package conflicts retain existing wording and behavior.
- Coherence remains global over loaded modules. There is no orphan rule; importing another module can reveal a conflict. No E0960 is introduced: E0939 already diagnoses two versions of the same package name.
Alternatives considered
- Keep file-only locations for every conflict — leaves package ownership implicit and makes dependency versions difficult to distinguish.
- Report only conflicts in imported or visible interfaces — makes coherence depend on lexical scope and can allow a graph to change validity with an unrelated import; it contradicts whole-program coherence.
- Add E0960 for duplicate package versions — duplicates the existing E0939 package-version diagnostic and consumes a code without new semantics.
- Use absolute paths or internal
::names — leaks checkout-specific paths or compiler identity syntax into user-facing diagnostics.
Consequences
Conflict diagnostics identify package ownership and version reproducibly while preserving same-package diagnostics. The loaded graph remains the coherence boundary, so newly loaded modules may expose conflicts. This implements the design review's whole-program coherence and bridge-plugin decision (design review).