Expand description
Source scope enumeration — the declaration-layer walk that turns a
binding source’s scope patterns (allow / deny globs over a medium,
entity selectors over a graph) plus a binding’s ingest-level deny
paths into the set of artifacts the binding answers for, S(D).
Kernel, not loop: the anchors health axis enumerates a mem’s source
artifacts to report the unclaimed ones, and the facet read surface
reports a scope’s enumeration, so the walk lives beside the binding
store it reads and never behind the maintenance loop that also
consumes it. Moved here from ingest::cursor on 2026-09-10; the loop
reaches these items through ingest::cursor’s re-exports.
Structs§
- Scope
Enumeration - What an enumeration of a source’s scope selected, and what it could not speak for.
- Scope
Pattern Note - One scope pattern still written in the retired workspace-relative dialect.
Enums§
- Entity
Selector - One parsed entry of a graph facet’s scope — the entity-namespace
counterpart of a path glob. A graph source selects entities, and an entity
is not a path: matching id-shaped globs against
mem--sluginvites the “looks scoped, selects nothing” failure the dead-deny lint exists to catch on paths, so the vocabulary is explicit about which axis it selects on.
Constants§
- VCS_
INTERNAL_ DIRS - VCS metadata directories — never source artifacts. Pruned from source
enumeration (
S(D), mtime slices, advance) and from the dead-deny scan.
Functions§
- allow_
could_ match_ under - Whether any allow pattern could match a file somewhere under the
directory at
dir_rel(source-relative). True when, for some pattern’s literal prefix, the directory’s segments and the prefix agree over their common length: the directory is either an ancestor of the literal region (the walk must pass through it) or inside the pattern’s glob region. An empty prefix (pattern starts with a glob segment) matches every directory — no pruning for unanchored scopes. - build_
glob_ set - Build a
GlobSetfrom glob patterns, orNoneif any pattern is malformed. The namespace the patterns are written in is the caller’s business — scope patterns are source-relative, ingest denies workspace-relative. - build_
glob_ set_ reporting build_glob_set, plus the patterns that would not compile.- engine_
state_ denies - Workspace-relative deny globs excluding the engine’s own state from
every strategy’s input set. Unconditional and non-configurable: a
binding can never legitimately model
.memstead/,.memstead.cache/, or a mount’s resolved storage location as source artifacts — an allow glob covering them does not admit them. The dot-directories key on their names (the names are the contract, and a foreign workspace’s.memstead/is still engine state); the mount storage locations key on their resolved paths because their directory names are configurable. Fail-open on an unreadable mount list: the name-based excludes stay in force. - enumerate_
facet_ files - Enumerate the workspace-relative file paths a primary source’s facet scope
selects — the
mtimestrategy’s input set. Mirrors the plugin’senumerateFacetFiles: the path-shaped mediums (codebase/filesystem/git— a git source’s artifacts are paths pinned at a commit, so the walk is identical and only the anchor namespace differs); the facet’s allow globs minus its deny globs, evaluated over the medium’s directory tree. Returns a sorted, de-duplicated list. An unscoped facet (no allows) yields an empty list here — but callers must not treat that as signal: the strategy layer (compute_mtime_slice/current_primary_token) refuses an unscoped facet viafacet_unscopedbefore enumerating, so the empty list is only ever reached for a genuinely-empty scoped enumeration. - enumerate_
facet_ files_ reported enumerate_facet_files, carrying what the enumeration could not speak for: patterns that would not compile, and patterns still in the retired workspace-relative dialect. Any surface that reduces the set to a figure must consultScopeEnumeration::is_partialfirst.- enumerate_
graph_ entities - Enumerate the entity ids a graph source’s facet scope selects — the
graph medium’s
S(D), the exact counterpart ofenumerate_facet_filesfor a path medium. The source’spointernames the source mem; the store already holds every mounted mem’s entities, so this is a filter over memory rather than any kind of walk. - enumerate_
source_ artifacts - Enumerate one primary source’s in-scope artifacts, whatever its medium —
the single entry point every
S(D)consumer uses. Path-shaped mediums (codebase / filesystem / git) walk the file tree; a graph source filters the source mem’s entities. A medium the matrix marks non-enumerable yields nothing, and its callers render the non-enumerable basis rather than a denominator. - enumerate_
source_ artifacts_ reported enumerate_source_artifacts, carrying what the enumeration could not speak for. Any surface reducingS(D)to a figure consultsScopeEnumeration::is_partialfirst.- glob_
literal_ prefix - The longest run of leading path segments in a glob pattern that carry no
glob metacharacter — the literal region a match must live under.
dev/**/ *.md→["dev"];VISION.md→["VISION.md"];**/*.rs→[]. - medium_
base - The medium pointer resolved to an absolute base directory. Public
so init-time surfaces (CLI
projection init) can resolve a medium base exactly as the strategies do — e.g. to warn when it falls outside the workspace root. - normalize_
lexical - Lexically normalize a path — resolve
.and..without touching the filesystem (no symlink resolution), matching Node’spath.resolveon an already-absolute path. - parse_
entity_ selector - Parse one graph scope pattern.
Nonefor an unrecognised form — the caller decides whether that is a validation refusal (declaration time) or a skipped rule (run time, already refused at declaration). - relative_
path - The relative path from
fromtoto(both normalized), matching Node’spath.relative. - scope_
migration_ notes - Name every scope pattern of
sourcethat reads as the retired workspace-relative dialect: one that begins with the source’s own pointer, so it selected artifacts before the 2026-08-27 join and selects nothing after it. - selector_
matches - Does
selectorselect this entity?