Skip to content
← Documentation

docs/derivation-register.md


The Derivation Register — documentation made testable

The facts.ts contradiction was the bigger bug, and the repair is not to change the numbers. It is to make the system unable to claim a derivation that is not wired.

src/lib/ledger/derivation.ts, tests/derivation-register.test.ts.


The defect class, one more time

declared authority    "footprint follows the `files` metric"   (facts.ts)
actual authority      footprint: 11, 7, 6, 8                   (structure.ts)
arbitration           none

Fifth instance, after duplicate factIdentity, camera constants restated in a test, kind inside a URN, and a constants table nothing read. Every one is the same shape: two authorities for one quantity, free to diverge, with nothing able to notice.

The register

Every visual field records what it claims, the site that actually computes it, its warrant, and any contradiction between the first two.

7 derivations, all sites resolve
contradictions on record: Building.footprint, Building.accent
collapsed warrants:       Building.activity, District.activity

The load-bearing test is site resolution: site is path::substring, and a claim whose file does not contain it fails the gate. That is the property the prose lacked — a derivation that stops being wired now breaks the build instead of becoming quietly false.

The second is coverage: every field WorldScene reads must appear, so an awkward field cannot be omitted from its own audit.

The two contradictions on record

  • Building.footprint — claims nothing, and facts.ts claimed a metric for it. Recorded as false rather than left in prose.
  • Building.accent — honestly derived from identity, and the derivation is a projection: projection.ts already declares identity→hue. The World stores that projection's output and calls it a field.

Warrant as a separate axis

A field can be honestly derived and still compress two warrants into one mark, so warrant is its own column and mixed is a value rather than a footnote.

collapsed warrants: Building.activity · District.activity

Both carry an observed numerator over a stipulated ceiling. District.activity is the one the earlier experiment did not reach: it averages member activities, so it inherits every ceiling its members were normalised against — a compounded mixed warrant.

The set is asserted exactly, so a new mixed channel fails the gate rather than shipping unnoticed. That is the beginning of an answer to "which visual channels are allowed to collapse evidence and convention?" — not yet a rule, but now a list that cannot grow silently.

The prose is repaired

facts.ts no longer claims footprint follows a metric. It states the false claim as history, explains that not every dimension has a rule, and points at the register:

"Do not restate derivations here."

The detector that found the contradiction was retired by the repair — it now asserts the claim is gone and the pointer is present, which is the mechanism working.


Standing

Measurable defect exposed? yes — an unenforceable claim, now enforceable
Measurable improvement? yes — 7 derivations with resolving sites; the false claim removed
Fields moved? none — footprint is still four literals, deliberately

What is still not established

  • Footprint was not moved. The register records it as a realization choice with no source input; relocating it to a ProjectionStyle is the next step and is a projection decision, not a correctness one.
  • The register is hand-maintained. Coverage is asserted against a list of expressions WorldScene reads; a field added under a name not in that list would escape. The check is better than prose and is not a parser.
  • mixed is recorded, not resolved. Nothing yet decides whether a convention-warranted quantity may be rendered with the confidence of an observed one. The list exists so the rule has something to govern.
  • Health colours, alerts, capacity meters and agent status were named as likely members of the collapsed set and are not yet audited — only the two activity channels are.

242 → 248 tests, 26 DOM, 40 mutations, tsc clean.