Skip to main content

Module folder

Module folder 

Source
Expand description

Folder remotes (SPEC 9.6): a local or network directory holding one subfolder per machine, written only by that machine:

<path>/<store_id>/<machine_id>/
  machine.json   written last
  store.git/     repo-per-machine: a bare repository
  latest/        mirror: the HEAD tree and EXPORT.json
  archives/      archive: surjection-<yyyymmdd-hhmmss>-<shortsha>.zip

Readers accept only names of that grammar (ULID store and machine folders, the files above) and only the ids machine.json lists; everything else is skipped, and names that match a sync tool’s conflict or temp pattern, or refs machine.json does not list, are reported as sync_artifact_ignored. Nothing a reader skips is ever deleted. A remote that is not there (remote_unreachable) never blocks local work; Surjection never creates the remote’s own folder or mounts anything.

Structs§

Export
The store files of an exported tree (mirror or zip), without EXPORT.json, and the sync tool artifacts skipped on the way (a desktop.ini or a conflicted copy in latest/ is not a store file). Paths that are not plain store-relative paths (absolute, .., .git) are refused (zip-slip).
Listing
What a folder remote holds.
MachineEntry
One machine of a folder remote, from its machine.json.
PullReport
What a pull did.
PushOutcome
What a push wrote.
SiblingPull
What merging one incoming head did: a sibling machine of a folder remote, or a git remote’s main (no machine).

Enums§

Source
Where a restore takes a store from (surject restore --from).
SourceChoice
A path given to restore --from: one source, or a folder remote whose machines the user picks from.

Functions§

export_files
export_zip
The store at rev as a zip with EXPORT.json (what restore --from reads, SPEC 10 item 5), and its name surjection-<ts>-<shortsha>.zip.
list
Lists the machines under root (of store store_id, or of every store), reporting sync artifacts on the way.
open_source
Opens path for a restore: a zip, a bare repository, a mirror, a machine subfolder, or a folder remote (machine picks by id or exact label; an ambiguous label fails and names the ids).
pull
Pulls every sibling machine of this store from a folder remote and merges each head (SPEC 9.9). Conflicts go to state/merge/MERGE_STATE.json; HEAD stays where it was for them.
push
Pushes the store to a folder remote, in its mode.
reachable_root
The directory a folder remote resolves to now, or remote_unreachable.