clone

an offline map explorer where each world, from a game map to a city's open data, ships as one .atlas file

main
atlas / docs / decisions / 0010-revision-packing.md
0010-revision-packing.md 2.6K rendered
1# 10. An enriched build wins the fold by packing two policy revisions23- **Date:** 2026-08-024- **Status:** accepted5- **Where it is written down:** [enrich.md](../enrich.md) §2; issue #5 §5.3,6 §10 decision 16; `internal/enrich/revision.go`78## Context910An enriched build must be the one a library serves, deterministically, without11mutating anything. The registry's ordering is creation time, then policy12revision, then stamp, then locator. Creation time is the newest capture the13build was made from and **never the build clock** — a format invariant the14enrich lane does not get to touch. So an enrichment of the same captures ties15on creation time with the plain build beside it, and the revision has to16decide.1718## Decision1920The revision is one integer carrying two policy numbers:2122```23revision = enrichPolicy × RevisionSpan + generatePolicy RevisionSpan = 10024```2526A plain single-source build writes its generate policy revision alone — the27same number with an enrich policy of zero. `9` is generate policy 9 unenriched;28`109` is generate policy 9 enriched under enrich policy 1.2930Three properties chose it:3132- **Deterministic.** A pure function of two compiled-in constants. Nothing33 scans the library, nothing reads a clock. A mechanism that read the serving34 build's revision off disk and added one would make the stamp depend on which35 machine built it, breaking the format's first invariant.36- **Total.** Every enriched build of one capture outranks every plain build of37 it, with no tie for the stamp to break arbitrarily.38- **Honest about which axis wins.** Packing two axes into one integer makes one39 dominant; this picks enrich, because within one set of captures an enriched40 build is a *superset* of the plain one, and serving the plain build would41 lose data the library already holds.4243`BuildRevision` refuses a generate revision that does not fit the span rather44than wrapping into the next enrich band.4546## Consequences4748- Widening the span is a deliberate restamp of every enriched build, not an49 accident.50- A generate policy change reaches an enriched volume when the pipeline is51 re-run — which is how a policy change reaches a merged volume anyway, since52 enrichment is a pipeline stage and not a separate ritual.53- The `enriched-build-revision` waiver follows directly: the reference tree54 merged inside composition and wrote the plain revision `9`, so an enriched55 build's manifest — and therefore its stamp and its file name — cannot match.56 It is a stamp difference by construction, and the canonical content stays57 unwaived. See [ADR 8](0008-stamp-identity-is-an-aspiration.md).