v0.6.351: Deleted files and API records (#915, #972, #920, #926, #916, #971 privacy, #963/#976) #984

Merged
Cordy merged 71 commits from fix-b4 into main 2026-10-20 09:44:28 +00:00
Owner

Batch 4 of the backlog run. Decisions on #915, #920, #926 and #971 are recorded on each issue.

What changes

Deleted files and audit

  • #915 / #972: a grantee's actions in a shared folder now name the person who acted: the trash by, the audit user (plus a new owner field), lock checks, leak tracing and device-paused records. Keys, paths and quota are unchanged. The owner's Deleted files row shows the chip "{folder} · {name}".
  • #920:
    • A person's own purge is audited like manual-purge (original path, entry id), and admin manual-purge uses the same format.
    • Restores from Deleted files now reach the change feed as a write, and trash paths never leak into it.

API

  • #926 item 1: a REST rename onto an existing name answers 409 destination-exists unless the request sends overwrite: true. Copy's 409 gets the same code.
  • #926 item 2: .trash is trash only at /.trash and /spaces/<x>/.trash; anywhere else it is an ordinary folder. Creating .trash at a space root, or at the root in flat mode, is refused with name-reserved: 409 on REST, TUS and the drop link, 403 on WebDAV and OCM.
  • #926 item 3: the OCM grant PUT answers each refusal with a proper status and code.
  • #926 item 4: new log.level / CAIRN_LOG_LEVEL setting, which never affects the audit log. The OIDC confirmation line is now INFO, and a missing auth_time gives an hourly WARN.
  • #926 item 5: the dead Claims.Reauthed is removed.

Activity (#916, #971, privacy)

  • Restores: they are recorded in Activity.
  • Keying: Activity is keyed by backend path and translated when read, so no one sees another person's events.
  • Upgrade: existing history is converted once into activity-v2.json.
  • Moves: they carry only history that the new readers could already see.

Storage (#963 / #976)

  • Same name: on s3, a file and a folder can no longer share a name, as on posix. Every write surface maps the refusal to a code.
  • Folder-name probe: the s3 start probe checks how the store answers a HEAD of a folder name.

Process

  • Tasks A to F, each reviewed with fix rounds.
  • Final whole-branch review, three final fix rounds, then a last review with the verdict "ready to release".
  • Every package passes. -race runs on the batch-4 tests; go vet, gofmt and the web checks pass; no U+2014.
  • The SDD trail is in .superpowers/sdd/2026-10-19-batch4/.

Follow-ups filed: #971 (part), #973, #974, #975, #977, #978, #979, #980, #981, #982, #983, and notes on #742.

Release gate: a live screenshot OK for the #915 chip.

Batch 4 of the backlog run. Decisions on #915, #920, #926 and #971 are recorded on each issue. **What changes** **Deleted files and audit** - **#915 / #972:** a grantee's actions in a shared folder now name the person who acted: the trash `by`, the audit `user` (plus a new `owner` field), lock checks, leak tracing and device-paused records. Keys, paths and quota are unchanged. The owner's Deleted files row shows the chip "{folder} · {name}". - **#920:** - A person's own purge is audited like `manual-purge` (original path, entry id), and admin manual-purge uses the same format. - Restores from Deleted files now reach the change feed as a `write`, and trash paths never leak into it. **API** - **#926 item 1:** a REST rename onto an existing name answers 409 `destination-exists` unless the request sends `overwrite: true`. Copy's 409 gets the same code. - **#926 item 2:** `.trash` is trash only at `/.trash` and `/spaces/<x>/.trash`; anywhere else it is an ordinary folder. Creating `.trash` at a space root, or at the root in flat mode, is refused with `name-reserved`: 409 on REST, TUS and the drop link, 403 on WebDAV and OCM. - **#926 item 3:** the OCM grant PUT answers each refusal with a proper status and code. - **#926 item 4:** new `log.level` / `CAIRN_LOG_LEVEL` setting, which never affects the audit log. The OIDC confirmation line is now INFO, and a missing `auth_time` gives an hourly WARN. - **#926 item 5:** the dead `Claims.Reauthed` is removed. **Activity (#916, #971, privacy)** - **Restores:** they are recorded in Activity. - **Keying:** Activity is keyed by backend path and translated when read, so no one sees another person's events. - **Upgrade:** existing history is converted once into `activity-v2.json`. - **Moves:** they carry only history that the new readers could already see. **Storage (#963 / #976)** - **Same name:** on s3, a file and a folder can no longer share a name, as on posix. Every write surface maps the refusal to a code. - **Folder-name probe:** the s3 start probe checks how the store answers a HEAD of a folder name. **Process** - Tasks A to F, each reviewed with fix rounds. - Final whole-branch review, three final fix rounds, then a last review with the verdict "ready to release". - Every package passes. `-race` runs on the batch-4 tests; `go vet`, gofmt and the web checks pass; no U+2014. - The SDD trail is in `.superpowers/sdd/2026-10-19-batch4/`. **Follow-ups filed:** #971 (part), #973, #974, #975, #977, #978, #979, #980, #981, #982, #983, and notes on #742. **Release gate:** a live screenshot OK for the #915 chip.
User restore records the path the restore answers (their home as /home, a
space by its current name); Administration > Deleted files restore now
records too, on the path the entry's owner sees; a deleted space's restore
on /spaces/<current name>. The audit events keep the backend path.
507 quota-exceeded, 423 legal-hold, 423 locked, 403 read-only (also the
read-only share's own refusal), with the fixed text in the plain body the
grant surface already uses. Every refusal and the remaining 500 now log
one WARN per share and code per minute.
#907 moved the confirmation decision to Claims.Confirms, which a Sign in
again that passed its auth_time checks always sets; nothing read Reauthed
after that. Tests that set or asserted it now use Confirms.
A file moved onto a folder's name, or a folder onto a file's, is refused
on both backends (the REST half of #963). Case-only renames stay allowed,
also on a case-insensitive store. The two #908 tests that replace through
REST rename now send the explicit overwrite.
The /shared overlay runs the layers below it with the grant owner's
identity (keys, paths, quota), and the person who acted was lost: the
trash entry said by=<owner> and the audit line user=<owner>. The swap now
keeps the person beside the owner identity (auth.User.Actor, read through
auth.ActorOf). The audit decorator records user=<person> and the new
owner field when the identity differs; the trash entry records
by=<person> and still lands in the owner's trash. Keys, paths and quota
are unchanged. share-grant-read/-write lines keep being written (D3 a).
The lock check compared the identity below scope, which a share grant
has swapped to the owner: a grantee passed the owner's lock, and a lock
the grantee took through /shared (recorded for the grantee by the lock
API, WebDAV and WOPI) blocked the grantee's own writes. It now compares
auth.ActorOf, the person acting.
The audit log (month files and audit.stdout) never depends on it; a test
holds that at error level.
The lines carry user and reason only. The #907 tests that read the line
at DEBUG now read it at INFO (and the WARN for no auth_time).
The owner's row gets the chip space rows already use, "{folder} · {name}"
(the item's parent folder as the owner sees it, the deleter's display
name), with "Deleted by {name}" on hover in EN, DE, FR and IT. The
viewer's own deletions show no chip. Administration > Deleted files
already shows by for personal rows and is unchanged.
Review B fix round 1:
- marks: a download through /shared is recorded for the person who
  downloaded (auth.ActorOf), not the folder owner.
- devicebind: the latch's `by` (device-paused audit row and WARN) is the
  person acting, else "system".
- trash: "refused a change inside a trash tree", "refused the reserved
  name .trash" and "trash: refused" log user=<person> and owner=<identity
  below scope> when it differs, as the audit line does.
- audit: the Owner comment says who it is for a space-folder grant.
- tests: rig tests on posix/s3, encryption off and on (ledger, transition,
  log lines, grantee rename through a lock); WOPI LOCK+PutFile and WebDAV
  LOCK+PUT through /shared (posix, s3, encrypted); ActorOf and asOwner
  nesting unit tests. The stacktest rig exposes the marks layer.
Activity was keyed by the path the person saw, so every person's
/home/x.txt shared one history (who, what, when) and a rename moved
everyone's. Events are now recorded under the backend path the
person's path resolves to (actrec, the trash restores of #916, user and
administrator) and the drill-down answers the events of the caller's
backend path under the caller's own path, as the change feed does:
owner and grantee of a shared folder see one history, two people's
same-named files never share one.

- Renames through any surface rekey by backend path in actrec; the
  REST route no longer rekeys view paths.
- Space renames: a read also finds the file under the space's former
  folders (registry names and aliases, never another space's folder),
  so events from before the folder converged still show.
- Upgrade: a file from before is migrated once (marked "keys":
  "backend"): home events to the actor's own home, space events to the
  space's folder, restore and share events kept (already backend
  paths); /shared views and unknown spaces are dropped with a WARN.
- pathAs (an administrator's restore mapped to the owner's view) is
  gone: the record is the backend path (review-a findings 1, 5).
- Tests: posix and s3, two users with same-named files incl. an admin
  restore, shared folder, file/folder rename, space rename across
  convergence, numbered restore (review-a finding 6), upgrade.
CHANGELOG v0.6.351 (Security, Fixes, Operations with every new and changed
log line, Upgrade notes with Rollback); sharing, file-browser, change-feed,
data-protection-operators, admin-policy, deployment (log.level, S3 name
checks and boot probe, .trash, acting person, Activity), users-access,
spaces, spaces-rename, spaces-quota, account, document-editing,
federation-ocm, leak-tracing, SYNC, VERSIONING, ARCHITECTURE, README.
Limits stated with #973, #974, #975, #977, #978, #979, #980.
- Activity move rule as implemented (#971): a rename in the same folder
  keeps all; a move to another folder carries only the mover's and, in a
  home, the owner's events; homes off carries all (CHANGELOG,
  file-browser, sharing, spaces, deployment, ARCHITECTURE)
- #981 known limits (re-created account, ownership transfer)
- log.level in any case; s3 folder-name probe retry and inconclusive WARN;
  request cost beyond seven parent levels
- upload link page words destination-exists and name-reserved
- rollback notes: .trash re-hidden (sync clients, locks, owner records),
  grantee locks (final review 6)
- Purge log lists admin and automatic purges only (final review 10)
- third-party tus clients and 409 (final review 11)
- corrected: Use this folder text, pre-#768 Activity window, .trash sync
  pickup and peer 423 handling marked client-dependent / not verified,
  old space grants dated (before v0.6.215)
- planPersisted: a convergence plan that rests on the old folder being
  gone (folder-missing) is made again on the registry as persisted, read
  after the folders were checked. A second instance whose cache predated
  another instance's move answered folder-missing (WARN, audit
  space-converge-failed, inventory row, its bound devices left Moving)
  for a rename that had finished; it now answers finished, or finishes
  the recorded move (stepFinish).
- spaceids.DropMove: the copies-left refusal clears MovingTo and records
  its reason in one write, only while the record on disk is the rename
  this instance tried. Clearing MovingTo first refreshed the cache, so
  copies-left landed on a record another instance had converged.
- TestConvergeTwoInstancesRandom931: a finished move the registry lost to
  the other instance's concurrent write (last writer wins, no
  compare-and-swap, the documented single-writer limit) is finished by
  the administrator's Finish rename, as TestConvergeLostRegistryUpdateFinish931
  shows deterministically.
- spaceids.DropMove and SetConvergeFailure take the attempt's record and
  write only while the registry still shows that rename (name, folder)
  with that MovingTo. They compared with this instance's cache, which any
  registry read or write refreshes while a move copies: copies-left could
  land on a record another instance converged, and a later rename's
  MovingTo and folder markers could be erased. updateDiskLocked no longer
  passes the cached record.
- planPersisted also re-plans on the record as persisted when the cached
  record holds a MovingTo: a MovingTo another instance dropped (copies-left,
  folder-exists) no longer leads a system attempt to merge into, or adopt,
  a folder holding what the move did not make.
- convergeAs checks the space for deletion again on the re-planned record.
- Inventory: one registry read per page for the rows that rest on the
  cache, after every row's folders were checked; a failed read keeps the
  cached plan, so folder-missing is never hidden.
- TestConvergeTwoInstancesRandom931 accepts only the lost update's own end
  state (one attempt finished, the other copies-left; the registry shows
  the old folder, no MovingTo, copies-left).
Cordy merged commit 0ac70c9742 into main 2026-10-20 09:44:28 +00:00
Author
Owner

Status (2026-10-20): v0.6.351 is merged and tagged, the image is built, and both dogfoods are bumped (homelab-config 3336a8d). Both started cleanly on v0.6.351.

Activity conversion at first start (#971):

  • files: 48 entries kept.
  • files-bao: 99 kept; 7 dropped because they could not be attributed to one person's file.

S3 folder-name probe (files-bao): no WARN, so Garage answers HEAD of a folder name with 404.

Still open (Nikola signs in on both instances):

  • The live check, including the #915 chip screenshot for Nikola's OK.
  • Removing the test data afterwards.
  • Result comments on, and closing of, #916, #915, #972, #920, #926, #971, #963, #976.
**Status (2026-10-20):** v0.6.351 is merged and tagged, the image is built, and both dogfoods are bumped (homelab-config 3336a8d). Both started cleanly on v0.6.351. **Activity conversion at first start (#971):** - files: 48 entries kept. - files-bao: 99 kept; 7 dropped because they could not be attributed to one person's file. **S3 folder-name probe (files-bao):** no WARN, so Garage answers HEAD of a folder name with 404. **Still open (Nikola signs in on both instances):** - The live check, including the #915 chip screenshot for Nikola's OK. - Removing the test data afterwards. - Result comments on, and closing of, #916, #915, #972, #920, #926, #971, #963, #976.
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#984
No description provided.