Execution and stale cells
Notebook execution is per note. Each .notebook.md file gets its own session,
dependency graph, and generated output state.
Explicit runs
Section titled “Explicit runs”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.
Stale cells
Section titled “Stale cells”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.
Auto-run on edit
Section titled “Auto-run on edit”You can enable automatic stale-cell reruns after edits:
- Open notebook settings and turn on Auto-run stale cells on edit, or
- Set
notebook.autorun: truein note frontmatter
Auto-run is debounced so rapid edits do not trigger a run on every keystroke.
Status bar messages
Section titled “Status bar messages”The notebook status bar reports:
| Message | Meaning |
|---|---|
| Restored generated outputs | Serializable outputs loaded from the app database |
| Outputs recomputed | Cells ran during this session after an explicit run |
| Restored outputs need rerun | Saved state exists but live DOM or inputs need a rerun |
| Worker runtime | Simple notebooks without DuckDB or live DOM |
| In-process runtime | DuckDB, interactive inputs, or trusted DOM outputs |
Persistence model
Section titled “Persistence model”- Source stays in
.notebook.mdon 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.
Safe Mode
Section titled “Safe Mode”When Safe Mode disables notebook execution, run commands show a recovery notice instead of starting the runtime. See Safe mode and Limitations.