Skip to main content

Module layout

Module layout 

Source
Expand description

Where a city keeps each kind of file on disk: one derivation from the city root and an address (crates/kernel/spec/Layout.lean §8-56).

Every directory name and file name the city writes is declared here once, and every path it writes them to is spelled here once, so a rename reaches every caller and none is left reading an empty directory.

Nothing here touches a disk. A CityLayout is a value: it answers where a file would be, and the caller that owns the I/O decides whether to create it, read it, or refuse. That keeps the layout inside kernel, where the address grammar it rests on already is.

One rule governs the placement itself: what governs a scope lives in that scope’s reserved subtree, and no write domain reaches it (Address::is_reserved). The rules of a building, its configuration layer and its filters are therefore under RESERVED_PREFIX, while the documents residents write — the job, the handoff, the urbanite page, the archive — sit in the open where residents can edit them.

Structs§

CityLayout
The disk layout of one city, derived from its root.

Constants§

ARCHIVE_DIR
Where a building files work it has finished with, by kind and day.
BUILDING_SHELF
A building’s own shelf of skills, under that building’s reserved subtree: what this building knows and no other building is given.
CAS_DIR
The content-addressed object store, under the city’s reserved subtree.
CONFIG_FILE
What one configuration layer declares. The same file name at every layer, because the layer is the scope it sits in rather than a name.
DEVICES_FILE
The devices paired to reach the city from outside the machine.
FILTERS_FILE
What a scope keeps out of the transcript it sends to a model.
GUIDE_FILE
How far the person has got through the first-run guide, under the city’s reserved subtree.
HANDOFF_FILE
What the next agent needs before it starts, per room.
JOB_FILE
The task of one session, in the room it is run from.
LEDGER_DIR
The append-only history of a city, under the city’s reserved subtree.
LIBRARY_DIR
The city’s shelves of skills, under the city’s reserved subtree.
MONITOR_FILE
The beat the performance monitor samples at, under the city’s reserved subtree (crates/sprawling/spec/Monitor.lean D48).
PLAYBACK_DIR
Where residents’ playback exports land, under the city’s reserved subtree, one directory per building.
REMOTE_DIR
What the remote gate keeps on disk, under the city’s reserved subtree.
RUN_ID_PATTERN
A run id as a git ignore pattern: one ? for each character of the hyphenated form a crate::RunId displays, so a building can keep every run’s transcript out of its history by name.
SKILL_FILE
The one document of a skill filed as a directory: a package on a section shelf, and every skill on a shelf the city mounts from elsewhere. It is the layout pi, claude and agents all use; the catalog lists this file’s first line, and read opens the files beside it by <name>/<path>.
SNAPSHOT_DIR
What the views held after one ledger line, under the city’s reserved subtree; a projection a start may discard.
TRANSCRIPT_EXT
The extension of what one run saw, written in its room as <run>.jsonl.
URBANITE_FILE
Who a standing resident is, in that resident’s own directory.

Functions§

document_staging_name
What the staging file of a document named name is called: the name hidden by a dot and suffixed .staging, in the document’s own directory (crates/kernel/spec/Layout.lean §8-56).
is_document_staging_name
Whether name is spelled the way document_staging_name spells the staging file of some document.