v0.6.401: #742 Step 0 (start lock, key file, versioned state saves, editor sessions, settings conflicts, folder copy keeps history) #1138

Merged
Cordy merged 86 commits from st742 into main 2026-11-06 14:10:17 +00:00
Owner

#742 Step 0. Running more than one Cairn process on one storage root is still not supported; this release makes one process safe by construction and refuses a second.

  • Start lock: flock + heartbeat on the state directory and on the POSIX data root (compared by file identity); on S3 a sealed lock object. A failed read never takes over a live lock (refused after about 10 s); a lock sealed to other keys is taken over only after it stood still for 130 s; a process whose lock was taken over exits; release deletes only its own lock.
  • Instance key file instance-keys.json (WOPI and OIDC state purposes); sealed OIDC state cookie; WOPI kid.payload.sig tokens survive a restart; admin "End all editor sessions".
  • Versioned state saves (UpdatePath/SaveIfPath) for every read-merge-write store; spaces and quotas re-read every 10 s; guard test against whole-file state writes (one allowlisted pod-local writer); two-process soak behind -tags soak742; key drain re-seals version-checked.
  • Settings PUT 409 settings-changed / 428 settings-version-required; lock-held 409; editor-key-unavailable 503; last-admin floors decide on admins.json as stored (503 state-unreadable if unreadable).
  • Local delete: disable, remove app passwords, remove account; a deleted local account's devices are refused in every auth mode.
  • Change journal writer guard (new feed epoch when another process wrote it).
  • #950: a folder copy keeps each file's version history (S3 cost follow-up #1135).

Reviews: W1-W3, final, two focused re-reviews of the lock fixes (last: release-ready). Residuals listed in ARCHITECTURE.md "What Step 0 does not yet do".

#742 Step 0. Running more than one Cairn process on one storage root is still **not** supported; this release makes one process safe by construction and refuses a second. - **Start lock**: flock + heartbeat on the state directory and on the POSIX data root (compared by file identity); on S3 a sealed lock object. A failed read never takes over a live lock (refused after about 10 s); a lock sealed to other keys is taken over only after it stood still for 130 s; a process whose lock was taken over exits; release deletes only its own lock. - **Instance key file** `instance-keys.json` (WOPI and OIDC state purposes); sealed OIDC state cookie; WOPI `kid.payload.sig` tokens survive a restart; admin "End all editor sessions". - **Versioned state saves** (`UpdatePath`/`SaveIfPath`) for every read-merge-write store; spaces and quotas re-read every 10 s; guard test against whole-file state writes (one allowlisted pod-local writer); two-process soak behind `-tags soak742`; key drain re-seals version-checked. - **Settings** PUT 409 `settings-changed` / 428 `settings-version-required`; `lock-held` 409; `editor-key-unavailable` 503; last-admin floors decide on admins.json as stored (503 `state-unreadable` if unreadable). - **Local delete**: disable, remove app passwords, remove account; a deleted local account's devices are refused in every auth mode. - **Change journal** writer guard (new feed epoch when another process wrote it). - **#950**: a folder copy keeps each file's version history (S3 cost follow-up #1135). Reviews: W1-W3, final, two focused re-reviews of the lock fixes (last: release-ready). Residuals listed in ARCHITECTURE.md "What Step 0 does not yet do".
Legal holds, the user/WebDAV/editor lock store, notify-seen and the OCM servers, contacts and shares-in documents apply each change to the document as stored now through statestore.UpdatePath (version-checked, retried on conflict); side effects (released hook, notice hooks, rename marks) run once after the save. Holds and locks re-read their document at most every 10 s (spec 5, A6). filelock.PutIf/ErrLockChanged: WebDAV LOCK answers 423, the manual lock API 409 lock-held, the WOPI lock machine 409 with the current token. WebDAV and WOPI UNLOCK remove only the lock they decided on.
# Conflicts:
#	CHANGELOG.md
#	deploy/chart/Chart.yaml
Cordy merged commit 78c814d79d into main 2026-11-06 14:10:17 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#1138
No description provided.