ADR 007: Shipped Profiles and Archive Adapters Are Plugin Packages¶
Date: 261201 Status: Accepted (261201), amended 261201 (adapter declarations stay in the core); steps 1 and 2 implemented, steps 3 and 4 open Context: Issue #482
Decision¶
pip install metaseed installs the core and nothing domain-specific: no profiles, no examples, no archive adapters. Profiles and adapters are separate distributions that register through the existing entry point group metaseed.plugins (see Integration Adapters), exactly as a third-party plugin does. Each is installed by an extra of the same name.
| Distribution | Contains | Extra |
|---|---|---|
metaseed |
Engine (spec loader, model factory, validators, term sources), MetaseedClient, CLI, MCP server, spec builder, local web UI (extra ui), LinkML converter, DCAT writer (extra dcat), ISA-Tab writer, hub client (extra hub) |
— |
metaseed-profiles |
The standards no adapter owns: MIAPPE, ISA, Darwin Core, DiSSCo, REMBI, Health-RI core, with their examples | metaseed[profiles] |
metaseed-ena |
The ena profile and example, the ENA importer and SRA XML exporter |
metaseed[ena] |
metaseed-pride |
The pride profiles and examples, the PRIDE importer and submission.px + SDRF exporter |
metaseed[pride] |
metaseed-metabolights |
The metabolights profile and example, the MetaboLights importer and ISA-Tab + MAF exporter |
metaseed[metabolights] |
metaseed-brapi |
The BrAPI importer and exporter; depends on metaseed-profiles, because it fills the MIAPPE profile |
metaseed[brapi] |
metaseed-seek |
The seek and seek-ready-template profiles and examples, SEEK provisioning, sync and export |
metaseed[seek] |
metaseed[all] installs every distribution above. An archive's profile travels with its adapter because the two change together: a mapper reads and writes the profile's field names, and a profile change that breaks the mapper is caught by the same package's tests.
DCAT and ISA-Tab stay in the core. Neither describes one archive: DCAT describes any dataset (the local UI, the CLI and the hub's public records use it, and every importer records its origin through it), and ISA-Tab is a file format the ISA and MetaboLights profiles share.
Context¶
Today every profile and every adapter ships inside the metaseed wheel. The extras only add the adapters' network and parsing dependencies; the code and 1.9 MB of specs and examples are always installed. A deployment that uses one profile, as plan07 does, carries all seventeen profile versions, and a profile cannot be released without releasing the engine.
The plugin mechanism needed for the split exists: a Plugin can contribute adapters, a specs_dir and an examples_dir, and SpecLoader, the example lookup and the action registry already read all plugins through one list. What does not exist yet is a core that works with none of them installed.
Coupling measured on 261201, by which modules outside an adapter package import it:
| Package | Imported from outside by |
|---|---|
metaseed.ena, metaseed.pride, metaseed.brapi |
only the registry in metaseed.adapters |
metaseed.metabolights |
only the registry |
metaseed.isatab |
metaseed.metabolights |
metaseed.dcat |
the CLI dcat command, the local UI's DCAT route, the ENA, PRIDE and MetaboLights importers; metaseed-hub's public records and release routes |
metaseed.seek |
metaseed.specs.schema (the seek entity key validates its role against metaseed.seek.roles), the spec builder's entity form, the local UI's SEEK routes, the CLI seek command; metaseed-hub's SEEK routes and spec builder |
Order of work¶
Each step is released on its own and leaves every install working.
- Packaging. Make the repository a uv workspace with one directory per distribution under
packages/. All distributions release together from onev*tag with one version number, and each plugin requiresmetaseedat exactly that version; this avoids a compatibility matrix until there is a reason for independent versions. Move the standards intometaseed-profilesand add theprofilesextra. - ENA, PRIDE, MetaboLights, BrAPI. Move each package with its profile, example and tests. Their declarations stay in
metaseed.adapters(see Amendment). - SEEK. First give the core the extension points SEEK needs: the vocabulary of the schema's
seekkeys moves intometaseed.specs.schema, which owns those keys, and a plugin gains a way to contribute web routes and CLI commands to the local UI and the CLI. Then move the package. This step has the most unknowns and is designed in its own change. - MIxS, imported from LinkML, ships in
metaseed-profiles.
Amendment: first-party adapters stay declared in the core¶
Decided 261201. The AdapterInfo declarations of the adapters published from this repository (name, description, extra, configuration fields, actions with their lazy "module:function" refs) stay in metaseed.adapters.ADAPTERS; the distribution ships the code, the profile and the example. Each declaration's requires names the distribution's package (for example metaseed.ena), so an adapter whose distribution is not installed is listed as unavailable with the extra that installs it, on the Plugins page, by metaseed plugin list and in the MCP import tool, as before the split. Moving the declarations into the plugins would have removed uninstalled adapters from those lists. The declarations are data: the core still imports no plugin, and a third-party plugin still declares its adapters in its own Plugin.
Mechanism¶
- The repository is a uv workspace.
metaseedstays at the root; each plugin distribution is a member underpackages/<distribution>/, with its package undersrc/<package>/and its tests undertests/.metaseed-profilesis the packagemetaseed_profiles; its profiles are undersrc/metaseed_profiles/specs/and its examples undersrc/metaseed_profiles/examples/, laid out as the core's. - Every distribution takes its version from the same
v*tag through hatch-vcs. A plugin's dependency onmetaseedis set at build time by a hatch metadata hook (packages/<distribution>/hatch_build.py) tometaseed==<its own version>, so the pin needs no edit per release and the lockfile does not change with each commit. - The core's extra names the plugin with a range,
metaseed-profiles>=0.77,<1, whose lower bound admits the development builds (0.77.2.devN) the fresh-install smoke installs before the first release. The exact pin on the plugin side is what keeps the two in step: a resolver can only pairmetaseed0.80 withmetaseed-profiles0.80. - A distribution with profiles declares itself under the entry point group
metaseed.plugins, named after its extra, with aPlugincarrying itsspecs_dirandexamples_dir.metaseed-brapipublishes no profile and declares no entry point. - An adapter distribution keeps its import path:
metaseed-enainstallsmetaseed/ena/, with its profile and example undermetaseed/ena/specs/andmetaseed/ena/examples/, and itsPlugininmetaseed.ena.plugin. In a wheel install the files land in the onemetaseeddirectory; in the editable workspace install each distribution'ssrc/is a separate path entry, andmetaseed/__init__.pyextends the package's__path__over them (pkgutil.extend_path). A plugin's portion ofmetaseed/has no__init__.py. - Every plugin's
hatch_build.pyis the same file, kept identical by a test; its configuration in[tool.hatch.metadata.hooks.custom]lists the distributions pinned to the release version (pinned) and the other dependencies (dependencies, bounded). - A plugin's tests live in
packages/<distribution>/tests/test_<name>/and run in the one suite (testpaths); the shared fixtures are in the repository's rootconftest.py. - The release workflow builds every distribution (
uv build --all-packages), runs the gates below against the built wheels, and publishes them together.metaseedandmetaseed-profilesare published from the GitHub environmentpypi; each adapter distribution from its own environment,pypi-<name>, in a job of its own. PyPI accepts only one pending trusted publisher per repository, workflow and environment, so distributions that do not exist on PyPI yet cannot share one; and only three pending publishers per account at once. A new distribution therefore needs its environment and a pending publisher before the release that first publishes it; where more than three are new, the release publishes the first three, the rest are registered once those exist, and their failed jobs are re-run from the same workflow run.
Gates¶
- An import-scanning test fails when a module in
metaseedimports a plugin distribution's package, at module level, in a function body or underTYPE_CHECKING, as the gate of ADR 004 does for the web app. - The release workflow installs the built
metaseedwheel alone into a clean environment with a fresh resolution and checks that it imports, thatmetaseed --helpandmetaseed profile listrun, that the profile list is empty, and thatmetaseed.miappe()raises an error namingmetaseed[profiles]. - The same workflow installs
metaseed[all]from the built wheels and checks that every profile listed in the docs loads. - A test fails when an extra named in the API contract has no distribution behind it, or a distribution under
packages/has no extra.
Consequences¶
- A bare install lists no profiles.
miappe(),isa(),ena()and every lookup of a missing profile raiseProfileNotFoundErrornaming the distribution and extra that provide it. The CLI, the MCP server and the local web UI say the same where they list profiles. - metaseed-hub depends on
metaseed[all]and stays unchanged in what it offers. - Code that imports
metaseed.ena,metaseed.pride,metaseed.metabolights,metaseed.brapiormetaseed.seekkeeps working: the distributions keep those import paths. A user upgrading with a plainpip install -U metaseedloses the profiles until they add the extra; the changelog of the first release says so. - The core test suite runs with the workspace installed, so tests that load shipped profiles keep working; each plugin's tests live with the plugin.
- A profile can be fixed and released with the engine unchanged, though while versions are shared the release still carries every distribution.
Considered Alternatives¶
One metaseed-profiles distribution for every profile, adapters left in the core¶
Smaller change. Rejected because the ENA, PRIDE and MetaboLights mappers are written against their profiles' field names; splitting the profile from its adapter puts the two halves of one contract in different packages with different tests.
Independent versions per distribution¶
Deferred. It lets a profile release without the others, at the cost of a compatibility range per plugin and a test matrix over them. Shared versions can be relaxed later without breaking anyone; the reverse cannot.
Separate repositories¶
Rejected for now. A change that touches the engine and a profile, such as the taxon fields of 261201, would need coordinated pull requests and releases in two repositories.