config
config
¶
Configuration, tree location and the closed failure taxonomy of the files backend.
Nothing in this module touches the filesystem: the factory's validation is
cheap and pure, and :func:resolve_files_location only computes paths.
FILES_SUBTYPES is the closed set of reasons a files-backend call can fail,
each mapped onto its errors/1 code. The spec's fourteen subtypes are kept;
wave A adds five, each named here:
cursor_invalid(E7): a recall cursor that was forged, tampered with, or minted against a tree that has changed since.fact_invalid(E7): fact text the tier format cannot store (empty, or a line that looks like a fact marker), or a tier name that is not a plain*.mdfile name.state_corrupt(E5): the backend's ownstate.jsoncannot be parsed.argument_invalid(E7): a call argument out of range (fetch offset inside a UTF-8 character, a non-positivelimit...).storage_error(E5): the operating system refused a read or write.
Classes¶
FilesBackendConfig
¶
Bases: BaseModel
One files-backend attachment, as the gateway hands it to the factory.
FilesLocation
dataclass
¶
Where one scope's files live: the tier tree, its attachment dir, the state root.
Functions:¶
files_error
¶
The typed errors/1 exception for a files-backend subtype.
Source code in src/marianne/memory/backends/files/config.py
default_files_root
¶
resolve_files_location
¶
Map a scope onto its scope-family tree under root.
project/demo -> <root>/project/demo; local:default ->
<root>/local/default; organization/x -> <root>/org/x. Writer
state for every tree lives under <root>/trees. A scope that would
resolve outside root is refused (E3 scope_unknown). No I/O.