Skip to content

Execution and stale cells

Notebook execution is per note. Each .notebook.md file gets its own session, dependency graph, and generated output state.

Lapis does not execute notebook cells automatically when you merely open a note. Run work through:

  • Run notebook — execute the note from the status bar or command palette
  • Run cell — inline control on the active cell
  • Rerun stale — rerun only cells marked stale in the dependency closure

Queued and running cells show status in the cell footer. Stop a running cell with the inline stop control on that cell.

When an upstream cell changes, downstream dependents become stale. Stale cells keep their previous outputs visible until you rerun them.

Lazy mode tracks which cells need rerunning without rebuilding unchanged input cells unnecessarily. Input changes rerun downstream cells only and reuse already-satisfied upstream values.

You can enable automatic stale-cell reruns after edits:

  1. Open notebook settings and turn on Auto-run stale cells on edit, or
  2. Set notebook.autorun: true in note frontmatter

Auto-run is debounced so rapid edits do not trigger a run on every keystroke.

The notebook status bar reports:

MessageMeaning
Restored generated outputsSerializable outputs loaded from the app database
Outputs recomputedCells ran during this session after an explicit run
Restored outputs need rerunSaved state exists but live DOM or inputs need a rerun
Worker runtimeSimple notebooks without DuckDB or live DOM
In-process runtimeDuckDB, interactive inputs, or trusted DOM outputs
  • Source stays in .notebook.md on disk.
  • Generated state (outputs, input values, stale flags) lives in the app database keyed by note path.
  • Live DOM (trusted html/svg, mounted inputs) is ephemeral and is rebuilt by rerunning the owning cell when needed.

Use Clear outputs to discard generated state without touching source.

When Safe Mode disables notebook execution, run commands show a recovery notice instead of starting the runtime. See Safe mode and Limitations.