Skip to content

ADR 0006 — A comprehensive content application: write articles, create content, brainstorm ideas, gather information, operate a news site and write books, on one Python platform with a React frontend, AI integrations and pipelines and workflows; every merged repository absorbed; no Ruby

  • Status: accepted 2026-10-21; implemented in ../plan/PLAN.md Phase P, with Phase G's absorptions re-pointed at it. The target is described in ../plan/TARGET.md; every capability, and where it comes from, is in ../plan/capabilities.yml. The pull request that adds this file lands P0 (this record, the target, the ledger, and the gate that enforces them).
  • Amends: ADR 0004 — decision 1's carve-out ("Jekyll — the theme and the image-generator gem — stays Ruby") is withdrawn, and so is G11's "the stdlib bin/zer0 workspace tool stays"; decision 2 ("the Wagtail admin is the CMS … no new SPA is started") is replaced by decision 2 below; decision 3 (the extension as client) is strengthened by decision 9 below; decision 8 (agent definitions are GitOps) stands for tool-using agents and is complemented by user-managed assistants (decision 7); the retire table's "the gem keeps shipping" is replaced by decision 11. Every other decision of ADR 0004 (one backend, OIDC, enterprise rows, cloud-agnostic deploy, parity gates before deletion) stands. ADR 0005 — decisions 1 and 2 stand (the theme and its studio live in bamr87/zer0-mistakes, and that repository's Ruby is that repository's business); decisions 3, 4 and 5 (each site pins the theme, drsai builds against the theme's main, the theme's docs site as a round-trip fixture) are superseded by decision 4 below: zer0-mistakes leaves this repository completely, except as one rendering option. ADR 0002's DB-first decision (D1) is generalised by decision 13 below.
  • Inputs: the owner's direction of 2026-10-21, given after an agent session read a stale main and harmonized the theme's docs inside this repository (#55), in their words: "this repo needs to be cleaned up, normalized, refactored into a single platform while retaining the functionality. all of the barodybroject/parodynews capabilities need to exist. there shouldn't be any ruby code" · "the frontend should use react, and designed to manage/review/create content" · "all the repos that were merged need to be refactored or absorbed. the goal is to keep the content, features, and capabilities" · "perform a complete rewrite if necessary. the vscode extension should be aligned with the capabilities with the frontend. there should be AI adapters/integrations that help with the creation/development of content such as the model built in barodybroject. rewrite/refactor these models and views to be scalable and manageable" · "incorporate all the capabilities of modern CMS tools and frameworks. use existing libraries where possible. this should also have the capability to manage, monitor, and evolve/improve sites. the AIEO tool and functionality should also be incorporated" · "remove zer0-mistakes completely, and only add an option/capability to render a site using that theme and to deploy using a jekyll server. rewrite the zer0-image generator into python and/or typescript" · "absorb the books package and content into the database but have a statically generated set of files of the content. add the functionality to create/manage/write books with AI assistance" · "the goal is to make this platform a comprehensive application to write articles, create content, brainstorm ideas, gather information, operate a news site, write books, etc. through a robust frontend framework and backend database, with AI integrations and pipelines/workflows" · "make sure the vscode extension is built off of the same framework/capabilities as the frontend. use the same programming language and libraries. don't reinvent the wheel where possible. less code is better" — and three answers the same day: React renders the public sites too; Wagtail stays as a headless library; the VS Code extension stays, as a client.

Context

The repository was assembled by importing fifteen repositories with their history (ADR 0002). ADR 0004 then chose one backend but kept three exceptions that left two languages on the server side — Jekyll (and with it the sites' Gemfiles and plugins), the image-generator gem with its byte-identical Ruby port, and the Ruby bin/zer0 — plus the Rails fleet CMS until each of its functions is absorbed. It chose the stock Wagtail admin as the only CMS UI, although two of the absorbed apps (aieo, parodynews) already had React frontends, and it described the absorptions as ports.

Agents kept misreading the target. The direction lived in five ADRs that amend each other; the always-loaded AGENTS.md described today's code at the same weight as the destination; the plan's own rule ("pick the first unchecked milestone") pointed at milestones the later ADRs had overtaken; and one stacked pull request (#52) merged into a branch instead of main, so main contradicted the owner for a day — long enough for automated fleet passes to do careful work in the wrong place. A target that has to be reconstructed from five documents will be reconstructed wrongly. This record states the whole target once, TARGET.md describes it, the ledger makes "nothing is lost" checkable, and a gate fails the build when the work moves the wrong way.

The target, in one paragraph

zer0-CMS is a comprehensive application for content work: writing articles, creating content, brainstorming ideas, gathering information, operating a news site and writing books, with AI integrations and pipelines and workflows throughout — every AI result something a person reviews. Everything below serves that. One Python platform (content/: Django, with Wagtail as a headless content library, Celery, Postgres + pgvector) is the system of record and the only backend. One React codebase (web/) is the only web frontend: the studio, where people manage, review and create content and operate their sites, and the site renderer, which turns each site's content into its static public site. The VS Code extension (src/) is a client with the studio's capabilities, through the same API. The platform has the capabilities of a modern CMS, built on established libraries rather than hand-rolled; an AI content layer — provider adapters, assistants, pipelines, output schemas, briefs and conversations, rebuilt from barodybroject's model to scale — helps create and develop content; and the platform manages, monitors and improves sites in a loop whose signals include AIEO's citability scoring. Content lives in the database, and every site and book also exists as a statically generated set of files exported from it. Books are written there with AI assistance. Every repository that was merged in is absorbed with its content, features and capabilities intact, tracked one capability at a time. zer0-mistakes is gone except as one option: render a site with that theme and deploy it with a Jekyll server. No Ruby remains.

Decisions

# Decision Mechanism that enforces it
1 No Ruby in this repository. Every .rb, .rake, .ru, .erb, .gemspec, Gemfile, Gemfile.lock, Rakefile and .ruby-version goes, every Ruby executable (bin/zer0, rails/bin/*) is replaced by a Python one, and no workflow installs Ruby. Until then the existing Ruby is a ratchet: a per-directory ceiling that only goes down, and no new directory may start holding Ruby. Files that merely model an outside Jekyll site for a test (a two-line Gemfile fixture) are listed as fixtures, not code. tools/check_absorption.py (ruby_ratchet: and ruby_fixtures: in ../plan/capabilities.yml), run by zer0-workspace.yml on every pull request
2 React is the frontend. web/ is one React + TypeScript + Vite codebase. Its studio is designed around three jobs — manage (sites, page trees, media, settings, people, assistants, agents, jobs), review (suggestions with diffs, revisions, workflow tasks, comments, agent runs, scores, monitor findings) and create (pages, drafts, briefs and conversations, with or without AI) — and every absorbed app's screens move into it. It talks to the platform only through the platform's APIs, through a client generated from the committed schemas. The Wagtail admin stays as an operator fallback until the studio covers it, then is closed to editors. The aieo and parodynews React code is source material, not a second app. PLAN P4; web/ unit tests and the verify kit's studio scenarios; the generated client's drift check against schemas/
3 Wagtail is a headless library. Its page tree, revisions, workflows, locking, comments, StreamField, images, documents, forms, redirects, search, settings, snippets and locales are the data layer; nothing new is built as a Wagtail admin view. review rule in AGENTS.md; PLAN G2 superseded by P4
4 React renders the public sites; zer0-mistakes is only an option. The default renderer pre-renders each site to static HTML (pages, feeds, sitemap, robots, search index, redirects) in the platform's own design system — tokens and React components seeded from the zer0 UI tokens, not ported from the theme — and deploys it. It reads the site's generated file tree (decision 13), so it builds in CI with no live database; Liquid in content is evaluated by a JavaScript Liquid engine; site features built as Jekyll plugins (zer0-pages's Obsidian bridge: wikilinks, embeds, callouts, Dataview, the graph index) are rebuilt as renderer plugins. A site may instead choose the Jekyll-theme option: the platform exports its file tree with remote_theme: bamr87/zer0-mistakes@<tag>, resolves at export what a plugin-less Jekyll cannot (Obsidian syntax, generated indexes), and builds and deploys it with a Jekyll server — GitHub Pages' builder or a pinned Jekyll container, run as an external tool; Ruby runs inside that tool, never in this repository's code. Apart from that option, zer0-mistakes leaves this repository completely: no vendored copy, fixture checkout, CI job against the theme, Gemfile entry, doctor rule, design port or editor overlay remains. A site keeps its URLs, content, feeds and redirects whichever way it renders: its Jekyll build is recorded as a parity fixture before it moves, and it moves only when the new path reproduces it. theme_ratchet:/theme_allowed: in the ledger (code and configuration that name the theme, per prefix, until only the option does); PLAN P1 (fixtures, recorded while Jekyll still runs), P2 (the option), P3 (the removal), P6 and P7 (the renderer, per site)
5 A modern CMS, built on established libraries. The platform's capability catalog (TARGET.md § Capabilities, machine-readable in the ledger's platform: section) covers what current CMS tools offer — structured content types, a block editor, live preview, revisions with diff and revert, editorial workflows with assignments, scheduling, comments and locking, localization, taxonomy, full-text and semantic search, redirects, forms, reusable snippets and navigation, a media library with focal points and renditions, roles and per-site permissions, audit log, webhooks and events, REST/GraphQL/MCP APIs, multi-site, bulk import/export — and each is built on the library that already does it (Wagtail, django-allauth, DRF, drf-spectacular, django-filter, Celery, pgvector, jsonschema, the provider SDKs; TanStack Query/Router, a component library, a block editor in web/). Hand-rolling a capability a maintained library provides needs a reason in the pull request. Less code is better: configure an established library before writing code, delete code that the platform or a library now covers, and count a smaller diff as progress. review rule; TARGET.md § Libraries names the chosen library per capability
6 A rewrite, where a port would not scale. The merged repositories' code is source material. What must survive is their content (imported) and their capabilities (ledger rows); their models, views and services are rebuilt to the platform's rules — a service layer with thin views, async jobs for anything that calls a model or the network, owner/site scoping in one place, public ids rather than prefixed string keys, per-site settings rather than singleton rows, encrypted credentials, typed and paginated APIs. Every redesign records its old → new mapping in the ledger, and an importer moves the data. the ledger (each source capability names its platform target); each source's importer and its round-trip test
7 An AI content layer, rebuilt from barodybroject's model. Provider adapters behind one registry (claude_code, anthropic, openai, a LiteLLM catch-all, recorded and fake for tests) with per-provider configuration, health checks and a synced model catalog; user-managed assistants (persona, instructions, model, parameters, output schema) that may only propose; ordered pipelines of assistants; an output-schema library (barodybroject's bundled article, news and content-detail schemas seeded); briefs that turn a prompt into a structured draft; and conversations (threads and messages, replayed to any provider, promotable to a brief or a draft). Every generation runs as an AgentRun on Celery, streams to the client, and is costed and budgeted. Tool-using agents stay GitOps and eval-gated (ADR 0004 decision 8); assistants are the user-editable layer above them. There is one LLM client — the adapter registry — and nothing calls a provider SDK outside it. PLAN G8; content/tests/ai/; the registry test that no module outside content/ai/providers/ imports a provider SDK
8 The platform manages, monitors and improves sites. Manage: a site registry with per-site settings, design and domains; sync, render and deploy as jobs with logs. Monitor: scheduled checks with history and alerts — uptime, broken links, performance and Core Web Vitals, accessibility, SEO, the doctor's consistency checks, analytics (GA4, Search Console, DataForSEO), and AIEO citability scores. Improve: an evolution loop in which agents read those signals and the site's editorial plan and propose improvements — refreshes, fixes, internal links, new topics, rewrites for citability — as suggestions a person accepts, then measures the result. PLAN G4 (manage), G12 (monitor), G7 (AIEO), G13 (improve); each app's tests
9 The extension is built from the studio's code. Same language (TypeScript), same framework and libraries (React, the component library, TanStack Query, TipTap), same generated API client: its webviews render the studio's workspaces from web/packages/, and its own code is a thin VS Code host — commands, tree views, editor integration, secret storage, MCP registration — plus file mode for sites still on files. Every studio capability that belongs next to a file is therefore available in the extension by construction; parity is still tracked per capability, and a gap is reported. This amends the extension's decision D3 (and D14): libraries are bundled at build time through the esbuild allow-list instead of hand-rolled, and the hand-rolled YAML, glob, date and JSONC helpers in src/core/shared/ are replaced by the libraries the studio uses. the ledger's platform: surfaces and platform.shared-ui, reported by tools/check_absorption.py --report; esbuild.js's per-bundle allow-list; PLAN G10
10 Every merged repository is absorbed with its content, features and capabilities. Each source is listed in the ledger with every capability it has, its platform target, its status (missing, partial, done, or dropped with the owner's decision), and for done the test that proves it. A source directory may be deleted only when every one of its capabilities is done or dropped and its content has been imported. parodynews (barodybroject) is absorbed in full — every capability its inventory lists, including its posts, versions, assistants, groups, schemas and threads — and so is AIEO. tools/check_absorption.py: a missing source with an open capability fails; a done row without an existing proof fails; a dropped row without decided_by fails; a row whose target is not a platform capability fails
11 The image generator is rewritten in Python and TypeScript. The engine, its providers, prompt engines, review and enhance steps, and its jobs become the platform's media app (Python, starting from the existing Python engine, restructured into tested modules); the panel's sites view, the image forge, the SVG studio, the library and the runs audit become studio views (TypeScript); the CLI becomes manage.py commands. The byte-identical Ruby port, the gem, jekyll preview-images and the Rails panel go, and no gem continues from this repository. ratchet ceiling for packages/zer0-image-generator/ reaches 0 in G6; content/tests/media/
12 The workspace tool becomes Python. bin/zer0 keeps its commands and their output (list, info, run, affected, matrix, routes, check, vendor, doctor, tags) and its tests are ported; zer0-workspace.yml, pages.yml and sites.yml stop installing Ruby. PLAN P5; the ported tests
13 Content lives in the database; its files are generated. Every site's and every book's content is held in the platform. Each also has a statically generated set of files — a site's source tree, a book's library/<slug>/ — exported from the database byte-stably, committed by a job so git keeps the history, read by the static builds, and re-importable (a round trip is a test). People and agents edit in the platform (the studio, the extension, the agents); a direct edit to a generated file is imported as a suggestion, never lost and never silently overwritten. each exporter's round-trip test; the export job's "no diff after re-export" check (PLAN G4, G9)
14 Books are written in the platform, with AI assistance. The books package and its library are absorbed into the database (books, parts, chapters, outline, characters, continuity notes, style guide), and library/<slug>/ becomes the generated file set. The platform helps create a book (premise → outline → chapter plan), manage it (structure, status, continuity, statistics, compiled manuscripts) and write it (draft, continue, rewrite or expand a chapter; check continuity and voice) through assistants, pipelines and conversations that read the book's own context, every result a suggestion the author accepts. The ABC wizard and drsai's story engine become book types and generators. PLAN G9; content/tests/books/ (import/export round trip on library/impairment, the assistant flows on recorded fixtures)
15 The product is the workspaces. The studio is organised around what people do — Write, Create, Ideas (boards, AI brainstorming, promotion to briefs), Research (sources, capture from the web, feeds and documents, questions and fact-checks over them), Newsroom (desks, story budget, calendar, assignments, the newsroom workflow, fronts, corrections, newsletters), Books and Sites — and every workspace has AI help and runs on the same pipelines and workflows: AI pipelines, editorial and newsroom workflows, and automations (trigger → condition → action) with a run history. A capability is not done until a person can use it from its workspace. TARGET.md § What it is for; the ledger's ideas.*, research.*, news.* and workflows.* capabilities; PLAN G14–G16

What an agent must not do

Each of these has happened here, or is the next obvious mistake. Each is a review rule in AGENTS.md.

  • Add Ruby anywhere, or build a feature on Rails, Jekyll, the image-generator gem or bin/zer0 that a later milestone would have to port.
  • Add screens to the Wagtail admin. New UI is React in web/ — and its counterpart in the extension, or a recorded gap.
  • Call a model provider's SDK outside the adapter registry, or add a second LLM client, ledger or registry.
  • Port a merged app's models and views one to one. Map its capabilities onto the platform's model and import its data.
  • Hand-roll what an established library does (an editor, a diff, auth, a job queue, a schema validator, a query cache) without a reason in the pull request.
  • Add a dependency on zer0-mistakes — a vendored file, a fixture checkout, a CI job against it, a design port, an overlay. Only the Jekyll-theme option names it (theme_allowed:); its home is bamr87/zer0-mistakes.
  • Hand-edit a generated file tree (a site's exported source, a book's library/<slug>/) as if it were the source. Edit in the platform; the files are regenerated.
  • Delete a source directory, a site, content or a capability because it looks obsolete, or mark a capability dropped. Deletion follows the ledger, and dropping is the owner's decision.
  • Run a fleet-wide kit (docs framework, governance, standards) over an imported project as if it were a live product. The projects under apps/, packages/, rails/ and sites/ are sources being absorbed; fleet kits apply to the platform, web/ and the extension.
  • Pick work by "the first unchecked box". The order of work is PLAN § 3's list.
  • Stack a pull request on another unmerged branch. Base every pull request on main.

Consequences

  • One language per role: Python on the server and in tooling, TypeScript in the browser and the editor. One deploy artifact for the backend, one build for the frontend, one API contract for both clients.
  • The absorption is long, so it is observable: the ledger is the progress report, the ratchet's ceilings are the Ruby burn-down, the surface columns are the extension/studio parity report, and all three fail CI when they move the wrong way.
  • Sites keep publishing throughout: each moves to the Jekyll-theme option (which needs no Ruby in this repository) or to the React renderer only when its recorded build is reproduced. The price is ordering: each site's Jekyll build must be recorded before its Ruby is removed (P1 comes first for that reason).
  • The studio must reach the Wagtail admin's coverage before editors lose the admin; until then both exist — a temporary second UI, accepted and bounded by P4's accept criteria.
  • The platform now carries every absorbed product's complexity. Libraries carry most of it; the service-layer and async rules in decision 6 are what keep the rest manageable.

Progress

Ticked milestones live in ../plan/PLAN.md; capability status lives in ../plan/capabilities.yml. This ADR changes only when a decision above changes.