Skip to main content

Module selection

Module selection 

Source
Expand description

The provenance-native selection algebra (vw note §7.3; untie readiness tracker Phase 2): a revset-shaped composable expression language over recorded change-units, feeding the three selective verbs (undo <selection>, transport <selection>, adopt --only) and the archaeology queries.

Grammar (union | loosest, then difference ~, then intersection &, parens group):

expr   := diff ( '|' diff )*
diff   := inter ( '~' inter )*
inter  := prim ( '&' prim )*
prim   := atom | '(' expr ')'
atom   := path(<glob>) | by-effect(<prefix>) | by-origin(<prefix>)
        | by(<prefix>) | intent(<prefix>)
        | in-branch(<id>) | change(<id>) | cut(<id>)
        | since(<stamp>) | until(<stamp>) | dependents-of(expr)

The unit of selection is one recorded write: (cut, path, before → after), derived from cut lineage. dependents-of is the slicer seam’s conservative floor: path-level dependence (a later unit on the same path consumed the earlier one’s output). The declaration/slice-granularity atoms (decl(...), slice-of(...)) arrive when the slicer joins as this algebra’s client — the grammar is closed under adding atoms.

Structs§

ChangeUnit
One recorded change-unit: what one cut did to one path.
DeclUnit
One changed declaration within a change-unit (DR-0054 Decision 6.3).

Enums§

SelAtom
SelExpr

Functions§

eval
Evaluate an expression over a change-unit universe, returning the selected indices.
glob_matches
A */? glob match (segments are not special: * crosses /, matching the whole-path selection intent).
parse
Parse a selection expression. Errors carry the offending position’s remainder — enough for a CLI message.
stranded_by_undo
The stranding check (selective-undo.maude, the slicer’s 7th client at its path-level floor): undoing selected strands every RETAINED later unit whose path input came from an undone write. Returns the stranded indices — empty means the exclusion’s dependency closure is clean and the proposal is safe.