Skip to main content

Module resolution

Module resolution 

Source
Expand description

Local vault resolutions that no longer fit their checkout (dogfood 5.11.: one repository split across two vaults without a warning).

projects.json (VaultMap) remembers which vault Cloud resolved for a checkout. That memory goes stale when

  • the link file now names another vault (cloud link after cloud connect, or a pulled commit that changed .lean-ctx-cloud.json), or
  • the checkout’s identity changed: a .lean-ctx-id that an earlier cloud link wrote (32 random hex characters) no longer outranks the git origin (crate::vault::project_identity), so every checkout of one origin is one repository again.

A stale record is never used: it is dropped, and the next resolve maps the checkout again (with the person’s first-share consent where the gate holds). When Cloud still answers with another vault than the link file names, the resolve is refused (refuse_unlinked): nothing syncs into a vault the link file does not name.

Structs§

Stale
A resolution of root to resolved (ns/name) that does not hold.

Enums§

StaleReason
Why a recorded resolution does not fit the checkout any more.

Functions§

current_view
The map at data_dir without its stale records, the file unchanged: what the live bus subscribes and announces from, so it never joins a vault a checkout left.
forget_all_stale
forget_stale for every checkout map knows.
forget_stale
Drop the stale resolution of root from map, if any. A link file that names another vault drops the whole record: one identity has one vault, so every checkout of it resolves again. An identity change drops only this checkout from the record of its old identity.
forget_stale_at
Drop the stale resolution of root in the map at data_dir.
load_current
The vault map at data_dir without stale resolutions; the file is rewritten when one was dropped. What every pass that sends (sync, task proposals) reads, so none sends into a vault the checkout left.
refuse_stale
The refusal for a write into the stale resolution stale.
refuse_stale_record
Refused (vault_mismatch) when record, which a caller is about to sync for the checkout at root, is not what the checkout resolves to now: its link file names another vault, or the map’s record of root at data_dir is stale. The guard of every vault sync (background pass and cloud sync), whatever map snapshot the caller planned from.
refuse_unlinked
Cloud answered answered for the checkout at root: refused when its link file names another vault. Cloud keeps the first binding of an identity (another Instance of the workspace may have made it), so a link to another vault cannot move it; syncing anyway would split the repository silently.
stale_for_root
Whether the recorded resolution of root is stale. Local files only; changes nothing.
vault_for_root
The vault the checkout at root sends to, from the map at data_dir: None when it has none, refused (vault_mismatch) when its record is stale. The one lookup of every caller that writes to a vault (tasks, bus posts and leases, docs, the live bus), so a record the link file or the identity no longer backs is never written to, also before link, connect or sync dropped it (a git pull that changed the link file).
vault_in
vault_for_root in a loaded map.