Skip to main content

REL-NB-004 — Scope autosave state to each notebook

FieldValue
StatusOpen; source-verified and output autosave happy path tested
Architecture stateSource-backed current behavior
SeverityCritical
Affected surfaceMultiple tabs, background execution output, autosave, and refresh
Componentssparqd/oqullus
Associated issueoqullus #518

Where the problem appears​

Edit or execute notebook A, switch to notebook B before autosave runs, and then inspect which notebook was written and which dirty state was cleared.

Concrete observed case​

Workspace holds one provider-level dirty flag and revision counter. The later save serializes the current active tab rather than the tab that became dirty. Background execution output follows the same shared path.

Expected condition​

Each canonical notebook has independent dirty, saved, saving, and failed revisions. A queued save remains bound to that document and snapshot regardless of active-tab changes.

Cause and evidence​

Dirty state is global, while save target resolution happens later from the current active tab. Execution output does not consistently set the affected tab's visible dirty indicator.

Why it matters​

One notebook can remain unsaved while another is overwritten and the shared guard is cleared. Refresh can then discard the intended edit or output.

Existing controls and workarounds​

Remain on one notebook until save completes and manually verify the saved indicator before switching. This does not protect background completion.

Alternatives considered​

  1. Recommended: per-notebook revisions and saveTab operations bound to ID, snapshot, and expected server version.
  2. Lock tab switching during save — rejected because it harms normal notebook use and does not solve background changes.
  3. Keep one global dirty flag — rejected because it cannot represent multiple documents.

Component involvement​

  • sparqd/oqullus owns per-notebook dirty/save state, snapshot binding, background-output targeting, and navigation guards.

Reproduction and verification​

Follow NB-S015 and NB-S016.

Resolution conditions​

Close when edits and output in multiple tabs save only their originating notebook, independent statuses remain correct, and refresh restores both.

Validation and blockers​

The shared-state source path is confirmed. Deployed two-tab request evidence is pending.