0091. Plugin kit conformance and name checks
- Status: Accepted (default; pending owner confirmation)
- Date: 2026-11-01
- Plan: M9.9 Step 9.0
- Relation: Builds on ADR-0074, ADR-0076 and ADR-0078
Context
Plugin manifests and editions establish discoverable plugins and curated dependencies. The plugin kit needs a repeatable way to scaffold and check plugins, verify generator behavior and run plugin-owned goldens. These defaults are adopted pending owner confirmation.
Decision
harness plugin check runs checks in this order and
exits 1 if any check fails: manifest; docs and index limits; name
check; fmt --check; gen --check;
harness.requires freshness; kind conformance;
plugin-local goldens; capability summary.
Plugin goldens live under
<plugin>/tests/<case>/. Each case
manifest uses { path = "../.." } and runs against
both the C and interpreter backends by re-executing
current_exe().
For every pub fn matching the generator signature,
conformance derives over an embedded set of target shapes in a
temporary project under .harness/. Each generator
must return ok or a clean err, never
trap (E0964) or hit a limit (E0965), produce byte-identical output
on two runs, pass gen --check, and contribute no
generator code to the binary.
Until a name registry exists, compare plugin names against
keywords, builtin_type,
builtin_function, reserved_type,
std, harness and edition members. Reject
exact matches and names at distance at most one when the name has
length at least four, after removing _ and mapping
0 to o and 1 to
l. An unmodified edition member is exempt. Real
squatting checks wait for M15.5. A rejected name reports
E0985.
The capability summary reports the declared ceiling and
capability types in public signatures. Generator plugins
additionally print
generator stage: no capabilities.
plugin new platform,
plugin new intrinsic, plugin new backend
and plugin new tool are unavailable until their
interfaces exist; each exits 2 and names the milestone or
register. E0986 identifies a failed conformance check; E0987
identifies a failed plugin golden or backend difference.
Alternatives
- Defer name checks until a registry exists. Instead, use the existing reserved-name sources and defer only real squatting checks to M15.5.
- Apply near-name checks to short names too. The length threshold avoids excessive false positives for short identifiers.
- Treat unavailable plugin kinds as ordinary errors. Exit 2 and a milestone or register reference make the unavailable interface actionable.
- Restrict plugin goldens to one backend. Running both backends detects behavior differences as part of the plugin's own conformance suite.
Consequences
Plugin checks have a stable order, actionable diagnostics and one command for metadata, formatting, generated output, behavior and capability visibility. Plugin authors can keep goldens with their plugin, while the two-backend run guards against backend divergence. The embedded shapes and conservative name-check rule provide deterministic checks without introducing a registry. These implementation defaults remain subject to owner confirmation; a change gets a superseding ADR.