ADR 0008 — Retire the test pillar (autonomous test synthesis)¶
- Status: accepted
- Date: 2026-10-26
- Spec: none — a removal. The loop it retires shipped as Pillar A of specs/018-autonomous-framework (G2) and its review surfaces as BL-20260511-03 and BL-20260511-17.
- Constitution clauses amended: §12 Autonomy Loop Invariants — invariant I5 retired
- Supersedes / Superseded by: amends ADR 0003. Pillar A is removed; Pillar B (corpus growth), the digest and the LSAT content pillars stand as decided there.
Context¶
Spec 018 gave the autonomy loop two pillars. Pillar B grows the product: TopicFrontier walks the knowledge graph and dispatches known sources through the ingestion quarantine. Pillar A grew the repository: TestSynthesizer read coverage.xml from make test-coverage, asked a model for pytest skeletons for the five thinnest-tested modules, and wrote them to backend/tests/autonomy/proposed/ as *.proposed.py, skip-decorated, for a human to promote. Around it grew a product surface — GET /api/agents/proposed-tests, the ProposedTestReview queue on Agent Ops, the "lowest-coverage modules" panel on /autonomy — a nightly Celery beat entry, and a nightly workflow step that put the proposals on a draft PR.
On 2026-10-25 the development harness left this repository: the spec-driven loop, its gates, the weekly evolve audit and the GitFactory lines moved to the bamr87 fleet hub and are consumed by reference (docs/spec-driven.md). The test pillar is the same kind of thing — code whose subject is this codebase rather than the law — but it was wired into the product: a Django view listing a directory of the repo's own test files, a React component on the operator dashboard, a beat entry in the worker, and a constitution invariant (§12 I5) about how it writes. A lawyer or a student never needs any of it, and an operator who does is operating the repository, not the platform.
The hub already owns the replacement. Its weekly repo-evolution.yml loop opens draft improvement PRs in each opted-in repo's own upstream, and its issue pipeline turns a filed gap into a mergeable PR; a coverage signal in the evolution brief is a small follow-up there. Neither needs a CrewAI crew, an Ollama call or an API endpoint inside Law AI.
Decision¶
- Remove Pillar A end to end: the
TestSynthesizercrew and its prompt, thetest_pillarcycle kind, theautonomy-nightly-testsbeat entry,law_ai.eval.coverage_audit,GET /api/agents/proposed-tests,GET /api/agents/autonomy/lowest-coverage,backend/tests/autonomy/proposed/, theProposedTestReviewcomponent, the lowest-coverage panel, and the nightly workflow's synthesis step and "proposed tests" draft-PR half.run_autonomyandautonomy_cycledefault todigest, the one kind that is safe without a source. - Retire constitution §12 I5 rather than delete it: the clause records that any future test synthesis returns under the same propose-only rule.
- Keep everything the product uses: the
/autonomypanels for LegalBench history, recent cycles and the quarantine queue; the review queue; Pillar B; the digest; the LSAT content pillars. The LegalBench harness stays — it measures the product's reasoning, not the repo's coverage. - Where coverage goes now:
make test-coverageand CI's backend coverage floor (--cov-fail-under=75) remain the gate. Proposing tests for thin modules is the hub's evolution loop (opt in withauto_evolve: truein the fleet registry); feeding it the coverage report is tracked inBACKLOG.md.
Consequences¶
- The Agent Ops page loses the proposed-test queue and
/autonomydrops from four panels to three.AutonomyRunrows withkind = "test_pillar"remain readable history; no migration. GET /api/agents/proposed-testsandGET /api/agents/autonomy/lowest-coveragereturn 404. The API contract fixture (frontend/__tests__/fixtures/api-schema.json) is regenerated in the same change.- The nightly draft PR carries only the discovery audit's
BACKLOG.mdentries. AUTONOMY_ENABLEDand the other §12 invariants are untouched; nothing about ingestion, HITL or provenance changes.- Autonomy Level stays 2 (§10).
Alternatives Considered¶
- Keep the pillar, hide the UI. Rejected: the view, the beat entry and the proposals directory would still be product code whose subject is the repository, and a hidden surface is the one nobody maintains.
- Port
TestSynthesizerinto the hub kit. Rejected: it is a Django management-command runner over a CrewAI/Ollama call with a Law AI-specific coverage path. The hub's evolution loop is already a generic "improve the repo" agent with a brief; a coverage line in the brief is the right size. - Keep only the lowest-coverage panel as a read-only operator view. Rejected: it exists to point the pillar at its targets; without the pillar it is a
coverage.xmlviewer, whichmake test-coverage'shtmlcov/already is.