gleamunison/store_deps

Checked retraction decisions: the dependency error vocabulary and the branch-binding queries the retraction commands share. Mutation callers build ONE verified snapshot (dependency_snapshot.read) and reuse it for all checks — the one-shot *_checked wrappers that used to live here re-read the whole store per question, existed only for tests, and are deleted (bk-f7ea); tests now use the production shape directly.

Types

pub type DependencyError {
  StoreFailure(storage.StorageError)
  NamespaceFailure(String)
  CorruptDefinition(identity.DefinitionRef)
}

Constructors

Values

pub fn branches_binding_elsewhere(
  adapter: storage.StorageAdapter,
  ref: identity.DefinitionRef,
  selected: String,
) -> Result(List(#(String, String)), DependencyError)

Content is shared by every branch, so a retraction decision needs to know whether a branch other than the selected one still binds the ref: deleting bytes another branch resolves to leaves a binding nobody can load.

pub fn describe_branch_bindings(
  held: List(#(String, String)),
) -> String

dev (a), feature (b): which branch holds it, and under what names. One spelling of the refusal, so both retraction commands name the same thing the same way.

pub fn describe_dependency_error(
  error: DependencyError,
) -> String
✨ Search Document