ADR-0058: PM_DOC Is the Only Content Format (pre-production cut; amends ADR-0057 §5)¶
- Status: accepted
- Date: 2026-07-10
- Deciders: Nicolas Burri ("as we do not have any productive data yet, migration should not be a problem"), on the recommendation that the dual-format machinery now protects only seed data.
- Amends: ADR-0057 §5 (no-bulk-rewrite / format-versioned coexistence) — the coexistence posture is RETIRED before first production deployment. §§1–4, 6–7 (tree record, projection, server extraction, trust model, editing modes, tree rendering) are unchanged.
Context¶
ADR-0057 §5 kept legacy MARKDOWN (v1) versions readable forever and converted documents on
revision — the right posture for a system holding controlled records, and genuinely
load-bearing as ROLLBACK INSURANCE while M1–M4 were in flight. Both motivations are now spent:
M1–M4 shipped and were review-hardened, and the system holds no productive data — every
database is seed-built and one down -v from clean. What the dual-format machinery costs,
permanently: a second read path (markdown-it document rendering + format dispatch), a v1↔v2
diff special case, conversion notices/UX, convert-on-revise/derive logic, and a doubled test
surface. Nicolas also (correctly) challenged sequencing: the upcoming feature track (math,
color, block-in-cell tables) is ADDITIVE schema evolution under ADR-0057's known-limitations
mechanism and never required the dual-format layer — but closing out M5/M6 as planned would
have documented and cemented a coexistence nobody needs.
Decision¶
- PM_DOC is the only supported content format, effective immediately, until and unless a future production migration reintroduces a coexistence layer (which would get its own ADR with this arc as its worked example).
- Every content write carries a tree. Document creation and draft save REQUIRE
{treeJson, projection}; markdown-only writes are rejected. Markdown remains an INPUT format only via client-side import (source mode) and the seed pipeline. As-built deviation (M5′): ONE narrow producer of markdown drafts survives — TEMPLATE INSTANTIATION, which builds drafts server-side where no JS runtime can construct trees; such a draft converts on its first editor save (the client always sends trees). The V040 CHECK therefore stays state-qualified/PM_DOC-conditional rather than universal. A server-side import (Node sidecar) would remove the exception and would also serve future AI/MCP writes — deferred until either need is real. - Seeds author real trees: the seed pipeline converts its markdown beats through the real
projection module (Node,
projection-node.mjs) before POSTing — demo content is genuine tree documents, not legacy rows. - The v1 machinery is deleted, not maintained: the markdown-it DOCUMENT read path and format dispatch in the detail view, the conversion notice, convert-on-revise/derive format-carrying special cases (they simply always carry trees now), and the planned v1↔v2 diff banner. markdown-it itself STAYS — it renders the source-mode split preview, which is a projection view, not a record view.
- Existing dev/demo databases are reseeded (
down -v); no data migration is written. Thecontent_formatcolumn stays (constant 'PM_DOC') as cheap schema headroom for a future coexistence need.
Consequences¶
- The remaining migration phases collapse into ONE closeout slice (M5′, replacing M5+M6):
v2-only enforcement + v1-path deletion + seed conversion + the offline
projection-verification tool + the full documentation closeout (arc42, requirements delta,
glossary, DEMO) — now describing one format.
As-built finding (M5′): the SEARCH CUTOVER to
search_textis a deliberate NO-OP for user-visible search — freeze-time FTS already indexes the projection, which tokenizes to the same lexemes;search_textbecomes load-bearing at the RAG/AI layer (ADR-0044 layer 2). The detail view retains a minimal markdown render branch solely for transient instantiation-born drafts. - The rollback story "stop writing v2" ends; acceptable with zero productive records.
- The feature track (math → color → block-in-cell tables) starts on a single-format base.
- tree-record-migration.md records the reshaped plan.