ADR 0004 — One platform: the Django/Wagtail platform absorbs the apps, the Wagtail admin is the CMS, the extension is its client, and the platform is built enterprise-ready¶
- Status: accepted 2026-10-21; amended by ADR 0006 (React replaces the Wagtail admin as the CMS UI; no Ruby, so the Jekyll/gem/
bin/zer0carve-outs are withdrawn; the extension reaches parity with the studio) — implemented in phases —../plan/PLAN.mdPhase G (one platform) and Phase H (enterprise). The pull request that adds this file lands G0 (this record and the plan) and G1 (the operational baseline,content/ops/). - Amends: ADR 0001 — the two-plane split is superseded: the Rails experience plane is retired function by function and the content plane becomes the platform; its boundary rules (one registry, effects, agent users,
suggestfirst, one revision per accepted outcome, outbox events in-transaction) carry over unchanged. ADR 0003 decision 7 — PLAN-D5 is decided (the extension stays) and PLAN M2's directory moves are closed as won't do. ADR 0002 is unaffected: one home, Phase E cutover and Phase F DB-first per site continue as written. - Inputs: the owner's direction of 2026-10-21 (one common platform with a VS Code extension, enterprise-ready; absorb the apps' functionality into the framework; review the CMS frontend and give it the features a CMS has), the inventories taken the same day of the Wagtail admin, the extension's surfaces and the four other UIs, and the fleet's Universal Project Standard (
bamr87/bamr87specs/), whoseBEandOPSrows are the definition of "enterprise-ready" used here.
Context¶
After ADR 0003 the repository still held four runtimes and five user interfaces for one job. The content plane (content/) was live and already the system of record — seventeen registered tools, seven agents, GraphQL, REST and MCP over one registry, a byte-exact Jekyll round trip — but it was one product among several: the Rails fleet CMS (a disk-synced Administrate index with file write-back, the LinkedIn distribution lane, the ABC wizard, zer0 doctor), the image generator's own Rails panel (preview runs, compositions, the SVG studio, a library, provider credentials), the books CLI and studio, and two imported apps still standing as separate products: aieo (FastAPI + React — AI-citability scoring with fifteen analyzers and ten prompt agents, GA4/GSC/DataForSEO connectors, WordPress publishing, a 28-tool MCP server) and parodynews (Django + React — assistants, assistant groups, chat threads, posts published as GitHub pull requests). Between them: five LLM clients, three governance/ledger copies, two site registries, two MCP servers, four admin UIs, and no single place that was the product.
The Wagtail admin itself was stock: no theme, no dashboard panels, no "draft with agent" button, suggestions in a read-only panel with no diff, agent runs in a filterless report and tokens with no UI at all, scheduled publishing never run, sites reachable only at *.localhost hostnames compose refused. And none of the fleet's operational rows held: /healthz touched the database, there was no readiness or version endpoint, no request id, no JSON logging or redaction, no error envelope, no API throttling, no CORS policy, no OpenAPI document, no SECURITY.md.
The owner answered the four questions that decide the shape: one backend (Django/Wagtail); the Wagtail admin, customized, as the one CMS web UI; a cloud-agnostic deploy (release-tagged images on GHCR, a production compose file, a Helm chart); OIDC single sign-on through django-allauth with optional TOTP, group claims mapped onto Wagtail groups.
Decisions¶
| # | Decision | Mechanism that enforces it |
|---|---|---|
| 1 | One backend. content/ is the platform: the system of record, the agent runtime, every API and every admin screen. Rails is retired function by function — each function moves into a platform app, and the Rails code goes only once the absorbing app's parity gate (below) is green. Jekyll — the theme and the image-generator gem — stays Ruby because Jekyll is Ruby; those are frontends and packages, not a plane. The directory keeps its name; the docs call it the platform. |
bin/zer0 check and workspace.yml (a retired project is an unregistered directory); each gate's tests in content/tests/ |
| 2 | The Wagtail admin is the CMS. One web UI, themed with the zer0 design tokens and extended with the platform's own views — dashboard panels, a suggestions inbox and side panel with diffs, agents (runs, evals, tokens), sites, distribution, the media studio, scoring, reports, per-site settings, forms, locales, scheduled publishing. The Rails admins and both React SPAs retire as their features move in; no new SPA is started. | PLAN G2; content/tests/admin/; the verify kit's admin scenarios |
| 3 | The extension stays, as the platform's editor client (PLAN-D5). When a platform URL and a user token are configured it reads pages, suggestions and runs over GraphQL, sends edits as content.propose_edit and requests runs; without them it keeps today's file mode. Its governance queue, ledger and harness duplicates are deleted only for sites that are DB-first (ADR 0002's rule). |
PLAN G10; src/test/; decision D11 (no network at activation) unchanged |
| 4 | Absorb, don't federate. Each app's functionality becomes a platform app that reuses the registry, the agent users, Suggestions, the outbox and the admin: sites + jobs (the Rails registry, sync, write-back and doctor; the image generator's run UX generalised), distribution (LinkedIn, WordPress, GitHub-PR channels, the queue, the ledger), media (the image pipeline over the Python engine), scoring (aieo's analyzers, patterns and agents), conversations (parodynews's threads, playbooks, output schemas), books (the importer, continuity review, the ABC wizard view), accounts (SSO, MFA, personal tokens), ops (this PR). A feature that would need a second LLM client, a second ledger or a second registry is not absorbed until it can use the one that exists. |
Each app's README names the registry entry points it uses; content/AGENTS.md invariants; PLAN G4–G9 gates |
| 5 | Enterprise-ready means the fleet's rows, asserted. ops/ satisfies UPS-BE-04/05/06/10/11/12/20/21/22/31/50 and OPS-10/11/12/13/17/23 (probes, request ids, the error envelope, throttling, CORS, OpenAPI, JSON logging with redaction, error reporting, compose labels, security headers) and tests/ops/ pins every one; accounts/ (G3) adds SSO, MFA, personal tokens; deploy/ (H1) the images, compose and chart; H2 the rest. A row the platform does not yet meet is listed in PLAN, not waived. |
content/tests/ops/; content.yml's OpenAPI drift step; the hub's tools/dash spec check |
| 6 | Deploy is cloud-agnostic. Release-tagged images on ghcr.io/bamr87/zer0-cms, a production compose file and a Helm chart with /readyz probes; the deploy verifies readiness before it is green. parodynews's Azure files are not the deploy path; they go with parodynews (G11). |
PLAN H1; publish.yml |
| 7 | Sign-in is OIDC first. django-allauth's openid_connect provider (one app per IdP, from the environment), allauth.mfa TOTP with recovery codes, OIDC groups mapped onto Wagtail groups, local accounts kept as the fallback with the same MFA. Machines keep agent tokens; people get personal API tokens issued and revoked in the admin. |
PLAN G3; content/tests/accounts/ |
| 8 | Agent definitions stay GitOps. agents/definitions/*.yaml is the source; the admin shows a definition, its eval status and its runs, and never publishes or edits one. sync_agents --publish keeps overwriting, which was already the rule in content/AGENTS.md and is now what the UI does too. |
G2's inspect-only viewset; content/AGENTS.md |
| 9 | No directory moves. M2 is closed: rails/ → app/, src/ → clients/vscode/ and the frontends/ tree were cosmetic once the Rails plane was going and the extension was staying, and a move changes what the hub's detect-stack sees at the root. |
PLAN M2 |
What retires, and the gate that lets it¶
Nothing is deleted on the strength of a plan. Each row is one Phase G milestone; the removal is its own commit citing the gate.
| Retires | Absorbed by | Gate |
|---|---|---|
Rails Site/Page/Asset/Term, SiteSync, PageEditor, Zer0Cms::Cms::Writer, Catalog |
sites + jobs (G4) |
the same fixture sites (rails/test/fixtures/jekyll-site) sync and export byte for byte through import_jekyll/export_jekyll; the digest stale-write guard is ported and tested |
rails/lib/zer0_cms/{distribution,linkedin}, zer0-linkedin.yml |
distribution (G5) |
the ported event contract tests pass; a recorded LinkedIn transport fixture suite covers compose, approve, publish and statistics |
The ABC wizard (abc_books_controller, rails/lib/zer0_cms/abc) |
books (G9) over the existing drafter abc profile |
the admin view writes the same index.md and _data/abc_books/<slug>.json as rails/test/zer0_cms expects |
zer0 doctor (Ruby), zer0-doctor.yml's Ruby step |
sites/doctor.py (G4) |
identical findings JSONL on the fixture sites; the reusable workflow switches callers |
packages/zer0-image-generator/web/, rails/app/services/image_engine.rb |
media (G6) |
preview runs produce the same artifacts on the fixture site; credentials migrate; the gem keeps shipping for Jekyll users |
apps/aieo/ |
scoring (G7) |
the backend tests ported; the same scores on the fixture pages; the aieo_* MCP names kept as aliases |
apps/parodynews/ |
conversations + distribution (G8) |
the import_parodynews round trip and the conversations tests |
packages/books/src/ |
books (G9) |
import_books and books.validate parity on library/impairment |
Consequences¶
- The repository converges on one runtime for everything that is not Jekyll: one auth model, one registry, one audit trail, one deploy artifact, one admin. The price is that the platform now carries every feature's complexity, which is why each absorption is gated on parity tests rather than on a rewrite looking finished.
- Enterprise rows become the platform's own tests, so a regression is a red build, not a finding in the next fleet audit. The first PR clears
REPO-14,REPO-32andQA-06of the hub's conformance report along with theBE/OPSrows above;WORK-10(pinned fleet workflow refs) and theAGENTrows are left to their own pull request. - The ADR 0001 vocabulary of "planes" goes out of the agent rules: there is the platform, its clients (the extension), its frontends (the Jekyll sites and the theme) and its packages (the gem, the engine). The safety rules that made the content plane trustworthy are unchanged and now apply to everything.
- Until each gate is green, the old code keeps running: the Rails CMS and the image-generator panel still start from the compose file, the apps still have their workflows. A user loses nothing on any day of the migration.
Progress¶
Ticked milestones live in ../plan/PLAN.md Phase G and H; this ADR changes only when a decision above changes.