Creation Parameters
Some parameters of a store are chosen when it is created and never change afterwards: they are
written into the store itself (its GRAPH file, its container), every copy of the store carries
them, and no API, command or option changes them. Everything else is an open option: given to
every open, it may differ from one open to the next and is stored nowhere.
graphersal store info <dir> lists the creation parameters under "fixed at creation"; Store::info
/ Store::inspect return them (StoreInfo::store_id, chunk_bytes, damage_policy, created_at,
format_version, space for a single file, layer_base for a layer store), the dev server's
GET /api/store and the Store menu show them.
$ graphersal store create data/ --from modern --on-damage continue
Created the store data/: graph 01a11cfc-..., commit 0, 1 snapshot(s); damage policy continue (fixed for its life).
$ graphersal store info data/
...
fixed at creation (never changed):
store id 01a11cfd-...
created 2026-10-08T19:27:26Z
chunk size 1048576 bytes
on damage continue (damage found while open is reported, commits continue)
backend directory (format version 4)
A layer store lists its base too, as the last line of the block:
base graph 019a6b2e-... at commit 42 (commit time 1763...)
# a layer store: opens only over this base, a backup is useless without it
graphersal --graph <BASE> --layer-store <dir>
The parameters fixed at creation
| Parameter | Default | Set with | Stored in | Carried by |
|---|---|---|---|---|
| Damage policy: what an open store does when damage is found on disk while it is open (below) | maintenance | Rust StoreOptions::with_damage_policy on Store::create, create_with, create_from_packed, create_file; CLI graphersal store create <dir> --on-damage maintenance|continue, graphersal --graph <dir> --create-store --on-damage <p> (also with --server); Python Store.create(path, on_damage="continue"), Store.create_file(...) | GRAPH flag bit 5 (format spec 5.2) | every write of GRAPH; fork, attic fork, repair, convert, compact, rollback, every backup (full, increment, ZIP, from memory), restore, upgrade (copy and in place) |
| Chunk target size: the uncompressed size of a snapshot chunk, the unit of repair | 1 MiB | Rust StoreOptions::with_chunk_bytes; CLI store create --chunk-size <bytes> | GRAPH offset 44 (5.1); each manifest | fork, attic fork, repair, convert, backups, restore, upgrade |
| Store id: the store's identity, which an incremental backup requires to be equal | random (128 bits) | (made by the create) | GRAPH offset 100 (format spec 5.5) | every write of GRAPH; rollback, attic restore, compact, every backup (full, increment, ZIP, from memory), restore (a restored backup IS the store), upgrade (copy and in place: the upgraded store IS the store in the new format). RENEWED (a new store) by fork, attic fork, repair and convert |
| Creation time | the time of the create | (the clock) | GRAPH offset 32 | convert, backups, restore, rollback, upgrade (a fork or repair is a new store with its own time) |
Backend: a directory, one container file (.gstore), memory | by the path (store_dir_at): an existing file or a new .gstore path is a single file | the path; CLI --single-file; Rust SingleFileDir, MemDir; Python Store.create_file | the location itself; a single file's preamble holds its container version (14.1) | compact (same file), upgrade in place; store convert and store upgrade <old> <new> make a NEW store, in any backend |
Base of a layer store (base_ref): the identity of the frozen base graph the layer was built over (its lineage id, commit and commit time, BaseRef); only a layer store has one (Layered Graphs) | none (a plain store) | Rust Store::<LayeredGraph>::create_layer(dir, &base, options) / create_layer_with (the LayerBase given); CLI and dev server: graphersal --graph <base> --layer-store <dir> --create-store (the --graph is the base: a Store or a .gsnap; graphersal store info shows it); Python: not yet (its layers live in memory) | the layer file (layer.bin, segment kind 128) of every snapshot and its segment-table row in the manifest, file format version 5 (format spec 7.5); no GRAPH field or flag (the manifests tell, 15) | every snapshot the store writes (checkpoints, live and closed); every backup (full, increment, ZIP, from memory), restore (in place and from a ZIP), the read-only open of a backup, export_packed (a layer .gsnap); a fork (fork, Store::fork_layer_dir, CLI store fork --base) and an attic fork (attic_fork, Store::attic_fork_layer_dir, CLI store attic <dir> fork --base): a new layer store over the same base; a rollback and an attic restore (the store stays a layer over it); convert (byte copy); upgrade_in_place (a layer store is current: unchanged). Not carried, by design: the materialized export (Store::export_materialized, CLI store materialize --base, a plain whole-graph snapshot without a base). Refused for a layer store (StoreFailure::LayerStore, nothing written): the repair (a salvage rebuilds whole graphs, a layer store holds only changes to a base it does not read: restore a backup instead), the closed-store model commits (a layer store keeps no model), the plain fork_dir/attic_fork_dir (no base to load over) |
| Store format version | the build's (4) | (the build) | GRAPH offset 8 (the file format version, 4, is in every other file header; a store created from an older packed snapshot keeps that snapshot's older files) | everything; a newer version is refused; an older released one (2, Graphersal 0.1.x; 3, Graphersal 0.2.x to 0.4.x) is refused until graphersal store upgrade converts it (a 0.4.0 store's models become blobs), the only change of this parameter, which carries every other one (Format Versions); the pre-release version 1 moves through a packed snapshot |
The graph id is not a parameter: it identifies the current lineage. It is set when the store is created, an in-place rollback starts a new one in the same store, and a fork or repair has its own (its lineage chain names the parent). The store id identifies the store itself: a fork, repair or conversion is another store (a new id), so it never continues the original's incremental backups (Backups).
Damage policy
Damage can appear on disk while a store is open. A backup (it reads every checksum of what it
copies), a checkpoint (its merge reads the last snapshot and the WAL after it) and verify find
it; the damage policy decides what happens then:
maintenance(the default): the open store turns read-only with the damage as the reason. Commits, marks, checkpoints, prune, rollback and compaction are refused (PersistError::DamageFound); queries go on; a backup from memory saves the intact graph; the store writes nothing more to the damaged disk.continue: the store keeps accepting commits; the damage stays reported (store info, the Store menu, a warning in the log) for as long as it is open.
It does not apply to damage found when the store is opened: a store that cannot be loaded intact always opens in maintenance mode. See Damage, Maintenance and Repair.
Why fixed: the policy is a decision about the data (may it change while its files are known to be
damaged?), not about one process. A fork, a repair or a backup is the same data, so it keeps the
decision; an open never overrides it. An open given another policy ignores it
(StoreOptions::with_damage_policy is used only when a store is created), and the CLI refuses
--on-damage for an existing store with another policy instead of ignoring it silently. A store
whose GRAPH files are both lost cannot tell its policy: a repair of it gets the default.
The base of a layer store is fixed because the layer holds only its changes to that very
base, by element id: over any other graph (also the same lineage at another commit) the changes
mean something else. An open, a view, a verification or a checkpoint with the base is checked
against it before anything is read (PersistError::LayerBaseMismatch, naming both; so is a
fork or attic fork of the closed store, Store::fork_layer_dir/attic_fork_layer_dir), and a copy
of the store is useless without the base: a backup's report warns about it. To move a layer to a
new base, rebuild it there. No GRAPH flag marks a layer store: every one of its snapshots names
the base in its manifest (which the version guard reads anyway, format spec 15), so a flag would
only be a second copy that could disagree, and releases that do not know layer stores already
refuse the version-5 manifests.
The storage type of the graph (Store<TraversalGraph> or a host's Store<S>,
Your Own Storage) is NOT a creation parameter: the files do not depend on
it, so any storage type opens any store.
Neither are the additions of store format version 4: the hash algorithm of a blob is stated
by each blob reference itself (hash_algo, format spec 3 and 4.6), so another
algorithm needs no new store; the part size of a commit in parts (64 MiB) is the writer's
choice, readers accept any slice size (9.3.1); the embedding models and the default model
are catalog definitions, data of the history that commits change
(Embedding Models in a Store); the system journal's segment size and instance
name are open options (below).
Open options (per open, stored nowhere)
| Option | Default | Rust (StoreOptions) |
|---|---|---|
| Durability: fsync per commit, at most once per interval, or left to the OS | per commit | with_durability |
| WAL segment size | 16 MiB | with_wal_segment_bytes |
| Automatic checkpoint after this much WAL | 256 MiB (4 MiB in the browser) | with_checkpoint_after_bytes |
| Merge checkpoint bound | 1 GiB (64 MiB in the browser) | with_checkpoint_merge_bytes |
| Snapshot segment target | 64 MiB | with_snapshot_segment_bytes |
| Compression codec of chunks and large WAL records | LZ4 | with_codec |
| Checkpoint on close | off | with_checkpoint_on_close |
| Read options (memory limit, value depth) | defaults | with_read_options |
| Compaction policy and automatic compaction after prune | defaults, off | with_compaction_policy, with_auto_compact |
Workload statistics level (off, memory, persisted: the sidecar WORKLOAD) | persisted | with_workload_level |
| System journal segment size (book page "System Journal") | 4 MiB | with_journal_segment_bytes |
Instance name in the system journal (kept in the instance file INSTANCE, never copied) | the host name (HOSTNAME, COMPUTERNAME), else unknown | with_instance_name |
A new creation parameter is added to the first table (and to store info); see CLAUDE.md.