clone

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

feat/atlas-next-horizon
atlas / docs / decisions / 0012-scan-at-launch-never-watch.md
0012-scan-at-launch-never-watch.md 2.0K rendered
1# 12. The registry is scanned at launch and on import — never watched23- **Date:** 2026-08-024- **Status:** accepted5- **Where it is written down:** issue #5 §2, §4.6, §10 decision 15;6 [app.md](../app.md) §1.1, [format.md](../format.md)78## Context910The library is a directory of immutable `.atlas` files. Something has to decide11which build of a volume serves, and something has to notice when the directory12changes. The reference implementation watches the directory. A watcher is a13long-lived OS resource with platform-specific behaviour, it fires on partial14writes, and it makes "what is the library right now" a question with a racy15answer.1617## Decision1819**Scan at launch, rescan on import, never watch.** A file dropped into the20library from outside appears at the next launch. The user's expectation is21"open Atlas and see my registry", not a live file watcher.2223The fold itself — newest capture, then policy revision, then stamp, then24locator; newest-per-slug wins — is **pure and lives in `format/bundle`**.25Touching the filesystem is a `hostenv` concern26([ADR 7](0007-hostenv-portability.md)), so a host only ever has to produce27descriptors.2829`index.json` is always derived from the files. New builds land beside old ones;30nothing ever mutates a published bundle.3132## Consequences3334- `VolumeStore.Rescan()` returns the volumes whose **serving build moved**,35 which is exactly what the SSE stream needs to announce: a refreshed volume36 selector, a refreshed library card, and a full-refresh directive when the37 current volume's serving stamp moves.38- An import (or a pipeline install performed through the workbench) is the only39 in-session trigger, and it is one the application already knows about.40- `Location()` is a label, not a path the handler takes apart — it is what the41 catalog reports as `bundlesDir` and what the empty-library page shows.42- The pure fold is testable without a filesystem, and it is the same code the43 CLI's install path uses, so the desktop app and the pipeline can never44 disagree about which build is current.