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
- Five LLM clients: extension
src/agent,rails/lib/zer0_cmsAnthropic provider, parodynews provider layer (AIProviderConfig/AIModel), books studio, drsai story engine (plus image-generator). Target: one Django tool registry + LiteLLM, andruby_llmonly for Rails app agents. - Two ledgers:
src/core/governance/ledger.tsandsrc/core/harness/ledger.ts, both idempotency/run records. They becomeAgentRun/AgentStepin Django. - Two content models: Rails
Page/Term/Assetvs parodynewsPost/PostFrontMatter/PostVersion/ContentItem, both shadowing Markdown files. Both are replaced by Wagtail pages, revisions and snippets. - Two MCP surfaces in waiting: extension
src/mcp(TS) vs the note's Django MCP server. - Image engine twice: Python engine + "byte-identical Ruby port" +
rails/app/services/image_engine.rb+ vendored copies tracked bybin/zer0 vendor. - 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/), 9CLAUDE.md(the theme's went home with it, ADR 0005). - CI is not on hub conventions: 18 workflows, none call
standard-ci@v2; release-please covers only the root node package. - 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.ymlrefs); parodynews Azureinfra/andazure.yamlif Azure is dropped;sites/drsaiplanning 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.ymlis 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.
- P0 — ADR 0006, the target, the ledger, the gate.
- P1 — record every site's Jekyll build (it needs Jekyll, so it comes before any site loses its Ruby).
- P2 — the Jekyll-theme option; sites move to it and drop their Gemfiles and plugins.
- P3 — zer0-mistakes removed completely.
- P4 — the studio foundation (
web/): Write, Create and Review, built as shared packages from the start. - 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).
- G3 — accounts (the studio's sign-in, and parodynews's account capabilities).
- G8 — the AI content layer (parodynews in full): AI help in Write and Create.
- G14 — Ideas and Research.
- G15 — the Newsroom (parodynews's news site runs as a desk).
- G9 — Books, in the database, with generated files and AI-assisted writing.
- G4 — sites and jobs (the Rails catalog, writer and doctor in Python; the generated site trees).
- G16 — automations.
- P5 — the workspace tool in Python.
- G5 — distribution (LinkedIn, WordPress, GitHub pull requests, email).
- G7 — AIEO.
- G12, then G13 (with M17's remaining entity extraction) — monitor, then improve.
- G6 — media: the image generator rewritten.
- P6, then P7-
per site — the React renderer, then each site that moves to it. - G11 and P8 — retire the sources; no Ruby.
- 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 rootCLAUDE.mda pointer to it; make sub-packageCLAUDE.mdfiles pointers or AGENTS.md sections; adddocs/adr/0001-target-architecture.mdlinking to the note. - Files:
AGENTS.md,CLAUDE.md,*/CLAUDE.md,docs/adr/. - Accept:
bin/zer0 checkpasses; 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 rootCLAUDE.md's invariants moved into it and everyCLAUDE.mdis now a pointer whose@AGENTS.mdline imports it (so Claude Code reads the same text other agents do); projectCLAUDE.mdfiles became their ownAGENTS.md(the theme's was folded into its existing one), and Jekyll sites excludeAGENTS.mdfrom their builds. A root.markdownlint-cli2.jsoncrelaxes 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.ymlcallingbamr87/<hub>/.github/workflows/standard-ci.yml@v2(the exact hub path is open decision D5) with a matrix frombin/zer0 affected; convert the rootrelease-please-config.jsonto 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.ymlalready callsbamr87/bamr87/.github/workflows/standard-ci.yml@v2(D5's hub path), and every project —content/included, via the newcontent.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 releasejekyll-theme-zer0andzer0-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.jsonoff the root changes what the hub'sdetect-stacksees (docs/RELEASING.md: the root manifest'sprivate: truesteers 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 profilesites). - Accept:
docker compose upgives healthy services;/healthzreturns 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 (
dbon 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 namecmson :3001 and runs Solid Queue in-process (noapp-jobsuntil 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,/healthz200, a REST-started run executed by the worker, the relay delivering to thezer0:contentstream.
Phase B: Content plane¶
- M4: Wagtail skeleton from config
- Tasks: create
content/fromapps/parodynews/srcsettings; add Wagtail 6, Postgres + pgvector extension,cmsapp withBasePage,ArticlePage,BookPage, theAgentManagedMixin(note §2.2), customAbstractImagewithai_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
parodynewsis not mounted — its data comes in throughimport_parodynewsfrom adumpdata, so the content plane carries none of parodynews's dependencies and parodynews's own suite is untouched;ai_keywordsis JSON (SQLite and Postgres share one schema); vectors live ingraph.Embedding, not on the page or image row (a revision would copy them);front_matteris an order-preserving JSON text field (Postgresjsonbsorts keys). - M5: Headless APIs
- Tasks: Grapple (or Strawberry, D2) schema for the page types; Wagtail API v2
/api/v2/pages/; exportschemas/graphql/schema.graphql; CI check for drift. - Accept: a GraphQL query for an
ArticlePagereturns 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'srawValuecannot 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-matterpreviewimages into a collection per site; ABCalphabet:→letterblocks) andimport_parodynews(posts,PostVersionhistory as dated revisions bylegacy:import, assistants as legacy definitions that cannot run). drsai's books import throughimport_jekyll. -
packages/bookslibrary/<slug>/→BookPage+ chapters (§4.5) — not started. - Found:
apps/parodynews/src/pages/_config.ymlrefers 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_jekyllandroundtrip_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 bycontent.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:
outboxapp (OutboxEventwritten in the same transaction as publish/revision); relay to Redis Streams;schemas/events/CloudEvents JSON Schemas forcontent.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, inabc-engine.yml).content.suggestion.createdcarries atarget(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:
agentsapp with the models from note §4; data migration creating theAgentsgroup andagent:seo,agent:editor,agent:drafter,agent:reviewusers 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 withtrace_id. - Accept: a run of a fake tool records an
AgentRun+ steps; a tool with effectpublishis 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 bysync_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 userecordedandfake. OpenTelemetry spans open whenopentelemetryis installed; the trace id is recorded either way and crosses planes astraceparent. - M10 (build step 1b): Suggestion model + editor sidebar
- Tasks:
Suggestion(note §2.3), accept → new Revision by the agent user withBlockProvenance; Wagtail admin panel hook; port the extension's governance semantics (draft queue → Suggestionpending, 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_schemaemits JSON Schema per block, versioned and stored onAgentRun; toolscontent.get_schema,content.get_page,content.search,content.propose_editvalidated withStreamBlock.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:
AgentDefinitionfixtures fordrafter(incl. "abc" and "story" profiles ported fromrails/lib/zer0_cmsand drsai) andseo; GraphQLrequestAgentRun,acceptSuggestion; REST/api/v2/agent-runs/with SSE; both agents start at policysuggest. - 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 bysync_agents; besides drafter (profilesabc— the Rails generator's offline lexicon path, ported — andstory) and seo there are editor, review, brand, a11y and enrich. "Draft with agent" at policysuggestis suggestions that accept as one draft revision; atdraftthe drafter writes that revision itself. - M13 (build step 3): pgvector + structural edges + related/semanticSearch
- Tasks:
graphapp withEntity,Edge(note §5); embeddings keyed bycontent_hash+embedding_model; structural edges fromReferenceIndex, page tree, tags, locale on publish; GraphQLrelated,semanticSearch,entities; REST/api/v2/graph/neighbors/path. - Accept: publishing builds
child_ofand reference edges;relatedreturns 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=litellmswaps in a real one. Internal Markdown links and wikilinks becomelinks_toedges, since imported bodies keep their links as Markdown rather thanPageChooserBlocks. - 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
/mcpbacked by the same registry (one definition, three surfaces); scoped tokens mapped to agent users; retireclients/vscode/src/mcpin favour of a thin proxy or registration that points at Django. - Accept: the MCP
tools/listmatches the registry; a token foragent:seocannot callcontent.propose_editon 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 ismcp_server/so it never shadows themcppackage. - Retire
src/mcpin 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 andSiteSyncwrites;ContentClient(graphql-client, persisted queries);agent_runs/agent_stepsmirror;McpClient;HomepageAgent(ranker, returns block IDs or variant keys); Rails outbox → Redis Streams; consumecontent.page.publishedfor cache purge and LinkedIn distribution; emitapp.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): removingPageEditorand 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'simport_jekyllpicks 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
sitesapp 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 publishescontent.page.published;distributionconsumes it in G5). - M17 (build step 6): Entity extraction + GraphRAG + behavioral edges
- Tasks: enrichment agent on publish (entities,
mentions/about/similar_towith a confidence threshold → Edge or Suggestion); GraphRAG retrieval (search → 1–2 hops → rerank); nightly Celery job aggregating Rails interaction events intoviewed_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, GraphQLgraphSearch); theenrichagent proposingabout/similar_toedges, below-threshold ones as Suggestions;app.user.interactionaggregated into daily and co-view counts with no reader id stored, and a nightlyviewed_togetherbuild. - Entity extraction proper: a tool that creates
Entityrows (people, organisations, topics) from page text, and the publish-time trigger that runsenrich.
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; deletesrc/core/harnessandgovernance/ledger.tsduplicates. 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, andimage_engine.rbstays until they replace it.: image save → event → alt/tags/focal/embedding usingzer0-image-generator; deleterails/app/services/image_engine.rband 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
parodynewsmodels (after the M6 import verifies), its React frontend, its Azure infra (D4 is decided: drop once a deployment target exists), RailsPage/Term/Assettables (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
mainholds each imported tree as one commit (packages/zer0-mistakes: 3 commits here, 770 in the original) and the rewritten histories survive only inrefs/pull/29/head,refs/pull/36/headand the originals. Nothing is archived before this lands. - Tasks: a branch from
mainthat 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 latermaincommit that touched those paths as its own commit, so the branch's tree ends equal tomain's. - Accept:
git diff main <branch>is empty;git log -- sites/drsai/_config.ymlandgit blamereach 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, butgit logandgit blamestill stop at the squash, becausemain'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'sdocs/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
mainequals 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>aftergit 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 generatorv0.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 checkfails for apublishes: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-mistakesis the theme's home andtheme-mirror.ymlis deleted. - Tasks:
mirror-theme.yml— on a push tomainthat touchespackages/zer0-mistakes/**, and on a theme release, commit the subtree ontobamr87/zer0-mistakesmainas one fast-forward snapshot commit (sync: zer0-CMS@<sha>) and, on a release, tag itv<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'smainis not the commit it last pushed; a consumer pinned to@v<version>builds. - Needs the owner: a
FLEET_TOKENwithcontents:writeon the mirror; disabling its issues and pull requests. - Built:
.github/workflows/theme-mirror.yml(kill switchTHEME_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.ymlbuilds every site undersites/and parodynews's sidecar into one artifact with each site's sub-pathbaseurl(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.iobuildssites/2005into/2005/from this repository. - Accept: every route answers 200 in a link-checked preview;
bin/zer0 checkfails 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:+ thepagestask inworkspace.yml,bin/zer0 routes [--json]and theroutesrule inbin/zer0 check. Routed today:/zer0-pages/,/drsai/,/zer0-pages-remote/,/demos/cookbook/,/demos/garden/,/wargames/. Not routed, each with its reason inworkspace.yml: parodynews (its sidecar's_config.ymluses 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 whilePAGES_DEPLOY_ENABLEDistrue. - 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-mistakesis 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.ymlgainscontent_source: files | wagtailper site (defaultfiles);pages.ymlbuilds awagtailsite fromexport_jekylloutput; a CI check fails when awagtailsite'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 frombamr87/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.ymlsay "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'sBE/OPSrows):/healthz(liveness, touches nothing),/readyz(database, cache, Redis),/version;X-Request-Id+X-App-Versionon 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,-32603on 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→ committedschemas/openapi/openapi.jsonwith a CI drift step; Sentry whenSENTRY_DSN; compose labels and log rotation; rootSECURITY.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.pyis 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/documentsendpoints (per address;NUM_PROXIESkeys the bucket behind a proxy); the OpenAPI document covers the platform's own endpoints only, because Wagtail's viewsets build their serializer per request;handler500is JSON only withDEBUG=False; the graph views' query-parameter errors moved from 400 to 422 (no consumer outsidecontent/). - 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 honourscancelled), 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; blocksembed,document,table,typed_table,raw_html,liquid,calloutwith richer rich text, each with a preview template and ablock_to_markdowncase; a theme-like preview via headless preview;SiteSettings(SEO defaults, analytics, feedback, brand voice, navigation,content_source);BrandRulesper site;Author/Series/Category/Entitysnippet viewsets;FormPage; i18n on;publish_scheduledon beat; search promotions; a seeded "Editorial" workflow (brand review → moderators);.localhostinALLOWED_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-*.ymlpass with evidence. - Test:
cd content && python -m pytest -q && node verify/runner.mjs - G3:
accounts— django-allauthopenid_connect(one app per IdP from the environment),allauth.mfaTOTP + 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.headlessserves the studio and the extension. - Status, 2026-10-27: built on
feature/g3-accounts(onfix/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,socialaccountwithopenid_connectandgithub,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/mestays. - OpenID Connect, one allauth app per IdP from the environment (
OIDC_PROVIDERSandOIDC_<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 withresponses). -
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. -
UserTokenscoped (read,write; migrationaccounts/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 bymanage.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 followsSIGNUP_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.tsxis 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/uiasAuthHost;SignInScreenfollows the flow allauth says is pending,AccountWorkspaceis 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
appclient (/_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.tsnames 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.ymlpasses 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_ACTIVITYstays 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 --recordedon a scratch SQLite aftermigrate -v0andsync_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'snpm ci && npm run compileand 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(WagtailSite⇄ checkout path,content_source files|wagtail— D1-0's switch — digests, last sync, doctor findings), discovery underSITES_DIR, sync asimport_jekylljobs, write-back asexport_jekyllforfilessites with the digest stale-write guard ported frompage_editor.rb;zer0 doctorported (sites/doctor.py, six checks, the same JSONL),manage.py doctor,zer0-doctor.ymlswitched, and — left over from P5 —bin/zer0 doctor(tools/workspace/doctor.py) switched to it, withzer0-workspace.yml's lastsetup-rubyremoved and theworkspace.doctorledger row andplatform.workspaceops set todone(P5's doctor item). Gate: the Rails fixture sites sync and export byte for byte. Retires RailsSite/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) andJobArtifact, 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: 409job.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 WagtailSite, its checkout,content_source files|platform,render react|jekyll-themewith the theme's tag and the Jekyll server — P2'srender: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) andSiteSettingsthroughwagtail.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 plusmanagedandcan_manage, so the site switcher and the registry are one source — registers a checkout inside the repository orSITES_DIR(its first sync starts), discovers workspace.yml's sites andSITES_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 needssites.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.pyrenders the walk injekyll-parity's JSON and compares it byte for byte with the lists Jekyll 4.4.1's reader produced, the fixtures moved tocontent/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) andsites/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 rendersexporters.jekyll.site_filesinto the checkout underPageEditor'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'sImportedSource.manage.py site_job sync|export|doctor --site KEYruns 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 doctorin 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 aruby:3.3container on the 22 scenarios oftest_doctor.rband the three fixture sites (tests/fixtures/doctor/ruby-recording.json), held finding for finding bytests/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'stheme-not-zer0andno-theme-overrides, and the theme's front-matter schema behindmissing-key:*(the vendored copy, a site's own,--schema); its generic ruleconfig-unreadableis now theconfigcheck's. In their place a required field is one the site's ownzer0.jsoncontent type declares (resolved as the extension resolves it), andzer0.jsonis checked againstschemas/zer0.schema.json.bin/zer0 doctorruns it (P5's doctor item),zer0-workspace.ymlinstalls no Ruby, andzer0-doctor.ymlruns it on Python.docs/ZER0-STACK.mdsays 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) andJobLog(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.rband the vendored theme schema it alone read;Zer0Cms::Doctor::Jsoncstays because the LinkedIn lane readszer0.jsonwith it until G5.check_absorption.py --tighten:rails/151 → 150; themerails/lib/5 → 4,rails/test/andworkspace.ymlto 0. The ledger:sites.registry,sites.jobs,sites.doctorandsites.syncdone on their surfaces,platform.workspaceops done,rails.catalog,rails.front-matter,rails.doctor,rails.page-editandworkspace.doctordone with proofs;rails.writer,rails.site-registryandrails.parity-toolspartial 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 inrails-cms-spec.md. What this item said before: RailsSite/Page/Asset/Term,SiteSync,PageEditor,SitePathandrails/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/studioitem): 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.ymlbuilds 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.ymlview (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_sourceisfiles|platform(D1-0 named the secondwagtail, and ADR 0006 makes Wagtail a library); the doctor'sthemecheck is nowconfig(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 doctorneeds Python 3.11+ with PyYAML and jsonschema, though the rest ofbin/zer0still runs on 3.9; registration also discovers workspace.yml's sites, and theirrender:setting becomes the site's; the doctor's image-engine rules still name the image generator's gem, which G6 replaces.catalog.py,frontmatter.pyandwriter.pyare 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 thebrandagent; the LinkedIn client ported (restli,oauth,posts,statistics); toolsdistribution.compose(propose) anddistribution.publish(publish, armed byZER0_LINKEDIN_PUBLISH); consumescontent.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. Retiresrails/lib/zer0_cms/{distribution,linkedin}andzer0-linkedin.yml. Test:pytest content/tests/distribution -q - Status, 2026-10-22: landed on
overhaul/distributionas 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 throughmanage.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, migrationdistribution/0001_initial):Channel(LinkedIn, WordPress, a GitHub repository as pull requests, a newsroom newsletter; per site; the credential encrypted withai/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),LedgerEntrykeyed 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;Statisticrows 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) anddistribution.publish(publish, refused until the page and the agent are atauto, the definition is live and the agent's group holds the publish right) in the registry and over MCP; the GitOpsdistributionagent, eval-gated; thecontent.page.publishedconsumer drafts a post for every channel of the page's site that drafts automatically — never a publish — and the composeeventsservice 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'sdistributioncheck ported for G4 (lane/doctor.py); the reusablezer0-linkedin.ymlruns 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/distributionand/admin/channels, itschannelstable and encryption initializer;rails/lib/zer0_cms/distribution/,bin/zer0-cms linkedinand the Ruby doctor'sdistributioncheck;rails/lib/zer0_cms/linkedin/. The Ruby ratchet forrails/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 armeddistribution.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 ownrequestserrors 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 orSITES_DIR(G4's rule, which also confines the site ledger file), or refused — never a guessed URL — and compose'seventsconsumer 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;LedgerEntryhas a UUIDpublic_id(P-D6; migrations 0004–0006, the fill aRunPythonin Django's recipe for a unique field on a populated table, checked on SQLite and Postgres) and avisible_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 throughresearch.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 exactlyentry_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.unchangedrather than a bare hash); the lane's commentary check, dead helpers deleted, the last rules out of the views; the enum components carry theDistributionprefix; the studio keeps a rejected post read-only, lists a story's own site's channels and followsoneClick, andweb/README.mdlists the workspace. Already settled onmain: the doctor'sdistributioncheck runs (sites/doctor.py, c43b1780), the worker mounts the sites (G4), and the Railschannelstable left withrails/(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.channelsanddistribution.statsdone onapiandstudio,distribution.queueonapi,studioandmcp(extensionstays partial);rails.linkedin,rails.linkedin-stats,rails.distribution-queue,rails.channels,parodynews.publish-prandaieo.publish-wordpressdone. - 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 thebrandagent — 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.ymlis 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 Rubyzer0 doctorno longer runs adistributioncheck: its Python port waits for G4's doctor, andmanage.py linkedin statusfails 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 --recordedon a fresh database aftersync_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-stdlibon ruby:3.3 and 4.0.5 (75 runs each) ·bin/rails test(66 runs)&& bin/rails zeitwerk:checkand 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 frompackages/zer0-image-generatoras a library;ImageRunjobs (dry-run, list-missing, generate, enhance; provider, parallelism, cost),Composition/CompositionImage(forge: direct → render → review → enhance),StudioRenderand sweeps,LibraryEntrywith FreeSVG sourcing,ProviderCredential(encrypted, environment fallback), the image-save trigger →media.describe/propose_alt, thepreview_images:site-config editor; the Media studio menu. Gate: the same artifacts on the fixture site; credentials migrate. Retirespackages/zer0-image-generator/web/andrails/app/services/image_engine.rb; the Ruby port and the gem leave this repository (ADR 0006 decision 11). Test:pytest content/tests/media -qADR 0006 decision 11: a rewrite in Python and TypeScript, not an import — the engine, providers, prompt engines, review and enhance as tested modules incontent/media/; the panel's sites view, the forge, the SVG studio, the library and the runs audit as studio views; the CLI asmanage.pycommands;jekyll preview-images, the Ruby port, the gem and the Rails panel go. - G7:
aieo(all ofapps/aieo/, ADR 0006) — the analyzers and scoring engine as modules;ScoringPatternsnippets seeded fromprompts/patterns/*.md;AuditRun(page or URL, five dimensions, evidence); toolsscoring.audit_page|audit_url|score_text|list_patterns|apply_pattern; the ten prompt agents asAgentDefinitionprofiles atsuggest;Citationand 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); theaieo_*MCP names kept as aliases. Gate: the ported backend tests and the same scores on the fixture pages. Retiresapps/aieo/. Test:pytest content/tests/scoring -qADR 0006: everyaieo.*row of the ledger — the content lifecycle, the CLI and root scripts asmanage.pycommands, reports as job artifacts, Qdrant replaced by pgvector — and the scores feed G12 and G13. - Landed 2026-10-22 on
overhaul/aieoas 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 48aieo.*rows aredone, 6partialand 3missing, 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 totests/aieo/golden/source.json— recorded by runningapps/aieo/backend's own code ontests/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
assistantagent (run kindsaieo.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 — throughresearch/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 fromgraph.Embeddingkindaudit— Qdrant replaced by pgvector); the visual audit behindAIEO_VISUAL_AUDIT, Playwright optional with every browser request routed through the guard, faked in tests, its screenshot reaching the providers that declare the newvisioncapability (ai/providers: image parts in a message foranthropicandopenai). - 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_editas suggestions — never a revision; a pasted text's rewrite is a draft shown beside the original. The pattern library asPatternrows (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-promptsre-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 newLandingPagepage type (allowed under a site root and a collection); reports — AIEO's per-site and summary Markdown, byte for byte from its importedreports/, and HTML. - Interfaces:
/api/v2/aieo/(people only,202+Idempotency-Keyfor 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 theaieoagent 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-promptsfor 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/uicomponents; 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.prioritiestargetssites.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
AgentDefinitionprofiles, as the overhaul's brief asked; patterns arePatternrows with a Django permission, not Wagtail snippets (no new admin screens); connectors areConnectorrows per site — each with its own encrypted credential, status and syncedConnectorData, 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 bymanage.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 carriespatternsas 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 writesproposed/only — AIEO's--apply-in-placeis 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); theaieoagent is a review agent with no page rights of its own, so its page tools needagent:aieogranted page permissions, and an agent rewrites a text, never a page (only a person asks for suggestions on one);PyJWTis a new runtime dependency. - Test:
cd content && python -m pytest tests/aieo -q(the app isaieo, so its tests aretests/aieo, nottests/scoring) andpython -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 --recordedon a freshly migrated scratch database aftersync_agents --publish(19 cases, theaieoagent's two new) · the OpenAPI drift command (additive: no existing path or component changed; the agent block schema gainsaieo.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
mainon 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 abovesites/:id); WordPress publishing is G5's channel, soaieo.publish-wordpresskeeps G5'sdonerow; the connectors' credentials joinmanage.py rotate_ai_credentialsthrough G5'sai.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'stoken_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 atAIEO_RUN_TIME_LIMIT; a site's brand context, keywords and Search Console rows reach only its editors, onscore/,agents/run/,aieo.run_agentandaieo.prioritiesalike (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 mostMAX_SITEMAPSsitemaps and reads at mostmax_pagespages 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 inaieo); 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 takesaieo.delete_connector; a failed sync is logged without its frames; AIEO's report inputs are kept inaieo/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 and24cca0b8:tests/aieoand the OpenAPI tests pass on Postgres. The box is open again, as G3's is for its own items: of the 48aieo.*rows 39 aredone, 7partialand 2missing—aieo.prd-lineageis not built,aieo.site-snapshotandaieo.site-contextare partial, andaieo.visual-auditis 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);LandingPagestays inaieo, socms'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) withagents/llm.pyas a front over it and a test that nothing else imports a provider SDK;ProviderConfig(encrypted, write-only credential; one default),ModelEntryand its sync job, the health test;OutputSchemawith 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 anAgentRunon 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_parodynewsextended (assistants →Assistant, groups →Pipeline, schemas, content details →Brief, threads →Conversation);ensure_adminand the install wizard's bootstrap; the GitHub-issue error reporter as an optional logging handler. Gate: everyparodynews.*ledger rowdone(ordroppedby the owner), the import round trip,content/tests/ai/. Retiresapps/parodynews/once its sidecar site has moved (P2). Test:pytest content/tests/ai -q - Was (ADR 0004): G8:
conversations(parodynews) — chat over anAgentRun(messages as steps, replayed to any backend),Playbook(ordered agents),OutputSchemasnippets, message → page draft, the provider settings page overagents/llm.py(sync, test, default), publish-as-PR throughdistribution(export_jekyll→ branch → PR withFLEET_TOKEN). Gate: theimport_parodynewsround trip and the conversations tests. Retiresapps/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,structuredvalidated withjsonschema,list_models,health, declared capabilities;AI_PROVIDERSadds or removes one);agents/llm.pya 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 outsideai/providers/; the SDKs optional (requirements-providers.txt, installed by the image unlessAI_PROVIDERS=false). -
ProviderConfig(one per adapter, one default by a database constraint, the credential MultiFernet-encrypted fromAI_CREDENTIAL_KEYSorSECRET_KEY— the keys derived fromSECRET_KEYand its fallbacks always still decrypt — write-only over the API, dropped when the base URL changes,rotate_ai_credentials;extraonly the adapter's declared options; configured by people withai.change_providerconfig, the only ones who see the configuration),ModelEntryand its sync (a run, andmanage.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 theassistantdefinition'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 theassistantagent 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
AgentRunof the GitOpsassistantagent (agents/definitions/assistant.yaml, eval-gated on recordings) through the runner's own loop on Celery:202with the run, followed on/api/v2/agent-runs/<id>/stream/;Idempotency-Keyon 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_toeverywhere, a row only in a site its owner edits, provider configuration forai.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; toolsai.run_assistantandai.generate_brief(propose) in the registry, over MCP for an agent that lists them. -
import_parodynewsmaps 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;Assistantno longer becomes a legacyAgentDefinition. 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; theanthropicadapter sends an OAuth token's beta beside the fallback one; a definition'santhropic/…model id reaches a vendor adapter bare, andclaude_coderefuses 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.
- Provider adapters behind one registry (
- 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, onoverhaul/studio-ai; every workspace is a@zer0/uicomponent, 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 takessuggestwithpage_id(andblock_id,selection) and starts apagerun 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_editon every owned row, a brief'spageandsource_messagetyped 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-briefandstudio-ai-chatfor featureZER0-044,studio-ai-workspaceforZER0-043), passing with evidence undertest/evidence/; the verify kit's platform runs agent runs in the request and answers assistants fromverify/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'slinktypeorhref, a heading's level, a code block's language, another occurrence. - Suggestions are proposed through the registry:
_proposecallscontent.propose_editas theassistantagent 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_pageasks the registry (Registry.check, every check but the rate) when the run is requested and again in the worker. Theassistantdefinition listscontent.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_editunder 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-Keymade 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'sordering=-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:assistantgroup and the rate.
- AI → Providers: every adapter's status, credential (set or not set) and last health for everyone; for those with
- The AI and Create areas' extension counterparts — G10 (the extension renders these components; the ledger's parity report lists each
studio: done, extension: missingrow). -
ensure_adminand 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.*rowdone— 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), notis_staff— the editors' fixture is staff; theclaude_codeadapter takes nocli_path,envorcwdfrom a provider row (barodybroject's did) — they are the deployment's;import_parodynewsgained--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 twoassistantones 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
pagerun (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 anIdempotency-Keymade 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);beautifulsoup4is now a direct dependency (it was Wagtail's) for swapping a selection in a paragraph's text nodes; theassistantdefinition listscontent.propose_edit, which only its handler calls; request bodies became…Requestcomponents 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 inApp.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 inverify/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 --recordedon a fresh database aftersync_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 --recordedon a fresh database aftersync_agents --publish(14 passed) · the OpenAPI drift command (and the GraphQL and agent schemas: unchanged) ·node verify/runner.mjson a freshly seeded platform (7 of 7 scenarios,studio-ai-workspacenew) ·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 andChapterPages; manifest, outline, characters, style guide and continuity notes as fields andMemory) andexport_books(the generatedlibrary/<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; thebooksCLI's commands asmanage.pycommands; 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 onlibrary/impairment(import → export → byte-compare), everybooks.*ledger rowdone, the Rails wizard's fixtures. Retirespackages/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), thebooks.validatetool and acontinuityreview profile,export_manuscript, the ABC wizard as an admin form over thedrafterabcprofile andexport_jekyll. Gate: parity onlibrary/impairmentand the Rails wizard's fixtures. Retirespackages/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 fourbooks.*rowspartial. 16 of the 20books.*rows aredone(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, migrationcms/0002_book_manuscripts):BookPageholds 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 asdocuments(the act guides, the README);ChapterPageholds 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 infront_matter, in order. A book's parts are its acts, for now (P-D8). Every field butdocumentsis 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 incms/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 theImportedSourceit 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 ofpackages/books/library(impairmentand_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 atpackages/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(migrationbooks/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_bookswrites 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;--forceoverwrites); the file of a renumbered, deleted or unpublished chapter, a removed document or a deleted book is removed while unchanged.import_booksmatches 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 takesch0NN.md, and validation reportschapter-duplicate;add_chaptertakes 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 frompackages/books/src). - AI through
content/aionly: the GitOpsbooksagent (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'sgenerate(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 anai.Briefthe 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 genericapply/, 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/withIdempotency-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 untilbooks.abc), the same whichever site is picked. A smoke test against a running platform (recorded provider) drafted a chapter ofimpairmentfrom 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) andweb/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'sabcandstoryprofiles exist) — the gate's "Rails wizard's fixtures". The Rails wizard and generator were deleted on 2026-10-27 (ADR 0008): what they did israils.abc-wizard-uiandrails.abc-generatorinrails-cms-spec.md, and their fixtures are drsai'sit-alphabetbook, which the Rails generator reproduced byte for byte atd0a572fb. - 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.exportstayspartial. - 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 keepsbooks.studio-editor,books.ai-draft-continue,books.ai-contextandbooks.ai-clientpartial. - 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 thebrand_cleaneval, judged on each suggestion's own target, and in whatbrand.ruleslists for the agent; the filler warnings, the same marketing vocabulary, go with them. The markup check, every activeBrandRulesand the site's own banned phrases still hold. The switch is a setting of the book, not its text: it is in no file oflibrary/<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.tsxandsites.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.managepartial. - 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
BookPageandChapterPage, andexport_jekylldoes 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'smetaop 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 andfront_matterwithout the template's comments, as bookshelf'sbooks newdid;books ask,studioandserveare the studio's Books area (a task is a run a person starts); imported books and chapters are published bylegacy: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_bookswrites what is live unless--include-drafts(asexport_jekyll); a book made from a premise gets the model's values in the accepting person's draft revisions rather than as suggestions (themetaop 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'Memoryas the milestone's text says — nothing read the copy, andmemory.recallchecks no page rights, so it showed unpublished manuscript text to any person's assistant (memory.recallis off thebooksagent'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 havechildren; a JSON list field renders as tags in the studio's field panel;ChapterPagehas 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, whichai.services.apply_briefcalls for a page type that has one — and in behaviour:suggestionsjudges 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 --recordedon a freshly migrated database aftersync_agents --publish(17 cases, the threebooksones included) · the OpenAPI drift command (--fail-on-warn, no drift), the agent block schema and the GraphQL schema (no drift) ·import_booksthenexport_booksanddiff -ragainstpackages/books/library/impairmentand_template(identical),export_booksback into the library (0 written, 26 unchanged;git statusclean),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.tsx12) ·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,postMessagetransport for the generated client);dist/panel.js,dist/dashboard.jsanddist/agent.jsreplaced 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, andsrc/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 markedstudio: doneisextension: doneor 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/extensionas 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/uiexportsWORKSPACES, the workspace registry (each entry with the destinations it shows), andSitePicker(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.cssmaps every--zer0-*token ontomedia/tokens.css's--z-*, so light, dark and high contrast follow the editor live);esbuild.jsbuilds it intodist/studio.jsanddist/studio.csswith its own allow-list of the studio's libraries, and the rootpostinstallinstallsweb/from its lockfile. The page isdefault-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 witheventsource, which can send the token as a header);src/studio/studio.tsplaces the views;zer0Cms.platform.url(settings layer only, restricted and ignored in an untrusted workspace),zer0Cms.platform.setTokenand.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'sImportedSource.legacy_pathand the site'ssource_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), andaccounts.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'sUserToken; the OpenAPI document andweb/packages/apiregenerated. -
src/core/shared/'s hand-rolled helpers replaced by the libraries, each in its own commit: YAML byyaml(frontmatter.ts1578 → 1033 lines,siteConfig.ts312 → 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 isnulland a warning), JSON with comments byjsonc-parser(jsonio.ts338 → 222), globs bypicomatch(glob.ts164 → 136), dates bydate-fnswith@date-fns/tz(dates.ts562 → 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 asCORE_LIBRARIES— the MCP bundle exactly those, never the engines package — anddist/panel.jsthe two date libraries. - Every capability marked
studio: doneisextension: done:content.revisions,content.publish,ai.suggestionsandplatform.shared-ui, each proved byweb/packages/webview/test/webview.test.tsx(the extension's ownAppover a fake host and platform);ai.streaming,platform.tokensandcontent.collaborationmoved topartial. The remaining gaps are reported bytools/check_absorption.py --report. - The extension's line count goes down: tracked
src/**/*.ts74,456 → 74,339 lines (60,852 → 60,338 outsidesrc/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 inweb/packages/(the app, the transport, the registry and the site picker). After the review fixes below: 60,565 outsidesrc/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.jsanddist/agent.jsreplaced 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
WORKSPACESentry each when they merge — done when G10 merged ontomain(2026-10-27), for those and wave 3's too:WORKSPACESis 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, andHOMEnames the workspace of every destination — typed over the wholeDestinationunion, so a destination added without one failstsc. 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 isextension: partialwith what is not yet proved, and the gaps a webview has by nature are recorded in the ledger — an upload (research.capture), adata: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.tsxrenders the sameAppoverconnect(port)with every message handed to a realStudioBridge, whose only fakes are the platform behindfetch, the modal, the token and the stream opener, so the path gate, theLIVE_CHANGESmodal, the header allow-list and the token are in the loop for each of its 32 rows — the 16 of the parkedwip/mac/harmonize/w1-extension(8b17c541), adapted tomain, and 16 more for the workspaces it did not cover. Twenty-one ledger rows moved toextension: doneon it:ideas.brainstorm,research.sources,research.synthesize,news.workflow,news.corrections, the fouroutbox.*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 threeaieo.*rows the parity report listed,books.createandbooks.write. TakingIdempotency-Keyout ofREQUEST_HEADERSfails the twelve rows that send one or follow the job one starts, taking the page-publish pattern out ofLIVE_CHANGESfailscontent.publish, and takingpublishedout ofSTORY_RELEASESfailsnews.workflow.web.ymlnow also runs on a change tosrc/core/studio/, whichbridge.ts's header asks to keep import-free. The parity report is down from 26 gaps to 5, each recorded on its row:content.workflowandcontent.search(no studio screen yet),ai.assistants(its export downloads as adata:link the host does not open),distribution.queue(the ledger download and LinkedIn's consent return) andplatform.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-srcno longer allows any https host); the transport carriesIdempotency-KeyandIf-Matchand the response headers a workspace reads, and refuses an upload withextension.unsupported_body(recorded as a gap underplatform.shared-ui); platform mode is decided per file — the Metadata view keeps file mode for a file the platform has no page for, andzer0Cms.dashboard.filesopens 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'sD,YY,Doread as theirs, every other letter written as typed — an unquotedThad become the epoch in milliseconds, andDthrew out of the panel);dist/THIRD_PARTY_NOTICES.txtcarries the licence of every bundled library into the vsix. On the platform: both bearer tokens shareaccounts.tokens.HashedToken, whose use is recorded at most every five minutes after the request commits (a write insideATOMIC_REQUESTSfailed parallel requests with "database is locked");accounts.servicesissues (90 days by default, a superuser's only with--superuser), lists and revokes;UserTokenhas a UUIDpublic_idandvisible_to; andzer0u_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 throughWORKSPACES, left untouched while the wave-2 tracks edit that file. TOML front matter keeps its small reader, andcore/harness/workflows.tsits line scans, which could now read the parsed document — neither was in this milestone's list. The test line'snpx vscode-test --label multirootis part ofnpm test, which runs both labels.docs/CONFIG.md§5 is maintained by hand and checked bytools/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/uineeded@dnd-kit/*indist/studio.js's allow-list,schemas/books/(ADR 0008) left the vsix, the webview's entry hands its nonce toget-nonceas 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.js19;npm teston 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, andmcp.test.js19) ·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 lsequals.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 rowsspecified),packages/zer0-image-generator/,apps/aieo/,apps/parodynews/,packages/books/src/; the workflowsrails-app.ymlandabc-engine.yml(gone withrails/; notzer0-linkedin.yml, which G5 kept and moved to Python),aieo.yml,parodynews.yml,books.yml;workspace.yml,docs/MONOREPO.md,ATTRIBUTION.mdupdated; one commit per removal, each citing its gate. Test:bin/zer0 check && bin/zer0 run test --allADR 0006: a source goes only whentools/check_absorption.pyshows its rowsdoneordropped— 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 atsuggest) 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) —Ideaon 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) withQuotes andCitations, collections, capture (URL withtrafilatura, RSS/Atom and wire feeds withfeedparseron a schedule, uploads withpypdf, 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-checksowned/usedmade 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 capabilitysearch(Provider.search→SearchResults), declared by theanthropicadapter 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 throughresearch/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 onereplacesuggestion, proposed through the registry as theassistantagent; none on a page whose agent policy isoff), web search (hits become sources to fetch), research briefs (AIEO's prompt) — each a run of theassistantagent 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, kindidea), 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.synthesizedone onapiandstudio;research.capturepartial on both until wire feeds are read (extension and MCP open everywhere);aieo.topicsandaieo.researchdone. - 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
researchqueue only the newresearch-workerservice 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 throughregistry.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'scontent.propose_edit, whichagents/definitions/assistant.yamllists for this one use (no assistant may list it). Either amend TARGET.md, or remove that line fromassistant.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) — themcpsurfaces 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 atIDEAS_CLUSTER_THRESHOLD, duplicates atIDEAS_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 (effectpropose, through the registry'scontent.propose_edit) where the other research runs only read — open for the owner (above); web search comes only from theanthropicadapter (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; aDrawerruns 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 --recordedon a freshly migrated database aftersync_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) withStoryEventas 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, aTaskthe story's desk approves: its workflow lock, moderation and log are Wagtail's), the rest the story's status;WAGTAIL_FINISH_WORKFLOW_ACTIONleaves a newsroom page to the newsroom, which publishes or schedules it only throughcms.servicesunder 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 frompage_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 (
Authorsnippet, orderedBylines, 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 inexport_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 andList-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.servicesonly: 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/dndor 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
authorsandcorrections). - 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=abcanswered 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 whenEMAIL_BACKENDwas 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>throughreact-style-singleton, which takes its nonce fromget-nonce— so the studio host now hands the page's nonce toget-noncetoo (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-anymailwithout an extra (each deployment installs its ESP's:django-anymail[amazon-ses]…), its settings fromANYMAIL_*variables, and Django's SMTP backend whenEMAIL_BACKENDis 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, andWAGTAILADMIN_NOTIFICATION_INCLUDE_SUPERUSERSis off for every workflow. - Test:
cd content && python -m pytest -q(365 passed, 1 skipped — 43 of themtests/newsroom/; the theme-checkout skip unchanged) · the fast tier on Postgres 16 + pgvector as CI'spostgresjob 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 aftersync_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 themnewsroom.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),enabledfalse 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 bykind), a JMESPath condition,on_error,max_runs_per_hour, a secret encrypted under the AI layer's credential keys, its last run — andAutomationRun: 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 fromzer0:content(EVENTS_STREAM) by the outbox consumerautomations(consume_events --own --group automations, the new composeeventsservice), once per event; cron schedules, in UTC, dispatched every minute by one beat task that reads each automation's cron line with Celery's owncrontaband claims each due tick before firing it; webhooks signed with the automation's secret (X-Zer0-Signature-256, or GitHub'sX-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 asmonitor.finding). An automation hears only what its owner may see, and only its own site's; its own work never fires another (started_by_eventcarriesautomation-run:<id>). - Conditions: JMESPath through the maintained
jmespathlibrary (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_runafterapi.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 overmax_runs_per_houris 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) anddisable/(staff may pause anyone's);test/(a real run with a sample payload, paused or not, with anIdempotency-Key) anddry-run/;export/andimport/as YAML, the round trip unchanged;rotate-secret/; each webhook trigger'swebhook/;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_credentialsre-encrypts the automations' secrets with the providers' credentials, in one transaction. - The
automations.fire_hooktool (write: an agent at policydraft, 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_errorand 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
eventsconsumer 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 readsEVENTS_STREAMthroughconsume_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 throughresearch.fetch.post, the fetcher's guard and its one deadline, and a run executes on theresearchqueue; 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 hasautomations.email_anyone, asked again when it runs, at mostAUTOMATIONS_EMAILS_PER_HOURrecipients an hour per person, as taggedAnymailMessages); 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 everyX-…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 signedt=…,v1=…over its time and body, never the way an endpoint accepts, and no webhook action may call an automation's endpoint);automations.fire_hookwas aproposeany agent could use to set off anyone's automations under any hook name (write, and an agent fires onlyagent.<slug>.<name>); the documentedrotate_ai_credentialsleft the automations' secrets under the old key (it re-encrypts them in the same transaction, throughai.crypto.REENCRYPT, androtate_automation_secretsis gone); the documented start commands left outevents. 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_eventsforzer0:apphad 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.interactionis not one (its reader ids are never stored here) and an event from the other plane is ignored; "notify" is two action kinds,emailandwebhook, 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 hookmonitor.finding, which G12 fires — nothing fires it yet; schedules are one dispatcher on beat reading cron lines with Celery'scrontabrather than django-celery-beat's database scheduler (no second scheduler to deploy, no per-automationPeriodicTaskrow to keep in step; the reason is in the README), and cron lines are UTC; event automations need the new composeeventsservice (consume_events --own), the first process in which the platform consumes its own stream, andconsume_eventsregisters 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 triggerevent,scheduleormanual(a test) and links back throughstarted_by_event; a webhook delivery over the hourly limit answers 202 with its run's statuslimited, 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'sExportButtonandImportButtongained 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 --recordedon a freshly migrated scratch database aftersync_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: theeventsconsumer against Redis 7 through quiet spells and then an event, and the verifier's trickling server againstfetch.post(stopped at 1.0 s) - Merged onto
mainon 2026-10-27, after G4, G5 and the outbox desk had landed (merge: G16 — automations (overhaul/automations) onto main): G5 had already added a composeeventsservice 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'sai.crypto.credentials_rotatedsignal rather than the branch'sREENCRYPTset, 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,/readyzprobes),.github/workflows/publish.yml(build and pushghcr.io/bamr87/zer0-cmson a release tag, verify/readyzon the image),docs/OPERATIONS.md(backups withpg_dump, a restore drill, retention, rotation),manage.py seed_demoif 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(extendingagents/tracing.py), optional Prometheus/metrics, per-site budgets (budget_usdperSiteSettings, 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 remainingAGENTrows 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-mistakesas a draft PR (port/zer0-cms-2026-10: ship-no-person, the setup-wizard fix, the settings byte copy — each with aPorted-From:trailer);packages/zer0-mistakes/removed; thezer0-mistakesproject, its/route, eightdepends_onedges and twovendored:entries gone fromworkspace.yml;zer0-mistakes.ymlandtheme-mirror.ymldeleted;pages.ymlwithout the theme's route and targeting this repository's project site;drsai.ymlbuilding against the theme'smainchecked out beside the site (weekly too);content.ymlfetching the theme at a pinned tag into.cache/zer0-mistakesfor 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.ymlandSITES_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 withstudio/excluded. - T3: The platform's theme record per site (inside G2) —
SiteSettings.theme_source(gem|remote_theme|path),theme_version,theme_skin, filled byimport_jekyllfrom the site'sGemfile/_config.yml; a dashboard row comparing the pin with the newestbamr87/zer0-mistakesrelease (read on demand); a test thatexport_jekyllleaves 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-mistakesback as a submodule, the registry entry's mirror note andscout: falsedropped, thezer0-CMSdescription 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.pyand its tests, run byzer0-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,parodynewsfromapps/parodynews/src/pages,wargames,zer0-pages-remote,zer0-pages) built exactly aspages.ymlbuilds them, and the two nothing routes yet built as this repository builds them today:2005with its ownbuildtask, assites.ymldoes, andirony-workswith its Node step and GitHub Pages' own builder, asirony-works.ymldoes. Per-site counts, notes and recipes inweb/site/fixtures/README.md.tools/site_manifest.py(build,compare [--pages],--check,--write) with 28 tests;pages.ymlrecords every routed site's build and compares it with its recording;web/site/README.mdsays what the renderer must reproduce. The ledger is unchanged — P1 records and absorbs nothing, so everysite-*.publishrow staysmissing. - 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_withrecords the gems and the theme commit each build resolved; andcompare --pagescompares 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--writefrom 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_LOCALandBUNDLE_GEMFILEpointing nowhere) — and2005andirony-workstwice 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 --checkrebuilt the seven routed sites from a fresh copy under the same environment and found eachidentical. - 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 assite-manifest-<site>for a person to commit with its reason, and a dispatch withcheck: truefails on a difference (a baseline a machine rewrites is no baseline; the first version's separatesite-manifests.ymlduplicated 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>; sitemaplastmods are not recorded — both carry the build's clock on undated pages. The rebuild runs in UTC and passes on none of the caller'sJEKYLL_*,PAGES_*,ZER0_*,OCTOKIT_*orBUNDLE_GEMFILEvariables, and removes aGemfile.lockit wrote. Media types come from a fixed table, becausemimetypes's built-in table differs between Python 3.12, 3.13 and 3.14. The theme ratchet skipsweb/site/fixtures/(THEME_SKIP_PREFIXESintools/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, likesrc/test/fixtures/..vscodeignoreleaves outweb/**(the extension ships nothing fromweb/as a file) andextension.ymlignoresweb/site/fixtures/**. - Found: parodynews's 58 posts are written with no layout (57 ask for
journals, one forblog; 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 of2025-05-02T00:01:30Zchanges 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 (98e978dfor these recordings), so a gem release or a theme commit can change a recording until P2 pins them. irony-works publishes itsnode_modules/(23 files, two of them READMEs rendered as pages) andhome-before.png, because itsexclude:list replaces Jekyll 3's defaults — recorded as built, for P2 to fix knowingly. - Record
sites/2005andsites/irony-works: done, by hand with their own recipes (--checkcannot rebuild them until they have routes).sites/1987has 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-themewith the theme tag; forjekyll-theme, the export writes the site's file tree withremote_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-pagesor 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 itsGemfile,Gemfile.lock,_plugins/and Ruby-only config leave in the same commit (zer0-pageslast). When the last site has moved,pages.yml's andsites.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 intheme_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; for2005andirony-works, until they have routes, the recipe inweb/site/fixtures/README.md, thenbuildandcompare. Gems float for five routed sites and the theme for every remote-theme site (recorded at98e978d):built_withand the notes--checkprints 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-optionas 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
apiandstudiosurfaces (G4's, below). - The option:
tools/jekyll_theme.py— a site'srender:setting inworkspace.yml({as: jekyll-theme, theme: <tag>, server: github-pages | jekyll-4, before: <command>?, obsidian: true?}, validated by the workspace tool and shown byinfo,routes --jsonandlist --json);exportwrites the files git tracks under the site's Jekyll source with its_config.ymlmerged with the route's config andremote_theme: bamr87/zer0-mistakes@<tag>, runsbefore:on that copy and resolves an Obsidian vault;buildruns the server in Docker as the caller's user and reports what it resolved (the tag's commit, the server's image) fortools/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) andjekyll-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 atv1.31.3, the tag on98e978d, the commit every remote-theme recording was made against. - The Obsidian bridge in Python:
tools/obsidian/portspages/_pluginsmodule 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), withtest_obsidian_vault.pyfor 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-gardenandwargamesonjekyll-4;drsai,parodynews(apps/parodynews/src/pages),zer0-pages-remote,2005andirony-works(its node transplant asbefore:) ongithub-pages. Deleted with the switch: theirGemfiles, parodynews'sGemfile.lock, the Ruby-only_config_dev.ymlof drsai and parodynews (the theme as a gem), thedocker-compose.ymldev servers of the demos and zer0-pages-remote (bundle-based) and wargames's Ruby devcontainer; theirsetup/build/pagestasks call the option, and their docs say how to build. -
--checkrebuilds 2005 and irony-works too:routes()adds the option's sites nothing routes, built by theirbuildtask with their own config, as recorded. - CI:
pages.ymlbuilds the moved sites through the option (the jekyll-4 image built bydocker/build-push-actionwith the Actions cache) and records with--built-with;sites.ymlbuilds its five sites through it, every one when the option changes, and compares 2005 with its recording;drsai.ymlbuilds through it, its theme-mainbuild,ZER0_THEME_LOCALand weekly run gone;irony-works.ymlbuilds through it and compares with the recording. Nosetup-rubyin any of them butpages.yml's zer0-pages leg;zer0-pages.ymlis unchanged.actionlintclean. Each of them runs when anything that builds its sites changes — the site,workspace.yml(therender: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 — andbin/zer0 checkholds that (OPTION_INPUTS: a site'sci: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.ymlfor 2005,irony-works.yml), and each uploads the fresh recording to commit in that pull request when the change is intended; a push tomainonly warns inpages.yml, so a difference never blocks a deploy, and zer0-pages, still on its Gemfile, only warns. - Ratchets:
check_absorption.py --tightendropped the eight Ruby files (seven prefixes,ruby_ratchet:nowpackages/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/andsites/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-jekyllopsdone(api and studio are G4's: choosing the option and running the build as a job); the eight sites' publish rows retargeted tosites.render-jekyllandpartial— 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--checkcommand line is not a test, whichtools/check_absorption.pynow refuses as a proof; zer0-pages's callouts, Dataview and fence-mask rowsmissing→partial, andsites.obsidiangains anops: partialsurface. - 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 shipsassets/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: itsrender:setting and itscheck,buildandpagestasks on Python and the option (and nodepends_onthe image generator's gem, which only its Gemfile loaded);Gemfile,Gemfile.lock,pages/_plugins/(seven.rbfiles),tests/(two minitest suites) anddocker-compose.ymldeleted;zer0-pages.ymlon 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 aspages.ymlbuilds 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, thesites/zer0-pages/ceiling gone (ruby_ratchet:now onlypackages/zer0-image-generator/), the theme ceiling there 4 → 2. The site's published files are untouched, so itspages/SCHEMA.mdstill lists_plugins/(a lint warning) and its graph page's include still creditsobsidian_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·actionlintonpages.ymlandzer0-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'sbundle installin--checkandbuild --source(a bundle'sGemfile.lock),pages.yml's--sourcebranch thattest_site_manifest.pyholds to it, and their tests. - The option's
apiandstudiosurfaces: 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.ymlanddrsai.ymlnow run onworkspace.yml, the workspace tool,tools/obsidian/**and (where they compare)tools/site_manifest.py, andsites.ymlbuilds every site when any of those changes — before, a theme-tag bump, a server switch or an edit to irony-works'sbefore:reached no build at all — with thebin/zer0 checkrule above so it cannot recur;tools/jekyll_theme.py buildwrites only a new or empty directory or the site's own_siteholding 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/drsaior a staleZER0_PAGES_DESTwiped a site's source); the eight publish rows arepartial, 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'sbefore:installsjs-yaml@5.5.0andargparse@3.0.3, the versions its recording publishes, so a js-yaml release (five since August) cannot change its build; the option's seconddeep_mergeis gone. Not changed: the Jekyll reading intools/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.pycomputes 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 withJEKYLL_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 inremote_theme:(unpinned; the option overrides it) — generating them is P3's. irony-works's recording publishesnode_modules/(itsexclude: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 itsbefore: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.ymlno longer builds against the theme'smain, which also settles that item of P3. drsai'sbundle 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.mdstill 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·actionlinton 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'smainandZER0_THEME_LOCAL(gone with drsai's move in P2), the extension'szer0-mistakesoverlay (folded into the option's profile, listed intheme_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.pywith an emptytheme_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 fromschemas/openapi/openapi.jsonwith a drift check; sign-in (session + CSRF, thenallauth.headlesswith 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'sstudiosurfaces 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/uifree of routers, transports, page globals and injected HTML, Vitest with Testing Library.web.ymlruns it;workspace.ymlregisters it (web, depending oncontent). -
@zer0/api:openapi-typescriptoutput fromschemas/openapi/openapi.json, committed, withnpm run check:apias the drift check; anopenapi-fetchsession client (same origin, the CSRF token on unsafe requests). -
@zer0/tokens: the zer0 UI tokens kit's values as--zer0-*custom properties, onelight-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/meandPOST /api/v2/session/login|logout(content/api/session.py), called only fromweb/studio/src/auth.tsx, so G3 swaps them forallauth.headlessin one file — swapped by G3 (2026-10-27): the two POSTs are gone,/api/v2/mestays. - 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 —
markdownandparagraphblocks 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
drafterrun 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/andreview/runs/<id>/accept/— services incms/services.pyandsuggestions/services.py, tested incontent/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 incontent/Dockerfile). -
verify/scenarios/studio-{create-page,accept-suggestion,publish}.ymlpass with evidence undertest/evidence/; featuresZER0-040–042. - G2's backend items, first part:
publish_scheduledon Celery beat (cms/tasks.py),.localhostinALLOWED_HOSTS,manage.py seed_demo. - Review fixes (2026-10-22, two independent verifiers): a changed
paragraphkeeps 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 409resource.lockedand 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_toandAgentRun.objects.visible_toscope 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 onlycms/page.htmlexists; every page type now renderscms/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
AgentRunandSuggestion. 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 onfeature/p-d6-public-idsby the owner's decision P-D6 (ADR 0009) —AgentRunandSuggestionhave 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 ablock_to_markdowncase and the round trip kept byte for byte),SiteSettings,BrandRulesper 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'sTableBlock,TypedTableBlock(text and number columns),EmbedBlock(checked as a URL, never fetched: no request reaches a provider) andDocumentChooserBlock(in adocumentblock with the link's title and href),RawHTMLBlock, aliquidand acalloutblock. 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 ownto_python,cleanandget_prep_value, never assumed — so a compact pipe table (| a |rows, a|---|rule) is atable, or atyped_tablewhen a column holds only numbers;> [!kind]± titlewith every line quoted acallout; a bare URL anembed; a link to a file of a type the document library takes adocument; 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, soembedanddocumentare 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/wargamesandsites/2005joined 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. -
BrandRulesper site (2026-10-27): a site's own brand rules live in itsSiteSettings(TARGET.md § Rules: settings are per site) rather than a second model —brand_voice(G4's) is its style guide andbanned_patternsits banned phrases, incms.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 activeBrandRules(which stay, for every site), wherever it judges a page's text: a suggestion at propose and at accept, the brand review agent, thebrand_cleaneval check, and a distribution post (its channel's site);brand.rulesreturns 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 andseed_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'sWorkflowPageon its root);seed_demogives 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'scontent.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'sregister_log_actionshook —zer0.suggestion.propose(the agent),.acceptand.reject(the person, with the revision or the reason) insuggestions/services.py;zer0.run.start(who started it, the agent, the trigger) andzer0.run.finish(its status and error) inagents/runner.py;zer0.token.issueandzer0.token.revoke(the holder, the token's name and shown prefix, never the token) for both bearer tokens, inaccounts/tokens.py(HashedToken.revoke, whichaccounts.services.revokenow calls). The log has no API or screen yet (the ledger'splatform.audit). Test:content/tests/agents/test_log_actions.py.
- The blocks (2026-10-27,
- 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 mattercanonical_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;previewstays the teaser andpreview_image),noindex↔noindex(the zer0 front-matter vocabulary). No site in the repository or lifehacker.dev hascanonical_url,og_*,noindexorrobotsin 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'simage: {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 newbooleankind, a switch, in the OpenAPI document);distribution.services.canonical_urlreads the field. Not in the agent'sop: metafields (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/tiptapfor the editor's toolbar; React Router 7, as TARGET.md names it, although 8 exists; TypeScript 5.9 becausetypescript-eslintandopenapi-typescriptdo not accept 6;web/package-lock.jsoncommitted andopenapi-typescriptexact-pinned (AGENTS.md § Standard deviations);django-filteradded 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 fortext/event-stream, without which a browser'sEventSourcewas answered 406. From the review: a lock is 409 with the coderesource.lockedrather than 423, so the document's error statuses stay the ones it lists; the inbox's page filter ispage_id, becausepageis the paginator's;schedule/'sgo_live_atis 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/zer0in Python with the same commands and output;tools/workspace/tests ported;zer0-workspace.yml,pages.ymlandsites.ymlwith nosetup-rubyand noruby -e;bin/zer0 doctorruns the platform's doctor (G4). Accept: the Ruby and Python tools print the samelist,affected --json,matrix,routes --jsonandcheckon this tree (recorded before the Ruby goes); the ratchet'sbin/zer0andtools/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.3container: 202 steps over 36 scenarios intools/workspace/tests/golden/recordings.json— this tree frozen at40c904b9(list,infofor all 16 projects,routes,check,vendor,matrix,affectedandmatrix --affectedagainst three fixed bases,run <task> --all --dry-runfor every task,tags,doctor, usage and errors) and every small workspace the Ruby suite built and broke. -
bin/zer0and thetools/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.pyreplays every recording and compares stdout, stderr and exit status byte for byte. - The Ruby tool, its tests and the recorder deleted;
check_absorption.py --tightendropped thebin/zer0andtools/workspace/ceilings; everyworkspace-toolledger row butworkspace.doctorisdonewith its proof, andplatform.workspaceops ispartialuntil the doctor is Python. -
zer0-workspace.yml,pages.ymlandsites.ymlrunbin/zer0on Python with PyYAML; the two jobs that only plan (pages.yml's andsites.yml'splan) install no Ruby, andsites.yml'sruby -rjson -eis apython -c;tools/workspace/README.md,docs/MONOREPO.md,docs/CICD.md,AGENTS.mdandworkspace.ymlupdated. - Discovered:
check_absorption.py --tightendeleted the comments inside a ratchet block; fixed, with a test. - Discovered in review, each fixed with a test:
affectedmissed a file whose name git quotes (a non-ASCII name, a quote), so its project went unbuilt — git's paths are read with-znow, which the Ruby tool lacked too; the manifest's paths were not held inside the repository, and an absolute vendoredcopyletvendor --writeoverwrite a file outside the checkout (Ruby'sFile.joinhad 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 testedaffectedon 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, andbin/zer0runs itself on the repository's.venvwherepython3lacks PyYAML. -
bin/zer0 doctorruns the platform's doctor, andzer0-workspace.yml's doctor step installs no Ruby: done in G4 (2026-10-22), which portedzer0 doctortocontent/sites/doctor.pyand set theworkspace.doctorrow andplatform.workspaceops todone. -
pages.yml's andsites.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) andpages.yml'sruby/setup-rubystep 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 throughbin/zer0 run pages, which spawned it — not forbin/zer0. - These two items are ADR 0006 decision 12's "
zer0-workspace.yml,pages.ymlandsites.ymlstop 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/zer0itself needs no Ruby anywhere. Ruby is still installed for what runs through it or beside it:zer0-workspace.yml's doctor step (the doctor israils/bin/zer0-cms, until G4),pages.yml's build legs (bin/zer0 run pagesspawns a Jekyll build) andsites.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 (-jfor--json) and the YAML parser's syntax-error text differ from the Ruby tool;test_golden.py'sDEVIATIONSlists each and checks its exit status. The recordings name the deleted theme (its paths in anaffectedrecording, the doctor's theme checks), so the theme ratchet skipstools/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·actionlinton 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 withliquidjs, 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 withtools/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.mdsays 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.ymlbuilds it with the renderer, itsrender: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.ymlwithout itsrubyleg;.vscode/tasks.jsonwithout the Ruby task; no workflow installs Ruby. (src/core/harness/render.tsstill generatessetup-rubyfor 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 activeBrandRules,SiteSettings, AIEO'sBrandContext, 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.rulesanswers from it (held to its old answers by a test);GET /api/v2/sites/<id>/voice/resolved/andPOST /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 rowsites.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 —
VoiceProfilewith the site, section, type and channel scopes and revisions; the studio's Map and Profile; the voice fields ofSiteSettingsandBrandContextmigrated into site profiles;import_voicefor bash-365.com (VD2, VD3, VD5) - V2: push —
generate,brand.rules, AIEO and books read the resolution;voice_digeston 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/andVOICE.md; bash-365.com's lint and skills read them - V5: judgment — a voice-review agent at policy
suggestand adherence evals on recorded fixtures
4. Content and data migration¶
- Freeze: tag
pre-migration(via the PR merge, not a manual push); record counts of files per site and rows per parodynews table. - Jekyll/Obsidian → Wagtail (M6):
manage.py import_jekyll --site <name> --path frontends/sites/<name>: one WagtailSite+ root per Jekyll site; collections/_posts→ArticlePage; front matter → typed fields perschemas/zer0.schema.json(title, date, tags → taggit, categories → snippet,seo_title,search_description); body Markdown → StreamFieldmarkdown/rich_textblocks (paragraph split); images → Wagtail Images in a collection per site; internal links →PageChooserBlockafter a second pass; the original path is kept inlegacy_pathfor redirects. Obsidian wikilinks resolve the same way. - Governance state: extension
.cms/drafts, approvals and ledger →Suggestion(pending/accepted) andAgentRunrows withlegacy_ref. - parodynews DB:
Post+PostFrontMatter→ArticlePage;PostVersion→ Revisions (ordered, authored by alegacy:importuser);Assistant/AIModel→AgentDefinition;Thread/Message→ archived JSON orAgentRun(D-open); dumped withdumpdatafirst. ADR 0006 (G8):Assistant→ai.Assistant(notAgentDefinition),AssistantGroup→Pipeline,JSONSchema→OutputSchema,ContentDetail/ContentItem→Brief,Thread/Message→Conversation/Message,AIProviderConfig→ProviderConfig(credentials re-entered, never exported),AIModel→ModelEntry. - books / drsai:
library/<slug>/→BookPagewith chapter children; drsai stories →BookPage(profilestory). - Rails DB:
Siterows stay in Rails as the registry (with awagtail_site_id);Page/Term/Assetare derived caches, so drop them rather than migrate after verifying they match the files;Channeland LinkedIn tokens stay. ADR 0006: the registry is the platform'sManagedSite(G4); Rails keeps nothing. - Verification: an idempotent importer (re-run = no changes); a round-trip test
import → export → diffagainst the original Jekyll tree (allow whitespace/front-matter key order); count parity report; redirect map fromlegacy_path. - 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 todraft/autoneeds 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_modelare stored with runs and vectors. - Content is data: review agents get no
publishtools;write/publisheffects 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), aweb.yml(the studio and the renderer),extension.yml,pages.yml(the renderer per site) andzer0-workspace.yml(Python) — no Ruby. The bullets below describe the path there.
- CI: a single
ci.ymlcallsstandard-ci@v2withbin/zer0 affectedproducing 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. Keepcodeql-analysis.ymlandclaude.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 frombamr87/zer0-mistakes. Conventional commits are required (squash merge titles). - Images:
content/DockerfilecarriesGIT_SHA/BUILT_ATinto/versionand 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) andimagegenuntil Phase G retires them. The root.env.examplelists the compose keys;content/.env.examplethe platform's own.
7. Risks and open decisions¶
Risks
- Markdown → StreamField is lossy (Liquid tags, includes, raw HTML). Mitigation: a raw
markdownblock + 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 (parodynewsdefaults) 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 forstandard-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
BrandRulesand the site's own banned phrases (SiteSettings.banned_patterns) still hold. Built in G9:BookPage.builtin_bans(the Books overview) andSiteSettings.chapter_builtin_bans(the Sites area's settings), honoured at propose, at accept, in the brand review, in thebrand_cleaneval and inbrand.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.ymlacts, a chapter'sact, 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 aPartPagebetweenBookPageandChapterPage, rendered asparts/<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;
AgentRunandSuggestiongained one and every surface moved to it in one change — REST, Idempotency-Key replays, GraphQL, MCP, the events (agent.run.completedandcontent.suggestion.createdv2), 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, andAgentRunandSuggestionexposed integers through the pre-P4 REST endpoints, GraphQL and MCP, and then the studio. Remaining, from the auditcontent/tests/api/test_public_ids.pyholds (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'sEntityType.id, edge suggestions'dst),cms.Category(the studio's category field, Grapple'sCategory.id),cms.BrandRulesandcms.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.