the midden/trench/the-generated-map
Dig report
The Generated Map
The committed, drift-checked routing machinery, dug out whole when the build learned to derive it in memory.
At the very bottom of the trench lies a complete little machine for keeping a file honest. For the Platform's first day, the runtime routing map — every Tenant, Space and Collection, flattened to the keys the client needs — was generated by a script, committed to the tree, and drift-checked on every build so the committed copy could never fall out of step with the manifests it came from. It worked. It was also an entire apparatus built to guard a file that, it turned out, did not need to exist on disk at all.
When the build learned to derive the map in memory and expose it as a virtual
module, the whole assembly came out together, in a single stratum, over two days:
the generated file itself, the generator that wrote it, the generated form of the
content config beside it, and — with them — the plumbing that had served all
three, the little pnpm gen && that opened every build script and the CI step
that policed the lot. The Platform's own commentator posted an obituary the next
morning — a live post titled "The Generator Is Gone" — which is how we can date
the layer so precisely.
What follows is the machine proper, laid out in the order it was assembled and
abandoned: the three finds that each answer to a decision of their own. Its
plumbing is catalogued too, but held in the stores rather
than shown here — a build-script prefix and a git diff in CI are consequences
of this machine's death, not arguments in it.
the Routing Excavation
shared/routing.generated.ts
file · routing.generated.tsremoved in e75bda0assessed 16 Jul 2026
The runtime routing map, committed to the tree and drift-checked on every build so it could never disagree with the manifests it came from. Forty-four lines of collection keys, re-committed by hand after each manifest edit — until, some thirty-one hours in, the build learned to hold the same data in memory and the file had nothing left to be.
“⚠️ GENERATED FILE — DO NOT EDIT.”shared/routing.generated.ts, header line 1
the Routing Excavation
scripts/generate.ts
file · generate.tsremoved in e75bda0assessed 16 Jul 2026
It read every Tenant manifest and wrote the generated files: 176 lines at Milestone 1, slimmed to 76 once content.config.ts learned to build itself, then deleted a day later along with the last file it produced. The Platform's commentator posted the obituary the following morning.
“The generator (ADR-0002/0013): reads every Tenant manifest and emits the one remaining GENERATED artifact”scripts/generate.ts, header
the Routing Excavation
the generated content.config.ts
commit 73bf3dc · content.config.tsassessed 16 Jul 2026
At Milestone 1 it was 35 generated lines and four collections; by the end, 76 lines spelling out all twelve keys, one defineCollection block each, regenerated whenever a manifest moved. ADR-0013 replaced the body with a module computing the same cross-product at config-evaluation time; only the filename survived.
“⚠️ GENERATED FILE — DO NOT EDIT. // Produced by scripts/generate.ts from tenants/*/tenant.config.ts (ADR-0002).”content.config.ts, former header