On this page

0088. Plugin manifests, docs and index

Context

Packages and manifests (ADR-0070) establish package identity and dependency metadata, while generators already provide a first plugin mechanism. The M9.7 discovery-index review calls for concise plugin descriptions that can be shown to an agent, with fuller guidance available when relevant. The design defaults below are adopted pending the maintainer's confirmation.

Decision

A plugin is a package with an optional [plugin] table in harness.toml. The table declares a kind (generator or library) and a short index description. Plugin documentation lives at the fixed path DOCS.md beside the manifest; no manifest path field is needed. Packages without [plugin] remain ordinary packages.

DOCS.md is limited to 1,500 estimated tokens and declares that budget with <!-- token-budget: 1500 -->. An index description is a single line beginning with <name>: and is limited to 40 estimated tokens, the hard limit for the target of about 30. A Rust copy of the estimate function in scripts/spec-budget.py (word and character counts, Python's ties-to-even rounding) lets plugin check run outside this repository; both implementations check the shared tests/token-estimates.tsv cases.

Provide separate read-only commands: harness plugins index [dir] prints installed plugin index lines sorted by name, and harness plugins docs <file.hn> prints the docs for plugins imported by the root package's modules, sorted and headed by plugin name and version. Installed means packages in the root dependency graph plus edition members; generator-only imports count. Transitive plugins are not included. harness plugin new and harness plugin check remain the plugin kit commands and write only their specified scaffold or temporary-check output.

When M9.7 updates the language reference, move the specified duplicate and #line statements out of LANGUAGE.md and add concise command references via diagnostics.md#plugins, for a net reduction of 13 characters. This preserves the 6,000-token spec budget with no headroom.

Alternatives

Consequences

Existing manifests remain valid and plugin metadata does not change package identity. The index is compact and deterministic; full docs are available on demand for imported plugins. Token-count parity is tested against shared cases. Implementation proceeds on these defaults; if the owner changes one, a superseding ADR records it.