ADR 0004: The static harness registry is authoritative at runtime
The engine resolves every adapter from a static registry; scanning the harnesses folder is only a test that the registry and the folder agree.
- Status: Accepted
- Date: 2026-07-07 (in force in the first release in this repository's history)
Context
Apothem has one adapter subpackage per supported harness under
src/apothem/harnesses/. The engine needs the list of adapters every time it
runs, including from a plain checkout with no package installed. A list found
by scanning folders at runtime changes whenever a folder is added, renamed or
left half-written, so an adapter could appear or vanish without anyone
deciding it should.
Decision
The harness registry, src/apothem/lib/harness_registry.py with its data table
in src/apothem/lib/harness_registry_data.py, is authoritative at runtime. The
engine resolves every adapter from this static registry.
Discovery by folder convention (discover_adapters) is not used to resolve
adapters. It is a parity check: a test asserts that the adapters found under
src/apothem/harnesses/ are exactly the ones in the registry.
Consequences
- The engine loads the same adapters from a checkout, a wheel or a plugin copy.
- Adding a harness means adding both its subpackage and its registry entry. An adapter that follows the folder convention but is missing from the registry fails the parity test instead of being picked up silently.
Where it is enforced
tests/unit/test_adapter_discovery.py, the parity test between discovery and the registry.tests/unit/test_harness_registry.py, which checks the registry's entries, and the registry-capability-consistency validator, which checks each registry capability cell against an install entry in the propagation manifest, the adapter's materializer, or a documented projection.- The Harness Adapter Pattern section of
AGENTS.mdandCLAUDE.md. - The harness registry reference.
Sources
- The Harness Adapter Pattern section of
AGENTS.mdandsrc/apothem/lib/harness_registry.py, both present in the first release commit (2026-07-07).
ADR 0003: AGENTS.md is the canonical instruction file
The repository's instruction files mirror one another's shared claims, AGENTS.md wins any conflict, and a validator checks that they agree.
ADR 0005: Files with no native home install under an Apothem-owned support folder
Adapters use each harness's documented native surface, and anything without one lands under .apothem/support/ inside the harness's configuration folder.