Skip to content
LITHOEN

Evidence platform and governance

Document

Documented future, deliberately not built

Repository path
docs/architecture/FUTURE_MIGRATIONS.md
Size · SHA-256
10.2 KB · 1ae00af9fc29777e7b91818ba7ae486a5a5976fcac2ea56f6e928d369b8ee902

Each migration below is architecturally possible without breaking the Phase 0 foundation. None of it should be built before its complexity pays for itself.

Deferred in Phase 1, with reasons

  • Typed public routes (/plates/[slug], /rocks/[slug]): would create a second indexable surface for the same record. See ADR-0011 for the full argument and the conditions under which they should be introduced.
  • Named melting mechanisms (decompression, flux): real, standard, and unsupported by any Tier A or B source retrieved in Phase 1. They enter the corpus when a primary or peer-reviewed source is read, not before.
  • Broad geospatial coverage: Phase 1 added coordinates only for the three volcanoes whose monitoring profiles publish them. Coordinates are never inferred from maps.
  • Map rendering: a map library is not a deliverable. It enters when a map carries scientific value that a table or diagram cannot.
  • Source artefact archiving: verificationStatus records whether a source still resolves; storing copies of the artefacts is a licensing question as much as a technical one, and is not yet needed.
  • External review: the review vocabulary contains only internal structured verification, and gains an external value only when external review actually happens.

A. PostgreSQL + PostGIS

Trigger: real geometry (plate boundaries, fault traces, basins, provinces, rasters) or corpus scale beyond comfortable full-tree loading. Path: record stores are already relational-shaped — stable ids, typed references, one-record-one-file. Migration is a loader swap: @lithoen/corpus gains a Postgres backend behind the same Corpus/CorpusIndex interface; JSON files become the seed/fixture format. Geospatial primitives are WGS 84 (EPSG:4326) with GeoJSON-compatible semantics and an explicit GeometryReference type that today points at external geometry and tomorrow at a PostGIS geometry column. Nothing in schemas needs renaming.

B. Search infrastructure

Trigger: more entities/articles than a rendered index page serves well. Path: the projection layer already produces public DTOs; a search index is one more projection target (build-time Lunr/Pagefind first, hosted search only at real scale).

C/D. Geological map layers, raster/vector data

Trigger: first map surface. Path: keep heavy libraries out of the base bundle (route-level dynamic import); store layer data as Datasets with Source provenance; PostGIS (A) precedes serious layer work.

E. Professional API

Trigger: first external consumer. Path: the public DTO layer is the API contract; expose it read-only, versioned as /api/v0, generated from the same projection code so the site and API can never disagree.

F. Authenticated Lithoen Pro

Trigger: first paying user. Path: authentication gates a projection scope, not a different corpus: Pro = a projection that may include INTERNAL-tier derived products explicitly promoted to a new PUBLIC_PRO-style classification. The classification vocabulary is extensible by design (add a member + definition + directory mapping).

G/H. Resource/deposit intelligence, prospectivity modelling

Trigger: the science layer is broad enough to support them honestly. Path: RESTRICTED record stores already exist and are leakage-gated; model outputs are claims with MODELLED status and named models in qualifiers; rankings live in RESTRICTED notes/records. The scientific independence rule (SCIENTIFIC_POLICY.md) governs: outputs must be able to say "unsupported".

I/J. ML/AI pipelines, exploration intelligence

Trigger: measurable value over manual curation. Path: AI_POLICY.md already defines the contract — AI proposes (HYPOTHESIS status, aiAssisted: true), evidence-backed review promotes. Pipelines write to INTERNAL stores; promotion to canonical claims is a human, evidence-cited act.

G/H revisited after Phase 3 — what "prospectivity" would actually require

Phase 3 built the ontology in which a prospectivity question is well formed, and built no scoring of any kind. Recording here what the missing pieces are, so that a future phase cannot mistake "the ontology exists" for "the model is nearly done":

  1. Spatial data. Lithoen has three entities with coordinates. A prospectivity model needs mapped geology, geophysics and geochemistry over an area, with stated positional accuracy — none of which the corpus holds.
  2. Validation against known outcomes. A score that has never been tested against places where mineralisation was and was not found is a preference, not a model. This requires a training set of outcomes, and an honest account of how it was assembled.
  3. An accounting of the barren counterpart. The single best-sourced statement in the Phase 3 corpus is that each ore-controlling feature typically has an unmineralised counterpart in the same district. Any model that does not carry the base rate of the barren case will overstate every positive.
  4. A separation between the model's output and the corpus. Model outputs are MODELLED claims with a named model in a qualifier, written to RESTRICTED stores. They never become canonical claims without a human, evidence-cited promotion.
  5. The ability to output "unsupported". Required by SCIENTIFIC_POLICY.md. A model that always produces a ranking has no way to say the data do not support one.

Until all five exist, the honest output is the one Phase 3 produces: a description of what a system requires, and of what each observation does and does not distinguish.

Phase 4 — geospatial architecture built, and what remains documented only

Built: SpatialRepresentation and GeospatialDataset as first-class records; the raw → normalised → validated → public pipeline with a deterministic CLI; geometry validation including self-intersection, ring closure, degenerate rings, hole containment and coordinate range; the antimeridian resolved with a poleClosure case; reproducible simplification with recorded tolerance; data-derived map generation with a checked licence chain; and a static atlas.

Documented and deliberately NOT built, each with the condition that would change it:

Not built Build it when
PostgreSQL + PostGIS any of the five triggers in ADR-0022
Python GIS toolchain reprojection, topology-preserving simplification or an unreadable format is genuinely needed (ADR-0023)
Interactive mapping the corpus holds competing geometry for the same regions (ADR-0023)
Raster ingestion, GeoTIFF, COG a raster product is part of the science rather than a picture of it
Vector tiles, PMTiles, tiling a single map's geometry stops fitting in a static SVG at a useful size
WMS / WFS integration a source Lithoen needs publishes only through a service, AND its rights permit derivative use
Geophysical grids, remote sensing Lithoen holds primary data of its own, rather than reading somebody's interpretation of it
Authenticated spatial API there is an authenticated product to serve it to
Spatial search: bbox, nearest feature region coverage is broad enough that finding by place beats finding by name
Prospectivity rasters, target layers never, as part of this corpus. The five requirements listed above under G/H remain unmet, and Phase 4 added a sixth: no source Lithoen has read supports the inference at all.

Private geospatial intelligence. data/internal/spatial/ and data/restricted/spatial/ exist, are mapped to their classifications, and are covered by the spatial canary listed in scripts/canaries.ts plus the forbidden-path scan of the public build. (Since ADR-0065 the raw third-party files in data/internal/spatial/raw/ are held back by rule and fingerprinted by that scan; the store READMEs are published.) They were created before there was anything sensitive in them, so that future proprietary geometry inherits a boundary rather than needing one built around it in a hurry. A target polygon says where somebody thinks something is, which is the whole product; it is the thing Lithoen would most regret leaking.

Phase 5 — the known-deposit foundation, and the boundary it does not cross

Built: Deposit and MineralOccurrence as entity types; SourceRecordMapping as the audit trail from a dataset row to an entity; controlled grade scopes, tonnage categories and reporting frameworks; a fail-closed bulk-ingestion CLI; a coordinate-precision gate that publishes only what a source authored; 23 deposits and one district from two accepted datasets and six Tier A deposit models.

The model boundary, stated once and precisely:

  KNOWN DEPOSIT DATA          built (Phase 5)
+ REGIONAL GEOLOGY            partial (Phase 4)
+ MINERAL SYSTEMS             built (Phase 3)
+ GEOCHEMISTRY                partial (Phase 2)
+ GEOPHYSICS                  NOT BUILT
+ REMOTE SENSING              NOT BUILT
+ NEGATIVE / BACKGROUND       NOT BUILT — and not obtainable from deposit databases
+ VALIDATION SETS             NOT BUILT
        ↓
  FUTURE PROSPECTIVITY MODELLING          NOT IMPLEMENTED IN PHASE 5

The negative-data principle. A database of known deposits contains almost only positive examples. Future prospectivity requires knowledge of barren systems, unsuccessful exploration, background geology, negative drill results and areas without deposits — none of which is compiled anywhere Lithoen has read. A model trained on positives alone would be scientifically inadequate no matter how well it scored, because its error would be invisible to it. This is recorded in the corpus as claim:known-deposits-are-not-prospectivity, so that a machine reading the data meets it as data.

Still not built, with triggers unchanged: PostGIS (ADR-0022 — 600 spatial records and 27 visuals is nowhere near any of the five thresholds), a Python toolchain (ADR-0023 — the two CSVs are 244 kB and 314 kB and a 60-line reader handled them; pandas would have bought a locked environment for nothing), interactive mapping (ADR-0023 — the corpus still holds no competing geometry for the same object), and a drillhole database, an operational mine layer, a company layer and commodity economics, each of which is a separate product with a separate freshness contract.