Expand description
Compiled lifecycle-policy rule sets — first-match-wins glob lookup
over the [[mem_management.create]] /
[[mem_management.delete]] arrays surfaced in workspace.toml.
The data carriers (crate::workspace::CreateRuleSetting,
crate::workspace::DeleteRuleSetting) live with the workspace
types in crate::workspace; this module owns the compiled
matcher view that handlers call to decide whether a candidate
mem path matches an operator-allowed rule.
Each rule’s pattern is a gitignore-style glob: * does not cross
/; ** matches zero-or-more path segments. Matching is
case-sensitive, no normalization. The matcher targets the composed
candidate <path>/<name> (the mem’s full hierarchical branch
path on the mem-repo) so rules can scope to a directory under
the registry tree without separate path-glob plumbing. Flat-layout
mems pass their leaf name as the candidate.
Boundary note. The lifecycle orchestrators (create_mem,
delete_mem, their params/responses, the shared NOTE_MAX_LEN
cap, the validate_mem_path helper) live in
[memstead_engine::mem_management]. The matcher primitives stay
here because the lean engine’s
crate::Engine::cross_mem_link_allowed synthesises a
CreateRuleSet on multi-folder workspaces — they are a lean
policy primitive shared by both flavors.
Structs§
- Create
Rule Set - Compiled
[[mem_management.create]]rule set. Each rule is a pre-builtglobset::Globplus the rawCreateRuleSetting. The underlyingGlobSetcarries the same globs in declaration order soSelf::first_matchresolves to the first-listed rule whose glob matches. - Delete
Rule Set - Compiled
[[mem_management.delete]]rule set. Same first-match semantics asCreateRuleSet, minus the schema dimension. - Matcher
Set - Compiled set of allowlist globs with gitignore semantics.
Enums§
- Matcher
SetError - Construction-time error for the matcher constructors. The
ParseEntryvariant names the offending entry string so callers can surface an actionableINVALID_INPUTenvelope without re-deriving which entry blew up.