Projections, never copies

Everything a CTXR site shows the world — pages, the sitemap, the feed, the AI map, the index of the data and every entity’s readable form, the app manifest and service worker, the relation map — is derived from the same files on request. Nothing is maintained as a second copy of anything. The one address that is not a projection is the entity file itself, /data/<type>/<x>.json: served as it lies, because the source needs no derivation.

The choice

A fact should live in one place. Wherever a system keeps two representations of one fact — a page and a sitemap entry, a record and a search index — it has taken on a synchronisation job, and synchronisation jobs fail quietly. An earlier engine we built learned this twice: hand-propagated theme copies drifted, and per-site configuration files that duplicated defaults drifted from the platform.

CTXR’s rule is regenerate rather than bookkeep. Whatever can be derived from the source is derived when needed and never stored as truth. A cache, where one exists, is disposable: throw it away and the site is still right.

What it buys

Views that cannot disagree. The sitemap lists exactly the pages that exist, because it is computed from the same slug maps that make pages exist. The AI map has the same titles as the pages; the feed has the same articles; the MCP’s search and ?q= on the index are one function, so they cannot rank differently. See AI and search.

New views for free. A per-language index, a per-type index, an entity as markdown beside its JSON, a relation graph — each is a new derivation, not a new thing to keep in sync. The .md forms under /data are the same arrays as the .json forms, encoded differently — never a second walk of the files.

Drafts stay drafts. Every projection reads the live layer only. See Drafts and going live.

Zero maintenance for the owner. Publish an entity and every lane updates itself.

What it costs

Computation on read instead of storage on write — the same trade as rendering. The machine views are cached against the live layer and rebuilt when it changes, so the cost is paid once per change, and the cache never becomes a source. The indexes the engine keeps of its own roots are the same kind of thing: one derivation per root that every view reads instead of walking the disk again — derived, disposable, rebuildable. Delete .cache/ and the first request restores it byte for byte; the moment something lived only in an index, this would be a database, and that is a different product.

The wider shape

The same principle governs the site’s own structure:

Not stored Derived from
A URL the entity’s slug
An entity’s @id, language, canonical address the file, on read
The page-to-template choice a ladder walked each time

Each was once a place where two facts could drift apart. Each is now one fact and a rule.