Repository navigation
Description
Part of #2648. Read the epic first: it holds the model and the decisions.
Goal
A layer is stale for exactly three reasons: its version changed, a source has a newer version to use, or an input changed. Code changes are not a reason. One binary runs everything.
Scope
-
Layer declaration in the engine (
host/obc-data/src/engine.rs): name, shape (tiled,whole, orwholewith named partitions),format,revision, inputs (sources and layers), options, outputs, readers (for the format-change review in P2), steps. One operator layer can have several internal steps; the layer version applies to all of them. -
Layer key = SHA-256 of (layer, step, format, revision, input digests, options). Inputs enter by the digest of their bytes, as today, so a rebuild with the same bytes stops there.
-
Delete code identity:
host/obc-data/src/engine/code.rs,store/code/,producers/, the worker binding (host/obc-data/src/worker.rs), the launcher (host/obc-data-steps/src/launcher.rs), theobc-data-workerbinary, the exit-code reload, and the Python import-list test inhost/obc-data-steps/src/planner.rs.tools/justfilebuilds and runs one release binary. -
Format numbers from the readers:
device/mapusesobcm::VERSION(firmware/obc-formats/src/obcm.rs),planner/routinguses the routerFORMAT(planner/router/src/package.rs),device/catalogusesCATALOG_SCHEMA_VERSION(host/obc-pack/src/catalog.rs). Other layers start at the format their spec states. Everyrevisionstarts at 1. -
Operator layers as in the epic table. Map today's steps onto them:
maps/source/*,maps/region-osm,maps/osm→ internal OSM steps shared by the layers that read OSM;maps/reference/*,maps/terrain/*→device/terrain;maps/{coarse,mid,fine,network}/*→device/map;maps/landmark-content,maps/peak-content,maps/landmarks/*,maps/peaks/*→device/landmarks;maps/catalog→device/catalog;planner/*steps → the planner layers;*/gridsteps belong to their layer.
This also removes today's fault where the planner product emits
maps/…steps thatcli/build_cli.rsrejects. -
Staleness judge (rewrite
engine/state.rs,engine/changes.rs): for a release and the current code, each layer isok,offorstalewith one cause and one short text:format 19 → 20: readers need new datarevision 2 → 3: improved outputwiki 2026-06-01 → 2026-09-01(cause 2)follows device/map(cause 3)
-
Naming a layer rebuilds it:
--only LbakesLagain even when it is not stale. Its followers bake again only when its bytes change. -
The TUI is deleted (
cli/tui.rs,cli/tui/). It would need a rewrite against the new states. The CLI is the interface until P5.
Acceptance
- Focused tests, one per cause: a version change, a newer source version, a changed input layer; plus "naming a layer rebuilds it" and "a producer refactor with no version change leaves every layer
ok". - Changing
obcm::VERSIONmakesdevice/mapstale with aformatcause and no other edit. obc test -p obc-data,obc test -p obc-data-steps, clippy with-D warningson both.specs/obc-data.md: the key and staleness sections state the new rules; the code-identity sections are removed.- The PR reports added and removed lines.
Out of scope
Targets, releases and publishing (P2). Serving (P3).
Depends on
Nothing.
Activity
timohueser commentedon Oct 12, 2026
Scope item 8 is done in #2658 (merged). The
obc dataTUI is deleted, and a bareobc dataprints the status. The diff is +67 / −5072 lines, including 37 crates that leaveCargo.lockwithratatui.Items 1–7 follow in the next P1 pull requests: layer versions, the new key, the deletion of code identity, and the staleness judge.
Generated by Claude Code
timohueser commentedon Oct 12, 2026
#2659 is merged. It covers scope items 1–5 and deletes
obc data dev, the portable adoption andtools/planner_local.pyearly; P3 replaces them withobc data serve. The diff is +1181 / −9560 lines.engine::Layer { name, shape, format, revision, readers }replaces code identity. Each step points to its layer. The key is SHA-256 of layer, step, format, revision, input digests and options.obct::SURFACE_VERSION,obcm::VERSION, the landmark and peak section versions,CATALOG_SCHEMA_VERSIONand the routerFORMAT. Every revision is 1.data/sources.tomlgo into step options, so a change of attribution makes the step stale.The staleness judge and
--only(items 6 and 7) follow in the next pull request.Generated by Claude Code