Skip to content

PLAN: zer0-CMS → one Python platform with a React frontend (ADR 0006)

The build plan: ADR 0006's order of work (§ 3), every milestone and phase with what is done, what is blocked and what overtook it, and the open decisions.

The target is ADR 0006, described in TARGET.md; what each merged repository can do, and where it goes, is capabilities.yml; the order of work is § 3's list. This plan grew in layers (the agent-native content plane, then one home, one platform, the theme going home, and now one Python platform), and its older sections are kept as the record of what was built and why; where an older line says Ruby, Jekyll or the Wagtail admin "stays", ADR 0006 has superseded it. Source of truth for the target: docs/plan/agent-native-design.md (called "the note"; section numbers refer to it). Working rules: AGENTS.md. The decision record is ADR 0001, which also makes the interim calls on §7's open decisions. One milestone = one Claude Code session = one PR. Tick boxes in the same PR that does the work.

0. What is in this repo today (review findings)

Historical (the 2026-10-17 review). The current target is TARGET.md; a row here that keeps Ruby, Rails, Jekyll or the Wagtail admin is superseded by ADR 0006.

Repos merged in (from ATTRIBUTION.md, workspace.yml upstream: keys, git log --merges):

Project (workspace.yml) Path Upstream Notes
cms-extension src/ media/ schemas/ (root) bamr87/zer0-CMS (fork of estruyf/vscode-front-matter v10.10.1, rewritten) Merge history still carries estruyf PRs (#9xx–#1026) before the rewrite; zer0 PRs #13–#27 after
— governance layer inside the extension src/core/governance/ bamr87/bash-cms (ported, not subtree) draft queue, brand guard, approval, idempotency ledger
cms-rails rails/ bamr87/zer0-CMS (PR #24 feat/rails-fleet-platform) Rails 8.1 fleet CMS + stdlib zer0 lib
zer0-mistakes (returned to its repository, ADR 0005) bamr87/zer0-mistakes Jekyll theme gem jekyll-theme-zer0; developed there with its Rails studio; consumed here as a gem / remote_theme
zer0-image-generator packages/zer0-image-generator bamr87/zer0-image-generator Python engine + byte-identical Ruby port + web panel; own release-please + compose
books packages/books bamr87/books Python bookshelf app + Claude studio
parodynews apps/parodynews bamr87/barodybroject Django 5.2 + React, Azure Container Apps
drsai sites/drsai bamr87/drsai Jekyll picture-book site + Python story engine
zer0-pages sites/zer0-pages bamr87/zer0-pages Obsidian vault + Jekyll bridge
zer0-pages-remote, zer0-demo-cookbook, zer0-demo-garden sites/* same-name repos remote_theme / installer demos
aieo apps/aieo bamr87/aieo FastAPI + React AI Engine Optimization app (imported 2026-10-20)
irony-works sites/irony-works bamr87/irony-works AI-tended Obsidian vault + Jekyll site, Germinate loop (imported 2026-10-20)
wargames sites/wargames bamr87/wargames OverTheWire study site, remote_theme consumer (imported 2026-10-20)

Per part: stack, features, models, APIs, tests, CI

Part Stack Features Models / data APIs Tests CI
Extension TS, esbuild, no runtime deps front-matter panel, dashboard, SEO insights, governance (drafts/guard/approval/ledger), harness lanes (src/core/harness), catering/distribution, analytics, portfolio, Claude agent panel (src/agent), MCP server (src/mcp, tools.ts ≈2.3k lines) files + zer0.json, .cms/ contract, schemas/zer0.schema.json VS Code commands zer0Cms.*, MCP tools src/test via vscode-test extension.yml, release.yml (release-please, node)
Rails Rails 8.1, Ruby indexes every registered site, writes edits back to files, ABC book wizard, LinkedIn distribution, image engine Site, Page, Term, Asset, Channel (schema.rb) HTML admin, files, abc_books, linkedin_callbacks minitest (integration, services, zer0_cms) + bin/test-stdlib rails-app.yml, zer0-doctor.yml, zer0-linkedin.yml
rails/lib/zer0_cms stdlib Ruby catalog, doctor, ABC generator with ContentProvider (Deterministic, Anthropic) — CLI stdlib tests rails-app.yml
parodynews Django 5.2, DRF, React/Vite, Postgres, Azure AI parody news generation, assistants, threads, posts with front matter + versions JSONSchema, AIModel, Assistant, AssistantGroup(+Membership), AIProviderConfig, AppConfig, FieldDefaults, ContentItem, ContentDetail, Post, PostFrontMatter, PostVersion, Thread, Message, PoweredBy DRF parodynews/api/urls.py pytest + Vitest (frontend) parodynews.yml
books Python validate/compile/edit book projects, Claude studio library/<slug>/ files CLI/local app pytest books.yml
image-generator Python + Ruby gem + web AI preview/social images files CLI, Jekyll plugin py + ruby tests zer0-image-generator.yml
Sites Jekyll / Obsidian content Markdown + front matter — build sites.yml, zer0-pages.yml, drsai.yml, abc-engine.yml
Workspace tooling Ruby bin/zer0, tools/workspace registry check, affected, vendor drift workspace.yml, fleet.manifest.yml CLI — zer0-workspace.yml, ci.yml, markdown-oneline.yml, codeql, claude.yml

Duplication and dead code

  1. Five LLM clients: extension src/agent, rails/lib/zer0_cms Anthropic provider, parodynews provider layer (AIProviderConfig/AIModel), books studio, drsai story engine (plus image-generator). Target: one Django tool registry + LiteLLM, and ruby_llm only for Rails app agents.
  2. Two ledgers: src/core/governance/ledger.ts and src/core/harness/ledger.ts, both idempotency/run records. They become AgentRun/AgentStep in Django.
  3. Two content models: Rails Page/Term/Asset vs parodynews Post/PostFrontMatter/PostVersion/ContentItem, both shadowing Markdown files. Both are replaced by Wagtail pages, revisions and snippets.
  4. Two MCP surfaces in waiting: extension src/mcp (TS) vs the note's Django MCP server.
  5. Image engine twice: Python engine + "byte-identical Ruby port" + rails/app/services/image_engine.rb + vendored copies tracked by bin/zer0 vendor.
  6. Per-package infra leftovers from the subtree imports: 2 nested release-please-config.json (root, image-generator), 10+ docker-compose.yml (incl. apps/parodynews/src/posthog/), 9 CLAUDE.md (the theme's went home with it, ADR 0005).
  7. CI is not on hub conventions: 18 workflows, none call standard-ci@v2; release-please covers only the root node package.
  8. Dead/obsolete: pre-rewrite estruyf history (keep it in git, but nothing in-tree depends on it); commented-out reusable-workflow calls (zer0-doctor.yml, zer0-linkedin.yml refs); parodynews Azure infra/ and azure.yaml if Azure is dropped; sites/drsai planning docs (PRD*.md, IMPLEMENTATION_PLAN.md, newsletter_seuss.md, reena_poem.md, Family newsletter.md) at the site root; src/test/fixtures/sites/wikijs/docker-compose.yml is a fixture, so keep it.

1. Inventory → target mapping

Historical (the 2026-10-17 review). The current target is TARGET.md; a row here that keeps Ruby, Rails, Jekyll or the Wagtail admin is superseded by ADR 0006.

Source Features Lands in Action
parodynews Django project Django settings, DRF, Postgres, auth content/ (Django + Wagtail project base) Evolve: becomes the content plane skeleton
parodynews Post/PostFrontMatter/PostVersion/ContentItem/ContentDetail posts, versions Wagtail ArticlePage + Revision Migrate data, then drop the models
parodynews Assistant/AssistantGroup/AIModel/AIProviderConfig agent config content/agents: AgentDefinition (snippet + RevisionMixin), LiteLLM config Migrate, then drop
parodynews Thread/Message chat history AgentRun/AgentStep (kind=llm) Migrate if needed, otherwise archive
parodynews JSONSchema/FieldDefaults content schemas wagtail_ai_schema export (note §2.1) Replace
parodynews React frontend admin UI — Drop (Wagtail admin replaces it); keep it only as a reference in git history
parodynews Azure infra deploy — Drop (open decision D4)
Rails Site/Page/Term/Asset + site_sync, page_editor, files_controller file index + write-back Content → Wagtail (importer + Jekyll exporter); Rails keeps Site only as an app-side registry Rails stops writing content (boundary)
Rails Channel, linkedin_gateway, LinkedIn callbacks distribution Rails app/ (app-domain: OAuth, channels); triggered by the content.page.published event Keep in Rails
Rails ABC wizard + rails/lib/zer0_cms ABC generator book generation Django drafter agent profile "abc"; export target becomes a Jekyll exporter Port the logic to Django tools, then drop the Ruby provider
Rails doctor, catalog (stdlib lib) fleet checks tools/zer0 CLI (stays Ruby, stdlib) Keep
Rails users/sessions (new) personalization Rails app/ + agent_runs/agent_steps mirror, MCP client, outbox New
Extension src/core/governance drafts, brand guard, approval, ledger Django: Suggestion, AgentReviewTask(brand), brand rules snippet, AgentRun Port the semantics; the extension becomes a client
Extension src/core/harness lanes, skills, metering, preflight Django agents harness (tool registry, budgets, evals) Port, then delete the TS duplicates
Extension src/mcp MCP tools Django MCP server (content.*, graph.*, media.*) Replace; the extension calls Django MCP/GraphQL
Extension panel/dashboard/SEO UI editor UX clients/vscode headless client (reads/writes via the GraphQL API + suggestions) Keep as a frontend
schemas/zer0.schema.json project file schema schemas/ (shared) + schemas/events/*.json (CloudEvents) Keep + extend
zer0-image-generator image AI Django media pipeline (ai_alt, ai_tags, embedding, previews) via a Python import; the gem stays for Jekyll users Keep the package; drop the Ruby port from Rails (image_engine.rb)
books book projects + studio Content import as BookPage tree; studio → Django agents Migrate content; drop the studio LLM client
drsai story engine story generation Django agent profile; site → frontend Migrate
zer0-mistakes theme Jekyll theme its own repository, bamr87/zer0-mistakes, with its Rails studio (ADR 0005); the exporter's sites build with the gem / remote_theme each declares Consume
sites/* content Imported into Wagtail (one Site per Jekyll site); Jekyll stays as a static frontend Migrate
bin/zer0, tools/workspace, workspace.yml registry Keep, re-registered with the new projects Update
18 workflows CI standard-ci@v2 caller + per-project matrix via bin/zer0 affected Consolidate

2. Target layout

Historical (the 2026-10-17 review). The current target is TARGET.md; a row here that keeps Ruby, Rails, Jekyll or the Wagtail admin is superseded by ADR 0006.

content/                 # Django 5.2 + Wagtail 6 — system of record, agent runtime
  config/                # settings, celery, urls (GraphQL, /api/v2, MCP mount)
  cms/                   # page models (ArticlePage, BookPage, SitePage...), AgentManagedMixin, StreamField blocks, custom Image
  agents/                # AgentDefinition, AgentRun, AgentStep, Memory, EvalCase, EvalResult, tool registry, runner
  suggestions/           # Suggestion model, accept flow, editor sidebar (wagtail hooks)
  graph/                 # Entity, Edge, pgvector, structural edges from ReferenceIndex, GraphRAG
  workflow/              # AgentReviewTask
  api/                   # Grapple/Strawberry schema, REST viewsets, SSE
  mcp/                   # FastMCP server backed by agents.registry
  outbox/                # transactional outbox + relay to Redis Streams
  importers/             # jekyll, parodynews, books, drsai
  exporters/             # jekyll exporter (static frontends)
  tests/
app/                     # Rails 8 (moved from rails/) — experience plane
  app/models             # User, Site(registry), Channel, AgentRun, AgentStep, Affinity, OutboxEvent
  app/services           # ContentClient (graphql-client), McpClient, HomepageAgent, LinkedinGateway
  lib/zer0_cms           # stdlib doctor/catalog (ABC generator removed)
clients/vscode/          # the extension (src/, media/, package.json) as a headless client
frontends/sites/         # sites/*
packages/zer0-image-generator/
schemas/                 # zer0.schema.json, events/*.json, graphql/schema.graphql (generated)
tools/                   # bin/zer0, workspace lib
docs/  AGENTS.md  CLAUDE.md -> AGENTS.md (one line pointer)
docker-compose.yml  workspace.yml  release-please-config.json  .release-please-manifest.json

Moving rails/ → app/ and src/ → clients/vscode/ was milestone M2; ADR 0004 closes it. The tree keeps its layout — content/ is the platform, src/ the extension, rails/ and the apps retire in place (Phase G) — and only the names in the docs change.

3. Milestones

Each milestone: one branch m<N>-<slug>, one PR, green CI. Commands assume docker compose up -d db redis where noted.

Status, 2026-10-21 (later). ADR 0006 sets the destination. The product: a comprehensive application for writing articles, creating content, brainstorming ideas, gathering information, operating a news site and writing books, with AI integrations and pipelines and workflows throughout (TARGET.md § What it is for). The means: one Python platform, one React frontend (the studio and the site renderer), the extension at parity with the studio, an AI content layer rebuilt from barodybroject's model, the manage → monitor → improve loop for sites with AIEO in it, every merged repository absorbed with its content and capabilities, and no Ruby. Later the same day the owner added: zer0-mistakes leaves completely except as an option to render a site with that theme and deploy it with a Jekyll server; the image generator is rewritten in Python and TypeScript; content lives in the database with a statically generated set of files; books are written in the platform with AI assistance. That is Phase P below, with Phase G re-pointed at it: G2 is superseded by P4, G7 is AIEO in full, G8 is the AI content layer, G9 is books with AI-assisted writing, G10 is the extension built on the studio's stack (and moves up to follow P4), G12 (monitor), G13 (improve), G14 (ideas and research), G15 (the newsroom) and G16 (automations) are new, T3 and Phase F's D1 milestones are superseded by P2 and P7, and M16 and C2's Ruby component are struck.

Order of work. Pick the first milestone in this list that is not done and whose predecessors have merged; never pick by "the first unchecked box" — the older phases keep unchecked boxes that later decisions overtook, and each of those says so. Within a milestone, keep one commit series per concern.

  1. P0 — ADR 0006, the target, the ledger, the gate.
  2. P1 — record every site's Jekyll build (it needs Jekyll, so it comes before any site loses its Ruby).
  3. P2 — the Jekyll-theme option; sites move to it and drop their Gemfiles and plugins.
  4. P3 — zer0-mistakes removed completely.
  5. P4 — the studio foundation (web/): Write, Create and Review, built as shared packages from the start.
  6. G10 — the extension on the studio's stack: its webviews render the same workspaces. From here on, every milestone's workspace reaches the extension by construction (or records the gap).
  7. G3 — accounts (the studio's sign-in, and parodynews's account capabilities).
  8. G8 — the AI content layer (parodynews in full): AI help in Write and Create.
  9. G14 — Ideas and Research.
  10. G15 — the Newsroom (parodynews's news site runs as a desk).
  11. G9 — Books, in the database, with generated files and AI-assisted writing.
  12. G4 — sites and jobs (the Rails catalog, writer and doctor in Python; the generated site trees).
  13. G16 — automations.
  14. P5 — the workspace tool in Python.
  15. G5 — distribution (LinkedIn, WordPress, GitHub pull requests, email).
  16. G7 — AIEO.
  17. G12, then G13 (with M17's remaining entity extraction) — monitor, then improve.
  18. G6 — media: the image generator rewritten.
  19. P6, then P7- per site — the React renderer, then each site that moves to it.
  20. G11 and P8 — retire the sources; no Ruby.
  21. H1, H2 — enterprise.

Voice (ADR 0010, proposed). The owner's direction of 2026-10-30 made a site's voice — its scope and its distribution — the first feature explored for running bash-365.com from the platform. V0 (read-only) has landed; V1 onward waits on the ADR's open decisions VD1–VD5 and on where the owner places Phase V in this list.

Status, 2026-10-21. ADR 0004 makes content/ the one platform: Rails is retired function by function, the apps are absorbed, the Wagtail admin is the CMS, the extension stays as its client, and the platform is built enterprise-ready. That is Phase G and Phase H below; M2 is closed, M16's Rails half is superseded, and M18–M20 are re-scoped there (each says so). G0 (this record) and G1 (content/ops/) landed in one PR.

Status, 2026-10-19. M0, M3–M15 landed together (one branch, one commit series per area, so the PR can still be split), as the content plane content/ — additive, because no site has cut over yet (ADR 0002: the Jekyll files stay canonical for each site until it does). M1 and M2 are held on decisions, M16–M20 on §4.8's two-release rule, applied per site now that D1 is decided (ADR 0002, Phases E and F); each says what is done and what blocks the rest. Test paths are content/tests/<area>/… rather than content/tests/<area> run from the repository root; cd content && python -m pytest -q runs them all, on SQLite and (with DATABASE_URL) on Postgres + pgvector.

Phase A: Foundation

  • M0: AGENTS.md + hub conventions
  • Tasks: promote AGENTS.draft.md → AGENTS.md; make the root CLAUDE.md a pointer to it; make sub-package CLAUDE.md files pointers or AGENTS.md sections; add docs/adr/0001-target-architecture.md linking to the note.
  • Files: AGENTS.md, CLAUDE.md, */CLAUDE.md, docs/adr/.
  • Accept: bin/zer0 check passes; there is one canonical agent file.
  • Test: bin/zer0 check && npx markdownlint-cli2 AGENTS.md
  • Done: the draft was already at AGENTS.md, so "promote" became "merge": the root CLAUDE.md's invariants moved into it and every CLAUDE.md is now a pointer whose @AGENTS.md line imports it (so Claude Code reads the same text other agents do); project CLAUDE.md files became their own AGENTS.md (the theme's was folded into its existing one), and Jekyll sites exclude AGENTS.md from their builds. A root .markdownlint-cli2.jsonc relaxes the two rules that contradict the one-paragraph-per-line gate, so the test passes.
  • M1: CI on standard-ci@v2 + monorepo release-please — amended by ADR 0006: the release components are the extension, the platform image and web/; there is no Ruby component.
  • Tasks: add .github/workflows/ci.yml calling bamr87/<hub>/.github/workflows/standard-ci.yml@v2 (the exact hub path is open decision D5) with a matrix from bin/zer0 affected; convert the root release-please-config.json to multi-package (., rails, apps/parodynews, packages/*) with a .release-please-manifest.json; delete the nested release-please configs; fold the per-project workflows into the matrix (keep codeql and claude.yml).
  • Accept: one PR run executes check/test for affected projects only; release-please dry-run lists every package.
  • Test: bin/zer0 affected --base origin/main && npx release-please release-pr --dry-run --repo-url=bamr87/zer0-CMS --token=$GITHUB_TOKEN (dry-run, read-only); actionlint
  • Partly done, rest held: the root ci.yml already calls bamr87/bamr87/.github/workflows/standard-ci.yml@v2 (D5's hub path), and every project — content/ included, via the new content.yml — has one path-filtered root workflow, so a PR already runs only what it touches. Not done: multi-package release-please. The original repositories still release jekyll-theme-zer0 and zer0-image-generator (docs/MONOREPO.md), so a second release line here would double-version them; how tags are prefixed once packages share this repository is the decision MONOREPO.md lists. Folding the per-project workflows into one matrix is left until then too: each carries setup (services, xvfb, Ruby/Python matrices) a generic matrix would lose.
  • M2: Layout moves — closed, won't do (ADR 0004 decision 9).
  • Was: git mv rails app, git mv src media package.json … clients/vscode/, git mv packages/zer0-mistakes frontends/jekyll-theme, git mv sites frontends/sites.
  • Why closed: D5 is decided (the extension stays, as the platform's client), the Rails plane is retired rather than moved, and moving package.json off the root changes what the hub's detect-stack sees (docs/RELEASING.md: the root manifest's private: true steers it). content/ already sits where the target layout put it.
  • M3: Root docker compose
  • Tasks: services db (pgvector/pgvector:pg16), redis, content (Django), worker (Celery), app (Rails), app-jobs (Solid Queue), relay (outbox relay), imagegen; delete the per-project compose files that duplicate these (keep the site-preview ones behind profile sites).
  • Accept: docker compose up gives healthy services; /healthz returns 200 on content and app.
  • Test: docker compose up -d --wait && curl -fsS localhost:8000/healthz && curl -fsS localhost:3000/up
  • Done, with three deviations: the content plane's services (db on pgvector/pgvector:pg16, redis, content, worker, beat, relay) are behind --profile content, because the Rails CMS needs none of them while no site has cut over to DB-first yet; the Rails service keeps its name cms on :3001 and runs Solid Queue in-process (no app-jobs until M16 gives it jobs); and the per-project compose files stay, since they are each project's own dev server. Verified: docker compose --profile content up -d --wait db redis content worker beat relay → all healthy, /healthz 200, a REST-started run executed by the worker, the relay delivering to the zer0:content stream.

Phase B: Content plane

  • M4: Wagtail skeleton from config
  • Tasks: create content/ from apps/parodynews/src settings; add Wagtail 6, Postgres + pgvector extension, cms app with BasePage, ArticlePage, BookPage, the AgentManagedMixin (note §2.2), custom AbstractImage with ai_alt, ai_tags, embedding, embedding_model; keep the parodynews app mounted read-only for now.
  • Accept: migrations apply; Wagtail admin loads; existing parodynews tests still pass.
  • Test: cd content && pytest -q && python manage.py makemigrations --check --dry-run
  • Deviations: Wagtail 7.4, not 6 (Wagtail 6 does not support the Django 5.2 LTS parodynews runs); parodynews's settings shape is kept (base/development/production/testing, all from the environment) but parodynews is not mounted — its data comes in through import_parodynews from a dumpdata, so the content plane carries none of parodynews's dependencies and parodynews's own suite is untouched; ai_keywords is JSON (SQLite and Postgres share one schema); vectors live in graph.Embedding, not on the page or image row (a revision would copy them); front_matter is an order-preserving JSON text field (Postgres jsonb sorts keys).
  • M5: Headless APIs
  • Tasks: Grapple (or Strawberry, D2) schema for the page types; Wagtail API v2 /api/v2/pages/; export schemas/graphql/schema.graphql; CI check for drift.
  • Accept: a GraphQL query for an ArticlePage returns StreamField JSON; the schema file is committed and checked.
  • Test: pytest content/tests/api -q && python manage.py graphql_schema --out /tmp/s.graphql && diff /tmp/s.graphql schemas/graphql/schema.graphql
  • D2 decided as Grapple (ADR 0001). StreamField JSON is bodyJson (Grapple's rawValue cannot represent a struct block); mutations sit behind a GraphQL view that authenticates agent tokens and enforces CSRF for browser sessions.
  • M6: Importers (see §4): Jekyll → Wagtail, parodynews posts → ArticlePage.
  • Done: import_jekyll (idempotent; refuses to overwrite a page edited in Wagtail; links indexed in a second pass; front-matter preview images into a collection per site; ABC alphabet: → letter blocks) and import_parodynews (posts, PostVersion history as dated revisions by legacy:import, assistants as legacy definitions that cannot run). drsai's books import through import_jekyll.
  • packages/books library/<slug>/ → BookPage + chapters (§4.5) — not started.
  • Found: apps/parodynews/src/pages/_config.yml refers to an undefined YAML alias (*site_domain), which Jekyll's YAML loader refuses as well; the importer reports it instead of guessing.
  • M7: Jekyll exporter so the static sites keep building from Wagtail (§4).
  • Done: export_jekyll and roundtrip_jekyll. An unchanged page exports its source byte for byte; an edited one renders typed fields over its original front matter, in its original key order. Every Jekyll site in the repository round-trips byte for byte — zer0-pages (210 files), drsai, the two demos and zer0-pages-remote — and so does the theme's docs site (376 files) from a pinned checkout (ZER0_THEME_CHECKOUT, fetched by content.yml; ADR 0005), on SQLite and on Postgres (test_the_real_sites_round_trip_byte_for_byte). The build-time switch to exporter output (§4.8) waits on D1.
  • M8: Outbox + event schemas
  • Tasks: outbox app (OutboxEvent written in the same transaction as publish/revision); relay to Redis Streams; schemas/events/ CloudEvents JSON Schemas for content.page.published, content.suggestion.created, agent.run.completed, app.user.interaction; contract tests on both sides.
  • Accept: publishing a page writes exactly one outbox row; the relay delivers it at least once; consumers dedupe by event id.
  • Test: pytest content/tests/outbox -q
  • The Rails side of the contract is rails/lib/zer0_cms/events.rb + rails/test/zer0_cms/test_event_contracts.rb (stdlib, in abc-engine.yml). content.suggestion.created carries a target (page:/image:) so image suggestions fit; D6 decided as Redis Streams.

Phase C: Agents, harness, graph (note §10 build order)

  • M9 (build step 1a): Agent users, AgentRun/AgentStep, tool registry
  • Tasks: agents app with the models from note §4; data migration creating the Agents group and agent:seo, agent:editor, agent:drafter, agent:review users with page and collection permissions; @tool(effect, perms, rate) decorator, registry, permission resolution to the agent user; LiteLLM wrapper; runner as a Celery task with a hand-rolled state machine (D3); OTel spans with trace_id.
  • Accept: a run of a fake tool records an AgentRun + steps; a tool with effect publish is refused unless the policy allows it; there is no superuser path.
  • Test: pytest content/tests/agents -q
  • Deviations: agent users and groups are provisioned at post_migrate (and by sync_agents), not in a data migration — Wagtail's page-permission rows do not exist until after migrations run. LiteLLM is an optional backend loaded lazily, not a pinned dependency; tests use recorded and fake. OpenTelemetry spans open when opentelemetry is installed; the trace id is recorded either way and crosses planes as traceparent.
  • M10 (build step 1b): Suggestion model + editor sidebar
  • Tasks: Suggestion (note §2.3), accept → new Revision by the agent user with BlockProvenance; Wagtail admin panel hook; port the extension's governance semantics (draft queue → Suggestion pending, approval → accept, brand guard → validator).
  • Accept: accepting creates one revision; rejecting records the status; the accept rate is queryable.
  • Test: pytest content/tests/suggestions -q
  • The editor side is a panel in every page's edit view plus an accept/reject view ("accept all of this run" = one revision). The brand guard is a rule-for-rule port of src/core/governance/guard.ts.
  • M11 (build step 2a): Schema export + validated block tools
  • Tasks: manage.py wagtail_ai_schema emits JSON Schema per block, versioned and stored on AgentRun; tools content.get_schema, content.get_page, content.search, content.propose_edit validated with StreamBlock.to_python + clean().
  • Accept: invalid block JSON is rejected with the error; snapshot test of the schema output.
  • Test: pytest content/tests/schema -q
  • M12 (build step 2b): Drafter + SEO agents
  • Tasks: AgentDefinition fixtures for drafter (incl. "abc" and "story" profiles ported from rails/lib/zer0_cms and drsai) and seo; GraphQL requestAgentRun, acceptSuggestion; REST /api/v2/agent-runs/ with SSE; both agents start at policy suggest.
  • Accept: "Draft with agent" yields a draft revision with provenance; SEO produces meta suggestions; the LLM is mocked in tests (recorded fixtures).
  • Test: pytest content/tests/agents/test_drafter.py content/tests/agents/test_seo.py -q
  • Definitions are YAML (content/agents/definitions/), synced by sync_agents; besides drafter (profiles abc — the Rails generator's offline lexicon path, ported — and story) and seo there are editor, review, brand, a11y and enrich. "Draft with agent" at policy suggest is suggestions that accept as one draft revision; at draft the drafter writes that revision itself.
  • M13 (build step 3): pgvector + structural edges + related/semanticSearch
  • Tasks: graph app with Entity, Edge (note §5); embeddings keyed by content_hash + embedding_model; structural edges from ReferenceIndex, page tree, tags, locale on publish; GraphQL related, semanticSearch, entities; REST /api/v2/graph/ neighbors/path.
  • Accept: publishing builds child_of and reference edges; related returns kNN + 1-hop results; re-embedding is skipped when the hash is unchanged.
  • Test: pytest content/tests/graph -q
  • Embeddings default to a deterministic hashing model (hashing-256), so the graph works offline; EMBEDDING_BACKEND=litellm swaps in a real one. Internal Markdown links and wikilinks become links_to edges, since imported bodies keep their links as Markdown rather than PageChooserBlocks.
  • M14 (build step 4): AgentReviewTask + evals in CI
  • Tasks: AgentReviewTask (brand, a11y, factcheck) writing Wagtail comments; EvalCase/EvalResult; manage.py run_evals --agent <slug>; CI job runs the evals on mocked or recorded models; publishing an AgentDefinition revision requires a passing suite.
  • Accept: a failing review blocks the workflow; an eval regression fails CI.
  • Test: pytest content/tests/workflow -q && python manage.py run_evals --all --recorded
  • Added: an agent review cannot be a workflow's last task (approving the last task publishes as the approver, and an agent never publishes), and a definition with no eval cases can never go live.
  • M15 (build step 5a): MCP server
  • Tasks: FastMCP mounted at /mcp backed by the same registry (one definition, three surfaces); scoped tokens mapped to agent users; retire clients/vscode/src/mcp in favour of a thin proxy or registration that points at Django.
  • Accept: the MCP tools/list matches the registry; a token for agent:seo cannot call content.propose_edit on pages outside its permissions.
  • Test: pytest content/tests/mcp -q && npm --prefix clients/vscode test
  • Deviation: a Django view speaking MCP's Streamable HTTP (JSON responses) plus manage.py mcp_stdio, not a mounted FastMCP app (ADR 0001); the app is mcp_server/ so it never shadows the mcp package.
  • Retire src/mcp in favour of the content plane's server — moved to M18: the extension's server works without a content plane, which is still optional while no site has cut over to DB-first yet.
  • M16 (build step 5b): Rails app plane: content client, MCP client, outbox, personalization — struck: superseded by ADR 0004 and ADR 0006 (no Rails plane, no Ruby).
  • Tasks: Rails stops writing content: remove PageEditor, file write-back and SiteSync writes; ContentClient (graphql-client, persisted queries); agent_runs/agent_steps mirror; McpClient; HomepageAgent (ranker, returns block IDs or variant keys); Rails outbox → Redis Streams; consume content.page.published for cache purge and LinkedIn distribution; emit app.user.interaction.
  • Accept: no Rails code writes content tables or files (a test greps for it); the homepage returns variant keys; the trace_id propagates.
  • Test: cd app && bin/rails test && bin/rails zeitwerk:check
  • Started: the Rails half of the event contract (Zer0Cms::Events, M8). Gated per site (Phase F): removing PageEditor and the file write-back for a site waits until that site has cut over — while its files are canonical, Rails writing them is the design (D16), and the content plane's import_jekyll picks those edits up.
  • Superseded by ADR 0004: there is no Rails app plane to build. The "Rails stops writing content" half becomes G4's parity gate (the platform's sites app syncs and writes the same files); the content client, MCP client, personalization agent and Rails outbox are dropped. The event contract stays (the outbox still publishes content.page.published; distribution consumes it in G5).
  • M17 (build step 6): Entity extraction + GraphRAG + behavioral edges
  • Tasks: enrichment agent on publish (entities, mentions/about/similar_to with a confidence threshold → Edge or Suggestion); GraphRAG retrieval (search → 1–2 hops → rerank); nightly Celery job aggregating Rails interaction events into viewed_together / affinity edges (aggregates only).
  • Accept: below-threshold edges become Suggestions; no raw user ids are stored in Django.
  • Test: pytest content/tests/graph/test_enrichment.py content/tests/graph/test_behavioral.py -q
  • Mostly done (tests in content/tests/graph/test_graph.py): GraphRAG retrieval (graph_rag, graph.search, GraphQL graphSearch); the enrich agent proposing about/similar_to edges, below-threshold ones as Suggestions; app.user.interaction aggregated into daily and co-view counts with no reader id stored, and a nightly viewed_together build.
  • Entity extraction proper: a tool that creates Entity rows (people, organisations, topics) from page text, and the publish-time trigger that runs enrich.

Phase D: Clients and cleanup

  • M18: VS Code extension as a headless client — re-scoped as G10 (ADR 0004). Gated by Phase F: deleting the extension's governance queue, ledger and harness only makes sense once the sites it edits are DB-first; until then they are what works without a server.: panel/dashboard read via GraphQL, edits go out as propose_edit, suggestions shown inline; delete src/core/harness and governance/ledger.ts duplicates. Test: npm test
  • M19: Media pipeline — re-scoped as G6. The fields exist (ContentImage.ai_alt/ai_caption/ai_tags, media.describe, media.propose_alt); the image-save trigger and the image-generator integration are not started, and image_engine.rb stays until they replace it.: image save → event → alt/tags/focal/embedding using zer0-image-generator; delete rails/app/services/image_engine.rb and the vendored Ruby port. Test: pytest content/tests/media -q
  • M20: Remove superseded code — re-scoped as G11. Gated per site by §4.8 (ADR 0002): nothing a site still depends on is removed before that site has cut over.: the news app's parodynews models (after the M6 import verifies), its React frontend, its Azure infra (D4 is decided: drop once a deployment target exists), Rails Page/Term/Asset tables (after the M7 exporter is live), books studio LLM client, dead drsai planning docs → docs/archive/. Test: bin/zer0 run test --all

Phase E: Cutover — one home (ADR 0002)

Ordered: each step needs the one before it. A step that needs a credential, a repository setting, a DNS change or an archive stops and asks (AGENTS.md § Conventions, "Stop and ask"); those are the owner's.

  • C0: Restore the imported history — found 2026-10-19: #29 and #36 were squash-merged, so main holds each imported tree as one commit (packages/zer0-mistakes: 3 commits here, 770 in the original) and the rewritten histories survive only in refs/pull/29/head, refs/pull/36/head and the originals. Nothing is archived before this lands.
  • Tasks: a branch from main that removes the imported paths, merges each rewritten history back (git merge --allow-unrelated-histories, the tips taken from the PR refs so the hashes match what was reviewed), then replays every later main commit that touched those paths as its own commit, so the branch's tree ends equal to main's.
  • Accept: git diff main <branch> is empty; git log -- sites/drsai/_config.yml and git blame reach the original commits. (The theme's graft stays as history; the theme itself has gone home, ADR 0005.)
  • Needs the owner: it must land as a fast-forward (git push origin <branch>:main). A GitHub merge commit keeps the history reachable, but git log and git blame still stop at the squash, because main's side already carries the same lines. A fast-forward adds commits and rewrites none.
  • The same applies to law-ai#174 (lawmode/), gitorio#136 (packages/gitnexus, packages/git-with-the-program) and rewind-arcade#36 (retro-pi/), all squash-merged the same day — tracked in the hub's docs/CONSOLIDATION.md.
  • C1: Freeze and final delta
  • Tasks: land or close every open pull request on the originals (zer0-image-generator, …; the theme is not one of them, ADR 0005), re-open drafts here under the package path; re-import what landed since #29/#36 with the MONOREPO.md recipe (the rewrite is deterministic, so the new commits merge onto the earlier import without duplicating it); turn off the originals' scheduled workflows (*_ENABLED=false) and disable issues and pull requests on them.
  • Accept: every original's main equals what is under its path here (minus the nested workflows removed at import); no original has an open pull request.
  • Test: bin/zer0 check, plus a tree comparison per original (git diff --stat <original>/main HEAD:<path> after git fetch).
  • C2: Releases from here (the rest of M1) — amended by ADR 0006: no packages/zer0-image-generator (ruby) component and no RubyGems publish; the gem's fate is P-D2.
  • Tasks: release-please manifest mode with components . (extension, unchanged), packages/zer0-image-generator (ruby), sites/drsai (the story engine, python); prefixed tags; the manifest seeded from each original's last release (image generator v0.9.0, …); publish jobs for RubyGems and PyPI; delete the nested release-please configs. The theme releases from its own repository (ADR 0005).
  • Accept: a release-please dry run lists every component at its continued version; bin/zer0 check fails for a publishes: project without a component.
  • Needs the owner: RUBYGEMS_API_KEY (or RubyGems trusted publishing) and PyPI trusted publishing pointed at this repository.
  • C3: The theme mirror — struck by ADR 0005: there is no mirror; bamr87/zer0-mistakes is the theme's home and theme-mirror.yml is deleted.
  • Tasks: mirror-theme.yml — on a push to main that touches packages/zer0-mistakes/**, and on a theme release, commit the subtree onto bamr87/zer0-mistakes main as one fast-forward snapshot commit (sync: zer0-CMS@<sha>) and, on a release, tag it v<version>; the mirror's .github/workflows/ is reduced to nothing that deploys, releases or opens pull requests.
  • Accept: the mirror's tree equals packages/zer0-mistakes/ (less the workflows); the job refuses when the mirror's main is not the commit it last pushed; a consumer pinned to @v<version> builds.
  • Needs the owner: a FLEET_TOKEN with contents:write on the mirror; disabling its issues and pull requests.
  • Built: .github/workflows/theme-mirror.yml (kill switch THEME_MIRROR_ENABLED, default off). Armed only after C1: a local dry run of the first snapshot against today's mirror changes 99 files outside .github/workflows/ (−5,981 lines) — the theme's own commits since the import, which this repository does not have yet, so a sync before C1 would revert them on the mirror.
  • C4: One Pages deploy — amended by ADR 0006: each site builds with its Gemfile until it moves to the Jekyll-theme option (P2), then with a Jekyll server and no Ruby here, or with the React renderer (P7).
  • Tasks: pages.yml builds every site under sites/ and parodynews's sidecar into one artifact with each site's sub-path baseurl (ADR 0002 §4, amended by ADR 0005: the theme's docs stay on zer0-mistakes.com from the theme's repository, and this deploy targets this repository's project site); year-of-ai.github.io builds sites/2005 into /2005/ from this repository.
  • Accept: every route answers 200 in a link-checked preview; bin/zer0 check fails for a site with no route.
  • Needs the owner: enabling Pages for this repository (the domain stays with the theme).
  • Built: .github/workflows/pages.yml, route: + the pages task in workspace.yml, bin/zer0 routes [--json] and the routes rule in bin/zer0 check. Routed today: /zer0-pages/, /drsai/, /zer0-pages-remote/, /demos/cookbook/, /demos/garden/, /wargames/. Not routed, each with its reason in workspace.yml: parodynews (its sidecar's _config.yml uses an undefined YAML alias — C5), sites/1987 (no Jekyll config since its repository was deleted), sites/2005 (year-of-ai.github.io builds it), sites/irony-works (no Gemfile: it builds with GitHub Pages' own Jekyll after a node transplant step). Deploys only while PAGES_DEPLOY_ENABLED is true.
  • C5: Port what is left — done so far: the news app's Jekyll sidecar is routed at /parodynews/ (ADR 0003). Amended by ADR 0006: parodynews's Playwright E2E becomes studio scenarios in G8; its Azure deploy is not ported (H1 is the deploy).
  • Tasks: parodynews's Playwright E2E, container validation and Trivy jobs (the theme's workflows stay in the theme's repository, ADR 0005). parodynews's Azure deploy waits on D4.
  • Accept: every nested .github/workflows/ file is ported or deleted with a reason; MONOREPO.md § What still depends on the original repositories is empty.
  • C6: Redirect and archive
  • Tasks: one last commit per original (the theme excepted — it is not archived, ADR 0005) that replaces its Pages site with redirects to the new URL and its README with a pointer here; then archive it.
  • Accept: each old URL answers with a redirect to the new one.
  • Needs the owner: the archive itself.
  • C7: The fleet hub follows
  • Tasks (in bamr87/bamr87): point the registry entries at this repository's sub-paths (registry-only rows), remove the seven absorbed submodules, and take the originals out of every loop (evolution, issue pipeline, fan-outs); zer0-mistakes is registered as a submodule again (T4) and a normal fan-out target.
  • Accept: the hub's drift gate is green; no hub loop opens a pull request on an archived repository.

Phase F: DB-first, site by site (PLAN-D1, ADR 0002 §5)

One milestone per site, smallest first. A site is eligible once roundtrip_jekyll has been green for it for two consecutive releases.

  • D1-0: The switch — workspace.yml gains content_source: files | wagtail per site (default files); pages.yml builds a wagtail site from export_jekyll output; a CI check fails when a wagtail site's committed Markdown differs from the export. Test: bin/zer0 check && cd content && python -m pytest -q tests/exporters — re-scoped by ADR 0006: content lives in the database for every site (decision 13, G4), and each site renders with the Jekyll-theme option (P2) or the React renderer (P7).
  • D1-1: sites/zer0-pages-remote · [ ] D1-2: sites/zer0-demo-garden · [ ] D1-3: sites/zer0-demo-cookbook · [ ] D1-4: sites/drsai · [ ] D1-5: sites/zer0-pages · [ ] D1-6: sites/1987, sites/2005 (the theme's docs site is not a CMS site: it lives and publishes from bamr87/zer0-mistakes, ADR 0005) — re-scoped as P2 and P7-.
  • Each: flip content_source, publish from the export, unblock that site's share of G4 (the platform stops importing its files and starts exporting them), G10 and G11.

Phase G: One platform (ADR 0004)

One branch g<N>-<slug>, one PR per milestone. ADR 0006 applies to every milestone below: an "admin view", "menu" or "admin form" means a studio view in web/ and its extension counterpart (the Wagtail admin gets no new screens); a merged app's models are redesigned to TARGET.md's rules, not ported one to one; the milestone's first commit completes its source's rows in capabilities.yml from the code, and its last sets their status. Every absorption ends in a parity gate the ADR names; the old code goes in its own commit, citing the gate, and never before it is green. "Done" for a platform change is content/AGENTS.md's definition.

  • G0: ADR 0004 + this plan. The record, Phase G/H, D5 decided, M2 closed, M16/M18/M19/M20 re-scoped; AGENTS.md, README.md, docs/MONOREPO.md, docs/CICD.md, workspace.yml say "the platform". Test: bin/zer0 check && python3 tools/unwrap-prose.py --check --exclude '(^|/)SCHEMA\.md$' --exclude '(^|/)CHANGELOG\.md$'
  • G1: The ops baseline (content/ops/, the fleet's BE/OPS rows): /healthz (liveness, touches nothing), /readyz (database, cache, Redis), /version; X-Request-Id + X-App-Version on every response; one error envelope for REST (DRF handler + Django's own 400/403/404/500/CSRF on API paths), GraphQL (extensions.code/request_id) and MCP (data.request_id, -32603 on a crash); JSON logging (LOG_FORMAT=json) with secret redaction and one access line per request; throttles per address, person and agent token; CORS allowlist; security headers with a report-only CSP; drf-spectacular → committed schemas/openapi/openapi.json with a CI drift step; Sentry when SENTRY_DSN; compose labels and log rotation; root SECURITY.md, .env.example, .pre-commit-config.yaml; the verify kit pointed at the platform and a real feature index.
  • Accept: every row has a test in content/tests/ops/; tests/test_healthz.py is superseded (its traceparent assertions moved); every existing test stays green.
  • Test: cd content && python -m pytest -q && python manage.py spectacular --format openapi-json --urlconf ops.openapi --fail-on-warn --file /tmp/o.json && diff ../schemas/openapi/openapi.json /tmp/o.json
  • Deviations: the DRF throttles also cover Wagtail's public pages/images/documents endpoints (per address; NUM_PROXIES keys the bucket behind a proxy); the OpenAPI document covers the platform's own endpoints only, because Wagtail's viewsets build their serializer per request; handler500 is JSON only with DEBUG=False; the graph views' query-parameter errors moved from 400 to 422 (no consumer outside content/).
  • G2: The admin shell and the editor's UX — the Wagtail admin becomes the CMS: the zer0 design tokens mapped onto --w-color-* with light/dark/system, branding and login; dashboard panels (sites, suggestions inbox, agent activity, operations); menu groups (Suggestions, Agents, Sites, Reports); the suggestions side panel with a diff, a reject reason and accept-all-of-run, plus a cross-site inbox; "Draft with agent" and "Improve with agent" header buttons; agent runs as a viewset with filters, a steps timeline and cancel (the runner honours cancelled), evals and tokens (issue once, revoke); definitions inspect-only (decision 8); SEO/Social promote fields (og_*, canonical_url, noindex) and a read-only front-matter group; blocks embed, document, table, typed_table, raw_html, liquid, callout with richer rich text, each with a preview template and a block_to_markdown case; a theme-like preview via headless preview; SiteSettings (SEO defaults, analytics, feedback, brand voice, navigation, content_source); BrandRules per site; Author/Series/Category/Entity snippet viewsets; FormPage; i18n on; publish_scheduled on beat; search promotions; a seeded "Editorial" workflow (brand review → moderators); .localhost in ALLOWED_HOSTS; log actions for suggestion/run/token events; seed_demo. — struck: superseded by P4 (ADR 0006 decision 2). The editor UX is the studio's; the backend items (blocks, SiteSettings, publish_scheduled, the Editorial workflow, log actions, .localhost, seed_demo) moved to P4.
  • Accept: content/tests/admin/ covers each; the byte-for-byte round trip still holds for every in-repo site; verify/scenarios/admin-*.yml pass with evidence.
  • Test: cd content && python -m pytest -q && node verify/runner.mjs
  • G3: accounts — django-allauth openid_connect (one app per IdP from the environment), allauth.mfa TOTP + recovery codes, the Wagtail login routed to allauth with local accounts as the fallback, OIDC groups → Wagtail groups (OIDC_GROUP_MAP), UserToken (hashed, expiring, scoped; issued and revoked in the account menu) accepted by REST and GraphQL, password and session policy. Test: pytest content/tests/accounts -q (a fake IdP, recorded). ADR 0006 adds parodynews's account capabilities: email sign-up with verification, login by code, password reset, GitHub login, passkeys (WebAuthn) beside TOTP, the session list, per-user ownership and sharing; allauth.headless serves the studio and the extension.
  • Status, 2026-10-27: built on feature/g3-accounts (on fix/platform-findings, after G10, G16 and G7 merged there). The platform and the studio are done; the box stays open for the four items below, the extension's sign-in first. django-allauth 65.21 (account, socialaccount with openid_connect and github, mfa, usersessions, headless), configured, never hand-rolled (content/accounts/README.md).
  • allauth served headless only (/_allauth/browser/v1/; HEADLESS_ONLY, the email links and provider returns to the studio's /studio/account/…): local accounts by password (username or email), agents refused at every route (accounts/adapter.py); api/session.py's login and logout are gone, GET /api/v2/me stays.
  • OpenID Connect, one allauth app per IdP from the environment (OIDC_PROVIDERS and OIDC_<ID>_*, accounts/providers.py; none set: local accounts only); an IdP provisions its people, with state and PKCE; the IdP's groups claim → Wagtail groups at every sign-in (OIDC_GROUP_MAP, accounts/groups.py: mapped groups follow the claim, others are never touched, nobody becomes staff). Tested against a fake IdP, recorded (content/tests/accounts/fixtures/fake_idp.json, replayed with responses).
  • allauth.mfa: TOTP with recovery codes, and passkeys (WebAuthn) as a second factor and to sign in on their own; a security change asks for the password again (allauth's reauthentication). Proved with a software authenticator python-fido2 verifies (content/tests/accounts/authenticator.py).
  • The Wagtail admin's and the Django admin's sign-in routed to allauth: /admin/login/ and /django-admin/login/ send a signed-out person to the studio's sign-in with where they were going (a path on the platform only), and back once signed in; no admin form signs anyone in around a second factor; local accounts stay the fallback beside the IdPs. The Wagtail admin's own password change and reset are off.
  • UserToken scoped (read, write; migration accounts/0002), issued (from a signed-in session only, 1–365 days, read-only or not, a superuser's only when asked), listed and revoked in the account menu (/api/v2/account/tokens/) and by manage.py user_token --read-only; accepted by REST and now GraphQL, where a read-only token runs queries only.
  • Password and session policy as settings: Django's validators with PASSWORD_MIN_LENGTH (12), SESSION_COOKIE_AGE, SESSION_EXPIRE_AT_BROWSER_CLOSE, HttpOnly and SameSite=Lax cookies, ACCOUNT_REAUTHENTICATION_TIMEOUT; the session list records a session when it starts, never on every request.
  • ADR 0006's additions: email sign-up where SIGNUP_OPEN (closed by default) with the address verified by code before the first sign-in (ACCOUNT_EMAIL_VERIFICATION, mandatory by default; seed_demo's person is verified), sign-up with a passkey instead of a password, login by code, password reset by code (it never says whether an address has an account), setting a password for an account that has none, GitHub login (GITHUB_LOGIN_CLIENT_ID/_SECRET; sign-up through it follows SIGNUP_OPEN, connecting it to an account works either way), the session list (end one or every other). Per-person ownership and sharing were already the platform's (visible_to, G8 and G14).
  • The studio (web/): web/studio/src/auth.tsx is the one file that speaks allauth's headless API — the browser client, the provider form POST, WebAuthn through the browser, a TOTP set-up's QR code (qrcode.react) — handed to @zer0/ui as AuthHost; SignInScreen follows the flow allauth says is pending, AccountWorkspace is the account menu (password, TOTP and recovery codes, passkeys, connected providers, sessions, API tokens) from the person menu at /studio/account[/sessions|/tokens]. The studio's CSP allows its form to post to itself and the configured IdPs only. In the extension, the account workspace (WORKSPACES' account) lists and revokes the person's tokens through the host; no browser session, so no allauth there.
  • Signing in from the editor through allauth's app client (/_allauth/app/v1/), the extension minting its own token: open — a person issues a token in the studio's account menu and pastes it (zer0-CMS: Set platform token).
  • The studio's Admin area (people, groups and permissions, per-site roles, agent tokens, the audit log; areas.ts names G3 for it): open — nothing above builds it, and the newsroom's desk set-up (G15) waits on it. Groups are set by an IdP's claims or in the Wagtail admin meanwhile.
  • Managing email addresses in the account menu (add, verify, make primary, remove — allauth's /account/email): open.
  • Compose: docker-compose.yml passes none of the account variables to the content service; a deployment sets them in its own environment (content/.env.example). Changing compose needs the image built and booted, not done here.
  • Deviations: sign-up is closed unless SIGNUP_OPEN — a CMS's accounts are an operator's by default — while an OpenID Connect IdP provisions its people; codes, not links, verify addresses and reset passwords (allauth verifies by code only while verification is mandatory; otherwise a link opens the studio); an account an operator made verifies its address at its first sign-in, and one with no address cannot sign in while verification is mandatory; a token never issues another, and the account menu never issues one that never expires (the command line still can); USERSESSIONS_TRACK_ACTIVITY stays off, so the session list shows when a session started, not when it was last seen.
  • Test (2026-10-27, the branch tip): cd content && python -m pytest tests/accounts -q (42 passed: a fake IdP and a fake GitHub, recorded, and a software passkey) · python -m pytest -q (1038 passed, 1 skipped) · makemigrations --check --dry-run (no changes) · ruff check . && ruff format --check . · the three committed schemas (OpenAPI regenerated; GraphQL and the agent schema unchanged) · run_evals --all --recorded on a scratch SQLite after migrate -v0 and sync_agents (20 passed, 0 failed) · cd web && npm run lint && npm run typecheck && npm test (230 passed in 30 files) && npm run build && npm run check:api · the extension's npm ci && npm run compile and fast suites (389 passing) · python3 tools/check_absorption.py · bin/zer0 check · python3 tools/check-config-docs.py · python3 tools/docs_index.py --lint · unwrap-prose --check
  • G4: jobs + sites — Job (kind, status, params, log, artifacts, cancel) on Celery with a live-log admin view; ManagedSite (Wagtail Site ⇄ checkout path, content_source files|wagtail — D1-0's switch — digests, last sync, doctor findings), discovery under SITES_DIR, sync as import_jekyll jobs, write-back as export_jekyll for files sites with the digest stale-write guard ported from page_editor.rb; zer0 doctor ported (sites/doctor.py, six checks, the same JSONL), manage.py doctor, zer0-doctor.yml switched, and — left over from P5 — bin/zer0 doctor (tools/workspace/doctor.py) switched to it, with zer0-workspace.yml's last setup-ruby removed and the workspace.doctor ledger row and platform.workspace ops set to done (P5's doctor item). Gate: the Rails fixture sites sync and export byte for byte. Retires Rails Site/Page/Asset/Term, SiteSync, PageEditor, Writer, Catalog, the Ruby doctor. Test: pytest content/tests/sites content/tests/jobs -q
  • Status, 2026-10-22: built on overhaul/sites-jobs, a parallel track of the overhaul's third wave — ahead of § 3's order (twelfth; G10, G3 and G16 before it have not landed), on top of wave 2's merges. The studio's Sites area is where a person uses all of it; the extension's half is G10's (by construction, from @zer0/ui).
  • jobs/ — Job (kind, status, params, the Wagtail site, who started it, result, error), JobLine (its log, written as the work goes) and JobArtifact, on Celery (jobs.tasks.run_job); handlers registered per kind, cancel cooperative (a queued job at once, a running one at its handler's next check), exclusive kinds one at a time per site (sync and write-back: 409 job.busy). /api/v2/jobs/: the jobs a person started or may manage (Job.objects.visible_to), a job with its whole log, the log as server-sent events (line, status, end — the agent runs' stream), cancel, an artifact. jobs/README.md; tests/jobs/.
  • sites/ — ManagedSite (the Wagtail Site, its checkout, content_source files|platform, render react|jekyll-theme with the theme's tag and the Jekyll server — P2's render: setting, read from workspace.yml at registration — domains, deploy target, last sync, write-back and doctor run, the digest of every content file as the platform last read or wrote it, the doctor's findings) and SiteSettings through wagtail.contrib.settings (SEO defaults, analytics ids, navigation, brand voice, skin and design tokens, a monthly budget). /api/v2/sites/ — P4's site list moved here, the same operation and shape plus managed and can_manage, so the site switcher and the registry are one source — registers a checkout inside the repository or SITES_DIR (its first sync starts), discovers workspace.yml's sites and SITES_DIR's, shows a site, edits its registry fields and settings, lists its findings, and starts its sync, write-back and doctor jobs (Idempotency-Key). Managing needs sites.manage_site. sites/README.md; tests/sites/test_sites.py.
  • The Rails catalog's three stdlib modules in Python, no Django: sites/catalog.py (Jekyll 4.4's reader rules; tests/sites/test_catalog.py renders the walk in jekyll-parity's JSON and compares it byte for byte with the lists Jekyll 4.4.1's reader produced, the fixtures moved to content/tests/fixtures/), sites/frontmatter.py (line surgery over PyYAML's node marks — no YAML library writes untouched lines back byte-identical — every Ruby test ported) and sites/writer.py (SitePath's confinement, O_EXCL, the atomic replace re-checked before the rename, the transliterating slugs). The importer reads sites through the catalog — one Jekyll reader: HTML pages, drafts (imported as drafts) and posts without front matter now come in, an unreadable file is an error in the report rather than the end of the import, and a file is read as bytes so CRLF survives. The exporter renders a changed page over its original file by line surgery, so only what changed moves.
  • Sync and write-back as jobs: sync is import_site; the write-back renders exporters.jekyll.site_files into the checkout under PageEditor's guard — a file is written only while it still has the indexed digest and, when the job names one, the caller's base digest; re-checked right before the atomic rename; an unchanged write-back writes nothing; a hand edit since is a conflict, kept; a deleted page's unchanged file goes; what it writes is recorded on the site's digests and the page's ImportedSource. manage.py site_job sync|export|doctor --site KEY runs one in-process. Gate: the Rails fixture sites sync and export byte for byte (test_the_rails_fixture_sites_sync_and_export_byte_for_byte).
  • zer0 doctor in Python (sites/doctor.py, python -m sites.doctor, manage.py doctor PATH|--site KEY, a site's doctor job): six checks, the same JSONL. Recorded first: the Ruby doctor's findings in a ruby:3.3 container on the 22 scenarios of test_doctor.rb and the three fixture sites (tests/fixtures/doctor/ruby-recording.json), held finding for finding by tests/sites/test_doctor.py; on the nine in-repo sites the two agree exactly too (run once, 2026-10-22). Dropped, by ADR 0006 decision 4: the theme check's theme-not-zer0 and no-theme-overrides, and the theme's front-matter schema behind missing-key:* (the vendored copy, a site's own, --schema); its generic rule config-unreadable is now the config check's. In their place a required field is one the site's own zer0.json content type declares (resolved as the extension resolves it), and zer0.json is checked against schemas/zer0.schema.json. bin/zer0 doctor runs it (P5's doctor item), zer0-workspace.yml installs no Ruby, and zer0-doctor.yml runs it on Python. docs/ZER0-STACK.md says exactly what changed.
  • The studio's Sites area (web/packages/ui/src/sites/): SitesWorkspace (the registry, RegisterSite), SiteView (overview, registry fields with the renderer, settings, findings, jobs; sync, write-back and the doctor started and followed live) and JobLog (a job's log over its event stream, cancel, artifacts read through the client); its milestone flag removed. web/packages/ui/test/sites.test.tsx.
  • Retired: the Ruby doctor — its checks, zer0-cms doctor, test_doctor.rb and the vendored theme schema it alone read; Zer0Cms::Doctor::Jsonc stays because the LinkedIn lane reads zer0.json with it until G5. check_absorption.py --tighten: rails/ 151 → 150; theme rails/lib/ 5 → 4, rails/test/ and workspace.yml to 0. The ledger: sites.registry, sites.jobs, sites.doctor and sites.sync done on their surfaces, platform.workspace ops done, rails.catalog, rails.front-matter, rails.doctor, rails.page-edit and workspace.doctor done with proofs; rails.writer, rails.site-registry and rails.parity-tools partial with what is open.
  • Retired on 2026-10-27 with the rest of rails/, once G4 and G5 had merged (ADR 0008): the owner deleted the Rails CMS ahead of G6 and G11, and what it did that the platform does not do yet is specified in rails-cms-spec.md. What this item said before: Rails Site/Page/Asset/Term, SiteSync, PageEditor, SitePath and rails/lib's catalog, front-matter surgery and writer (with their Ruby tests). The Rails app boots on them and its image engine (G6) and distribution screens (G5) run through them, and the LinkedIn lane (rails/lib/zer0_cms/distribution, G5's) calls the catalog and the surgery; deleting them would break running code whose capabilities have not moved. They leave with their last Ruby caller — G5, G6, then G11.
  • Building a site with the Jekyll-theme option as a job a person follows (P2's open api/studio item): the renderer, the theme's tag and the server are chosen over the API and in the studio, but the build needs the Jekyll server's container, which the worker does not start; pages.yml builds it. Also open: deploy (sites.deploy), committing a generated tree by a job and a hand edit arriving as a suggestion (content.export), per-collection counts and the read-only _config.yml view (rails.site-registry), duplicating a page as a draft (content.create).
  • Deviations: no Wagtail admin view for jobs — the studio's Sites area is the live log (ADR 0006 decisions 2 and 3); content_source is files|platform (D1-0 named the second wagtail, and ADR 0006 makes Wagtail a library); the doctor's theme check is now config (its one generic rule), so that rule's fingerprint changes; a YAML or JSON syntax error's evidence is the Python parser's wording; bin/zer0 doctor needs Python 3.11+ with PyYAML and jsonschema, though the rest of bin/zer0 still runs on 3.9; registration also discovers workspace.yml's sites, and their render: setting becomes the site's; the doctor's image-engine rules still name the image generator's gem, which G6 replaces. catalog.py, frontmatter.py and writer.py are ports, not libraries: Jekyll's reader rules, line surgery that leaves untouched lines byte-identical and the confinement are what the parity fixtures and the Ruby tests pin, and no Python library does either of the first two.
  • Test: cd content && python -m pytest -q · python manage.py makemigrations --check --dry-run · ruff check . && ruff format --check . · python manage.py run_evals --all --recorded · the OpenAPI drift command · python3 bin/zer0 doctor · cd web && npm run lint && npm run typecheck && npm test && npm run build && npm run check:api · python3 tools/check_absorption.py · python3 -m unittest discover tools/tests · python3 -m unittest discover tools/workspace · python3 bin/zer0 check · docker run ruby:3.3 bin/test-stdlib (the Ruby that stays)
  • G5: distribution — Channel (LinkedIn OAuth with an encrypted token; WordPress; GitHub-PR), the queue (pending → approved → published) and the ledger keyed by canonical URL, byte-compatible with the extension's; the brand guard is the brand agent; the LinkedIn client ported (restli, oauth, posts, statistics); tools distribution.compose (propose) and distribution.publish (publish, armed by ZER0_LINKEDIN_PUBLISH); consumes content.page.published; statistics ingest; admin queue, draft and published views and a report. Gate: the ported event contract tests plus a recorded transport fixture suite. Retires rails/lib/zer0_cms/{distribution,linkedin} and zer0-linkedin.yml. Test: pytest content/tests/distribution -q
  • Status, 2026-10-22: landed on overhaul/distribution as one of the three parallel tracks of the overhaul's wave 3 (with G7 and G16), ahead of its place in § 3's order (the order is the integrator's to keep). A person uses it from the studio's Distribution area; a site that is still files keeps the same LinkedIn lane in its own CI through manage.py linkedin. The extension's half waits for G10, like every workspace.
  • Recorded first: what the Ruby lane computed, on ruby:3.3, over a fixture site and every site in this repository — the call plan, little text, hashtags, permalinks, the draft file, previews, status and sources (content/tests/distribution/golden/ruby-lane.json) — and the Python held to it.
  • The LinkedIn client in Python over httpx (content/distribution/linkedin/): the declared call plan with its "own" and forbidden-path tests, Rest.li encoding, little text, reads retried and writes not after a 5xx, OAuth with state and PKCE, one refresh on a 401, posts and card images, page roles, aggregate statistics; every test on respx recordings.
  • content/distribution/ (/api/v2/distribution/, distribution/README.md, migration distribution/0001_initial): Channel (LinkedIn, WordPress, a GitHub repository as pull requests, a newsroom newsletter; per site; the credential encrypted with ai/crypto.py's keys and write-only; LinkedIn connected with state and PKCE, the code exchanged on the worker), DistributionPost (a page or a story going to a channel: compose → brand guard → approve → publish on the worker → published or failed, with a sentence a person can act on), LedgerEntry keyed by canonical URL — the URL Jekyll gives a site's page, so the platform and the site's own lane never post it twice — downloaded and imported byte for byte in the extension's format, and a channel's site ledger file read before and written after a publish; Statistic rows from LinkedIn on beat (distribution-statistics, daily) or on request. A publish needs a person's approval, a channel a person armed and the deployment's switch for its kind (ZER0_LINKEDIN_PUBLISH, ZER0_WORDPRESS_PUBLISH, ZER0_GITHUB_PR_PUBLISH, ZER0_EMAIL_PUBLISH); every gate is checked in the request and again by the worker; a write that may have landed is ledgered unconfirmed before its error goes up.
  • Transports: WordPress over REST (a draft by default, the Yoast title and meta, behind research/fetch.py's SSRF guard), GitHub pull requests with PyGithub (the page's Jekyll file onto a branch, then a pull request; 401, 403, 404, 422 and an already-open pull request as sentences), email as an issue of the site's newsletter sent by the newsroom (django-anymail) — recorded with respx, responses (PyGithub speaks requests) and Django's locmem backend.
  • Agents: distribution.compose (propose) and distribution.publish (publish, refused until the page and the agent are at auto, the definition is live and the agent's group holds the publish right) in the registry and over MCP; the GitOps distribution agent, eval-gated; the content.page.published consumer drafts a post for every channel of the page's site that drafts automatically — never a publish — and the compose events service runs it (consume_events --stream zer0:content --group platform).
  • The lane over a site's own files as manage.py linkedin (content/distribution/lane/): every command of the Ruby lane, the loopback OAuth (now with PKCE), the lane's MCP server, and the doctor's distribution check ported for G4 (lane/doctor.py); the reusable zer0-linkedin.yml runs it on Python 3.13, opening no database.
  • The studio's Distribution area (web/packages/ui/src/distribution/, the area's milestone flag removed): the queue, a post (the guard's findings, the exact payload, every blocker, approve, reject, publish, force, record), channels (add, credential, connect, check, arm, the ledger file), the ledger and statistics; Distribute in the page editor and in a newsroom story's panel.
  • Retired, each removal its own commit citing the Python tests that replace it: the Rails CMS's /admin/distribution and /admin/channels, its channels table and encryption initializer; rails/lib/zer0_cms/distribution/, bin/zer0-cms linkedin and the Ruby doctor's distribution check; rails/lib/zer0_cms/linkedin/. The Ruby ratchet for rails/ went from 151 files to 110.
  • Hardened after a self-review the same day, each fix with a test that fails without it: rotating the AI layer's keys (manage.py rotate_ai_credentials) rotates every channel's credential too (ai.crypto.credentials_rotated); a delivery claims its attempt before sending, so a task redelivered after its worker died (acks are late) never posts twice; a site ledger file the platform cannot reach blocks the channel instead of being skipped, and one that cannot take an entry never rolls back the channel's row; every lane command and the platform's MCP tools are called by a test.
  • Review fixes (2026-10-28, on fix/g5-review-findings, after two independent reviews of the merged track — 34 findings, 28 once deduplicated —, each fix with a test that fails without it): approval is of the exact text — approved_digest, compared by the gates, so a failed post whose text an editor changed is a draft again for a person and for the armed distribution.publish, whose publish path is now tested armed; every attempt ends published or failed — an unexpected error after the claim is doubted and failed, PyGithub's own requests errors are sentences (doubted only for the pull request), the send has a soft time limit, the claim is a conditional update, a post queued or being sent is not queued again, and an attempt whose worker died, or that no worker took, is settled by the next Publish or the beat's sweep (distribution-settle); an email post follows its newsletter issue (DistributionPost.issue) and is published once the newsroom sent it; a page of a site in files is keyed from its checkout's _config.yml, found only inside the repository or SITES_DIR (G4's rule, which also confines the site ledger file), or refused — never a guessed URL — and compose's events consumer mounts the sites read-only; the worker refuses a site ledger file it cannot write and a post's notes say where its entry went; one channel of a site per target; a channel goes only while its ledger is empty, and the studio asks first; LedgerEntry has a UUID public_id (P-D6; migrations 0004–0006, the fill a RunPython in Django's recipe for a unique field on a populated table, checked on SQLite and Postgres) and a visible_to; a ledger file that cannot be read in is refused whole (422) rather than a 500; a channel uses its own LinkedIn token, never the environment's; Record needs an approved or failed post; a rejected auto-draft stays rejected; checking a channel and reading its statistics are a channel manager's; WordPress goes over https only through research.fetch.send (the fetcher's guard, deadline and size cap — no second client), and a connection that never opened is no doubt; a re-publish writes exactly entry_for's keys; a post is seen by those who find its page, and only a live page is distributed; the GitHub channel opens its pull request with the exporter's own file rule (exporters.jekyll.page_file, ImportedSource.unchanged rather than a bare hash); the lane's commentary check, dead helpers deleted, the last rules out of the views; the enum components carry the Distribution prefix; the studio keeps a rejected post read-only, lists a story's own site's channels and follows oneClick, and web/README.md lists the workspace. Already settled on main: the doctor's distribution check runs (sites/doctor.py, c43b1780), the worker mounts the sites (G4), and the Rails channels table left with rails/ (ADR 0008). Still open: the platform writes a site's ledger file into the working tree and never commits it, so the site's own CI sees what the platform published only once someone commits the file (committing a generated tree is G4's open job); PKCE has never been tried against a live LinkedIn, which documents it for native apps only, and nothing has gone to a live LinkedIn, WordPress or GitHub; a pair of channels with one target made before this change is not merged; a post approved before migration 0002 is asked for approval again; the compose stack was validated (docker compose config) but not booted after its two changes.
  • Ledger (docs/plan/capabilities.yml): distribution.channels and distribution.stats done on api and studio, distribution.queue on api, studio and mcp (extension stays partial); rails.linkedin, rails.linkedin-stats, rails.distribution-queue, rails.channels, parodynews.publish-pr and aieo.publish-wordpress done.
  • Deviations: the brand guard is the mechanical one (suggestions/guard.py: the extension's rules, the site's brand rules, and LinkedIn's 3,000 characters once escaped), not the brand agent — a gate that blocks a publish has to be deterministic and say what the editor and CI say. The admin views are the studio's Distribution area (ADR 0006 decision 2), and the report is its Statistics tab and the ledger. zer0-linkedin.yml is kept and switched to Python, not retired, because content repositories call it. An email channel was added (TARGET.md § Distribution). The queue's states are draft → approved → publishing → published, failed or rejected. The Ruby zer0 doctor no longer runs a distribution check: its Python port waits for G4's doctor, and manage.py linkedin status fails on the same settings errors meanwhile. A Rails channel's token is not carried over; the channel is set up again and reconnected. The theme ratchet skips the lane's golden recording, which names a page about the theme, as it skips the workspace tool's.
  • Open, outside G5: the extension keeps its own file-mode lane until it is the platform's client (G10); WordPress, pull requests and newsletters report no statistics; nothing has been sent to a live LinkedIn, WordPress or GitHub (recordings only).
  • Test (2026-10-22, the branch tip): cd content && python -m pytest -q (604 passed, 1 skipped; tests/distribution: 85) · makemigrations --check --dry-run · ruff check . && ruff format --check . · run_evals --all --recorded on a fresh database after sync_agents --publish (18 passed) · the OpenAPI drift command (and the GraphQL and agent schemas: unchanged) · cd web && npm ci && npm run lint && npm run typecheck && npm test (152 passed in 23 files) && npm run build && npm run check:api · rails/bin/test-stdlib on ruby:3.3 and 4.0.5 (75 runs each) · bin/rails test (66 runs) && bin/rails zeitwerk:check and a production eager load on ruby:4.0.5 · python3 tools/check_absorption.py · python3 -m unittest discover tools/tests (183 OK) · python3 bin/zer0 check · python3 tools/check-config-docs.py · unwrap-prose --check · docker compose --profile content config --quiet
  • G6: media (M19) — the Python engine imported from packages/zer0-image-generator as a library; ImageRun jobs (dry-run, list-missing, generate, enhance; provider, parallelism, cost), Composition/CompositionImage (forge: direct → render → review → enhance), StudioRender and sweeps, LibraryEntry with FreeSVG sourcing, ProviderCredential (encrypted, environment fallback), the image-save trigger → media.describe/propose_alt, the preview_images: site-config editor; the Media studio menu. Gate: the same artifacts on the fixture site; credentials migrate. Retires packages/zer0-image-generator/web/ and rails/app/services/image_engine.rb; the Ruby port and the gem leave this repository (ADR 0006 decision 11). Test: pytest content/tests/media -q ADR 0006 decision 11: a rewrite in Python and TypeScript, not an import — the engine, providers, prompt engines, review and enhance as tested modules in content/media/; the panel's sites view, the forge, the SVG studio, the library and the runs audit as studio views; the CLI as manage.py commands; jekyll preview-images, the Ruby port, the gem and the Rails panel go.
  • G7: aieo (all of apps/aieo/, ADR 0006) — the analyzers and scoring engine as modules; ScoringPattern snippets seeded from prompts/patterns/*.md; AuditRun (page or URL, five dimensions, evidence); tools scoring.audit_page|audit_url|score_text|list_patterns|apply_pattern; the ten prompt agents as AgentDefinition profiles at suggest; Citation and its check task; GA4/GSC/DataForSEO connectors as site settings with cached services; WordPress as a distribution channel; the Scoring menu (audit with the radar, patterns, citations, performance); the aieo_* MCP names kept as aliases. Gate: the ported backend tests and the same scores on the fixture pages. Retires apps/aieo/. Test: pytest content/tests/scoring -q ADR 0006: every aieo.* row of the ledger — the content lifecycle, the CLI and root scripts as manage.py commands, reports as job artifacts, Qdrant replaced by pgvector — and the scores feed G12 and G13.
  • Landed 2026-10-22 on overhaul/aieo as one of the three parallel tracks of the overhaul's wave 3 (Distribution, AIEO, Automations), while wave 2b (the extension on the studio's stack, sites and jobs, accounts) was built beside it; ahead of § 3's order (after G5 and P5 there). The gate is met in its intent: AIEO's 150 backend tests were not ported one by one but replaced by new tests against its recorded outputs, which pass, and every Markdown fixture scores exactly as AIEO scored it. 39 of the 48 aieo.* rows are done, 6 partial and 3 missing, each named below with the milestone that owns it; apps/aieo/ stays until G11.
  • content/aieo/ (content/aieo/README.md): the analyzers and the five dimensions (aieo — the ten citability patterns and their weights —, seo, readability, humanity, cro) and AIEO's two unwired analyzers (engagement, competitor gaps) ported with their heuristics, held to tests/aieo/golden/source.json — recorded by running apps/aieo/backend's own code on tests/aieo/fixtures/ before the port; the scoring engine's heuristics, penalties, gaps and grade; AIEO's prompt files as byte copies (aieo/data/prompts/).
  • The prompt-driven evaluator through the AI layer: the bundled AIEO evaluator assistant (AIEO's system prompt), each request carrying the rubric and the definitions of the library's enabled patterns byte for byte as AIEO built them, the answer held to the bundled AIEO evaluation schema rebuilt per run from the library; the heuristics stand when the provider fails, and the audit says why. One LLM client: every model call is a run of the assistant agent (run kinds aieo.audit, aieo.rewrite, aieo.citation).
  • Audits of a text, a page, a URL or a crawled site (Audit, history, a batch), every fetch — robots.txt, sitemaps, feeds, pages — through research/fetch.py's guard in the worker; a site's pages and link map (hubs, orphans); the benchmark (percentile among audits, per-engine citation rates, the nearest audits in meaning from graph.Embedding kind audit — Qdrant replaced by pgvector); the visual audit behind AIEO_VISUAL_AUDIT, Playwright optional with every browser request routed through the guard, faked in tests, its screenshot reaching the providers that declare the new vision capability (ai/providers: image parts in a message for anthropic and openai).
  • Optimize (enhance, expand), scrub, rewrite and apply-a-pattern as runs whose rewrite of a page is aligned block by block and proposed through content.propose_edit as suggestions — never a revision; a pasted text's rewrite is a draft shown beside the original. The pattern library as Pattern rows (aieo.change_pattern; the scorer reads a change); the ten AIEO agents and the lifecycle's writers, the citation probe and the rewriters as bundled assistants made from AIEO's prompts, each JSON agent with an output schema; manage.py aieo import-prompts re-reads a prompts directory and keeps a person's edit unless --force.
  • Citation tracking (CitationQuery, CitationCheck): a question asked of each engine — a provider of the AI layer — through the citation probe, now or on Celery beat (aieo-citations), whether the answer cites the domain and at what position, share of voice per engine and by week. GA4, Search Console and DataForSEO connectors per site (Connector, credential encrypted with the AI layer's keys and write-only; a Google service account's JWT signed with PyJWT), synced in a worker and tested on recorded HTTP; priorities by AIEO's opportunity rule with the trend since the last sync and the site's keywords as the business priority.
  • The brand context as a Wagtail site setting (BrandContext) the agents read and the scorer takes keywords and competitor topics from; the lifecycle on Ideas (topics), Research (research briefs), briefs (the bundled Article writer (AIEO) writes; the four agents read the draft), suggestions (rewrites) and the new LandingPage page type (allowed under a site root and a collection); reports — AIEO's per-site and summary Markdown, byte for byte from its imported reports/, and HTML.
  • Interfaces: /api/v2/aieo/ (people only, 202 + Idempotency-Key for runs, the research fetch throttle for audits that reach the web); aieo.* tools in the registry with AIEO's MCP names as aliases (24 of 28) and the aieo agent definition — the citability review as a workflow task (AIEO_REVIEW_MIN_SCORE) and the MCP principal that lists them, its evals deterministic; manage.py aieo audit|batch-audit|crawl|report|run|import-reports|import-prompts for the CLI and the root scripts.
  • The studio: the AIEO workspace at /sites/aieo[/:section] (a nav entry beside Sites; G4 owns /sites) — audit with the score breakdown (the five dimensions as a radar and as bars), evidence, the nearest audits in meaning and the report, optimize, patterns, agents, citations over time, connectors, priorities, reports, the brand context and the lifecycle — and Write's Citability tab (the page's score, score again, optimize or scrub into its Suggestions tab); web/packages/ui/src/aieo/.
  • The extension's counterparts (aieo.scoring, aieo.optimize, aieo.patterns) — with G10, which renders the same @zer0/ui components; each proved through the extension's host on 2026-11-15 (web/packages/webview/test/host.test.tsx).
  • Owned elsewhere: WordPress publishing and aieo_publish_wordpress (G5); the reusable CI workflow that commits optimized Markdown (aieo.ci-workflows, G16); AIEO scores as a monitor signal and in the improvement loop (G12, G13; aieo.priorities targets sites.evolve).
  • Still open in AIEO's own rows: the PRD-lineage inventory (aieo.prd-lineage, and its three MCP tools); a site snapshot's ETag cache and AIEO's PDF, HTML and bundle exports (aieo.site-snapshot); a crawl bounded by depth and per-page meta beyond the title (aieo.site-context).
  • Deviations: the AIEO agents are bundled assistants of the AI layer (propose-only), not AgentDefinition profiles, as the overhaul's brief asked; patterns are Pattern rows with a Django permission, not Wagtail snippets (no new admin screens); connectors are Connector rows per site — each with its own encrypted credential, status and synced ConnectorData, the cache — rather than fields of a site setting; reports are rendered from the audits on request (audits/<id>/report/, audits/summary/) and written to files by manage.py aieo report|batch-audit, not stored as job artifacts — the jobs app is wave 2b's, so they join it when both have landed; the evaluator's answer carries patterns as an object of the library's pattern names, rebuilt per run, so strict structured output accepts it; an HTML document's word count is the words a reader sees — AIEO counted html2text's Markdown, and html2text is GPL — so a URL's score differs slightly from AIEO's (Markdown is exact); audits fetch inside their run on the agents' queue rather than the research queue; the headless runner's optimize records runs (needing the database) and writes proposed/ only — AIEO's --apply-in-place is not carried; the CLI's runs execute in its own process; a site's score is the mean of its pages' (the first evaluated by a model when asked); the aieo agent is a review agent with no page rights of its own, so its page tools need agent:aieo granted page permissions, and an agent rewrites a text, never a page (only a person asks for suggestions on one); PyJWT is a new runtime dependency.
  • Test: cd content && python -m pytest tests/aieo -q (the app is aieo, so its tests are tests/aieo, not tests/scoring) and python -m pytest -q (see the last commit's body for the counts) · python manage.py makemigrations --check --dry-run · ruff check . && ruff format --check . · python manage.py run_evals --all --recorded on a freshly migrated scratch database after sync_agents --publish (19 cases, the aieo agent's two new) · the OpenAPI drift command (additive: no existing path or component changed; the agent block schema gains aieo.LandingPage; GraphQL unchanged) · cd web && npm ci && npm run lint && npm run typecheck && npm test && npm run build && npm run check:api · python3 tools/check_absorption.py · python3 -m unittest discover tools/tests · python3 bin/zer0 check · python3 tools/check-config-docs.py · unwrap-prose --check
  • Merged onto main on 2026-10-27, after G4, G5 and G16 (merge: G7 — AIEO (overhaul/aieo) onto main and G16): the workspace stays at /sites/aieo, a nav entry beside G4's Sites (the router ranks the static segment above sites/:id); WordPress publishing is G5's channel, so aieo.publish-wordpress keeps G5's done row; the connectors' credentials join manage.py rotate_ai_credentials through G5's ai.crypto.credentials_rotated (they were left under the old key — the fix after the merge, with a test); the branch's commits only — its worktree's uncommitted follow-up stays where it is.
  • Review fixes (2026-10-28, fix/g7-review-findings, on #72, #73 and #74): what the two verifiers found before G7 merged, finished from the follow-up its worktree kept, each fix with a test that fails without it. Security first: a Google connector trades its grant only at Google's token endpoint, never the pasted key's token_uri (an SSRF); the recursive-depth question count is linear, a text is scored inside a request or a tool call only up to 5,000 characters — Python-Markdown is quadratic too — and a longer one audited (over MCP too, aieo.audit_text), and an audit's or a rewrite's run stops at AIEO_RUN_TIME_LIMIT; a site's brand context, keywords and Search Console rows reach only its editors, on score/, agents/run/, aieo.run_agent and aieo.priorities alike (services.editor_of); a shared audit's benchmark names only what its reader sees; only the run a citation check or an audit was started with records its answer; the visual audit's browser has no way out but the guard (the context routed, service workers blocked, WebSockets held, a dead proxy, no name resolved, sandboxed with a scrubbed environment — checked once on a real Chromium); a crawl opens at most MAX_SITEMAPS sitemaps and reads at most max_pages pages by a deadline, on the research queue (the item the merge left open); a batch spends the fetch rate per site, and an alias its tool's rate; the studio's connector form starts from what is saved and opens the synced rows; a report's HTML is held to what its Markdown renders. Then: a landing page's call to action is in its hash, the Wagtail API, GraphQL and its file, read back by the importer (the other item the merge left open; the type stays in aieo); an unknown charset, a removed evaluator schema, a provider switched off, a failing embedder and an engine's model no longer fail or misroute a run; sitemaps are parsed with defusedxml; a pattern with no heuristic is the model's to score; a question's schedule follows its interval, and only its keepers move it; removing a connector takes aieo.delete_connector; a failed sync is logged without its frames; AIEO's report inputs are kept in aieo/data/ and imported private, a deleted audit's screenshot goes with it, and a diff base is never a git option; the performance analyst reads the synced rows; the second copies of _propose, page_text, robots.txt's reading and the paginator are gone. CI's Postgres failures were fixed by #72 and 24cca0b8: tests/aieo and the OpenAPI tests pass on Postgres. The box is open again, as G3's is for its own items: of the 48 aieo.* rows 39 are done, 7 partial and 2 missing — aieo.prd-lineage is not built, aieo.site-snapshot and aieo.site-context are partial, and aieo.visual-audit is partial until CI runs a browser. Still open beside them: the citability review, a workflow task on the agents' worker, scores a page with no time limit of its own (agent runs have none); LandingPage stays in aieo, so cms's subpage types name it; the view logic the review listed (the agents' grouping, the summary's selection, a connector's save) stays in the views.
  • G8: The AI content layer (content/ai/; parodynews in full, ADR 0006 decision 7) — TARGET.md § The AI content layer: provider adapters behind one registry (claude_code, anthropic, openai, litellm, recorded, fake) with agents/llm.py as a front over it and a test that nothing else imports a provider SDK; ProviderConfig (encrypted, write-only credential; one default), ModelEntry and its sync job, the health test; OutputSchema with barodybroject's bundled schemas seeded; Assistant (propose-only), Pipeline/PipelineStep; Brief (generate → validated structured result → draft page through a suggestion, with metadata extraction); Conversation/Message (history replay, run, run-pipeline, assign, re-run, promote to a brief or a draft); every generation an AgentRun on Celery, 202 + /api/v2/runs/<id>/events, idempotency keys, budgets; YAML import/export; the studio's AI and Create areas and their extension counterparts; import_parodynews extended (assistants → Assistant, groups → Pipeline, schemas, content details → Brief, threads → Conversation); ensure_admin and the install wizard's bootstrap; the GitHub-issue error reporter as an optional logging handler. Gate: every parodynews.* ledger row done (or dropped by the owner), the import round trip, content/tests/ai/. Retires apps/parodynews/ once its sidecar site has moved (P2). Test: pytest content/tests/ai -q
  • Was (ADR 0004): G8: conversations (parodynews) — chat over an AgentRun (messages as steps, replayed to any backend), Playbook (ordered agents), OutputSchema snippets, message → page draft, the provider settings page over agents/llm.py (sync, test, default), publish-as-PR through distribution (export_jekyll → branch → PR with FLEET_TOKEN). Gate: the import_parodynews round trip and the conversations tests. Retires apps/parodynews/. Test: pytest content/tests/conversations -q
  • Backend and API (2026-10-22, content/ai/, content/ai/README.md), built ahead of P4/G10 on the overhaul's orders — the screens come with them:
    • Provider adapters behind one registry (content/ai/providers/: claude_code, anthropic, openai, litellm, recorded, fake; complete, stream, structured validated with jsonschema, list_models, health, declared capabilities; AI_PROVIDERS adds or removes one); agents/llm.py a thin front over it with its public names kept; the graph's LiteLLM embeddings moved behind it; a test that fails on a provider SDK import anywhere outside ai/providers/; the SDKs optional (requirements-providers.txt, installed by the image unless AI_PROVIDERS=false).
    • ProviderConfig (one per adapter, one default by a database constraint, the credential MultiFernet-encrypted from AI_CREDENTIAL_KEYS or SECRET_KEY — the keys derived from SECRET_KEY and its fallbacks always still decrypt — write-only over the API, dropped when the base URL changes, rotate_ai_credentials; extra only the adapter's declared options; configured by people with ai.change_providerconfig, the only ones who see the configuration), ModelEntry and its sync (a run, and manage.py sync_ai_models), the health test (a run), per-provider monthly budgets (each model call counted once, on the provider that made it).
    • OutputSchema (validated as a JSON Schema on save, versioned, a Django-template render template), barodybroject's three bundled schemas and the parody prompt seeded after every migrate (content/ai/data/).
    • Assistant (propose-only; parameters validated; read-only tools only, narrowed to the assistant definition's allowlist), Pipeline/PipelineStep (previous output, the conversation or the run so far, the brief, a page field), export and import of assistants as documents.
    • Brief: generate (the structured result validated, rendered, then a metadata step through the content-detail schema) and apply (a draft page whose text arrives as suggestions from the assistant agent on the brief's run — never published).
    • Conversation/Message: post with the whole history replayed, run a pipeline, assign, re-run, delete, filter, start from a brief, promote to a brief or a draft.
    • Every generation an AgentRun of the GitOps assistant agent (agents/definitions/assistant.yaml, eval-gated on recordings) through the runner's own loop on Celery: 202 with the run, followed on /api/v2/agent-runs/<id>/stream/; Idempotency-Key on every run-creating POST; when the run executes, the rows it names and uses (each step's assistant, the output schema) re-checked against who started it and the provider against its enabled flag and budget, whatever surface started it; its tools read only pages that person may edit (ToolContext.on_behalf_of); a brief or reply whose run ends without succeeding — refused before the handler included — says so (agents.runner.run_finished).
    • /api/v2/ai/ (DRF, django-filter, cursor-paginated messages, visible_to everywhere, a row only in a site its owner edits, provider configuration for ai.change_providerconfig, a brief an agent asked for applied by the people it is shown to, a schema imported by posting its export) in the committed OpenAPI document; tools ai.run_assistant and ai.generate_brief (propose) in the registry, over MCP for an agent that lists them.
    • import_parodynews maps every barodybroject AI table (importers/parodynews_ai.py): providers without credentials, models, schemas, assistants, groups as pipelines, content details as briefs, threads and messages as conversations; Assistant no longer becomes a legacy AgentDefinition. Re-run on fresh dumps while barodybroject runs: what a person changed or deleted here since the last import — an AI row (importers.models.ImportedRecord) or a post's page — is a reported conflict and left alone unless --force, an applied brief keeps its draft even then, and a message new in the dump goes after the conversation's last.
    • Hardened after review (2026-10-22): the fixes above, each with a test that fails without it; the seeding after migrate uses the migrated models and waits for the AI tables (migrate ai zero); a schema refers only to itself and is validated without fetching; the anthropic adapter sends an OAuth token's beta beside the fallback one; a definition's anthropic/… model id reaches a vendor adapter bare, and claude_code refuses a tool-using definition; no environment credential goes to a base URL a row chose; a pipeline run on a conversation posts its prompt there first.
  • The studio's AI and Create areas (2026-10-22, web/packages/ui/src/ai/, web/studio/src/ai/) — landed ahead of § 3's order (before G10 and G3) as a parallel track of the overhaul's wave 2, on overhaul/studio-ai; every workspace is a @zer0/ui component, router- and transport-agnostic, so G10 renders the same ones:
    • AI → Providers: every adapter's status, credential (set or not set) and last health for everyone; for those with ai.change_providerconfig, the configuration (the credential write-only: typed into an empty field, sent once, never shown), test and model sync as runs followed live, and the default; the default's status on Home.
    • AI → Models: the synced catalog, filtered by provider, activity and name.
    • AI → Assistants: list, create, edit (instructions, prompt template, provider and model, temperature, top p, max tokens, effort, output schema, the read-only tools its runs use), try on a prompt with the run followed to its answer (Markdown rendered, the structured JSON beside it), export as a document to copy or save, import one; read-only for someone it is shared with.
    • AI → Pipelines: ordered steps — each step's assistant and what it reads — reordered by dragging (@dnd-kit, pointer or keyboard) or the move buttons, saved as a whole; run and follow.
    • AI → Output schemas: list, edit with feedback as the schema is typed and the platform's verdict on save, export, import, the bundled ones (staff).
    • Create → Briefs: write one (a prompt or a text, an assistant or a pipeline, a schema, the site, where the draft goes and its type), generate it (202, the run followed live), review the rendered Markdown, the metadata and the structured result, apply it — the draft opens in Write on its Suggestions tab; generate again after a failure; "Talk it over" starts a conversation from it.
    • Conversations (AI and Create): start one with an assistant, send a message and watch the reply's run until the answer shows, ask again (the same assistant or another), run the conversation's pipeline, filter by side or failure, promote a message to a brief or a draft, delete; who replies and the pipeline.
    • Write → the editor's AI panel: an assistant or a pipeline on the whole page, one block, or text selected in a block; the answer lands on the page as suggestions (never an edit), the run followed live, then reviewed in the Suggestions tab.
    • Discovered — the panel needed an answer to land on an existing page: run/ on an assistant or a pipeline takes suggest with page_id (and block_id, selection) and starts a page run whose answer the worker proposes on that page (services.suggest_on_page, propose_answer: new blocks at the end, or the block replaced, a selection swapped inside it), all of the suggestions or none, the person's edit right and the page's agent policy asked when the run is requested and again in the worker; content/tests/ai/test_on_page.py.
    • Discovered — assistants/tools/ (the read-only tools an assistant may list that its runs use), can_edit on every owned row, a brief's page and source_message typed nullable, the conversation's run-pipeline request without the page fields it ignored; and request bodies as their own OpenAPI components (COMPONENT_SPLIT_REQUEST), because openapi-typescript kept read-only fields required in requests.
    • Browser scenarios verify/scenarios/studio-ai-{brief,chat,workspace}.yml (studio-ai-brief and studio-ai-chat for feature ZER0-044, studio-ai-workspace for ZER0-043), passing with evidence under test/evidence/; the verify kit's platform runs agent runs in the request and answers assistants from verify/recordings/. studio-ai-workspace (added after review) opens the providers and the catalog, writes a schema with feedback as it is typed, and builds a pipeline whose steps it drags from the keyboard, saves, and reads back in the new order.
    • Hardened after review (2026-10-22, second pass), each with a test that fails without it:
    • A selection on a page is placed, not searched for: the panel sends the field of a structured block (data-field) and the character it starts at in the text a person sees (a paragraph's without its markup, from its source or from TipTap; Markdown's from TipTap only when the words show as often as they are written); the platform checks it there (services.place) — or, without a start, takes a selection that appears in the block once and refuses the rest with the reason — and swaps only that text (services.swap: a paragraph's text nodes through BeautifulSoup, Wagtail's own HTML parser, never a tag or an attribute; a struct block's named field; that occurrence). Before, a selection was the first match anywhere in the stored value: a link's linktype or href, a heading's level, a code block's language, another occurrence.
    • Suggestions are proposed through the registry: _propose calls content.propose_edit as the assistant agent acting for the person (on_behalf_of), so the agent's policy (the run's configuration) narrowed by the page's, its group's page permissions, the person's edit right and the tool's rate hold as for any agent — for a page run and for an applied brief alike; check_page asks the registry (Registry.check, every check but the rate) when the run is requested and again in the worker. The assistant definition lists content.propose_edit; the model is offered only read tools.
    • Only a person asks for suggestions on a page or applies a brief: an agent principal (an agent token) is refused at the request and in the worker — it proposes with content.propose_edit under its own policy, tools and token.
    • A replacement whose text reads the same but whose stored value differs (a link's target, the markup) is shown in the review by its stored values, labelled "markup only" (suggestions.services.describe), never as "No change".
    • One request per action: every request that starts a run sends an Idempotency-Key made when the person acts; its control waits while it is out (a provider's Test and Sync, one check at a time; a message's actions; Ctrl+Enter); and a button that starts a run or makes a row ignores a double click's second click however fast the platform answered.
    • A brief is saved and generated in two requests: a new brief is made once and opened whatever generating it answers (a refusal is shown on the brief, from whichever screen asked — useMutationState), and saving again changes that brief.
    • A conversation opens on its newest messages and loads earlier ones on request (useInfiniteQuery; the API's ordering=-seq), reading again only the pages it shows — no longer every message, at most 5000, after every turn.
    • Found by the new browser scenario: a JSON field reformatted when it lost focus grew and moved the button below it out from under the click (the schema's Create needed two clicks); no JSON field reformats on blur.
    • Vitest for editing an assistant, creating a pipeline, promoting a message to a brief, the AI panel's pipeline mode and its selections, the double activations; pytest for paragraphs with an internal and an external link, an entity, a heading's digit, a code block's language, a repeated word, an agent principal, a narrowed agent:assistant group and the rate.
  • The AI and Create areas' extension counterparts — G10 (the extension renders these components; the ledger's parity report lists each studio: done, extension: missing row).
  • ensure_admin and the install wizard's bootstrap (parodynews.install-wizard, parodynews.ops-commands); the GitHub-issue error reporter as an optional logging handler (parodynews.error-issues).
  • Pipeline steps that are actions, per-person and per-site budgets (H2), token-by-token streaming. (Sources and ideas attached to a brief landed with G14: a brief's citations reach its writer through ai.handlers.brief_context, and promoting an idea writes the brief from it.)
  • The gate: every parodynews.* row done — 16 of 41 now: the provider registry, the import and ownership, and since the screens 13 rows whose platform half the backend proved (configuration, test and model sync of providers, structured output, assistants, groups as pipelines, the schema library, generating an article, extracting metadata, content from text, threads, running a group on a thread, a message to a post), each with its studio test as proof and its API test in the note. Done means a person can use it from its workspace (ADR 0006 decision 15). Open: the messages screen across threads with per-message assignment (parodynews.messages: the studio works within one thread), the SPA as a whole until its posts screens are (parodynews.spa), accounts (G3), publishing as a pull request (G5), the sidecar site (P2), the newsroom (G15), post editing, preview and versions as the site moves (P2, P4's open items), the back office for every model (content.bulk), deploy and operations.
  • Deviations: runs are followed on the existing /api/v2/agent-runs/<id>/stream/, not TARGET.md's /api/v2/runs/<id>/events; assistants export and import as JSON documents rather than YAML; barodybroject's schema README (OpenAI-era usage notes) was not copied with its files; the bundled set is seeded after every migrate (post_migrate, like the agent principals) rather than by a data migration, and a bundled row a person edited is left alone; OpenAI's strict schema mode is off (the result is validated locally either way); tool names travel to vendors with __ for ., which vendor function names forbid; configuring providers is a Django permission (ai.change_providerconfig), not is_staff — the editors' fixture is staff; the claude_code adapter takes no cli_path, env or cwd from a provider row (barodybroject's did) — they are the deployment's; import_parodynews gained --force, and the post pages it imports are guarded like the Jekyll importer's.
  • Test: cd content && python -m pytest -q (279 passed, 1 skipped — 255 before the review fixes, 173 before G8; the theme-checkout skip unchanged) · python manage.py makemigrations --check --dry-run · ruff check . && ruff format --check . · python manage.py run_evals --all --recorded (14 cases, the two assistant ones included) · the OpenAPI drift command · python3 tools/check_absorption.py · python3 -m unittest discover tools/tests · ruby bin/zer0 check
  • Deviations, the screens: the editor's AI panel lands an answer as suggestions through a new page run (rather than a brief applied to an existing page, which would have made the person generate, review and apply for every request; the suggestions are the review); it reads the saved draft, so a selection is taken from a block as saved and an unsaved one is refused with a reason; Markdown is rendered by TipTap read-only (already the editor's library) rather than a Markdown renderer; every request that starts a run sends an Idempotency-Key made when the person acts (the first pass sent none, and claimed every run button waited while its request was out — two did not, and Ctrl+Enter did not); beautifulsoup4 is now a direct dependency (it was Wagtail's) for swapping a selection in a paragraph's text nodes; the assistant definition lists content.propose_edit, which only its handler calls; request bodies became …Request components in the OpenAPI document (COMPONENT_SPLIT_REQUEST), a renaming of the request-only components with no change to any path; the AI and Create areas are tabs that are routes (studio/src/ai/) rather than more top-level routes in App.tsx; the verify kit's platform runs agent runs in the request (CELERY_TASK_ALWAYS_EAGER) and answers assistants from hand-written, digest-free recordings in verify/recordings/, which nothing else reads.
  • Test, the screens (2026-10-22): cd web && npm ci && npm run lint && npm run typecheck && npm test (82 passed in 17 files — 39 in 9 before) && npm run build && npm run check:api · cd content && python -m pytest -q (331 passed, 1 skipped) · makemigrations --check --dry-run · ruff check . && ruff format --check . · run_evals --all --recorded on a fresh database after sync_agents --publish (14 passed) · the OpenAPI drift command · node verify/runner.mjs (6 of 6 scenarios, the two new ones included) · python3 tools/check_absorption.py · python3 -m unittest discover tools/tests · python3 bin/zer0 check · unwrap-prose --check
  • Test, after review (2026-10-22): cd web && npm ci && npm run lint && npm run typecheck && npm test (92 passed in 17 files) && npm run build && npm run check:api · cd content && python -m pytest -q (338 passed, 1 skipped) · makemigrations --check --dry-run · ruff check . && ruff format --check . · run_evals --all --recorded on a fresh database after sync_agents --publish (14 passed) · the OpenAPI drift command (and the GraphQL and agent schemas: unchanged) · node verify/runner.mjs on a freshly seeded platform (7 of 7 scenarios, studio-ai-workspace new) · python3 tools/check_absorption.py · python3 -m unittest discover tools/tests (56 OK) · python3 bin/zer0 check · unwrap-prose --check
  • G9: Books in the database, with generated files and AI-assisted writing (ADR 0006 decisions 13 and 14) — import_books (library/<slug>/ → BookPage, parts and ChapterPages; manifest, outline, characters, style guide and continuity notes as fields and Memory) and export_books (the generated library/<slug>/, byte-stable, committed by a job; a hand edit re-imported as a suggestion); create (premise → outline → chapter plan, as briefs), manage (structure, order, status, continuity, validation, statistics, compiled manuscripts, the static dashboard), write (draft, continue, rewrite or expand a chapter; continuity and voice checks) through assistants, pipelines and conversations that read the book's context, every result a suggestion; the books CLI's commands as manage.py commands; the studio's Books area and its extension counterpart; the ABC wizard and drsai's story engine as book types and generators. Gate: the round trip on library/impairment (import → export → byte-compare), every books.* ledger row done, the Rails wizard's fixtures. Retires packages/books/src/ and the Rails ABC code. Test: pytest content/tests/books -q
  • Was (ADR 0004): G9: books + the ABC wizard view — import_books (library/<slug>/ → BookPage/ChapterPage, the continuity ledger → Memory), the books.validate tool and a continuity review profile, export_manuscript, the ABC wizard as an admin form over the drafter abc profile and export_jekyll. Gate: parity on library/impairment and the Rails wizard's fixtures. Retires packages/books/src/ and the Rails ABC code. Test: pytest content/tests/books -q
  • Status, 2026-10-22: built on overhaul/books, ahead of § 3's order, as one of the five parallel tracks of the overhaul's second wave (the order is the integrator's to keep). Everything the books package does is in the platform and a person uses it from the studio's Books area; the box stays open for the unticked items below — the ABC wizard and drsai's story engine, which the gate names, parts (P-D8), pipelines and conversations over a book's material, the extension (G10), and what keeps four books.* rows partial. 16 of the 20 books.* rows are done (docs/plan/capabilities.yml); packages/books/src/ stays until they all are (G11). A review of the first series (two independent verifiers, 17 findings) was fixed on the same branch the same day; the items below describe the result.
  • The model (content/cms/models.py, migration cms/0002_book_manuscripts): BookPage holds the manifest — status (idea → outlining → drafting → revising → complete, or archived), logline, genre, point of view, tense, era, protagonist, acts, planned chapters, word target, themes, cast — the outline, the character bible, the continuity ledger, a style guide, and the book's other files as documents (the act guides, the README); ChapterPage holds a chapter's front matter (number, subtitle, act, status, point of view, era, characters, setting, tone, style) and its body as blocks; every other key stays in front_matter, in order. A book's parts are its acts, for now (P-D8). Every field but documents is an editor field, so the studio's page editor edits them as draft revisions; documents — the act guides a chapter task reads, the README — are edited one file at a time in the Books area's Files tab (/api/v2/books/<id>/documents/, a draft revision against the revision they were read from). The manuscript fields joined the content hash in cms/0002; one still at its default is left out of it (BasePage.sparse_hashed_fields), so a Jekyll site's book or chapter imported before them keeps its import hash and still exports its stored source verbatim.
  • import_books, export_books, roundtrip_books (content/books/files.py): each book and chapter renders its file over the ImportedSource it was read from — a YAML key rewritten only when its value changed (line surgery), a chapter body kept while its blocks are unchanged — so an unchanged book is byte-identical: 26 of 26 files of packages/books/library (impairment and _template) after the round trip, and an export back into the library itself writes nothing. A _-prefixed directory is a template, off the shelf. The generated tree stays at packages/books/library/ for now (BOOKS_LIBRARY_DIR, configurable); G11 decides its permanent home.
  • Neither side loses the other's change (ADR 0006 decision 13: "never lost and never silently overwritten"): books.LibraryFile (migration books/0001_initial) records, per library directory, what the platform last read from or wrote to each file — its digest, its page (kept as a record when the page is deleted), that page's content hash then. export_books writes what is live (--include-drafts: the latest revisions) and only over a file still as the platform last read or wrote it: a hand edit is kept and reported (exit 1; --force overwrites); the file of a renumbered, deleted or unpublished chapter, a removed document or a deleted book is removed while unchanged. import_books matches a file to the page last read from or written to it — a chapter renumbered in the studio keeps its old file until an export moves it, so nothing is created twice — leaves a file unchanged since alone, takes a changed one only while its page has not changed here since (else a conflict; --force), publishes only over a live page with no draft (otherwise a draft revision; a new chapter under a draft book stays a draft), and never brings back a page deleted here. Records are per directory, so an export to a scratch directory never makes the library's own files look hand-edited. Two chapters never share a file: when two want one name, the later keeps its own file or takes ch0NN.md, and validation reports chapter-duplicate; add_chapter takes the book's row lock, so two never take one number.
  • The bookshelf CLI as manage.py books list | show | new | add-chapter | validate | stats | build | dashboard | context, with its output, over a read model of the rendered files (content/books/library.py, services.py): the same validation codes, narrative-only word counts, the manuscript layout, library.json. On the real library the findings (3 errors, 120 warnings), library.json, both manuscripts and the assistant's context for the book and every chapter are identical to bookshelf's (content/tests/books/golden/bookshelf.json, recorded from packages/books/src).
  • AI through content/ai only: the GitOps books agent (content/agents/definitions/books.yaml, three eval cases on recordings) runs each bookshelf task — draft, continue, revise a passage to an instruction, continuity check, critique, outline — with the book's context assembled as bookshelf assembled it, through the AI layer's generate (the provider registry, budgets, the output schema validated). Draft, continue and revise are proposed as suggestions on the chapter through the tool registry, on behalf of the person who asked; the continuity check (structured findings in the bundled continuity-findings schema), the critique and the outline are the run's output. Six bundled assistants carry bookshelf's house rules and the package's authoring guidance, with the book-outline and continuity-findings schemas and a premise-to-critiqued-outline pipeline, seeded after every migrate; a person may run a task with an assistant of their own. A book from a premise is an ai.Brief the bundled outliner generates; when the person accepts it, the book is made as a draft with its facts, its outline and a stub per planned chapter, each value cut to its field so one long or empty value never costs the book; applied through the AI layer's generic apply/, the same brief makes the same book (BookPage.from_brief). Nothing is published. Draft and Continue find the prose as the read model does (library.prose_spans), so on a chapter whose sections are # headings in one Markdown block (impairment's ch03 and ch05) only the prose is replaced or continued, never the outline, references or links.
  • /api/v2/books/ (the library's shelf, overview, findings, chapters, a book's other files, manuscript, context, assist/ with Idempotency-Key, premise) in the committed OpenAPI document, and the studio's Books area (web/packages/ui/src/books/, the area's milestone flag removed): the shelf, a new book from the template or from a premise, a book's facts and statistics, its outline with the outliner's proposal as a diff, characters, continuity and style guide, its other files, chapters in order, findings, the manuscript to read and download, and the chapter writer — the page editor beside the book assistant and the chapter's findings. The Books area holds the library's books only (a Jekyll site's books stay that site's pages until books.abc), the same whichever site is picked. A smoke test against a running platform (recorded provider) drafted a chapter of impairment from the studio into a pending suggestion.
  • Tests: content/tests/books/ (68: the round trip and the import's and the export's rules — a hand edit kept, no draft published, a renumber and a deletion not undone, duplicate numbers, a scratch export — every validation code and the parity with bookshelf, every task on the fake provider including the real book's #-sectioned chapters and its own banned phrase, the premise flow and the generic apply, the worker's re-checks, the API with a book's other files and a Jekyll site's books, the commands), content/tests/suggestions/ (the guard on what a replace adds) and web/packages/ui/test/books.test.tsx (12: the chapter writer and the Files tab among them).
  • The ABC wizard and drsai's story engine as book types and generators (books.abc; the drafter's abc and story profiles exist) — the gate's "Rails wizard's fixtures". The Rails wizard and generator were deleted on 2026-10-27 (ADR 0008): what they did is rails.abc-wizard-ui and rails.abc-generator in rails-cms-spec.md, and their fixtures are drsai's it-alphabet book, which the Rails generator reproduced byte for byte at d0a572fb.
  • A hand edit to a generated file arriving as a suggestion (ADR 0006 decision 13: today it updates its page when the platform has not changed it, else it is a conflict), and the export committed by a job (G4's jobs) — content.export stays partial.
  • Autosave in the editor (content.edit), token-by-token streaming (G8's open item) and prompt caching of a book's brief in the provider adapters — what keeps books.studio-editor, books.ai-draft-continue, books.ai-context and books.ai-client partial.
  • The brand guard on fiction (P-D7, decided 2026-10-28): a book switches the built-in bans off for its chapters (BookPage.builtin_bans, the "Built-in bans" switch among the facts in the Books overview, saved as a draft revision and read from the book's latest revision), and a site for every book's chapters on it (SiteSettings.chapter_builtin_bans, in the Sites area's settings) — at propose and at accept (suggestions/services.py), in the brand review (agents/handlers/reviews.py), in the brand_clean eval, judged on each suggestion's own target, and in what brand.rules lists for the agent; the filler warnings, the same marketing vocabulary, go with them. The markup check, every active BrandRules and the site's own banned phrases still hold. The switch is a setting of the book, not its text: it is in no file of library/<slug>/ and not in the content hash. Tests: content/tests/books/test_ai.py (a book with the bans off takes "revolutionary" and still refuses active markup and the site's own phrase; with them on, propose refuses it, and accept refuses it again after the switch went back on; a site's switch), content/tests/workflow/test_review.py (the brand review), books.test.tsx and sites.test.tsx. The extension needs no counterpart: its guard (src/core/governance/guard.ts) judges only a distribution post's commentary, which is marketing copy whatever it is about.
  • MCP tools for books, and the extension's Books counterpart (G10).
  • Parts between a book and its chapters (ADR 0006 decision 14) — today a book's parts are its acts; open decision P-D8 (§ 7). Keeps books.manage partial.
  • Pipelines and conversations over a book's own material (the decision's "assistants, pipelines and conversations that read the book's context"): a book task as a pipeline step, a conversation about a chapter that carries the book's brief. The bundled premise-to-critiqued-outline pipeline runs today from the AI area on a premise, not on a book.
  • A Jekyll site's book or chapter in its site's export with the manuscript fields: the studio's page editor shows them for every BookPage and ChapterPage, and export_jekyll does not write them, so an edit to them on a Jekyll site's book stays in the platform only (the Jekyll importer does not read them either). With the ABC wizard and the story engine (books.abc).
  • Deviations: an outline for an existing book is offered as a diff that the person takes into the outline field and saves (their draft revision), not as a Suggestion — a suggestion's meta op covers the title and SEO fields only; validation, statistics and the AI context read the rendered file set, so a relative link that leaves the book's directory is not checked (bookshelf checked the disk); a book made here renders its manifest from its fields and front_matter without the template's comments, as bookshelf's books new did; books ask, studio and serve are the studio's Books area (a task is a run a person starts); imported books and chapters are published by legacy:import, as the other importers publish, but only over a live page with no draft and, for a new chapter, under a live book — otherwise a draft revision; export_books writes what is live unless --include-drafts (as export_jekyll); a book made from a premise gets the model's values in the accepting person's draft revisions rather than as suggestions (the meta op covers the title and SEO fields only; the brief records the book it made); the continuity ledger and the character bible are fields only, not the agents' Memory as the milestone's text says — nothing read the copy, and memory.recall checks no page rights, so it showed unpublished manuscript text to any person's assistant (memory.recall is off the books agent's tools too); a person renumbering chapters may pass through two chapters with one number (validation reports it, the files stay apart) rather than be refused, as bookshelf allowed; the brand guard holds book suggestions to the platform's bans like every agent's — on what a suggestion adds, so the author's own words never block Continue or Revise — and a draft that uses a banned phrase itself (a satire's corporate jargon, say) is refused unless the book or its site switched the built-in bans off (P-D7, above). Shared files changed: additively — INSTALLED_APPS, two settings, two enum names, the URLconf and the OpenAPI scope; an eval's fixture page may have children; a JSON list field renders as tags in the studio's field panel; ChapterPage has a docstring (the agent block schema regenerated); the AI layer's tests assert their own bundled set instead of counting every app's; BasePage.sparse_hashed_fields; BookPage.from_brief, which ai.services.apply_brief calls for a page type that has one — and in behaviour: suggestions judges a replace on the banned phrases it adds (guard.page_findings(…, before=…), at propose and at accept), where it judged the whole new block.
  • Test: cd content && python -m pytest -q (391 passed, 1 skipped — 369 before the review fixes, 322 before G9, the theme-checkout skip unchanged; the same on Postgres with pgvector; pytest tests/books -q: 68) · python manage.py makemigrations --check --dry-run · ruff check . && ruff format --check . · python manage.py run_evals --all --recorded on a freshly migrated database after sync_agents --publish (17 cases, the three books ones included) · the OpenAPI drift command (--fail-on-warn, no drift), the agent block schema and the GraphQL schema (no drift) · import_books then export_books and diff -r against packages/books/library/impairment and _template (identical), export_books back into the library (0 written, 26 unchanged; git status clean), roundtrip_books (26/26) · cd web && npm ci && npm run lint && npm run typecheck && npm test && npm run build && npm run check:api (52 tests, books.test.tsx 12) · python3 tools/check_absorption.py · python3 -m unittest discover tools/tests · python3 bin/zer0 check · python3 tools/unwrap-prose.py --check …
  • G10: The extension on the studio's stack (ADR 0006 decision 9; was M18 and "the extension as the platform's client") — web/packages/ built so its workspaces render inside a webview (CSP with nonces, VS Code theme tokens mapped onto the design tokens, postMessage transport for the generated client); dist/panel.js, dist/dashboard.js and dist/agent.js replaced by those workspaces; the host side reduced to commands, tree views, editor integration, secret storage, the platform URL and token, and MCP registration; the esbuild allow-list extended to the shared libraries, and src/core/shared/'s hand-rolled YAML, glob, date and JSONC helpers replaced by them (each golden that moves re-recorded with its reason); the extension's governance, ledger and harness duplicates deleted where the platform covers them; file mode kept for sites still on files. Accept: every capability marked studio: done is extension: done or a recorded gap; the extension's line count goes down. Test: npm test && npx vscode-test --label multiroot
  • Status, 2026-10-22: built on overhaul/extension as a parallel track of the overhaul, ahead of § 3's order — P4 had merged; G3, the studio's AI screens and the wave-2 workspaces (G14, G15, G9, P2) were in flight beside it. One commit series per concern. Both Accept items hold for what exists today; the box stays open for the three items below that are not done.
  • web/packages/ built so its workspaces render inside a webview: @zer0/ui exports WORKSPACES, the workspace registry (each entry with the destinations it shows), and SitePicker (the studio's header uses it too); web/packages/webview (@zer0/webview) is the extension's webview app — the dashboard (a tab per registered workspace), the page behind the open file, the AI workspace — over a postMessage transport, in the editor's theme (editor.css maps every --zer0-* token onto media/tokens.css's --z-*, so light, dark and high contrast follow the editor live); esbuild.js builds it into dist/studio.js and dist/studio.css with its own allow-list of the studio's libraries, and the root postinstall installs web/ from its lockfile. The page is default-src 'none' with scripts and styles by nonce (Mantine's <style> elements carry it; TipTap's injected CSS stays off) — no 'unsafe-inline', no connection.
  • The host side: src/core/studio/bridge.ts (pure, injected, tested in the fast suite) sends each request a webview names — a path under /api/v2/ only, never the session endpoints, JSON bodies, redirects refused — with the platform URL from the settings layer and the person's token from SecretStorage (one per platform origin, never posted, logged or reported), asks modally before publish, unpublish or schedule, and relays event streams (followed host-side with eventsource, which can send the token as a header); src/studio/studio.ts places the views; zer0Cms.platform.url (settings layer only, restricted and ignored in an untrusted workspace), zer0Cms.platform.setToken and .clearToken. No request at activation (D11); the startup dashboard stays file mode.
  • With a platform configured the dashboard renders every workspace the registry exports, the Metadata view the studio's page editor for the page behind the open file (GET /api/v2/content/pages/?source=<path>, matched against the import's ImportedSource.legacy_path and the site's source_root; "not on the platform" said plainly, several matches offered as a choice) and the agent view the AI workspace; a destination a view does not show opens the dashboard there. With none, file mode is untouched: its suites are green unchanged, and the file-mode dashboard keeps the fleet console, the audit and the harness under their own commands in either mode.
  • The platform side: ?source= on the pages list (importers/services.py), and accounts.UserToken — a person's bearer token (hashed, optionally expiring, revoked; manage.py user_token), which the studio's people-only endpoints accept — as the first slice of G3's UserToken; the OpenAPI document and web/packages/api regenerated.
  • src/core/shared/'s hand-rolled helpers replaced by the libraries, each in its own commit: YAML by yaml (frontmatter.ts 1578 → 1033 lines, siteConfig.ts 312 → 205 — anchors, aliases, merge keys, tags, multi-line flow collections and escapes now read as YAML reads them; dates stay strings; an alias to no anchor is null and a warning), JSON with comments by jsonc-parser (jsonio.ts 338 → 222), globs by picomatch (glob.ts 164 → 136), dates by date-fns with @date-fns/tz (dates.ts 562 → 99). No golden moved; the tests that pinned the subset's limitations now pin YAML's behaviour, and four audit fixtures' prose says so. The node bundles admit them as CORE_LIBRARIES — the MCP bundle exactly those, never the engines package — and dist/panel.js the two date libraries.
  • Every capability marked studio: done is extension: done: content.revisions, content.publish, ai.suggestions and platform.shared-ui, each proved by web/packages/webview/test/webview.test.tsx (the extension's own App over a fake host and platform); ai.streaming, platform.tokens and content.collaboration moved to partial. The remaining gaps are reported by tools/check_absorption.py --report.
  • The extension's line count goes down: tracked src/**/*.ts 74,456 → 74,339 lines (60,852 → 60,338 outside src/test/, which grew by the bridge and integration tests), src/core/shared/ 4,264 → 3,657; the webview app it now ships is 444 lines of React in web/packages/ (the app, the transport, the registry and the site picker). After the review fixes below: 60,565 outside src/test/, still under the base; 74,767 with the tests, which is above it, because each fix came with the tests that would have caught it.
  • dist/panel.js, dist/dashboard.js and dist/agent.js replaced by the workspaces: they are file mode, which this milestone keeps for sites still on files; in platform mode they are not loaded. They go when a site's files stop being its source (Phase F, G4).
  • The extension's governance, ledger and harness duplicates deleted where the platform covers them: the platform covers them only for sites on the platform, and file mode still needs them; same dependency as above.
  • The wave-2 workspaces (the studio's AI screens, Ideas, Research, the Newsroom, Books) reach the extension by one WORKSPACES entry each when they merge — done when G10 merged onto main (2026-10-27), for those and wave 3's too: WORKSPACES is the studio's areas in its navigation order (Home, Write, Create, Ideas, Research, Newsroom, Books, Review, AI, Outbox, Sites, Distribution; Media and Admin when G6 and G3 build them), each placing the components the studio's routes place, and HOME names the workspace of every destination — typed over the whole Destination union, so a destination added without one fails tsc. The agent view is the AI area's seven sections (runs, assistants, pipelines, output schemas, conversations, providers, models). The bridge's modal now also covers a newsroom story moved to published or scheduled (read from the body that is sent), a distribution post published and a newsletter issue sent. Proved through the host: an idea's vote, and a site's sync with its job followed over the host's stream (ideas.board, sites.jobs → extension: done); every other row these workspaces carry is extension: partial with what is not yet proved, and the gaps a webview has by nature are recorded in the ledger — an upload (research.capture), a data: download (a book's manuscript, the distribution ledger, an assistant's export), the research bookmarklet and LinkedIn's consent return (both the studio's own address).
  • Every workspace proved through the real host (2026-11-15, issue #65): web/packages/webview/test/host.test.tsx renders the same App over connect(port) with every message handed to a real StudioBridge, whose only fakes are the platform behind fetch, the modal, the token and the stream opener, so the path gate, the LIVE_CHANGES modal, the header allow-list and the token are in the loop for each of its 32 rows — the 16 of the parked wip/mac/harmonize/w1-extension (8b17c541), adapted to main, and 16 more for the workspaces it did not cover. Twenty-one ledger rows moved to extension: done on it: ideas.brainstorm, research.sources, research.synthesize, news.workflow, news.corrections, the four outbox.* rows, ai.providers, ai.pipelines, ai.briefs, ai.conversations, ai.streaming, sites.registry (registering, the registry fields and the settings, a row each), sites.doctor, the three aieo.* rows the parity report listed, books.create and books.write. Taking Idempotency-Key out of REQUEST_HEADERS fails the twelve rows that send one or follow the job one starts, taking the page-publish pattern out of LIVE_CHANGES fails content.publish, and taking published out of STORY_RELEASES fails news.workflow. web.yml now also runs on a change to src/core/studio/, which bridge.ts's header asks to keep import-free. The parity report is down from 26 gaps to 5, each recorded on its row: content.workflow and content.search (no studio screen yet), ai.assistants (its export downloads as a data: link the host does not open), distribution.queue (the ledger download and LinkedIn's consent return) and platform.accounts (signing in from the editor, G3).
  • Review fixes, 2026-10-22 (two independent verifiers): the bridge gates the URL it sends rather than the text the webview posted (./, %70ublish, // and a trailing /. reached publish and unpublish without the modal, and /api/v2/./session/ the session endpoints), and a page id is any one segment, so a UUID asks too; plain http is accepted for this machine only; the studio webview's images come from the platform and nowhere else (img-src no longer allows any https host); the transport carries Idempotency-Key and If-Match and the response headers a workspace reads, and refuses an upload with extension.unsupported_body (recorded as a gap under platform.shared-ui); platform mode is decided per file — the Metadata view keeps file mode for a file the platform has no page for, and zer0Cms.dashboard.files opens the file-mode dashboard, which the fleet, monitor, audit, harness and draft commands now open in either mode; ?source= sends the folder's name first and the platform matches no site without it, so another site's page never opens for a file; an alias inside the node it names reads as unknown instead of building data that contains itself; date patterns keep file mode's vocabulary (Moment's D, YY, Do read as theirs, every other letter written as typed — an unquoted T had become the epoch in milliseconds, and D threw out of the panel); dist/THIRD_PARTY_NOTICES.txt carries the licence of every bundled library into the vsix. On the platform: both bearer tokens share accounts.tokens.HashedToken, whose use is recorded at most every five minutes after the request commits (a write inside ATOMIC_REQUESTS failed parallel requests with "database is locked"); accounts.services issues (90 days by default, a superuser's only with --superuser), lists and revokes; UserToken has a UUID public_id and visible_to; and zer0u_ tokens are redacted in logs, Django's error reports (in development too) and Sentry's frame variables.
  • Deviations: the token is a person's bearer token issued on the platform (manage.py user_token) and pasted into zer0-CMS: Set platform token, because the studio's endpoints serve people only and the extension host cannot hold a browser session; signing in from the editor is G3's (allauth headless). P-D6 (public ids) was still open: the extension persists no id, so moving to UUIDs stayed one change in @zer0/ui — made on 2026-10-28 (ADR 0009). The studio's own routes (web/studio/src/App.tsx) still compose the same components directly rather than through WORKSPACES, left untouched while the wave-2 tracks edit that file. TOML front matter keeps its small reader, and core/harness/workflows.ts its line scans, which could now read the parsed document — neither was in this milestone's list. The test line's npx vscode-test --label multiroot is part of npm test, which runs both labels. docs/CONFIG.md §5 is maintained by hand and checked by tools/check-config-docs.py; there is no generator for it.
  • Merged onto main, 2026-10-27 (110 commits behind it; 15 conflicts, resolved by PR #70's rules — the merge commit lists each): main's @zer0/ui needed @dnd-kit/* in dist/studio.js's allow-list, schemas/books/ (ADR 0008) left the vsix, the webview's entry hands its nonce to get-nonce as the studio's does, and the registry and the bridge reached main's workspaces (above). Gates on the result: npm ci && npm run compile; the fourteen fast Mocha suites 387 passing, 2 pending, mcp.test.js 19; npm test on macOS (VS Code 1.101.0, no xvfb); the vsix file list; cd web && npm run lint && npm run typecheck && npm test && npm run build && npm run check:api; cd content && python -m pytest -q -m "not slow", makemigrations --check --dry-run, ruff check . && ruff format --check ., the OpenAPI drift command (the merge's document regenerated); tools/check_absorption.py, bin/zer0 check, python3 -m unittest discover -s tools/tests, tools/docs_index.py --lint, tools/check-config-docs.py — results in the commit messages.
  • Test: npm ci && npm run compile · the fourteen Mocha suites (384 passing, and mcp.test.js 19) · npm test (workspace 434 passing + 7 pending — the multiroot suite skipping itself in the one-folder window — and multiroot 8 passing) · the vsix file list (vsce ls equals .vsix-manifest.txt) · cd web && npm ci && npm run lint && npm run typecheck && npm test && npm run build && npm run check:api · cd content && python -m pytest -q, makemigrations --check --dry-run, ruff check . && ruff format --check ., run_evals --all --recorded, the OpenAPI drift command · python3 tools/check-config-docs.py · python3 tools/check_absorption.py · python3 -m unittest discover tools/tests · python3 bin/zer0 check · unwrap-prose --check — results in the last commit's message.
  • G11: Retire (M20) — rails/ (done on 2026-10-27, ADR 0008: deleted by the owner's decision with its open rows specified), packages/zer0-image-generator/, apps/aieo/, apps/parodynews/, packages/books/src/; the workflows rails-app.yml and abc-engine.yml (gone with rails/; not zer0-linkedin.yml, which G5 kept and moved to Python), aieo.yml, parodynews.yml, books.yml; workspace.yml, docs/MONOREPO.md, ATTRIBUTION.md updated; one commit per removal, each citing its gate. Test: bin/zer0 check && bin/zer0 run test --all ADR 0006: a source goes only when tools/check_absorption.py shows its rows done or dropped — or, by the owner's decision, specified (ADR 0008).

  • G12: monitor (ADR 0006 decision 8) — per-site checks on Celery beat: uptime, broken links, performance and Core Web Vitals (PageSpeed Insights/CrUX), accessibility (axe-core under Playwright in a browser worker), SEO, the doctor (G4), analytics ingest (GA4, Search Console, DataForSEO — G7's connectors), AIEO audits; Check, CheckRun, Finding (rule, severity, page, evidence, first/last seen, resolved) with history and trends; alerts (email, webhook, GitHub issue); the studio's Sites → Monitor views and the extension's findings for the open page. Test: pytest content/tests/monitor -q

  • G13: evolve (ADR 0006 decision 8) — the editorial plan per site (narrative, pillars with target shares, directives); improvement agents (GitOps definitions at suggest) that read findings, analytics, AIEO scores and the plan and propose refreshes, fixes, internal links, new topics and citability rewrites as suggestions and briefs within the site's budget; outcome measurement on accepted proposals; M17's entity extraction. Test: pytest content/tests/evolve -q && python manage.py run_evals --all --recorded

  • G14: ideas + research (ADR 0006 decision 15; TARGET.md § Ideas and research) — Idea on boards (tags, status, votes, links to sources and to what it became), brainstorm sessions as conversations whose results become ideas, clustering and de-duplication by embedding, promote to a brief, an article or a book; Source (URL, feed, document, note — extracted text, metadata, summary, entities) with Quotes and Citations, collections, capture (URL with trafilatura, RSS/Atom and wire feeds with feedparser on a schedule, uploads with pypdf, web search through a provider's tool), question answering over a collection with citations, fact-checking a draft against its sources; AIEO's topics and research stages map here; the studio's Ideas and Research workspaces, and capture-an-idea, cite-a-source and fact-check-this-draft in the extension. Research agents are read-only. Test: pytest content/tests/ideas content/tests/research -q

  • Landed 2026-10-22 ahead of § 3's order (after G8's backend, before G10, G3 and G8's studio part), as one of the overhaul's five parallel tracks of wave 2; the extension half waits for G10 like every workspace. The box stays open, as G8's does, until the open items below land: the extension's three actions, the agent tools, wire feeds and the owner's decision on the fact checker.
  • The AI layer's seams for the apps built on it (content/ai/): run kinds registered by an app (ai.handlers.register), the re-checks owned/used made public, brief_context (what a brief's writer reads after its prompt — the sources it cites), import_bundled(state, path) for an app's own bundle, and the provider capability search (Provider.search → SearchResults), declared by the anthropic adapter through Anthropic's server-side web search tool.
  • content/research/ (/api/v2/research/, research/README.md): Collection, Source, Quote, Citation, FeedSubscription, Question, FactCheck; URL capture in a worker through research/fetch.py (httpx behind an SSRF guard that resolves the host, refuses any non-public address and pins the connection to the address it checked, every redirect hop checked, size and time limits, no environment proxies; robots.txt honoured and recorded; trafilatura, pypdf), feeds with feedparser on Celery beat (research-feeds, conditional GETs), uploads (PDF, text, Markdown), notes; summaries with entities and suggested quotes, cited answers (retrieval by stored vector, then Wagtail search, then newest; every quote checked against its source), fact-checks (a block's exact corrections become one replace suggestion, proposed through the registry as the assistant agent; none on a page whose agent policy is off), web search (hits become sources to fetch), research briefs (AIEO's prompt) — each a run of the assistant agent with a bundled assistant and output schema; briefs read the sources they cite.
  • content/ideas/ (/api/v2/ideas/, ideas/README.md): Board, Idea (taggit tags, status, origin, sources, the reply it came from, the brief or page it became), Vote; capture from anywhere (with AIEO's topic template), votes, brainstorms as AI-layer conversations with the bundled Brainstormer whose ideas a person keeps, clusters and duplicates read from vectors a worker stores (graph.Embedding, kind idea), merging, promotion to a brief (the bundled Article writer; the idea's sources cited on it), an article draft or a book draft.
  • The studio: the Ideas workspace (boards and the inbox, a board made and shared — only me, a site's editors, everyone signed in — and changed beside them, columns by status, votes, capture, brainstorm, clusters, the idea's drawer with sharing, promotion and the brief's card), the Research workspace (collections made, shared and changed the same way, sources, capture by URL, upload, note or web search, ask, feeds, research brief, the bookmarklet), a source's page (with who sees it), and the editor's Research tab (cite a source, fact-check the draft — what it read and left out, exact corrections — capture an idea); the two areas' milestone flags removed.
  • Ledger: ideas.board, ideas.brainstorm, research.sources, research.synthesize done on api and studio; research.capture partial on both until wire feeds are read (extension and MCP open everywhere); aieo.topics and aieo.research done.
  • Review fixes (2026-10-22, from two independent reviews): a feed is parsed from its bytes as a stream, so a body naming a path never makes the worker read its own disk; workers write only the fields a fetch owns, to the row as it is after the network call (a deleted row stays gone, a pause or a person's change stays), and beat claims each due feed before a task of its own reads it; text is decoded by its charset, a byte-order mark or charset-normalizer, and NUL and other control characters never reach Postgres; one deadline covers a fetch's whole exchange (asyncio cancellation; httpx's timeouts are per read), the fetching tasks carry time limits and run on a research queue only the new research-worker service consumes, and what reaches the web is throttled per person; an idea shows only the sources, brief and page its reader may see, and a save keeps the links its editor cannot see; only a row's owner (or staff) changes who sees it; a fact-check reads the draft's citations first and records what it read and left out, its corrections are exact words made together per block inside the block's own value (links and emphasis kept) and proposed through registry.call('content.propose_edit'); research briefs and a brief's writer read the closest sources, not the newest; clusters are compared by pgvector on Postgres and retrieval's word stage is Wagtail search; the studio shares boards, collections, ideas and sources, with Vitest cases for the feeds panel and the drawer's save.
  • Wire feeds for research.capture (TARGET.md: "RSS, Atom, wire feeds"): feedparser reads RSS and Atom only; NewsML-G2 or ninjs — and the credentials a wire service needs — are not read yet, so the ledger row stays partial.
  • Owner decision: TARGET.md § Ideas and research says research runs are read-only for the agents that do them, while G14's brief asked that fact-check findings "become suggestions or review comments". The fact checker proposes suggestions (effect propose) through the registry's content.propose_edit, which agents/definitions/assistant.yaml lists for this one use (no assistant may list it). Either amend TARGET.md, or remove that line from assistant.yaml: the registry then refuses every proposal and each correction stays a finding, its refusal noted.
  • The extension's capture-an-idea, cite-a-source and fact-check-this-draft — with G10 (the components are @zer0/ui's, so they render there once its webviews host them).
  • Tools for agents and MCP clients (ideas.*, research.* in the registry) — the mcp surfaces stay open; AIEO's site crawl (aieo.site-context) and PRD lineage (aieo.prd-lineage) stay open.
  • Suggesting ideas from analytics and the editorial plan (TARGET.md § What it is for) — with G12/G13, which bring those signals; saved web searches that refresh on a schedule — with G16's scheduled automations (feeds already refresh on beat).
  • Deviations: brainstorms are AI-layer conversations whose reply a person keeps from (keep/), not ideas written by the run; clusters are computed from the stored vectors when asked (single-link at IDEAS_CLUSTER_THRESHOLD, duplicates at IDEAS_DUPLICATE_THRESHOLD), not by a job; a site-visible board, idea or research row is changed by everyone who edits that site (research.models.Collaborative), wider than the AI layer's owner-only rule — but who sees it (site, visibility) is changed only by its owner or staff (CollaborativeSerializer, 403), and sharing a collection does not reshare the sources already in it; a source belongs to at most one collection; retrieval embeds each source once and finds the rest by Wagtail search, then picks a source's passages by shared words, rather than embedding chunks; a fact-check reads at most six sources (the draft's citations first) and says how many it left out; a fact-check finding without a correction stays a finding on the check rather than becoming a Wagtail comment (the studio has no comments yet); a correction is the exact contradicted words and what they should say, made inside the block (inside one run of text in rich text) rather than a rewritten block, and refused when the words are not in the block once or run across a link; an upload keeps its extracted text and metadata, not the file; the fact checker proposes suggestions (effect propose, through the registry's content.propose_edit) where the other research runs only read — open for the owner (above); web search comes only from the anthropic adapter (web_search_20250305, the version that returns the result list) and the fake; the OpenAPI document gives every request body its own component (COMPONENT_SPLIT_REQUEST), so the generated client asks a create form for writable fields only; a Drawer runs without its scroll lock, whose injected <style> carries no CSP nonce; the research library's fetches run on a Celery queue and a compose worker of their own (research-worker), which the content services' command lines now list.
  • Test: cd content && python -m pytest tests/ideas tests/research -q (69 passed, on SQLite and on Postgres; 52 before the review fixes) · python -m pytest -q (391 passed, 1 skipped; 374 before the review fixes, the fast tier passed 321 before G14; the whole suite also passed on Postgres with pgvector before the last pure-function test was added, 390 passed) · python manage.py makemigrations --check --dry-run · ruff check . && ruff format --check . · python manage.py run_evals --all --recorded on a freshly migrated database after sync_agents --publish (14 cases) · the OpenAPI drift command · cd web && npm run lint && npm run typecheck && npm test && npm run build && npm run check:api (58 tests; 53 before the review fixes) · python3 tools/check_absorption.py · python3 -m unittest discover tools/tests · python3 bin/zer0 check · unwrap-prose --check; and the built studio driven in a browser against a seeded platform (sign in, a board, capture, vote, clusters, promote to an article draft, the editor's Research tab, a note, the SSRF refusal, citing a source on a page; after the review fixes: a board shared with a site's editors, another editor seeing it and voting, and being refused when making it private).
  • G15: newsroom (ADR 0006 decision 15; TARGET.md § The newsroom) — desks and sections, the story budget, the editorial calendar, assignments and deadlines, the newsroom workflow (pitch → assigned → drafting → editing → copy → scheduled → published → updated or corrected) as a Wagtail workflow with embargoes and a breaking-news fast path, home and section fronts (manual and rule-based), bylines and author pages, a corrections and updates log on the story, newsletters assembled from stories and sent through django-anymail, wires and feeds from Research as pitches; parodynews runs as a newsroom with a parody desk, its assistants and schemas; the studio's Newsroom workspace, and move-a-stage and add-a-correction in the extension. Test: pytest content/tests/newsroom -q
  • Landed 2026-10-22 ahead of its place in § 3's order (before G10, G3 and G14, which precede it there), as one of five parallel tracks of the overhaul's wave 2: the extension half waits on G10, and Research's sources reach the newsroom through the interface below once G14 merges. The milestone stays open, as G8 and P4 do, until its extension half and the open items below land: the platform and the studio parts are done.
  • content/newsroom/ (content/newsroom/README.md): Desk (site, section, editors, copy editors, its writer from the AI layer), Story (the planning record behind a page — slug, headline, pitch, priority, assignee, deadline, slot date, embargo, page, brief, wire item, bylines) with StoryEvent as its history and assignment history; UUID public ids, visible_to(user, site), services, thin DRF views under /api/v2/newsroom/, in the committed OpenAPI document.
  • The workflow: editing and copy are Wagtail's (StageTask, a Task the story's desk approves: its workflow lock, moderation and log are Wagtail's), the rest the story's status; WAGTAIL_FINISH_WORKFLOW_ACTION leaves a newsroom page to the newsroom, which publishes or schedules it only through cms.services under the person's publish permission and never before the embargo; the breaking-news fast path skips copy (Wagtail records it as skipped) and keeps its reason; every other way a page goes live (Write, the Wagtail admin, an agent's tool, an importer, the scheduled publish) is refused for a story still being made or under embargo (newsroom.services.publish_refusal, enforced from page_published); a stage sent back or a workflow cancelled in Wagtail returns the story to drafting; the newsroom's stages send no Wagtail workflow email.
  • Fronts (ordered slots, pinned or "the latest of a desk"), bylines (Author snippet, ordered Bylines, an author's page; an author changed only by the editors of every site their bylines are on), corrections and updates (a log beside the page, never lost to a revert, publishing nothing else, in the page API — BasePage.bylines, BasePage.corrections — and in export_jekyll's front matter), newsletters (double opt-in with signed links that open a page changing nothing until its button is pressed, issues from published stories of the newsletter's site, the preview as sent, a send job through django-anymail with per-subscriber unsubscribe links and List-Unsubscribe, each subscriber mailed once — IssueDelivery — and a failed or stalled send resumed for the rest), and pitches from a wire or feed item (services.WireItem, the interface G14's sources plug into).
  • AI through ai.services only: bundled assistants, schemas and a pipeline (content/newsroom/data/bundled.yaml) pitch from a wire item, draft a story from its pitch as a brief (made the story's page with its text as suggestions), suggest headlines and a summary (suggestions on the page) and draft a correction note — each applied or accepted by a person.
  • parodynews as a newsroom: manage.py seed_parody_desk (idempotent) makes the Parody desk on the parodynews site with barodybroject's parody writer and schema, the workflow, a home front, The Parody Weekly, and adopts the imported posts as stories.
  • The studio's Newsroom workspace (web/packages/ui/src/newsroom/): the budget as a board by status (drag with @hello-pangea/dnd or each card's menu; a column a page of the list with its count and "Show more"; a confirmation before anything goes live), the calendar, assignments, fronts, newsletters (resume a stalled send), authors, pitching, and a story's panel (moves, plan — the desk's decisions read-only to its reporter —, embargo, bylines, page, AI help, corrections, history) at /studio/newsroom/stories/<id>; verified in a browser against the platform with the parody desk.
  • The extension's move-a-stage and add-a-correction — with G10; both proved through the extension's host on 2026-11-15 (web/packages/webview/test/host.test.tsx), the move to published after the host asks.
  • Fronts' "related" and "most read" rules (the graph's related query; analytics in G12), and showing fronts, bylines and corrections on the public site (P6, or the Jekyll-theme option in P2: the export already carries authors and corrections).
  • Setting a desk up in the studio (today the API, with newsroom.add_desk, and the seed) — with the Admin area (G3).
  • A newsroom status for a story whose page was taken down (barodybroject's archived; today the story still reads published) — an owner's decision, since TARGET.md's workflow names none.
  • Review fixes (2026-10-22, two independent verifiers): the committed OpenAPI document depended on the database (Story.priority's range came from the backend's integer range; the field is declared now, and the document is byte-identical on SQLite and Postgres); an embargo, the copy desk and the fast path's reason held only on the newsroom's own path (every publish path is held to them now, and the admin's editor says why); posting a correction republished a page taken down and drafts nobody reviewed (it only adds to the log now); a cancelled Wagtail workflow stranded its story at editing; an issue could be moved to another site's newsletter by someone who may not curate it; authors were global — any desk's editor renamed or deleted another site's bylines, and deleting one with bylines, a duplicate slug or ?site=abc answered 500; a reporter could lift the editors' embargo; the subscription links changed state on a GET (a mail scanner confirmed or unsubscribed) and an old confirm link re-subscribed an address that had unsubscribed; a newsletter send that failed part way, or ran twice, mailed people twice; the newsroom's moves sent Wagtail's workflow email from inside the request, even for an approval then rolled back; the board, the calendar and the pickers dropped stories past 200 without a word; a drop on Published published at once; a reporter's own pitch refused them, and the pitch form could make a story twice; production mailed to the console when EMAIL_BACKEND was unset. Each fix has a test that fails without it.
  • Discovered: the studio's first modal tripped its own CSP — Mantine's scroll lock writes a <style> through react-style-singleton, which takes its nonce from get-nonce — so the studio host now hands the page's nonce to get-nonce too (web/studio/src/main.tsx); and one OpenAPI component serves requests and responses, so the generated client required read-only fields on a create — each newsroom create documents its writable fields only (<Name>Write), and the newsroom's endpoints take PATCH, not PUT.
  • Deviations: django-anymail without an extra (each deployment installs its ESP's: django-anymail[amazon-ses] …), its settings from ANYMAIL_* variables, and Django's SMTP backend when EMAIL_BACKEND is unset outside development; corrections are a log beside the page rather than part of its revisions, so a revert keeps them, and posting one publishes nothing — a fix goes live from the editor; the AI layer's bundled-schema tests count only its own bundle now that the newsroom seeds its own beside it; fronts' "most read" rule is deferred, as the milestone allowed. Decided here where the owner had not: a story still being made may not be published from Write at all (only through the newsroom's moves, the fast path included), while a scheduled or published story's page may, once its embargo has passed; an importer replaying a source still canonical for the site (barodybroject's publish of a post the Parody desk adopted as a draft) may move such a story on; the newsroom's stages send none of Wagtail's workflow email, and WAGTAILADMIN_NOTIFICATION_INCLUDE_SUPERUSERS is off for every workflow.
  • Test: cd content && python -m pytest -q (365 passed, 1 skipped — 43 of them tests/newsroom/; the theme-checkout skip unchanged) · the fast tier on Postgres 16 + pgvector as CI's postgres job runs it, DATABASE_URL=postgres://… python -m pytest -q -m "not slow" (364 passed; the OpenAPI document is byte-identical generated on either database) · python manage.py makemigrations --check --dry-run · ruff check . && ruff format --check . · python manage.py run_evals --all --recorded (14 cases, on a freshly migrated scratch database after sync_agents --publish) · the OpenAPI drift command (the GraphQL and agent block schemas unchanged) · cd web && npm ci && npm run lint && npm run typecheck && npm test && npm run build && npm run check:api (56 tests, 17 of them newsroom.test.tsx) · python3 tools/check_absorption.py · python3 -m unittest discover tools/tests · python3 bin/zer0 check · python3 tools/unwrap-prose.py --check --exclude '(^|/)SCHEMA\.md$' --exclude '(^|/)CHANGELOG\.md$' · the review fixes driven in a browser against a live server with the parody desk (the board's counts, the confirmation before publishing, Write refusing a story still being made, the confirm link's page)
  • G16: automations (ADR 0006 decision 15; TARGET.md § Pipelines and workflows) — Automation (trigger: an outbox event, a schedule, a webhook, a new source item, a monitor finding; conditions; actions: run a pipeline or an agent, create a brief or an idea, notify, move a workflow stage), each run logged with inputs and outcome, new automations paused until enabled, YAML import/export; the studio's AI → Automations view. Test: pytest content/tests/automations -q
  • Landed 2026-10-22 as one of the three parallel tracks of the overhaul's wave 3 (with Distribution and AIEO), on overhaul/automations, ahead of its place in § 3's order (after G4, which wave 2b was still building beside G10 and G3). Everything the milestone names is in the platform and a person uses it from the studio; its view in the extension waits for G10, like every workspace's.
  • content/automations/ (content/automations/README.md): Automation — an owned row (UUID public id, owner, site, visibility, visible_to), enabled false when it is made, its trigger and actions JSON validated against one JSON Schema per kind (spec.py, which is also how the OpenAPI document describes them, so the generated client types them as unions by kind), a JMESPath condition, on_error, max_runs_per_hour, a secret encrypted under the AI layer's credential keys, its last run — and AutomationRun: the trigger's payload, the condition's verdict, each action's inputs and outcome with links to the agent runs and rows it made, timings, the error.
  • Triggers: the platform's own events (content.page.published, content.suggestion.created, agent.run.completed) read back from zer0:content (EVENTS_STREAM) by the outbox consumer automations (consume_events --own --group automations, the new compose events service), once per event; cron schedules, in UTC, dispatched every minute by one beat task that reads each automation's cron line with Celery's own crontab and claims each due tick before firing it; webhooks signed with the automation's secret (X-Zer0-Signature-256, or GitHub's X-Hub-Signature-256: the HMAC-SHA256 of the body, checked before anything else is read; a delivery sent again gets the run it made); a research source once it is ready — a feed item, a note, a document, a captured page once fetched — in a collection or from a feed; named hooks (services.fire_hook(name, data, site=, by=), which G12's monitor findings will fire as monitor.finding). An automation hears only what its owner may see, and only its own site's; its own work never fires another (started_by_event carries automation-run:<id>).
  • Conditions: JMESPath through the maintained jmespath library (a new pinned dependency) over the payload; one that does not compile is refused when it is saved, one that cannot be evaluated fails the run with the reason; condition/ tries one against a sample payload.
  • Actions, each as the automation's owner through the service that person's own request calls — what it uses asked again when the run executes, in a savepoint of its own: run an assistant or a pipeline (ai.services), start an agent run (start_run after api.access.may_request_run, for a live agent that works from a prompt and lists no publishing tool), create a brief (written now when asked; only a person applies it), capture an idea (ideas.services.capture), notify by email (Django's mail API, so django-anymail) or a webhook (the run as JSON, signed, through the research fetcher's SSRF guard, in the worker), move a newsroom story to a stage that publishes nothing (newsroom.services.move). Nothing publishes; a failing action is recorded and the run stops there or goes on as the automation says; a firing over max_runs_per_hour is recorded as limited and runs nothing; a run still queued when its automation was paused is skipped.
  • /api/v2/automations/ for people (IsPerson), in the committed OpenAPI document: CRUD; enable/ (checked again first) and disable/ (staff may pause anyone's); test/ (a real run with a sample payload, paused or not, with an Idempotency-Key) and dry-run/; export/ and import/ as YAML, the round trip unchanged; rotate-secret/; each webhook trigger's webhook/; condition/; options/ (the events, stages and agents to pick from, and a sample payload per trigger); runs/ by cursor. An automation acts as its owner, so only its owner — or a superuser — changes, enables, tests or re-keys it, and its runs are its owner's and staff's. manage.py rotate_ai_credentials re-encrypts the automations' secrets with the providers' credentials, in one transaction.
  • The automations.fire_hook tool (write: an agent at policy draft, live and past its evals, that lists it), in a run or over MCP: an agent fires only its own hooks (agent.<slug>.<name>), the payload says which agent fired it, and a run an automation started cannot fire one.
  • The studio's AI → Automations (web/packages/ui/src/automations/): the list (trigger, on or paused, the last run, YAML import) and the editor — a trigger picker; the condition tried against the platform with the trigger's sample payload; the actions in order, reordered with @dnd-kit (pointer or keyboard) or the move buttons; on_error and the hourly limit —; enable and pause; the secret shown once and kept while the page is open, and the webhook URL; a dry run and a real run; YAML export; the run history with each action's inputs, outcome and a link to what it made. Driven in a browser against a live platform: made paused, the condition tried, enabled, a dry run, fired, the run's outcome, the idea it captured on the Ideas board, the YAML export.
  • The extension's view of automations — with G10.
  • Review fixes (2026-10-22, two independent verifiers): the compose events consumer died on its first quiet five seconds — redis-py's default socket timeout ended every blocked read that waited out its block — so event automations stopped for good (its socket now waits past the block, a timed-out read is a quiet stream, it reads EVENTS_STREAM through consume_events --own, and the service restarts if it stops; driven against Redis 7: alive through quiet spells, and an event added after them fired its automation); the webhook action had an httpx client of its own, bounded per read only — a server answering a byte at a time held it 24.8 s against a one-second limit — on the worker that runs agents (it goes through research.fetch.post, the fetcher's guard and its one deadline, and a run executes on the research queue; an action not started within 90 s of its run does not start, and one the task's time limit stops is recorded, never left running); a YAML import could expand a kilobyte of aliases into billions of values in a request (aliases are refused, nesting is capped at 20, the name must be text, a validation message is cut short); a shared automation's run log, last run and briefs showed its owner's private notes, webhook bodies and events to everyone it was shared with (runs are their owner's and staff's, a brief it writes is private); any signed-in person could mail any address at volume (email goes to the platform's people unless the owner has automations.email_anyone, asked again when it runs, at most AUTOMATIONS_EMAILS_PER_HOUR recipients an hour per person, as tagged AnymailMessages); an agent run's event, a suggestion on another site's page and a hook fired for a site reached other sites' and non-editors' automations, and a page behind a view restriction was heard by everyone (an event's site is its page's or its run's page's, a hook for a site reaches its people, a restricted page its editors); an incoming webhook kept every X-… header, credentials and client addresses included (an allow-list); what an automation sent could be replayed to an automation's endpoint, itself included (an outgoing webhook is signed t=…,v1=… over its time and body, never the way an endpoint accepts, and no webhook action may call an automation's endpoint); automations.fire_hook was a propose any agent could use to set off anyone's automations under any hook name (write, and an agent fires only agent.<slug>.<name>); the documented rotate_ai_credentials left the automations' secrets under the old key (it re-encrypts them in the same transaction, through ai.crypto.REENCRYPT, and rotate_automation_secrets is gone); the documented start commands left out events. Each fix in the code has a test that fails without it; the restart policy and the commands were checked by hand (docker compose --profile content config).
  • Discovered: redis-py 8 gives every connection a five-second socket timeout unless told otherwise, which is exactly the outbox consumer's block — consume_events for zer0:app had the same exit, unnoticed while nothing read that stream in compose.
  • Deviations: the event trigger offers the three event types this platform announces — Rails' app.user.interaction is not one (its reader ids are never stored here) and an event from the other plane is ignored; "notify" is two action kinds, email and webhook, and "move a workflow stage" is the newsroom's moves to the stages that publish nothing (assigned, drafting, editing, copy), since a release or a correction shows on the site; a monitor finding is the named hook monitor.finding, which G12 fires — nothing fires it yet; schedules are one dispatcher on beat reading cron lines with Celery's crontab rather than django-celery-beat's database scheduler (no second scheduler to deploy, no per-automation PeriodicTask row to keep in step; the reason is in the README), and cron lines are UTC; event automations need the new compose events service (consume_events --own), the first process in which the platform consumes its own stream, and consume_events registers the automations' handlers by a call (automations.consumers.register) rather than an import, so no other consumer's test sees them; an agent run an action starts records the runner's existing trigger event, schedule or manual (a test) and links back through started_by_event; a webhook delivery over the hourly limit answers 202 with its run's status limited, since an error status would roll back the run that records it; the YAML document is the automations' own (name, description, trigger, condition, actions, on_error, max_runs_per_hour), and the AI layer's ExportButton and ImportButton gained a YAML mode rather than a second pair; a source's payload carries the first 5,000 characters of its text; an outgoing webhook is signed with a time (X-Zer0-Signature: t=…,v1=…) while an incoming one is signed GitHub's way, over the body alone, so an incoming webhook has no replay window — a delivery id sent again gets its first run, and the hourly limit bounds the rest; an automation's runs are run on the research queue's worker rather than a worker of their own.
  • Test: cd content && python -m pytest tests/automations -q (55 passed) · python -m pytest -q (574 passed, 1 skipped — 55 of them tests/automations/; the theme-checkout skip unchanged) · the fast tier on Postgres 16 + pgvector, DATABASE_URL=postgres://… python -m pytest -q -m "not slow" (573 passed, 2 deselected) · python manage.py makemigrations --check --dry-run · ruff check . && ruff format --check . · python manage.py run_evals --all --recorded on a freshly migrated scratch database after sync_agents --publish (17 passed) · the OpenAPI drift command (the GraphQL and agent block schemas unchanged) · cd web && npm ci && npm run lint && npm run typecheck && npm test && npm run build && npm run check:api (151 tests in 22 files) · python3 tools/check_absorption.py · python3 -m unittest discover tools/tests (183 OK) · python3 bin/zer0 check · python3 tools/check-config-docs.py · python3 tools/unwrap-prose.py --check --exclude '(^|/)SCHEMA\.md$' --exclude '(^|/)CHANGELOG\.md$' · the review fixes driven live: the events consumer against Redis 7 through quiet spells and then an event, and the verifier's trickling server against fetch.post (stopped at 1.0 s)
  • Merged onto main on 2026-10-27, after G4, G5 and the outbox desk had landed (merge: G16 — automations (overhaul/automations) onto main): G5 had already added a compose events service for this plane's own stream, so there is one — consume_events --own --group platform, restarted if it stops, with the belt's volume — and it runs distribution's drafts and the automations' handler alike; the automations' secrets rotate through G5's ai.crypto.credentials_rotated signal rather than the branch's REENCRYPT set, so the rotation has one way in.

Phase H: Enterprise

  • H1: Deploy — deploy/compose.prod.yml (web, worker, beat, relay, Postgres, Redis; secrets from the environment), deploy/helm/zer0-cms/ (a Deployment per role, HPA on web, a PVC for media, external or subchart Postgres/Redis, /readyz probes), .github/workflows/publish.yml (build and push ghcr.io/bamr87/zer0-cms on a release tag, verify /readyz on the image), docs/OPERATIONS.md (backups with pg_dump, a restore drill, retention, rotation), manage.py seed_demo if G2 has not added it. Needs the owner: GHCR publish permission.
  • H2: Observability and tenancy hardening — OpenTelemetry instrumentation for Django and Celery behind OTEL_EXPORTER_OTLP_ENDPOINT (extending agents/tracing.py), optional Prometheus /metrics, per-site budgets (budget_usd per SiteSettings, enforced by the runner), per-site token scopes, an agent-provenance audit report, the CSP enforced after a report-only soak, WORK-10 (fleet workflow refs pinned) and the remaining AGENT rows of the hub's conformance report.

Phase T: The theme goes home (ADR 0005)

The zer0-mistakes theme returns to bamr87/zer0-mistakes, gains a Rails theme studio there, and this repository consumes it as each site declares it. T1 and T2 are pull requests on two repositories; T3 lands inside G2; T4 is a pull request on the fleet hub.

  • T1: The theme leaves this repository. The monorepo's theme changes ported to bamr87/zer0-mistakes as a draft PR (port/zer0-cms-2026-10: ship-no-person, the setup-wizard fix, the settings byte copy — each with a Ported-From: trailer); packages/zer0-mistakes/ removed; the zer0-mistakes project, its / route, eight depends_on edges and two vendored: entries gone from workspace.yml; zer0-mistakes.yml and theme-mirror.yml deleted; pages.yml without the theme's route and targeting this repository's project site; drsai.yml building against the theme's main checked out beside the site (weekly too); content.yml fetching the theme at a pinned tag into .cache/zer0-mistakes for the round-trip fixture (ZER0_THEME_CHECKOUT); ADR 0005; the docs. Test: bin/zer0 check && cd content && ZER0_THEME_CHECKOUT=<checkout> python -m pytest -q
  • T2: zer0 studio (in bamr87/zer0-mistakes, studio/) — a Rails 8.1 app, Ruby 3.3, SQLite + Solid Queue + Solid Cable, that customizes, updates and designs the theme: tokens and skins edited at the source through a small SCSS declaration tokenizer with a diff, a digest-guarded atomic write and the design-system parity check; a registry of consumer sites (from _data/consumers.yml and SITES_DIR) with each site's theme keys edited in place; the theme's own scripts (validate, audit-consumer, propagate.rb, release --dry-run, design-system-check.rb, Jekyll builds) run as jobs with a live log and cancel; docs-site previews in a sandboxed cross-origin iframe; a WCAG contrast check; a theme doctor (token parity, 7-vs-9 skins, the default skin, the gem's missing backgrounds, the config byte copy, studio/ excluded); version lockstep and the consumer pin matrix. Loopback-only unless a password is set, nonce CSP, confined paths, no network at boot, never in the gem. Then S2 (live CSS re-render, 9-skin before/after compare, new skins, the axe sweep, a companion theme PR for what the doctor flags), S3 (overrides, audit-consumer --fix, consumer previews against gem/remote/checkout, installer profiles), S4 (dispatch, bump PRs through the consumer kit, the hub roster). Test: cd studio && bin/rails test && bin/rails zeitwerk:check; the gem build unchanged; the docs site builds with studio/ excluded.
  • T3: The platform's theme record per site (inside G2) — SiteSettings.theme_source (gem|remote_theme|path), theme_version, theme_skin, filled by import_jekyll from the site's Gemfile/_config.yml; a dashboard row comparing the pin with the newest bamr87/zer0-mistakes release (read on demand); a test that export_jekyll leaves the pin's bytes untouched. The CMS never edits, vendors or publishes the theme; a bump reaches a site through its own repository and the consumer kit. — struck by ADR 0006 decision 4: the theme is only the Jekyll-theme option, whose per-site setting records the theme tag (P2).
  • T4: The fleet hub follows (in bamr87/bamr87) — projects/zer0-mistakes back as a submodule, the registry entry's mirror note and scout: false dropped, the zer0-CMS description without "plus the theme", docs/CONSOLIDATION.md's rows; the drift gate green. Needs the owner: merging.

Phase P: One Python platform, a React frontend, no Ruby (ADR 0006)

One branch p<N>-<slug>, one PR per milestone, based on main. The target is TARGET.md; the gate is tools/check_absorption.py.

  • P0: ADR 0006, the target, the ledger and the gate. ADR 0006; TARGET.md; capabilities.yml (the platform's capability catalog with its surfaces; every merged repository's capabilities with their targets; the Ruby and zer0-mistakes ratchets); tools/check_absorption.py and its tests, run by zer0-workspace.yml; AGENTS.md's target section and this order of work; the overtaken milestones marked. Test: python3 tools/check_absorption.py --report && python3 -m unittest discover tools/tests && bin/zer0 check
  • P1: Record every site's Jekyll build — for each routed site and the parodynews sidecar, build with Jekyll as today and write web/site/fixtures/<site>/manifest.json: every output path, its content type, a normalized text digest of each HTML page's main content, the feed and sitemap entries and the redirects; tools/site_manifest.py (stdlib Python) writes and compares manifests, with tests; a dispatch-only workflow that builds and commits them. Accept: a manifest per site; a second run is byte-identical. Test: python3 -m unittest tools/tests/test_site_manifest.py && python3 tools/site_manifest.py --check
  • Done 2026-10-22: nine sites recorded, none failing — the seven routed ones (zer0-demo-cookbook, zer0-demo-garden, drsai, parodynews from apps/parodynews/src/pages, wargames, zer0-pages-remote, zer0-pages) built exactly as pages.yml builds them, and the two nothing routes yet built as this repository builds them today: 2005 with its own build task, as sites.yml does, and irony-works with its Node step and GitHub Pages' own builder, as irony-works.yml does. Per-site counts, notes and recipes in web/site/fixtures/README.md. tools/site_manifest.py (build, compare [--pages], --check, --write) with 28 tests; pages.yml records every routed site's build and compares it with its recording; web/site/README.md says what the renderer must reproduce. The ledger is unchanged — P1 records and absorbs nothing, so every site-*.publish row stays missing.
  • Re-recorded the same day after review (schema site-manifest/v2), because the first rule let the theme's layout into the text: "main content" had been read as <main>, which also holds the theme's title banner, reading time, share and edit menus and table of contents, so a renderer in another design system could not have matched one article. A page's text is now its own content — the entry's marked content (e-content, articleBody), else the theme's content column, else <main> — and is stored with its digest, so a difference shows the changed blocks; feed entries carry their published and updated instants; built_with records the gems and the theme commit each build resolved; and compare --pages compares only what a reader reaches (pages, titles, text, feeds, sitemaps, redirects), leaving out the theme's asset files. A second run is byte-identical: each routed site was recorded twice — in place, then by --write from a copy on the container's own filesystem with a fresh gem install and a caller environment that changes each build if it leaks in (TZ=America/Denver, JEKYLL_ENV=development, PAGES_ENV, ZER0_THEME_LOCAL and BUNDLE_GEMFILE pointing nowhere) — and 2005 and irony-works twice by their recipes, every pair byte-identical; every build tree gives byte-identical recordings under Python 3.12, 3.13 and 3.14. The milestone's test then passed as written: python3 tools/site_manifest.py --check rebuilt the seven routed sites from a fresh copy under the same environment and found each identical.
  • Deviations: no dispatch-only workflow and nothing that commits — pages.yml, which already builds every routed site whenever one changes, records each build and compares it with its recording; a difference warns (annotation and job summary), the fresh recording is uploaded as site-manifest-<site> for a person to commit with its reason, and a dispatch with check: true fails on a difference (a baseline a machine rewrites is no baseline; the first version's separate site-manifests.yml duplicated pages.yml's plan and recipe and ran only when someone remembered to dispatch it). The text is narrower than <main>, as above, and leaves out <time>; sitemap lastmods are not recorded — both carry the build's clock on undated pages. The rebuild runs in UTC and passes on none of the caller's JEKYLL_*, PAGES_*, ZER0_*, OCTOKIT_* or BUNDLE_GEMFILE variables, and removes a Gemfile.lock it wrote. Media types come from a fixed table, because mimetypes's built-in table differs between Python 3.12, 3.13 and 3.14. The theme ratchet skips web/site/fixtures/ (THEME_SKIP_PREFIXES in tools/check_absorption.py, with a test): every recording lists the theme's own asset files by name, and a recording of a build is content, like src/test/fixtures/. .vscodeignore leaves out web/** (the extension ships nothing from web/ as a file) and extension.yml ignores web/site/fixtures/**.
  • Found: parodynews's 58 posts are written with no layout (57 ask for journals, one for blog; the theme has neither), and two of them (2024-08-07-Generated Title.md, 2024-08-07-generated-title.md) write the same URL, so the build keeps only one — recorded as built, for P2 to keep or fix knowingly; parodynews's post of 2025-05-02T00:01:30Z changes its URL with the build's time zone, hence the UTC pin; the garden demo's notes keep [[wikilinks]] and [!tip] callouts as plain text; five routed sites float on unpinned gems and every remote-theme site on the theme's default branch (98e978d for these recordings), so a gem release or a theme commit can change a recording until P2 pins them. irony-works publishes its node_modules/ (23 files, two of them READMEs rendered as pages) and home-before.png, because its exclude: list replaces Jekyll 3's defaults — recorded as built, for P2 to fix knowingly.
  • Record sites/2005 and sites/irony-works: done, by hand with their own recipes (--check cannot rebuild them until they have routes). sites/1987 has no Jekyll configuration and no build, so there is nothing to record; its first build, once it has one, is its recording.
  • P2: The Jekyll-theme option — a site's setting render: react | jekyll-theme with the theme tag; for jekyll-theme, the export writes the site's file tree with remote_theme: bamr87/zer0-mistakes@<tag> and resolves at export what a plugin-less Jekyll cannot (zer0-pages's wikilinks, embeds, callouts, Dataview and graph index, in Python); the deploy builds it with a Jekyll server — actions/jekyll-build-pages or a pinned Jekyll container — as an external tool, and nothing Ruby is committed. Each site then moves to the option: its manifest from P1 is reproduced, and its Gemfile, Gemfile.lock, _plugins/ and Ruby-only config leave in the same commit (zer0-pages last). When the last site has moved, pages.yml's and sites.yml's build legs install no Ruby (left over from P5, ADR 0006 decision 12; P5's build-legs item). The option's files are the only ones listed in theme_allowed:. Test: python3 -m unittest discover tools/tests && python3 tools/site_manifest.py --check --site <name>
  • From P1 (2026-10-22): each site's recording is web/site/fixtures/<site>/manifest.json, and the option is held to the full comparison, theme asset paths included, since it renders with the same theme: --check --site <name> for a routed site; for 2005 and irony-works, until they have routes, the recipe in web/site/fixtures/README.md, then build and compare. Gems float for five routed sites and the theme for every remote-theme site (recorded at 98e978d): built_with and the notes --check prints say what resolved differently, so pinning a tag that moves the theme's assets is a difference to re-record knowingly, not a surprise.
  • Status, 2026-10-22: built on overhaul/jekyll-option as one of five parallel tracks of the overhaul's second wave (third in § 3's order; P4, G8 and P5 landed before it in the first wave). Eight of the nine recorded sites render with the option and reproduce their P1 recordings exactly, the full comparison with the theme's asset paths; zer0-pages does not yet, for two differences the owner decides on (P-D7), so the box stays open. Per-site results and the zer0-pages differences in full: web/site/fixtures/README.md § The Jekyll-theme option.
  • Status, 2026-10-28: the owner accepted both differences (P-D7) and zer0-pages moved, last of the nine, so no site builds with Ruby; the box stays open for the option's api and studio surfaces (G4's, below).
  • The option: tools/jekyll_theme.py — a site's render: setting in workspace.yml ({as: jekyll-theme, theme: <tag>, server: github-pages | jekyll-4, before: <command>?, obsidian: true?}, validated by the workspace tool and shown by info, routes --json and list --json); export writes the files git tracks under the site's Jekyll source with its _config.yml merged with the route's config and remote_theme: bamr87/zer0-mistakes@<tag>, runs before: on that copy and resolves an Obsidian vault; build runs the server in Docker as the caller's user and reports what it resolved (the tag's commit, the server's image) for tools/site_manifest.py (build --built-with). Servers: GitHub Pages' own builder (ghcr.io/actions/jekyll-build-pages:v1.0.13, github-pages 232, Jekyll 3.10.0, through its own entrypoint) and jekyll-4 (tools/jekyll/Dockerfile: Ruby 3.3.12, Jekyll 4.4.1 and every gem of the Jekyll 4 recordings' built_with, exact). The theme is pinned at v1.31.3, the tag on 98e978d, the commit every remote-theme recording was made against.
  • The Obsidian bridge in Python: tools/obsidian/ ports pages/_plugins module for module — the fence mask, wikilinks and embeds, callouts, the Dataview subset (TABLE/LIST, FROM, WHERE, FLATTEN, GROUP BY, SORT, LIMIT), the deterministic graph index, the base-URL pass — and reads a source tree the way Jekyll 4.4 does (which files, each document's URL and data, a collection's order), so the rewrite happens before a plugin-less build and the base URL after it. Both Ruby suites ported test for test (tools/tests/test_obsidian_bridge.py, test_graph_index.py), with test_obsidian_vault.py for the Jekyll reading. Every URL it computes for zer0-pages's 203 pages is the recorded one.
  • Sites moved, each reproducing its recording (python3 tools/site_manifest.py --check --site <name>, identical): zer0-demo-cookbook, zer0-demo-garden and wargames on jekyll-4; drsai, parodynews (apps/parodynews/src/pages), zer0-pages-remote, 2005 and irony-works (its node transplant as before:) on github-pages. Deleted with the switch: their Gemfiles, parodynews's Gemfile.lock, the Ruby-only _config_dev.yml of drsai and parodynews (the theme as a gem), the docker-compose.yml dev servers of the demos and zer0-pages-remote (bundle-based) and wargames's Ruby devcontainer; their setup/build/pages tasks call the option, and their docs say how to build.
  • --check rebuilds 2005 and irony-works too: routes() adds the option's sites nothing routes, built by their build task with their own config, as recorded.
  • CI: pages.yml builds the moved sites through the option (the jekyll-4 image built by docker/build-push-action with the Actions cache) and records with --built-with; sites.yml builds its five sites through it, every one when the option changes, and compares 2005 with its recording; drsai.yml builds through it, its theme-main build, ZER0_THEME_LOCAL and weekly run gone; irony-works.yml builds through it and compares with the recording. No setup-ruby in any of them but pages.yml's zer0-pages leg; zer0-pages.yml is unchanged. actionlint clean. Each of them runs when anything that builds its sites changes — the site, workspace.yml (the render: setting: the theme's tag, the server, before:), the workspace tool that reads it, the option, its jekyll-4 image and the Obsidian bridge it imports, and the comparison where one runs — and bin/zer0 check holds that (OPTION_INPUTS: a site's ci: workflow that builds it with the option must filter on all of them). For every site on the option the comparison fails a pull request whose build differs from the recording (pages.yml; sites.yml for 2005, irony-works.yml), and each uploads the fresh recording to commit in that pull request when the change is intended; a push to main only warns in pages.yml, so a difference never blocks a deploy, and zer0-pages, still on its Gemfile, only warns.
  • Ratchets: check_absorption.py --tighten dropped the eight Ruby files (seven prefixes, ruby_ratchet: now packages/zer0-image-generator/, rails/, sites/zer0-pages/) and lowered the theme ceilings (.github/ 5 → 1, apps/parodynews/ 5 → 3, sites/drsai/ 5 → 3, the demos 4 → 2, sites/2005/ and sites/zer0-pages-remote/ 2 → 1, sites/wargames/ 5 → 4); theme_allowed: lists the option's files (tools/jekyll_theme.py, its test, tools/jekyll/Dockerfile). The ledger: sites.render-jekyll ops done (api and studio are G4's: choosing the option and running the build as a job); the eight sites' publish rows retargeted to sites.render-jekyll and partial — each renders with its recording's URLs, pages, feeds and sitemap, and CI fails a pull request that changes that without re-recording, but its original repository still publishes it (C4) and a person cannot yet choose its renderer or follow its build from the studio (G4; ADR 0006 decision 15), and a --check command line is not a test, which tools/check_absorption.py now refuses as a proof; zer0-pages's callouts, Dataview and fence-mask rows missing → partial, and sites.obsidian gains an ops: partial surface.
  • zer0-pages moves to the option (P-D7, decided and done 2026-10-28). Its option build (v1.28.0, the tag of its locked gem; jekyll-4; obsidian: true) reproduces every page, title, feed, sitemap, Dataview table, wikilink and callout, and differs in two ways that come from the option, not the port: 88 extra theme images (the remote theme ships assets/ whole, the gem leaves them out) and fuller "Linked mentions" panels on five Obsidian docs pages (the plugins rewrote a page's links only when Jekyll rendered it, so a panel saw only the pages rendered before it). Moved in one commit: its render: setting and its check, build and pages tasks on Python and the option (and no depends_on the image generator's gem, which only its Gemfile loaded); Gemfile, Gemfile.lock, pages/_plugins/ (seven .rb files), tests/ (two minitest suites) and docker-compose.yml deleted; zer0-pages.yml on the bridge's Python tests and the option's build; pages.yml's Ruby step gone, which also closes P5's build-legs item; the recording re-made from the option's build with the two differences as the stated reason. Before re-recording, the site was built twice as pages.yml builds it — with the Ruby plugins still in the tree (Jekyll 4 loads _plugins/ outside safe mode) and with them deleted — and the two recordings were byte-identical; the full comparison with the P1 recording listed the 88 images and the five panels, which only gain mentions, and nothing else. check_absorption.py --tighten: Ruby 234 → 223 files, the sites/zer0-pages/ ceiling gone (ruby_ratchet: now only packages/zer0-image-generator/), the theme ceiling there 4 → 2. The site's published files are untouched, so its pages/SCHEMA.md still lists _plugins/ (a lint warning) and its graph page's include still credits obsidian_graph_index.rb: correcting either changes a recorded page, a content change for its own commit with a re-recording. Test: python3 tools/site_manifest.py --check --site zer0-pages (identical) · python3 -m unittest discover tools/tests · python3 tools/check_absorption.py · python3 bin/zer0 check · actionlint on pages.yml and zer0-pages.yml.
  • Follow-up of P-D7, not part of P2's Accept: replace the Jekyll 4.4 reading in tools/obsidian/vault.py (about 300 lines) with a first Jekyll pass that emits each document's URL and data as JSON — worth doing now that the site builds through the option (the review fixes below say what it costs), and moot once G4 exports the site from the database, whose records hold every page's URL and data. With it, the Gemfile path no site uses any more: tools/site_manifest.py's bundle install in --check and build --source (a bundle's Gemfile.lock), pages.yml's --source branch that test_site_manifest.py holds to it, and their tests.
  • The option's api and studio surfaces: picking a site's renderer and following its build as a job are G4's (sites.registry, sites.jobs).
  • Review fixes (2026-10-22, two independent verifiers): sites.yml, irony-works.yml and drsai.yml now run on workspace.yml, the workspace tool, tools/obsidian/** and (where they compare) tools/site_manifest.py, and sites.yml builds every site when any of those changes — before, a theme-tag bump, a server switch or an edit to irony-works's before: reached no build at all — with the bin/zer0 check rule above so it cannot recur; tools/jekyll_theme.py build writes only a new or empty directory or the site's own _site holding nothing git tracks, and refuses anything else before it builds (it used to delete any directory but the repository's root and a git checkout after the build, so --dest sites/drsai or a stale ZER0_PAGES_DEST wiped a site's source); the eight publish rows are partial, as above, and a ledger proof must name a test file and, after ::, a test id; the comparison fails a pull request for every site on the option; irony-works's before: installs js-yaml@5.5.0 and argparse@3.0.3, the versions its recording publishes, so a js-yaml release (five since August) cannot change its build; the option's second deep_merge is gone. Not changed: the Jekyll reading in tools/obsidian/vault.py. Asking Jekyll for each document's URL and data instead (a first build pass with a Liquid page that writes them as JSON) would delete most of it, but it needs a server run before the export can resolve anything, turns the front matter's YAML dates into JSON strings that the Dataview subset sorts, formats and compares, doubles the vault's build, and would replace a reader whose URLs for all 203 zer0-pages pages and every Dataview table match the recording — a redesign for P-D7's decision rather than a fix; content/importers/jekyll.py computes no URLs and needs Django, and the content graph's wikilink pattern finds link targets in platform pages for graph edges, which converges with the bridge's parser when the platform imports vault content (sites.obsidian, G4).
  • Deviations: two servers rather than one, because the recordings were made by two Jekylls — GitHub's builder cannot reproduce a Jekyll 4 build (it adds GitHub Pages' default plugins, defaults future: true, replaces the default excludes and runs Jekyll 3.10's plugins), and a Jekyll 4 image cannot reproduce a github-pages build; the jekyll-4 image is a Dockerfile in the repository, not a Gemfile, and pins every gem with --ignore-dependencies. The option builds with JEKYLL_ENV=production, as GitHub Pages does, although the routed recordings were made with Jekyll's default (development): no recorded fact differs. The export copies only what git tracks (so a local build is CI's) and merges the route's config in Python, deep-merged as Jekyll layers --config, because GitHub's builder takes only _config.yml. The site configs still name the theme in remote_theme: (unpinned; the option overrides it) — generating them is P3's. irony-works's recording publishes node_modules/ (its exclude: replaces Jekyll 3's defaults); the option reproduces that as recorded rather than fixing it, which would be a re-recording with a reason — and so its before: pins the two packages it publishes (js-yaml@5.5.0, argparse@3.0.3), against the fleet's always-latest policy, because a floating install changes the recorded build. The Obsidian port is a port, not a library: its splits and parses are what the recording holds (a CommonMark parser would mask code differently), so no Markdown or parser library replaces them; PyYAML reads front matter. drsai.yml no longer builds against the theme's main, which also settles that item of P3. drsai's bundle exec jekyll preview-images (the image generator's Jekyll command, which its Gemfile loaded) left with the Gemfile; its README points at the generator's Python engine, which needs no Ruby, until G6 makes it a platform command. apps/parodynews/src/pages/README.md still describes the bundle: it is that site's home page (GitHub Pages' README-as-index plugin publishes it), so rewriting it would change the recorded page — a content change for its own commit, with a re-recording.
  • Test: python3 -m unittest discover tools/tests · python3 -m unittest discover tools/workspace · python3 tools/site_manifest.py --check --site <name> for each moved site (Docker; identical) · python3 tools/check_absorption.py --report · python3 bin/zer0 check · actionlint on the four changed workflows
  • P3: zer0-mistakes removed completely — every theme_ratchet: ceiling to 0: the vendored front-matter schema and the doctor's theme rules (G4 ports the doctor without them), content.yml's theme fixture checkout and its test, drsai.yml's build against the theme's main and ZER0_THEME_LOCAL (gone with drsai's move in P2), the extension's zer0-mistakes overlay (folded into the option's profile, listed in theme_allowed:, or removed), .vscode/launch.json, the site configs (now generated by the option), and the image generator's and Rails's references as those sources go. Content that writes about the theme stays. Test: python3 tools/check_absorption.py with an empty theme_ratchet:
  • P4: The studio foundation (web/) — the workspace (web/studio, web/packages/{api,ui,tokens}, each workspace a package the extension's webviews can render in G10 — no browser globals the webview lacks, no inline scripts); the client generated from schemas/openapi/openapi.json with a drift check; sign-in (session + CSRF, then allauth.headless with G3); the shell (site switcher, TARGET.md's areas, light/dark from the platform's design tokens); Content: page tree and filtered lists, the TipTap editor for the existing blocks with the Markdown round trip, fields and SEO, save as a draft revision, preview; Review: the suggestions inbox and the per-page panel with diffs, accept / reject with a reason / accept all of a run, revisions with diff and revert, publish, unpublish, schedule; Create: a page from a type, "Draft with agent"; AI: agent runs with step timelines. Platform side: the endpoints these need, with tests, and G2's backend items. Served by Django at /studio/, by Vite in development. Accept: Vitest suites; verify/scenarios/studio-*.yml (create a page, accept a suggestion, publish) pass with evidence; content/ green; schemas regenerated and committed; the ledger's studio surfaces updated. Test: cd web && npm test && npm run build && cd ../content && python -m pytest -q && cd .. && node verify/runner.mjs
  • Status, 2026-10-22: built on overhaul/studio, one commit series per concern, then a series fixing what two independent reviews found. Every Accept item holds; the box stays open for the three open sub-tasks below (G2's remaining backend items, the extra SEO fields, and public ids, which waits on P-D6).
  • Status, 2026-10-27: G2's remaining backend items and the extra SEO fields built on feature/p4-blocks-seo (one commit series each, below); the box stays open for public ids alone, which waits on the owner's decision P-D6.
  • Status, 2026-10-28: public ids done (P-D6, below), the last open sub-task; the box is ticked.
  • The workspace: web/ as an npm workspace (studio, packages/{api,tokens,ui}), strict TypeScript in one project, ESLint's flat config with a gate that keeps @zer0/ui free of routers, transports, page globals and injected HTML, Vitest with Testing Library. web.yml runs it; workspace.yml registers it (web, depending on content).
  • @zer0/api: openapi-typescript output from schemas/openapi/openapi.json, committed, with npm run check:api as the drift check; an openapi-fetch session client (same origin, the CSRF token on unsafe requests).
  • @zer0/tokens: the zer0 UI tokens kit's values as --zer0-* custom properties, one light-dark() pair per colour, and a Mantine theme that reads them; one derived token (--zer0-accent-strong) because white on the kit's dark accent fails contrast on a filled button.
  • Sign-in: GET /api/v2/me and POST /api/v2/session/login|logout (content/api/session.py), called only from web/studio/src/auth.tsx, so G3 swaps them for allauth.headless in one file — swapped by G3 (2026-10-27): the two POSTs are gone, /api/v2/me stays.
  • The shell: every TARGET.md area in the navigation, an unbuilt one naming its milestone; the site switcher; light and dark; sign-out.
  • Write: pages across sites in any status, filtered by status, type and text, and the tree a level at a time; the editor — markdown and paragraph blocks in TipTap with the Markdown round trip (a block TipTap would rewrite opens as source), the other blocks as their fields, typed fields and SEO from the platform's field specs, save as a draft revision against the revision it was loaded from (409 when someone saved since), preview (the platform's draft view), publish, unpublish, schedule and cancel.
  • Review: the inbox with diffs (jsdiff) — accept, reject with a reason, accept all of a run — also as the editor's per-page Suggestions tab; revisions with compare and revert (a new draft, never a publish).
  • Create: a page of a type its parent allows, with an optional brief and "Draft with agent" (a drafter run on the new page, whose draft arrives as suggestions).
  • AI: agent runs and one run's step timeline, live over /api/v2/agent-runs/<id>/stream/.
  • Platform side: /api/v2/me, session/, sites/, content/types/, content/pages/ (list across sites, create) and per page detail and save, types/, publish/, unpublish/, schedule/, unschedule/, revisions/, revisions/compare/, revisions/<id>/revert/; review/suggestions/ and review/runs/<id>/accept/ — services in cms/services.py and suggestions/services.py, tested in content/tests/api/test_{session,pages,review,studio}.py; the OpenAPI document regenerated, with named enums and typed run and decision shapes.
  • Served by Django at /studio/ (content/api/studio.py) with an enforced per-request-nonce CSP, by Vite in development; the platform image builds it (a Node stage in content/Dockerfile).
  • verify/scenarios/studio-{create-page,accept-suggestion,publish}.yml pass with evidence under test/evidence/; features ZER0-040–042.
  • G2's backend items, first part: publish_scheduled on Celery beat (cms/tasks.py), .localhost in ALLOWED_HOSTS, manage.py seed_demo.
  • Review fixes (2026-10-22, two independent verifiers): a changed paragraph keeps its internal links (rich text is validated from Wagtail's database format, in the save and the accept flow); new blocks keep their own editor through removes and moves (client keys, never positions); opening a page — its draft, fields and revisions — needs the right to edit or publish it, as Wagtail's draft view does, while its ancestors stay findable by title; Wagtail's locks (another person's, a workflow task's, a scheduled publish's) refuse every write with 409 resource.locked and the editor opens such a page read-only; the stale-write guard is required, and every page writer takes the page row's lock (cms.services.writable); a body with a block id twice is refused; "Draft with agent" starts a run only with a brief; the studio lists the platform's page types only (Wagtail's placeholder page no longer lists, nor 500s) with empty values sorted last on every database; schedule/ takes an expiry, with or without a go-live time, and the editor offers it; accept-all sends the ids the inbox shows; Suggestion.objects.visible_to and AgentRun.objects.visible_to scope the inbox, REST, GraphQL and the run stream (a reviewer opens the run behind what they review; a refusal never names what the person cannot see); the inbox's page filter (page_id) matches pages only; scheduled publishing runs one object per transaction with an overlap guard; the web role serves on gthread workers (content/gunicorn.conf.py), so a run's stream outlives gunicorn's 30 s worker timeout, and the timeline stops on a final status, reopens a live run's stream after a pause and backs off from a broken one. Tests: content/tests/api/test_{pages,review}.py, content/tests/cms/test_tasks.py, content/tests/ops/test_server.py, web/packages/ui/test/{editor,create,review,runs}.test.tsx, web/studio/test/transport.test.ts.
  • Discovered (2026-10-27, while proving the new blocks' preview): the editor's Preview answered every page with a server error — Wagtail names a template per page type (cms/article_page.html …) and only cms/page.html exists; every page type now renders cms/page.html (BasePage.get_template). Test: content/tests/api/test_pages.py::test_page_detail_has_fields_blocks_markdown_and_what_the_person_may_do.
  • Public ids: TARGET.md § Rules says UUIDs, and the studio's routes and shapes use integer keys — Wagtail's for pages, revisions, sites and users, and the existing ones of AgentRun and Suggestion. Not changed in P4: it is a contract change across the pre-P4 REST, GraphQL and MCP surfaces and the models the AI layer (G8) is rebuilding. Open decision P-D6; to settle before G10 binds the extension to these ids. Status, 2026-10-28: done on feature/p-d6-public-ids by the owner's decision P-D6 (ADR 0009) — AgentRun and Suggestion have UUID public ids (migrations agents 0002–0005, suggestions 0002–0004: nullable, filled, unique, then the ids stored in JSON rewritten; checked forwards and backwards on SQLite and Postgres) and every surface names them by it, the studio's /ai/runs/<id> and /review?run=<id> and the extension's webviews included (G10 merged first, and the extension persists no id); Wagtail's pages, revisions, sites and users keep their ids, the decision's recorded exception. Tests: content/tests/api/test_{review,graphql,public_ids}.py, content/tests/outbox/test_contracts.py, web/packages/ui/test/{runs,review}.test.tsx.
  • G2's backend items, the rest: the blocks embed, document, table, typed_table, raw_html, liquid, callout (each with a block_to_markdown case and the round trip kept byte for byte), SiteSettings, BrandRules per site, the seeded "Editorial" workflow, and log actions for suggestion, run and token events.
    • The blocks (2026-10-27, content/cms/blocks.py, content/importers/markdown.py): Wagtail's TableBlock, TypedTableBlock (text and number columns), EmbedBlock (checked as a URL, never fetched: no request reaches a provider) and DocumentChooserBlock (in a document block with the link's title and href), RawHTMLBlock, a liquid and a callout block. The importer cuts a body's Markdown into paragraphs at single blank lines and makes a paragraph the block that writes it back byte for byte — checked through the block's own to_python, clean and get_prep_value, never assumed — so a compact pipe table (| a | rows, a |---| rule) is a table, or a typed_table when a column holds only numbers; > [!kind]± title with every line quoted a callout; a bare URL an embed; a link to a file of a type the document library takes a document; an HTML block (a block-level tag, a closed comment or raw-text element) raw_html; a Liquid template that starts and ends with a tag or an output, through the tag that closes every block it opens, liquid. Anything else stays Markdown, verbatim. On the real sites that is 106 tables, 5 typed tables, 28 callouts, 1547 HTML blocks and 77 Liquid templates; none has a bare URL or a link to a file of its own, so embed and document are driven by fixtures. The exporter and the books' chapter files keep a body while its blocks write the Markdown the body's own blocks write (it compared block lists, so a page read before a block type existed would have lost its whitespace on an edit). The editor edits every one: a table's and a typed table's cells, rows, columns and column types in place (TableFields), a callout's fields with its fold, raw HTML and Liquid as monospaced source, an embed's URL, a document's title and href — its library file shows as an id until the studio has a media library (G6). The preview shows an embed as a link and raw HTML as source, so imported HTML never runs on the platform's origin. The agent schema describes each. sites/irony-works, sites/wargames and sites/2005 joined the real sites' round trip (the last two in the slow tier), all byte for byte. Tests: content/tests/importers/test_blocks.py, content/tests/importers/test_jekyll.py::test_the_real_sites_round_trip_byte_for_byte, content/tests/schema/test_schema.py, web/packages/ui/test/editor.test.tsx.
    • SiteSettings: done in G4 (content/sites/models.py: SEO defaults, analytics ids, navigation, brand voice, skin and tokens, a budget, edited from the studio's site page). Proof: content/tests/sites/test_sites.py::test_per_site_settings.
    • BrandRules per site (2026-10-27): a site's own brand rules live in its SiteSettings (TARGET.md § Rules: settings are per site) rather than a second model — brand_voice (G4's) is its style guide and banned_patterns its banned phrases, in cms.BrandRules' shape, each compiled by the API before it is saved (422 by field). The guard (suggestions/guard.py) adds the page's site's patterns to the built-in bans and every active BrandRules (which stay, for every site), wherever it judges a page's text: a suggestion at propose and at accept, the brand review agent, the brand_clean eval check, and a distribution post (its channel's site); brand.rules returns the run's page's site's voice and bans too. The studio's site Settings tab edits the phrases beside the voice. Tests: content/tests/suggestions/test_suggestions.py::test_a_sites_own_brand_rules_hold_on_its_pages_and_nowhere_else, content/tests/sites/test_sites.py::test_per_site_settings, web/packages/ui/test/sites.test.tsx.
    • The seeded "Editorial" workflow (2026-10-27, content/workflow/services.py): Wagtail's workflow "Editorial" — the brand agent's review (AgentReviewTask, rules only, no model), then Wagtail's own "Moderators approval" task for the Moderators group — so an agent is never the last task and a person publishes. Seeded by a command, as the newsroom's workflow is made by its service and seed_parody_desk (a hand-written data migration is not allowed here): manage.py seed_editorial [--site KEY …] makes it once and makes it each named site's workflow (Wagtail's WorkflowPage on its root); seed_demo gives it to the demo site. A page sent through it is reviewed by the agent and then waits for a moderator. The studio has no workflow screens yet (the ledger's content.workflow): a page is submitted from Wagtail's own editor. Tests: content/tests/workflow/test_editorial.py, content/tests/api/test_studio.py::test_seed_demo_makes_a_site_a_person_and_pending_suggestions.
    • Log actions for suggestion, run and token events (2026-10-27): Wagtail's own log (wagtail.log_actions.log, ModelLogEntry), its actions registered by each app's register_log_actions hook — zer0.suggestion.propose (the agent), .accept and .reject (the person, with the revision or the reason) in suggestions/services.py; zer0.run.start (who started it, the agent, the trigger) and zer0.run.finish (its status and error) in agents/runner.py; zer0.token.issue and zer0.token.revoke (the holder, the token's name and shown prefix, never the token) for both bearer tokens, in accounts/tokens.py (HashedToken.revoke, which accounts.services.revoke now calls). The log has no API or screen yet (the ledger's platform.audit). Test: content/tests/agents/test_log_actions.py.
  • SEO fields beyond Wagtail's own — canonical_url, Open Graph, noindex — with their Jekyll import and export, so the studio can edit them. Done 2026-10-27 (content/cms/seo.py): on every page type, canonical_url ↔ front matter canonical_url (jekyll-seo-tag's), og_title ↔ og_title, og_description ↔ og_description, og_image ↔ image (jekyll-seo-tag's og:image and twitter:image, the zer0 sites' per-page social image — six zer0-pages posts use it; preview stays the teaser and preview_image), noindex ↔ noindex (the zer0 front-matter vocabulary). No site in the repository or lifehacker.dev has canonical_url, og_*, noindex or robots in a file's front matter; sitemap: (9 files here, 16 in lifehacker.dev) is jekyll-sitemap's switch, not a robots directive, and stays raw front matter. Each field is null while the page says what its file says — every imported page, and every row and revision from before the fields — and holds a value once a person sets one; what a person sees is the page's value or its file's (seo.effective), and the hash and the exporter count a field only where it differs from its file, so an imported page keeps its import hash, an unchanged file exports byte for byte, and a key nobody changed is never rewritten whatever its form (jekyll-seo-tag's image: {path, alt} mapping included); a changed one is rewritten in place by line surgery, a new one added. The five keys are typed fields' now, so raw front matter refuses them by name (cms/files.py). The studio's SEO tab renders them from their specs (a new boolean kind, a switch, in the OpenAPI document); distribution.services.canonical_url reads the field. Not in the agent's op: meta fields (the SEO agent proposes the title tag and description, as before). Tests: content/tests/importers/test_seo.py, content/tests/importers/test_jekyll.py::test_the_real_sites_round_trip_byte_for_byte, web/packages/ui/test/editor.test.tsx.
  • Deviations: Mantine 9 with @mantine/tiptap for the editor's toolbar; React Router 7, as TARGET.md names it, although 8 exists; TypeScript 5.9 because typescript-eslint and openapi-typescript do not accept 6; web/package-lock.json committed and openapi-typescript exact-pinned (AGENTS.md § Standard deviations); django-filter added to the platform for the list filters; the studio's endpoints refuse agent principals (IsPerson), because an agent changes content only through the tool registry; the run stream view gained a renderer for text/event-stream, without which a browser's EventSource was answered 406. From the review: a lock is 409 with the code resource.locked rather than 423, so the document's error statuses stay the ones it lists; the inbox's page filter is page_id, because page is the paginator's; schedule/'s go_live_at is optional (an expiry alone publishes now and takes the page down later); the run stream stays (TARGET.md: the client follows the event stream) and the server moved to threaded workers, rather than the studio polling.
  • P5: The workspace tool in Python — bin/zer0 in Python with the same commands and output; tools/workspace/ tests ported; zer0-workspace.yml, pages.yml and sites.yml with no setup-ruby and no ruby -e; bin/zer0 doctor runs the platform's doctor (G4). Accept: the Ruby and Python tools print the same list, affected --json, matrix, routes --json and check on this tree (recorded before the Ruby goes); the ratchet's bin/zer0 and tools/workspace/ at 0. Test: python3 -m unittest discover tools/workspace && bin/zer0 check
  • The Ruby tool recorded before any of its code changed, in a ruby:3.3 container: 202 steps over 36 scenarios in tools/workspace/tests/golden/recordings.json — this tree frozen at 40c904b9 (list, info for all 16 projects, routes, check, vendor, matrix, affected and matrix --affected against three fixed bases, run <task> --all --dry-run for every task, tags, doctor, usage and errors) and every small workspace the Ruby suite built and broke.
  • bin/zer0 and the tools/workspace/ package in Python 3.9+ with PyYAML; every Ruby test ported (tests/test_workspace.py, tests/test_real_manifest.py) and the cases it lacked added; tests/test_golden.py replays every recording and compares stdout, stderr and exit status byte for byte.
  • The Ruby tool, its tests and the recorder deleted; check_absorption.py --tighten dropped the bin/zer0 and tools/workspace/ ceilings; every workspace-tool ledger row but workspace.doctor is done with its proof, and platform.workspace ops is partial until the doctor is Python.
  • zer0-workspace.yml, pages.yml and sites.yml run bin/zer0 on Python with PyYAML; the two jobs that only plan (pages.yml's and sites.yml's plan) install no Ruby, and sites.yml's ruby -rjson -e is a python -c; tools/workspace/README.md, docs/MONOREPO.md, docs/CICD.md, AGENTS.md and workspace.yml updated.
  • Discovered: check_absorption.py --tighten deleted the comments inside a ratchet block; fixed, with a test.
  • Discovered in review, each fixed with a test: affected missed a file whose name git quotes (a non-ASCII name, a quote), so its project went unbuilt — git's paths are read with -z now, which the Ruby tool lacked too; the manifest's paths were not held inside the repository, and an absolute vendored copy let vendor --write overwrite a file outside the checkout (Ruby's File.join had kept it inside) — every path the manifest names must be relative with no .., and a vendored path that leads out through a symlink is refused; nothing tested affected on uncommitted and untracked files; and the PyYAML hint, python3 -m pip install pyyaml, fails on PEP 668 Pythons (Homebrew, Debian) — it lists routes that work, and bin/zer0 runs itself on the repository's .venv where python3 lacks PyYAML.
  • bin/zer0 doctor runs the platform's doctor, and zer0-workspace.yml's doctor step installs no Ruby: done in G4 (2026-10-22), which ported zer0 doctor to content/sites/doctor.py and set the workspace.doctor row and platform.workspace ops to done.
  • pages.yml's and sites.yml's build legs install no Ruby: done in P2 (2026-10-28), when zer0-pages, the last site, moved to the Jekyll-theme option (P-D7) and pages.yml's ruby/setup-ruby step went with it; every leg builds its site with the option's Jekyll server in Docker. Each leg used to install Ruby for the site's Jekyll build — pages.yml's through bin/zer0 run pages, which spawned it — not for bin/zer0.
  • These two items are ADR 0006 decision 12's "zer0-workspace.yml, pages.yml and sites.yml stop installing Ruby"; P5 is ticked when G4 and P2 have both landed, which is why § 3 orders P5 after both.
  • Deviations: P5's code landed ahead of its place in § 3's order (before G4 and G16), as a parallel track of the overhaul — which is why the doctor still delegates to Ruby and the box stays open. bin/zer0 itself needs no Ruby anywhere. Ruby is still installed for what runs through it or beside it: zer0-workspace.yml's doctor step (the doctor is rails/bin/zer0-cms, until G4), pages.yml's build legs (bin/zer0 run pages spawns a Jekyll build) and sites.yml's (bundle exec jekyll build), until P2 moves the sites to the Jekyll-theme option. Options are parsed with argparse, not a clone of OptionParser, so the wording of a malformed option, a command's own --help, OptionParser's one-dash completion (-j for --json) and the YAML parser's syntax-error text differ from the Ruby tool; test_golden.py's DEVIATIONS lists each and checks its exit status. The recordings name the deleted theme (its paths in an affected recording, the doctor's theme checks), so the theme ratchet skips tools/workspace/tests/golden/.
  • Test: python3 -m unittest discover tools/workspace (57 OK, also on Python 3.9) · python3 bin/zer0 check · python3 tools/check_absorption.py · python3 -m unittest discover tools/tests · actionlint on the three workflows
  • P6: The React site renderer (web/site/) — reads a site's generated file tree (config, data, collections, posts, pages, the includes content uses), evaluates Liquid in content with liquidjs, renders Markdown with kramdown-compatible unified plugins, lays out pages in the platform's design system (layouts, navigation, skins, SEO tags, feeds, sitemap, robots, Pagefind search, redirects) with the Obsidian features as plugins, and writes static HTML; npm run site -- --site <name> [--compare] against P1's manifests with tools/site_manifest.py compare --pages — every page's path, title and text (its own content, not the theme's layout around it), the feed entries with their dates, the sitemap URLs and the redirects, but not the theme's asset files (web/site/README.md says what the renderer must reproduce). Accept: both demo sites match their manifests' URLs, feeds and text. Test: cd web && npm test && npm run site -- --site zer0-demo-garden --compare
  • P7-: A site moves to the React renderer — the owner picks which sites move (P-D5); each: the renderer reproduces the site's manifest (compare --pages), pages.yml builds it with the renderer, its render: setting flips. Replaces Phase F's D1 milestones.
  • P8: No Ruby — every Ruby ceiling at 0 and ruby_ratchet: empty, so the gate refuses any Ruby file; codeql-analysis.yml without its ruby leg; .vscode/tasks.json without the Ruby task; no workflow installs Ruby. (src/core/harness/render.ts still generates setup-ruby for other repositories' lanes; that is data about those repositories, not Ruby here.) Test: python3 tools/check_absorption.py && ! git ls-files | grep -E '\.(rb|rake|ru|erb|gemspec)$'

Phase V: Voice (ADR 0010, proposed)

  • V0: make today's voice visible (2026-10-30) — content/voice/: resolve(site, page=, channel=) composes the stores that hold a voice today in the order the guard applies them (the built-in bans and filler, each active BrandRules, SiteSettings, AIEO's BrandContext, a book's style guide and switch, a chapter's tone and style, a channel's limits), with where each lives, where it is changed and who reads it, and a digest; brand.rules answers from it (held to its old answers by a test); GET /api/v2/sites/<id>/voice/resolved/ and POST /api/v2/sites/<id>/voice/test/ (the guard on a text, no model); the studio's Voice tab on a site's page (web/packages/ui/src/voice/: who is told the voice, the map of who reads which layer with the readers it never reaches, each layer as a section, and the tester beside them), which the extension's Sites workspace renders; the "AI help reads it" label on the brand voice corrected (migration sites 0004). No writer or gate changed. Ledger row sites.voice, feature ZER0-046. Test: pytest content/tests/voice -q, cd web && npx vitest run packages/ui/test/voice.test.tsx, node verify/runner.mjs --only studio-voice-resolve
  • V1: the model — VoiceProfile with the site, section, type and channel scopes and revisions; the studio's Map and Profile; the voice fields of SiteSettings and BrandContext migrated into site profiles; import_voice for bash-365.com (VD2, VD3, VD5)
  • V2: push — generate, brand.rules, AIEO and books read the resolution; voice_digest on runs, suggestions and posts (VD4)
  • V3: gates — the guard and the reviews read the resolution; the built-in lists become the starter profile; P-D7's switches become lifts; the extension's guard reads the exported bans or the API (VD1)
  • V4: files — export and import of .zer0/voice/ and VOICE.md; bash-365.com's lint and skills read them
  • V5: judgment — a voice-review agent at policy suggest and adherence evals on recorded fixtures

4. Content and data migration

  1. Freeze: tag pre-migration (via the PR merge, not a manual push); record counts of files per site and rows per parodynews table.
  2. Jekyll/Obsidian → Wagtail (M6): manage.py import_jekyll --site <name> --path frontends/sites/<name>: one Wagtail Site + root per Jekyll site; collections/_posts → ArticlePage; front matter → typed fields per schemas/zer0.schema.json (title, date, tags → taggit, categories → snippet, seo_title, search_description); body Markdown → StreamField markdown/rich_text blocks (paragraph split); images → Wagtail Images in a collection per site; internal links → PageChooserBlock after a second pass; the original path is kept in legacy_path for redirects. Obsidian wikilinks resolve the same way.
  3. Governance state: extension .cms/ drafts, approvals and ledger → Suggestion (pending/accepted) and AgentRun rows with legacy_ref.
  4. parodynews DB: Post+PostFrontMatter → ArticlePage; PostVersion → Revisions (ordered, authored by a legacy:import user); Assistant/AIModel → AgentDefinition; Thread/Message → archived JSON or AgentRun (D-open); dumped with dumpdata first. ADR 0006 (G8): Assistant → ai.Assistant (not AgentDefinition), AssistantGroup → Pipeline, JSONSchema → OutputSchema, ContentDetail/ContentItem → Brief, Thread/Message → Conversation/Message, AIProviderConfig → ProviderConfig (credentials re-entered, never exported), AIModel → ModelEntry.
  5. books / drsai: library/<slug>/ → BookPage with chapter children; drsai stories → BookPage (profile story).
  6. Rails DB: Site rows stay in Rails as the registry (with a wagtail_site_id); Page/Term/Asset are derived caches, so drop them rather than migrate after verifying they match the files; Channel and LinkedIn tokens stay. ADR 0006: the registry is the platform's ManagedSite (G4); Rails keeps nothing.
  7. Verification: an idempotent importer (re-run = no changes); a round-trip test import → export → diff against the original Jekyll tree (allow whitespace/front-matter key order); count parity report; redirect map from legacy_path.
  8. Cutover per site: the Jekyll build switches from repo Markdown to exporter output (M7); the repo Markdown stays until the round trip is green for two releases.

5. Agent, harness and graph phases

They follow the note's §10 order exactly: M9–M10 (step 1), M11–M12 (step 2), M13 (step 3), M14 (step 4), M15–M16 (step 5), M17 (step 6). Invariants checked in every phase:

  • Every tool resolves to an agent Django user; no superuser service account.
  • Agents start at suggest; promotion to draft/auto needs the accept rate + evals above a threshold (recorded in the ADR).
  • One revision per accepted outcome; intermediate work stays in the run/checkpointer.
  • The exported schema version and embedding_model are stored with runs and vectors.
  • Content is data: review agents get no publish tools; write/publish effects need policy + an eval gate.
  • Rails reads content only via GraphQL/MCP; cross-plane writes go through the owning plane's API/tools.

6. CI/CD and docker compose

ADR 0006: the target CI is content.yml (the platform), a web.yml (the studio and the renderer), extension.yml, pages.yml (the renderer per site) and zer0-workspace.yml (Python) — no Ruby. The bullets below describe the path there.

  • CI: a single ci.yml calls standard-ci@v2 with bin/zer0 affected producing the matrix (content: pytest + makemigrations --check + schema drift + recorded evals; app: bin/rails test + zeitwerk:check; clients/vscode: npm test; image-generator, books: existing tasks; the theme is gated in its own repository). Services: pgvector/pgvector:pg16, redis:7. Keep codeql-analysis.yml and claude.yml; remove the per-project workflows once they are covered.
  • Release: release-please manifest mode, components content, app, clients/vscode (node, vsix), packages/zer0-image-generator (ruby). The theme releases from bamr87/zer0-mistakes. Conventional commits are required (squash merge titles).
  • Images: content/Dockerfile carries GIT_SHA/BUILT_AT into /version and OCI labels; the deploy target is decided (ADR 0004: GHCR images, a production compose file and a Helm chart — H1).
  • Compose (root): db, redis, content (gunicorn), worker (celery), beat, relay (outbox → Redis Streams) behind --profile content, each with the fleet's labels and log rotation; cms (Rails) and imagegen until Phase G retires them. The root .env.example lists the compose keys; content/.env.example the platform's own.

7. Risks and open decisions

Risks

  • Markdown → StreamField is lossy (Liquid tags, includes, raw HTML). Mitigation: a raw markdown block + round-trip tests.
  • Files-as-truth to DB-as-truth is a philosophy change for the extension and the Jekyll users (git history no longer holds content). Mitigation: the exporter keeps git snapshots.
  • parodynews's Django version and settings may not fit Wagtail 6 plus the monorepo layout; upgrading is possible churn.
  • The scope (20 PRs) and two runtimes add ops load for a single maintainer.
  • Prompt injection via imported content; LLM cost in CI (use recorded fixtures only).
  • Vendored-copy drift checks break during the moves (M2).

Open decisions

  • D1 — decided 2026-10-19 (ADR 0002): DB-first, one site at a time (Phase F). Does content become DB-first in Wagtail, with Jekyll repos as exported artifacts, or do Markdown files stay canonical with Wagtail as an index/editor?
  • D2: Grapple vs Strawberry-Django for GraphQL.
  • D3: LangGraph + Postgres checkpointer vs a hand-rolled state machine for the harness.
  • D4: Decided by ADR 0003. barodybroject does not survive as a product or a brand: the app continues as apps/parodynews/ until M20 absorbs its models; its Azure files stay de-branded (parodynews defaults) and deploy nothing from here until a deployment target is chosen.
  • D5 — decided 2026-10-21 (ADR 0004): the extension stays, as the platform's editor client (G10); the hub path is bamr87/bamr87/.github/workflows/standard-ci.yml@v2. The exact hub repo/path for standard-ci@v2, and whether the VS Code extension stays in this monorepo or splits out.
  • D6: Event bus: Redis Streams (default) vs NATS.
  • P-D1 (ADR 0006): when the Wagtail admin closes to editors — proposed: when the studio covers every editor task the admin offers (P2 plus G3–G9's views), checked against a list in the PR that closes it.
  • P-D2 — decided 2026-10-21 by the owner (ADR 0006 decision 11): the image generator is rewritten in Python and TypeScript; no gem continues from this repository.
  • P-D5 (ADR 0006 decision 4): which sites move from the Jekyll-theme option to the React renderer, and when — proposed: the demos first, as the renderer's proving ground; every other site stays on the option until the owner moves it.
  • P-D3 — decided 2026-10-21 by the owner (ADR 0006 decision 9): the extension is built from the studio's code — same language, framework, libraries and generated client; its webviews render the studio's workspaces; "less code is better".
  • P-D4 (ADR 0006 decision 2): the studio's home — proposed: served by Django at /studio/ (same origin, session auth, one deploy); the alternative is a separate static host with token auth.
  • P-D7 — decided 2026-10-28 by the owner (ADR 0006 decision 4): zer0-pages moves to the Jekyll-theme option (raised by P2), accepting both differences its option build shows — 88 extra theme images and fuller "Linked mentions" panels on five Obsidian docs pages — with its recording re-made from that build and those two differences as the stated reason; that removes the last site's Ruby. Done in P2 the same day. Replacing tools/obsidian/vault.py's Jekyll reading with a first Jekyll pass that emits each document's URL and data as JSON is a follow-up under P2.
  • P-D7 — decided 2026-10-28 by the owner: the brand guard on fiction (raised by G9) — a book, or its site, may switch the guard's built-in bans, written for marketing copy, off for its chapters in its settings; the markup check, every active BrandRules and the site's own banned phrases (SiteSettings.banned_patterns) still hold. Built in G9: BookPage.builtin_bans (the Books overview) and SiteSettings.chapter_builtin_bans (the Sites area's settings), honoured at propose, at accept, in the brand review, in the brand_clean eval and in brand.rules.
  • P-D8 (raised by G9's review): a book's parts. ADR 0006 decision 14 names "books, parts, chapters"; the books package has no parts, only acts (book.yml acts, a chapter's act, the manuscript's act headings), and G9 treats a book's parts as its acts. Proposed: keep it so until a book needs parts that are not acts (a series in volumes, a novel in books); then a PartPage between BookPage and ChapterPage, rendered as parts/<n>/ in the generated set.
  • P-D6 — decided 2026-10-28 by the owner (ADR 0009), as proposed: models the platform adds from G8 on carry a UUID public id from their first migration; AgentRun and Suggestion gained one and every surface moved to it in one change — REST, Idempotency-Key replays, GraphQL, MCP, the events (agent.run.completed and content.suggestion.created v2), stored JSON, Wagtail's log, the studio and, G10 having merged first, the extension; Wagtail- and Django-owned rows keep their integer ids as a recorded exception. (TARGET.md § Rules, raised by the P4 review.) The rule is UUIDs with integer keys internal, but pages, revisions, sites and users are Wagtail's and Django's rows with integer keys, and AgentRun and Suggestion exposed integers through the pre-P4 REST endpoints, GraphQL and MCP, and then the studio. Remaining, from the audit content/tests/api/test_public_ids.py holds (44 of 77 platform models have a public id; graph.Edge's key left the one tool answer that gave it): exposed today, ADR 0009's open questions — graph.Entity (entity:<id> graph nodes, GraphQL's EntityType.id, edge suggestions' dst), cms.Category (the studio's category field, Grapple's Category.id), cms.BrandRules and cms.ArticlePageTag (Grapple's ids); added from G8 on without one, none on a surface — ai.PipelineStep, ai.IdempotencyKey, ideas.Vote, newsroom.StoryEvent, newsroom.Byline, newsroom.FrontSlot, newsroom.IssueStory, newsroom.IssueDelivery, books.LibraryFile, importers.ImportedRecord.