LifeLab · reference

Lens syntax — the whole grammar

![[source]]{lens} — source says which set, lens says how to look at it. Space = AND, - = NOT, OR lives in the source list (union sets), never in the lens. The grammar is closed: if a token can't be completed from a menu, it isn't grammar. Same line works in region headers, the page-header filter, pickers, and buffers.

Order: filter terms are order-free (chips normalize to status · tags · dates · fields); duplicate shape keys — last wins; a scope token starts a run that lasts until the next scope token, so unscoped terms come first.

sources — inside ![[ ]]picker completes names; , commits + starts another (stored as IDs)

mcp · project/lifelabpage — blocks that live there. Referenced: page order, write-home, drag = move.
:project/lifelab:tag — blocks marked so. Computed: provenance groups, drag = mark/unmark, add = born matching.
lens/lifelab-nowsaved lens — a named source+lens pair; summons its result.
Projects, Reading, :mcp:union — any mix of named sets; this is OR. Grouped by source unless sorted; each sub-river keeps its own contract.

filter terms — inside { }space = AND · - = NOT

syntaxmeaningcost
todo · done · notetask tri-state: open · closed · no marker (a markerless block is a note). Negate any: -todo. Bare words — closed vocabulary, so no key needed; pages never appear bare inside {}, so no collision.free
:tag: · -:tag:tagged / not tagged. Self-delimiting — the colons are the key. Tag OR = summon a union of tags instead.free
when: · remind:the two built-in dates (entry · reminder). Keyed only because they collide. Values below. remind:none = unset; remind:overdueremind:..yesterday + still todo.free
today · this-week · next-2w · last-3mdate words. Chip/completion always shows the resolved range — never guess a boundary.free
-3w.. · ..+2w · -3w..-1wdate arithmetic, org-style units d w m y; .. ranges, ends may stay open; -- accepted as ...free
2026-07 · 2026-07-01..07-12anchored dates: a month, a day, an explicit range.free
key:* · key:valuearbitrary metadata: existence and equality — the two ops that can't lie on untyped data. Keys harvested with counts; values complete top-N then typeahead (never enumerate 50 years).free
calories>500 · calories:400..600comparisons and numeric/date ranges on a promoted key. Unpromoted → dotted underline, ignored, one-click promote; bad values become a lint list on fields/<key>.promote
"exact phrase"full-text match, quoted (web-search folk syntax). Bare words are never text search — they'd collide with the closed vocab.free
joins · computed values · cross-key mathnot grammar. Lua block, on purpose — the escape hatch stays imperative.lua

shape terms — inside { }keyed because rare · defaults first

sort: source · updated · created · when · remind · manualsource (default) keeps page order per sub-river. manual stores order on the lens — the only mode where drag-reorder is enabled in computed/interleaved regions.
group: source · page · tag · day · nonesource (default) = one sub-river per summoned set. page = provenance headers. Interleaving (group:none + a sort) disables positional drag.
render: transclude · compact · list · tabletransclude (default) = full blocks. compact = one line each. table = columns from mentioned keys.
limit: Ncap shown rows; footer reports the remainder (+18 more).

scopes — page faces & nestingonly meaningful where the face has sections

page: todo · linked: when:-3w.. · subpages: todosection-scoped terms — filter just that section of a summoned page's face. Unscoped terms apply to all sections.
-linked · -subpages · -pagehide a whole section: ![[mcp]]{-linked -subpages} = bare river only.
depth: 1 · 2 · allhow far to descend into nested pages (default all). Header toggle [page]depth:0, [all]depth:all.
*TODOship lens specproject/lifelab · direct
*TODOexpose query_open over mcp▤ mcp · nested
*TODOCRDT merge test on lens property▤ sync · nested

Nested tint: rows homed in a nested/subpage keep the existing lighter-pane color at row level, in every render mode — provenance survives interleaved sorts even when group headers are off.

drag & drop — contract by membershipthe badge tells you which one you're in

regiondrag indrag out / betweenreorder
referenced (page, union sub-river)move — block re-homes to that pagemove between pages (sub-river = page surface; existing logic unchanged)yes — edits page order
computed (tag, lens result)mark — tag applied, location unchangedunmark — tag stripped, block stays homeonly with sort:manual (order stored on lens)
interleaved (any region with a sort)drop targets = group headers ("→ Projects / Reading")per source row's contractno — positions belong to the sort

worked examples

![[mcp]]whole face: river + subpages + linked — today's behavior
![[mcp]]{todo when:-3w..}recent open work, all sections
![[mcp]]{-subpages linked: todo}subpages hidden; linked filtered to todos (scope runs to end)
![[Projects, Reading]]{todo sort:updated}one lens over a union, interleaved
![[:gym:]]{todo calories>500}computed set + promoted-field comparison
![[:project/lifelab:, :mcp:]]{remind:overdue}tag OR via union · the killer facet
header: todo when:this-weeksame terms, no ![[ — page-header lens over everything shown

Storage: a lens is just this text — in a block (region), in a page property (lens: todo when:-3w.., pinned header), in view state (this visit), or shelved at lens/<name> (summonable). Copy the line = share the lens.