Skip to main content

Module unlinked

Module unlinked 

Source
Expand description

<data_dir>/cloud/unlinked_roots.json (rc4-6): the project folders the person stopped sharing with cloud unlink. A folder listed here is never shared again on its own: it resolves no vault (also not through its main checkout or another checkout of the same repository), cloud sync and the knowledge sync do not map it, a write does not push it, a task proposal or message from it is not sent, and capture queues no draft for it. Only an explicit cloud link in the folder that Cloud accepts takes it out of the list.

Kept apart from projects.json (written by resolution and sync) so the opt-out survives every rewrite of the vault map.

Fails closed: a store that cannot be read or parsed counts every folder as not shared (contains is true), and add / remove refuse, so cloud unlink and cloud link report the damage instead of starting from an empty list. Changes are made under a file lock and written atomically.

Constants§

FILE
The file name in the cloud data dir.
REFUSAL
What a resolution of an opted-out folder answers.

Functions§

add
Remember that the person stopped sharing root.
before_link
Whether root has an opt-out in this machine’s cloud data dir, read by cloud link before it writes anything: a damaged store fails the link. The opt-out stays in force through the link and its share (which resolves the vault through crate::knowledge::pull::resolve_for_link), so nothing is sent before Cloud took the link (bd 40060).
check
Whether root was unlinked and not linked again; an error names a damaged store (for cloud status and refusals).
contains
The folder root was unlinked and not linked again; also true for every folder while the store is damaged (fail closed, warned once per process).
damage
The damage of the store, when it cannot be read (None: readable or absent). cloud status shows it, so the fail-closed state is visible.
forget_on_link
remove in this machine’s cloud data dir, once cloud link kept the link (Cloud took the share, or it is shared once this machine connects). A link Cloud refuses never lifts it.
refusal
What a sender answers for a folder contains holds back: REFUSAL, or the damage when the store cannot be read (cloud link would fail on it, so the refusal does not point there).
remove
The person linked root again: drop its opt-out. true when it had one.
shared_record
The vault record root is shared through, with the opt-out applied: VaultMap::for_root falls back from a worktree to its main checkout, which an unlinked worktree must not use (bd 40060). None for an unlinked folder and, fail closed, for every folder while the store is damaged.