Skip to main content

Module query

Module query 

Source
Expand description

Query parsing and in-memory evaluation. Pure: no git, no I/O. Grammar lives in ADR 0003. This module turns a query string into a ScanPlan and decides whether a candidate loop matches it.

Structs§

Candidate
A loop as seen by the evaluator. Borrowed to keep matches allocation-free.
ResolveOptions
Options for resolve_plan.
ScanPlan
The parsed query, derived before any heavy I/O.

Enums§

AttrFilter
An attribute filter evaluated in memory after the scan.
Cmp
Numeric/temporal comparator for idle/ahead/behind.
ContextPersistence
Whether an explicit @ token in the query should update persisted config.

Functions§

context_persistence_from_query
Parses @ usage for config persistence (call after resolve_plan succeeds).
merge_scan_plans
Merges two plans with AND semantics across filters and OR across flags.
parse
Parses a query string into a ScanPlan. Tokens split on whitespace only — a / is literal inside a term.
parse_duration
Parses <N><unit> where unit is one of m/h/d/w.
resolve_plan
Resolves @context tokens and default context into a single ScanPlan.