Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Scopes

A scope groups related records and can cascade context onto them.

scope kabir-hat-survey
  source district-health-survey
  observed-at 2026-05-03

  observation cases-clustered
    Nineteen of the twenty-two cases live within three hundred metres of the well.

  field-nurse noticed cases-clustered

Membership by nesting

Records written indented inside a scope become its members. The scope’s includes array lists their ids, in order. Nesting is the only place indentation changes meaning: outside a scope, an indented header is unusual and warns (it’s still desugared, at the top level, so nothing is lost).

Scopes nest to any depth:

scope college-choice
  scope what-i-want
    focus goal-research
      kind goal
      Do undergraduate research with leading faculty.
  scope the-decision
    focus where-to-go
      kind decision
      Which offer do I commit to?

The bundled grant-panel.thml nests a goal, a question, a decision and three options inside one scope, so the panel reads as a single unit.

Inheritance

A scope cascades four context fields onto every member that doesn’t set its own: asserted-at, observed-at, source, valid-during. The rule is member-wins — a member’s own value is never overwritten — and innermost wins, so a sub-scope’s default overrides an outer scope’s.

This means you can stamp an entire investigation with one date and source at the top, and only override where a specific record differs:

scope burndown-review
  asserted-at 2026-06-01        # every member inherits this date…
  analyst suspects early-burndown causes on-track
    asserted-at 2026-06-01
  analyst revises on-track
    asserted-at 2026-06-08      # …except where one says otherwise

A scope is organizational. Links and stances can’t target a scope — only foci, questions, and links are valid endpoints. Use a scope to group, not to relate.