Connected devices limited to one folder or read only, folder identity, duplicate names (#897, v0.6.341) #901

Merged
Cordy merged 25 commits from scoped-devices-897 into main 2026-10-15 02:09:27 +00:00
Owner

Implements #897. Decisions are in comments 9083, 9085, 9087, 9092, 9093 and 9094. Approved mockup: 897-scoped-devices-mockup.html.

Spec: docs/superpowers/specs/2026-10-14-scoped-devices-897-design.md. Plan: docs/superpowers/plans/2026-10-14-scoped-devices-897.md.

What it does

  • Limiting a device: a device can be limited to one folder (the folder becomes its whole drive at /dav/) and/or to read only. The limit is set in Connect a device and changed later with Change access; widening asks the person to confirm it's them. The server enforces the limit, and a device never gets more than its owner has.
  • WebDAV and uploads only: limited devices reach only WebDAV and TUS uploads. One central allowlist sits after authentication, and every other route, present or future, answers 403 device-limited. A golden file pins the allowlist, and a test sweeps the real route table.
  • Folder identity: each bound folder carries a hidden .cairn-folder-<id> marker on the raw driver.
    • The marker is reserved everywhere and never copied. On S3 it is deleted first and written last.
    • An event latch above changes pauses devices before Cairn deletes or moves their folder. Markers are re-checked on each root PROPFIND and daily.
    • Paused states are deleted, moved, no-access and different. A paused device gets 403 device-folder-unavailable, never an empty drive, never a 401. A device in a space being renamed gets 503 device-folder-moving.
    • Recovery:
      • Restore folder: the device resumes by itself.
      • Use the new location: the device follows the moved folder.
      • Use this folder…: adopts a different folder, behind a danger dialog.
  • Read only for everyone: LOCK, POST /api/v1/lock, PROPPATCH and TUS create now refuse read-only targets, including for read-only space members and shares. DAV:current-user-privilege-set is added.
  • Duplicate names: a default name that is already used is numbered. A typed duplicate gets a non-blocking hint in Connect a device and Rename. Approval names are numbered on the server.
  • Bell and audit: the bell gets device-paused items (one per device and state, removed on resume), and the new-device item names the limit. Audit gains app-password-scope-changed, device-paused and device-resumed.
  • Docs: account.md, users-access.md, admin-policy.md, data-protection-operators.md, security-standards.md, spaces.md, spaces-rename.md, deployment.md, SYNC.md, index.md, ARCHITECTURE.md and CHANGELOG v0.6.341.

Process. The work ran as 9 tasks, subagent-driven. Each task had a review, and fix rounds until the reviewer had no open findings; then a whole-branch review with one fix wave and a re-review, and a separate docs review against the code.

Live checks on a local instance (dark theme, against the mockup):

  • connect with a folder and with a shared folder, including the read-only variant;
  • escape attempts over WebDAV;
  • REST refused for limited devices;
  • delete → paused → restore → resumed;
  • move → Use the new location;
  • a replaced folder → Use this folder dialog;
  • Change access;
  • bell items;
  • the Files delete dialog and move line;
  • widening against a session older than 10 minutes: 401 reauth-required, then 200 after confirming.

Tests: go test ./... (59 packages) and 651 web tests pass; -race passes on the new packages; gofmt and vet are clean; no U+2014 in added lines.

Implements #897. Decisions are in comments 9083, 9085, 9087, 9092, 9093 and 9094. Approved mockup: `897-scoped-devices-mockup.html`. Spec: docs/superpowers/specs/2026-10-14-scoped-devices-897-design.md. Plan: docs/superpowers/plans/2026-10-14-scoped-devices-897.md. **What it does** - **Limiting a device:** a device can be limited to one folder (the folder becomes its whole drive at `/dav/`) and/or to read only. The limit is set in Connect a device and changed later with Change access; widening asks the person to confirm it's them. The server enforces the limit, and a device never gets more than its owner has. - **WebDAV and uploads only:** limited devices reach only WebDAV and TUS uploads. One central allowlist sits after authentication, and every other route, present or future, answers 403 `device-limited`. A golden file pins the allowlist, and a test sweeps the real route table. - **Folder identity:** each bound folder carries a hidden `.cairn-folder-<id>` marker on the raw driver. - The marker is reserved everywhere and never copied. On S3 it is deleted first and written last. - An event latch above `changes` pauses devices before Cairn deletes or moves their folder. Markers are re-checked on each root PROPFIND and daily. - Paused states are deleted, moved, no-access and different. A paused device gets 403 `device-folder-unavailable`, never an empty drive, never a 401. A device in a space being renamed gets 503 `device-folder-moving`. - Recovery: - **Restore folder:** the device resumes by itself. - **Use the new location:** the device follows the moved folder. - **Use this folder…:** adopts a different folder, behind a danger dialog. - **Read only for everyone:** LOCK, POST /api/v1/lock, PROPPATCH and TUS create now refuse read-only targets, including for read-only space members and shares. `DAV:current-user-privilege-set` is added. - **Duplicate names:** a default name that is already used is numbered. A typed duplicate gets a non-blocking hint in Connect a device and Rename. Approval names are numbered on the server. - **Bell and audit:** the bell gets `device-paused` items (one per device and state, removed on resume), and the new-device item names the limit. Audit gains `app-password-scope-changed`, `device-paused` and `device-resumed`. - **Docs:** account.md, users-access.md, admin-policy.md, data-protection-operators.md, security-standards.md, spaces.md, spaces-rename.md, deployment.md, SYNC.md, index.md, ARCHITECTURE.md and CHANGELOG v0.6.341. **Process.** The work ran as 9 tasks, subagent-driven. Each task had a review, and fix rounds until the reviewer had no open findings; then a whole-branch review with one fix wave and a re-review, and a separate docs review against the code. **Live checks** on a local instance (dark theme, against the mockup): - connect with a folder and with a shared folder, including the read-only variant; - escape attempts over WebDAV; - REST refused for limited devices; - delete → paused → restore → resumed; - move → Use the new location; - a replaced folder → Use this folder dialog; - Change access; - bell items; - the Files delete dialog and move line; - widening against a session older than 10 minutes: 401 `reauth-required`, then 200 after confirming. **Tests:** `go test ./...` (59 packages) and 651 web tests pass; `-race` passes on the new packages; gofmt and vet are clean; no U+2014 in added lines.
docs: #897 limited devices, paused devices, duplicate names across the handbook; CHANGELOG v0.6.341
All checks were successful
ci / test-and-build (pull_request) Successful in 5m28s
38ff4e4d85
Cordy merged commit 3e8605fd74 into main 2026-10-15 02:09:27 +00:00
Cordy deleted branch scoped-devices-897 2026-10-15 02:09:31 +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#901
No description provided.