Worked Examples
Apply persistent saved state — Workspace
Apply persistent saved state — Workspace Application: Workspace Status: Useful first draft, not a production-verified procedure. Purpose Record draft changes, revisions and outputs against durable identifiers. Use this workflow on
Application: Workspace
Component: Project persistence, account backups, local-first sync and revision recovery
Article type: Apply / procedure
Status: Source-reviewed guidance; production behavior not independently verified
Estimated reading time: 16 minutes
Source baseline: 04f28743751634ed0bc64a5028290b4d29119400 (November 20, 2026)
Summary. Workspace saves local working state separately from authenticated account backups and revision-controlled synchronization. A save is confirmed only after the intended project can be retrieved under the correct identity, with its expected revision, fingerprint and linked outputs intact.
1. Goal
Record drafts, project revisions, notebook work and associated outputs against durable identifiers, then establish that the saved state survives reopening and is visible only to the authorized owner. The primary acceptance condition is a fresh session retrieves the same authorized project state; it is not satisfied by a “Saved” label alone.
2. Requirements
- The intended Workspace deployment or isolated staging instance, including which persistence mode is enabled and the current release identifier.
- The correct project ID and owner context; for backend operations, an authenticated Workspace identity with access to that project.
- A separate backup or export of significant local drafts before testing sync, restore, import or deletion.
- The expected project revision and a project fingerprint from the authoritative store; do not substitute a whole-package fingerprint.
- For downstream work: notebook IDs, dataset or artifact IDs, source hashes, rights status and the publication state of each output.
- A second session or clean test client under the same authorized identity; a different account is required for the negative isolation test.
3. Choose the persistence authority
The inspected implementation includes several storage modes. They are not interchangeable, and the presence of an account session does not imply that browser-local work has automatically moved to the server.
| Layer | Authority and behavior | Acceptance evidence |
|---|---|---|
| Browser-local Workspace | localStorage["sc_workspace"] holds the canonical browser-local payload. The extracted persistence runtime uses verified read-after-write, an auxiliary journal and last-known-good recovery. |
Reload the same browser profile; inspect integrity status. Browser-local success alone does not establish cross-device availability. |
| Manual account backup | POST /v1/projects with sc-workspace-cloud-backup/1.0 persists an owner-scoped copy. There is no automatic upload. |
Confirm the server project listing and an authenticated GET of the saved package. |
| Enrolled project synchronization | sc-workspace-sync-push/1.0 and POST /v1/sync/envelopes carry revision conditions and operation IDs. Stale writes yield 409. |
Verify new server revision, receipt, and fresh-session read-back; resolve conflicts explicitly. |
| Notebook and research outputs | Notebooks have their own persistence endpoints; research figures, documents and publication drafts have distinct specialist stores and approval boundaries. | Check each object ID and associated project; a project save does not prove every external artifact was saved. |
| Historical restore points | Browser-local version history uses copy-based restore. Backend project revisions are retrievable separately. | Compare the chosen historical revision and confirm restore did not silently overwrite an active project. |
Source: canonical browser persistence runtime, revisioned backend repository, authenticated project and sync routes.
4. Identify the state before saving
- Open the exact project and record its stable
projectId, title, owner context and visible state. Avoid identifying a project by title alone. - Record its current browser-local revision and the most recent accepted server revision, if enrolled. Capture the last trusted server fingerprint separately from any package hash.
- Inventory notebooks, datasets, documents, figures, citations and draft outputs; identify whether each item is local, server-backed or a separately governed reference.
- Identify outstanding local-only mutations. Preserve a private project export before any risky reconciliation.
- Check that the intended user is permitted to store or retrieve this project. A visible menu action is not itself proof of authorization.
5. Procedure — save browser-local work
- Make a small, reversible change to a synthetic or authorized project, such as updating a descriptive note.
- Allow the normal Workspace save to complete. The extracted persistence runtime writes the canonical payload, reads it back and records integrity metadata.
- Reload the same browser profile and confirm the note, project ID and linked object IDs remain present.
- If an integrity warning appears, stop editing and export the current readable candidate and any last-known-good candidate before deciding on recovery. Do not let an automated repair overwrite readable state.
The sc_workspace key and the last-good/recovery design are documented in Persistence, Corruption & Recovery Integrity. The later canonical state boundary delegates read/write transactions to a dedicated persistence runtime. Internal storage keys are implementation details, not a recommendation to alter them manually.
6. Procedure — create a manual account backup
- Use the account backup workflow only after confirming an authenticated owner and the correct project. In the documented local-first flow, this is an explicit Back up now operation, not sign-in-triggered synchronization.
- Submit the project in the manual-backup mode supported by the selected release. A backend integration uses
POST /v1/projectswith schemasc-workspace-cloud-backup/1.0,sourceProjectIdand the project document. - Confirm a successful response, then perform
GET /v1/projectsandGET /v1/projects/{project_id}under the same authorized account. - Retain the server
revision,projectFingerprint, storage mode and the precise backup timestamp. Do not infer notebook or publication persistence from this response. - Do not use manual backup to replace an active sync head. The backend explicitly rejects that transition with HTTP 409.
{
"schema": "sc-workspace-cloud-backup/1.0",
"sourceProjectId": "synthetic-project-01",
"projectTitle": "Synthetic study",
"project": {"schema": "sc-workspace-project/20.0",
"id": "synthetic-project-01", "title": "Synthetic study",
"objects": []}
}
This minimal document illustrates a server request shape, not a promise that an arbitrary release accepts every field arrangement or that the site exposes a browser-callable endpoint. Authentication belongs to the configured WordPress proxy or Workspace session; never place a service token in public article examples.
7. Procedure — sync an enrolled project
- Confirm that the project is enrolled in the release-specific account sync workflow. Compare the local and server heads before making a write decision.
- Retain the current
baseRevision, optionalbaseFingerprint, stableoperationIdandenvelopeId. Retry an unobserved operation with the same identifiers rather than generating a new mutation. - Apply a project or notebook
putthrough the local-first envelope interface. Check the returned status and persisted receipt. - If the server replies 409, stop: inspect
base-revision-mismatchorbase-fingerprint-mismatch, rehydrate the canonical head, and select a human-controlled recovery option. Do not silently overwrite either branch. - After an applied response, retrieve the new server head and confirm its revision and fingerprint from a separate authorized session.
{
"schema": "sc-workspace-sync-envelope/1.0",
"envelopeId": "synthetic-envelope-01",
"operationId": "synthetic-operation-01",
"deviceId": "synthetic-device-01",
"objectKind": "project",
"objectId": "synthetic-project-01",
"baseRevision": 1,
"baseFingerprint": "<server-project-fingerprint>",
"mutation": {"action": "put", "title": "Synthetic study",
"document": {"schema": "sc-workspace-project/20.0",
"id": "synthetic-project-01",
"title": "Synthetic study", "objects": []}}
}
Replace the explanatory fingerprint placeholder with an authentic value from an authorized synthetic server head before making a staging request. The payload above is illustrative and must not be posted to production. The backend permits object kinds project and notebook; it does not automatically merge conflicting scientific content.
Source: local-first sync implementation and sync-envelope schema.
8. Verify saved state from a fresh session
- End the current test session or open a clean client; authenticate again as the same authorized owner. For browser-local state, use a reload in the same browser profile and record that this is local continuity, not server recovery.
- Retrieve the server project index with
GET /v1/projects; match the exact project ID, not a similarly titled record. - Fetch
GET /v1/projects/{project_id}. Confirm owner context,revision,storageMode,projectFingerprintand object count against the accepted save receipt. - For server historical revisions, retrieve
GET /v1/projects/{project_id}/revisions, then the exact revision endpoint. Check that older revisions are unchanged. - Retrieve notebooks separately with
GET /v1/notebooksandGET /v1/notebooks/{notebook_id}as applicable; verify they still refer to the intended project. - Use a second, unauthorized account in disposable staging to establish that the same project ID does not reveal private data. Never use genuine research files for an authorization-negative test.
Important: an API response 200 is evidence that a request succeeded under a particular identity; it is not scientific validation, nor does it establish that every linked output is current or published.
9. Keep drafts, notebooks, figures and publication outputs distinct
A saved project package may reference objects managed in their own authoritative services. The project ledger, Notebook Desk, artifact store, Reporting Studio and publication controls should be checked separately. Preserve stable IDs, source revision/hash, actor context and attachment links. When notebook code or a figure changes, confirm the new output is associated with the correct input dataset and method revision. A private publication draft remains private until the separate approval and release workflow is completed.
| Object | Identity to verify | Do not assume |
|---|---|---|
| Project | projectId, owner, revision, fingerprint |
That all linked notebooks or research artifacts were persisted |
| Notebook | notebookId, projectId, revision |
That a notebook save synchronized every execution output |
| Dataset / file | Artifact ID, project ID, immutable checksum, rights | That a filename uniquely proves identity |
| Figure / report | Source IDs, method revision, figure or document identifier | That the displayed image is reproducible or reviewed |
| Publication | Output ID, binding, publication stage and approval evidence | That stored = approved or publicly released |
10. Understand revision conflicts and idempotent retries
The backend stores project revisions by owner and project ID. Sync writes require the expected revision; a mismatch returns HTTP 409 and identifies the current revision. A replay with the same recognized operation ID may return the existing result instead of incrementing again. For the local-first envelope protocol, an accepted replay returns a durable receipt; a previously conflicted envelope remains a conflict on replay. A manual backup cannot replace an active synchronization head.
# Read-only, synthetic checklist (illustrative, no live credentials):
GET /v1/projects
GET /v1/projects/synthetic-project-01
GET /v1/projects/synthetic-project-01/revisions
GET /v1/sync/bootstrap
GET /v1/sync/receipts
# Never repeat a rejected write with newly generated operation IDs.
11. Detect interrupted or corrupted browser saves
The browser persistence runtime records a write journal, a read-after-write result and an optional last-known-good snapshot. A journal left after interruption does not automatically authorize replacement of the current payload. A readable state with unexpected fingerprint drift is retained for review; the lightweight FNV-1a integrity marker is a drift detector, not a cryptographic signature. If a recovery candidate is exported, treat it as sensitive project content, whereas a metadata-only diagnostic should omit project content.
- Capture a sanitized diagnostic first; include symptom, release, browser and timestamps, but not research content, cookies or credentials.
- Export readable current and last-known-good candidates to restricted storage where supported.
- Record source and candidate fingerprints; do not import an unverified candidate over the only surviving copy.
- Attempt recovery in isolated staging, restore as a new copy when the supported workflow requires it, and compare both copies before choosing one.
12. Use copy-based restore and retained revisions
Historical local restore points are copy-based and remap project, object and relationship identifiers instead of overwriting the current project. Backend revisions can be retrieved as historical packages, but downloading an old package is not permission to force it over a newer sync head. Document whether a recovered project is a new local copy, a deliberate server reconciliation or a read-only historical inspection.
Source: Project Version History & Restore Points and Conflict-Safe Recovery.
13. Reproducible evidence check — synthetic only
The accompanying package includes verify_saved_state.py and synthetic-observations.json. It compares two independently recorded metadata observations, checks project identity, owner scope, project fingerprint, revision, notebook and artifact linkage, and confirms a supplied synthetic file digest. It cannot verify that a genuine fresh authentication occurred; a test operator must provide that external evidence.
python3 verify_saved_state.py synthetic-observations.json
python3 -m unittest -v test_verify_saved_state.py
# The fixture should return metadata-consistent-not-auth-verified.
{
"save": {"projectId": "synthetic-project-01", "revision": 2,
"projectFingerprint": "<64 lowercase hex digits>",
"storageMode": "sync-head", "objectCount": 2},
"readBack": {"projectId": "synthetic-project-01", "revision": 2,
"projectFingerprint": "<same 64 hex digits>",
"storageMode": "sync-head", "objectCount": 2}
}
These two objects are an excerpt of the fixture, not a live Workspace response; the full fixture includes owner and fresh-session declarations plus notebook and artifact evidence. The checker returns a structural assessment, not a determination of user authentication or independent scientific correctness.
14. Negative test matrix
| Test | Expected behavior | Evidence to retain |
|---|---|---|
| Different signed-in owner | The private project is not disclosed; the service may return 404 or an empty owner-scoped listing. | Status code and sanitized owner-scope label |
Stale expectedRevision |
HTTP 409; canonical server head remains unchanged. | Current revision and a redacted conflict receipt |
Wrong baseFingerprint |
Envelope returns 409 with a typed conflict and rehydration required. | Conflict reason; last accepted fingerprint |
| Same operation retried | Recognized replay does not apply a second mutation. | Original operation ID and replay indicator |
| Manual backup over sync head | HTTP 409; the sync head is retained. | Before/after revision and storage mode |
| Interrupted local save | Readable current and last-good candidates are preserved for human review. | Metadata-only persistence diagnostic |
| Notebook references wrong project | Do not claim complete continuity; correct the association through the authoritative owner. | Notebook ID, project ID and revision |
| Draft mistaken for publication | Retained private state; no public release without governance step. | Publication stage and approval receipt |
| Restore of older revision | Creates an authorized copy or explicit reconciliation, without silent overwrite. | Source/current/restored identifiers and fingerprints |
15. Symptoms
- A project appears saved but is absent after sign-in on another device.
- A newly reopened project shows an older revision, or a second browser has different data.
- A save or sync produces HTTP 409; the server reports another revision.
- A project appears but notebooks, figures, attachments or private drafts do not.
- The browser reports integrity drift, an interrupted write or a recovery candidate.
- A backup action succeeds, but the intended account or project ID cannot retrieve the result.
16. Cause
Typical causes differ by persistence mode: (1) browser-local changes were never explicitly backed up; (2) the user is viewing another owner account or a different project ID; (3) revision or fingerprint checks rejected an outdated push; (4) an interrupted operation completed server-side but the browser never observed its receipt; (5) browser storage is damaged or full; or (6) an object belongs to an independent specialist store and was not persisted with the project. Diagnose the failing layer before selecting recovery.
17. Troubleshooting
- First identify the exact mode: local, manual backup, or revisioned sync. Verify the project ID and expected owner.
- For a local-only absence, inspect the same browser profile and local integrity diagnostics. A different device is not a valid test of browser-local storage.
- For a server absence, use a fresh authorized GET of the project index and exact project ID. Do not copy credentials into log files.
- For 409, compare last accepted server revision and fingerprint; preserve both branches and obtain a fresh head.
- For an unobserved write, inspect receipts with the same operation identifiers before retrying; never issue a new mutation merely because the UI timed out.
- For missing notebooks or artifacts, query the appropriate specialist store; compare project IDs, artifact hashes and revisions.
- For a failed restore, isolate the candidate and avoid deleting the only surviving version. Escalate with a sanitized incident packet.
18. Resolution
Use the smallest reversible correction that matches the diagnosed layer. Reload and reopen the same local project for browser-only recovery; back up explicitly for account continuity; rehydrate and perform a human-controlled merge or copy-based restore after 409; and reattach missing objects only through their authoritative services. A successful resolution includes a fresh-session read, a matching project identity, accepted revision and fingerprint, intact linked outputs, and a negative owner-isolation test in authorized staging.
19. Verification
Pass criteria: a read under the same authorized account returns the expected project ID, revision and project fingerprint, with the saved changes present; notebooks and artifacts match their authoritative references; a different account cannot access the project; history remains available; no unintended publication occurs. Mark partial if only local reload or synthetic structural checks passed. Mark unverified if a fresh authenticated session, deployed revision or database recovery test was not performed.
Evidence packet: source commit and deployment version; sanitized owner identifier; project ID or safe surrogate; save mode; operation ID where relevant; before/after revision and fingerprint; fresh-session proof; notebook and artifact checks; negative test result; rollback/restore decision; reviewer sign-off. Do not include raw bearer tokens, private research data, cookies, email addresses or access secrets.
20. Governance, rights and scientific integrity
Persistent storage supports continuity, not scientific correctness. Store method versions, source rights and provenance at the object level; record the difference between a draft, an editorially reviewed output, a scientific finding and an authorized publication. A checksum shows that particular bytes match a known digest; it does not prove that the data were lawfully acquired, that a calculation is valid, or that the output should be released. Keep deletion and off-host recovery separate from ordinary save testing.
21. Technical References
- Canonical browser persistence runtime and storage keys
- Canonical State & Persistence Boundary
- Persistence and Corruption Recovery Integrity
- Workspace HTTP routes for projects, revisions, notebooks, and sync
- Revisioned owner-scoped project and notebook persistence
- Sync envelopes, replay protection and conflicts
- ProjectStoreRequest and LocalFirstSyncEnvelope schemas
- Conflict-Safe Recovery
- Version History and Restore Points
- Existing source-level sync tests
22. Knowledge Base verification and release metadata
Source reviewed: 04f28743751634ed0bc64a5028290b4d29119400. Verified locally: companion checker and synthetic fixtures only. Not verified: currently deployed UI paths, production database migrations, real authenticated fresh-session recovery, automated disaster recovery, and independent scientific review. The source baseline is not a substitute for the installed WordPress plugin version or a release acceptance receipt.
Suggested component: Workspace → Persistence & Recovery. Publication status: source-reviewed support documentation, pending staging and production verification. Record the exact WordPress revision and deployed application version through the Knowledge Base release-verification process.
