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 linkaftercloud connect, or a pulled commit that changed.lean-ctx-cloud.json), or - the checkout’s identity changed: a
.lean-ctx-idthat an earliercloud linkwrote (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
roottoresolved(ns/name) that does not hold.
Enums§
- Stale
Reason - Why a recorded resolution does not fit the checkout any more.
Functions§
- current_
view - The map at
data_dirwithout its stale records, the file unchanged, asscopesees it (seeload_current): what the live bus subscribes and announces from, so it never joins a vault a checkout left, nor one of another Cloud or account. - forget_
all_ stale forget_stalefor every checkoutmapknows.- forget_
stale - Drop the stale resolution of
rootfrommap, 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
rootin the map atdata_dir. - load_
current - The vault map at
data_dirwithout stale resolutions, asscope(the connected Cloud and account,crate::vault::vault_scope;Nonewhen not connected) sees it; 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, nor one of another Cloud or account (rc3-81, bd 39540: a pass duringcloud connectelsewhere sends nothing). - refuse_
stale - The refusal for a write into the stale resolution
stale. - refuse_
stale_ record - Refused (
vault_mismatch) whenrecord, which a caller is about to sync for the checkout atroot, is not what the checkout resolves to now: its link file names another vault, or the map’s record ofrootatdata_diris stale, or the map there belongs to another Cloud or account thanscope(the session’s,crate::vault::vault_scope) now (rc3-81, bd 39540). The guard of every vault sync (background pass andcloud sync), whatever map snapshot the caller planned from. - refuse_
unlinked - Cloud answered
answeredfor the checkout atroot: 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
rootis stale. Local files only; changes nothing. - vault_
for_ root - The vault the checkout at
rootsends to, from the map ofstoreas the connected Cloud and account see it (rc3-81):Nonewhen it has none (or only one of another Cloud or account), 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 (agit pullthat changed the link file). - vault_
in vault_for_rootin a loadedmap.