v0.6.376: links and shares follow their file (#835); purge verbs on the admin tier (#1045) #1052

Merged
Cordy merged 43 commits from lf835 into main 2026-10-31 07:10:26 +00:00
Owner

Closes #835, #1045.

  • Personal links and shares follow renames and moves inside Personal, pause with Deleted files, resume on restore, end on purge or move out (confirmed), and carry an item id so a different item that later takes the path is refused (404, Item replaced).
  • Owner transfer carries links (paused for the new owner, or kept), estate counts, bell; Turn on for handed-over links.
  • Start stamp of existing records (once, claim + read-back).
  • manual-purge and auto-purge are admin-tier audit verbs (#1045).
  • Docs: CHANGELOG v0.6.376, chart appVersion, handbook, ARCHITECTURE.md.

SDD with TDD per task, wave reviews, fix rounds, final whole-branch review + focused re-review of the guard fixes (release-ready).

Closes #835, #1045. - Personal links and shares follow renames and moves inside Personal, pause with Deleted files, resume on restore, end on purge or move out (confirmed), and carry an item id so a different item that later takes the path is refused (404, Item replaced). - Owner transfer carries links (paused for the new owner, or kept), estate counts, bell; Turn on for handed-over links. - Start stamp of existing records (once, claim + read-back). - manual-purge and auto-purge are admin-tier audit verbs (#1045). - Docs: CHANGELOG v0.6.376, chart appVersion, handbook, ARCHITECTURE.md. SDD with TDD per task, wave reviews, fix rounds, final whole-branch review + focused re-review of the guard fixes (release-ready).
scope.Grant gains ItemID; Driver.WithItemGuard is asked for personal
grants in grantFor, grantAt and listSharedOwner. listSharedOwner now
stats and guards the grant resolveShared picks for each name (pickGrant),
so the listing shows exactly what a request reaches.
manual-purge and auto-purge become admin tier (#1045: permanent deletion
is a records event). Existing tests changed:
- tiers842_test.go: auto-purge anchor is now TierAdmin (#1045).
- cmd/cairnd/trashaudit842_test.go: with the access toggle off the
  per-file auto-purge events are now recorded too (#1045).
- verbs1023_test.go: the data export verbs are asserted contiguous and in
  order instead of being the tail of Verbs (#835 appends after them).
RepointGrants and RepointGrantsMulti become RepointPersonal. Existing tests
changed: repoint_test.go, repoint_multi_test.go and spaceshare1035_test.go
TestInSpaceSkippedByCreatorPaths are ported to RepointPersonal keeping every
grant assertion; reason: #835 decision 4, links now move with the grants
(paused for the new owner) instead of staying behind.
The transfer reaches the store through recordRepointer (RepointPersonal),
with a compile-time check that *share.FileStore satisfies it (wave review
S2: the type assertion on the removed RepointGrants answered 501). Records
paused by the departed person's Deleted files end at transfer (share-ended
reason=owner-transfer), never re-pointed (N4). Estate gains links,
transferItems, transferFiles, transferBytes; notify accepts
share-links-handed and share-item-replaced (share-activity).

Existing tests changed: owners_test, owners_scope_test, departed654_test
fakes ported from RepointGrants/RepointGrantsMulti to RepointPersonal
(interface removed in T4); linksBroken assertions in owners_test and
adminshares1035_test become links (decision 4); the shares-scope test
moves the linked item and "nothing shared" needs no record at all
(decision 5); a foreign grant refuses with transfer-record-unmapped.
Existing tests changed: sharereport csv_test.go header gains handedFrom (#835 spec 8,
appended last); spacelink1034_test.go calls loadRows with the new states argument.
- POST /api/v1/rename: a PersonalShareMoveOutError answers 409
  personal-share-move-out {code, error, shares, grants, links, items};
  endShares carries storage.WithEndShares as for spaces.
- writeErr and davError: ErrPersonalShareMoveOut is 403 with
  X-Cairn-Code personal-share-move-out and the error's text.
- DELETE /api/v1/files answers 200 {"deleted","sharesPaused"} (trash on)
  or {"deleted","sharesEnded"} (trash off), counted by the new
  Handler.ShareCount at the backend path before the delete (D-f).
- Deleted files lists carry "shares" {grants, links} per entry from the
  new TrashAPI.EntryShares (personal entries by trash.PersonalEntryID);
  restore answers gain sharesResumed, purges answer 200 {"sharesEnded"}.

Existing tests changed (reason: spec 8 / D-f, the delete and purge
answers are now 200 with a body; the restore body gains sharesResumed):
lifecycle1035_test.go (REST delete 204 -> 200), purgeaudit920_test.go,
purgeaudit926_test.go, restorefeed920_test.go, spacebc935_test.go,
spacedelete935_test.go, spacefinal4_test.go, spacekeys1002s3_test.go,
spacelink1034_test.go, spacepurge964_test.go, spacerestore935fix_test.go,
spacerestore935fix2_test.go, trashaudit911_test.go (purge 204 -> 200),
rename908_test.go and trash911_test.go (restore body gains
sharesResumed).
- personalShareHooks (cmd/cairnd/personalsharehooks.go): personal records
  follow moves inside the Personal folder (moved root re-stamped, D-a), end
  on a confirmed move out, pause/resume/end with Deleted files, end on a
  delete for good; share-ended per record; composeShareHooks gives actrec
  one check (space first) and runs both move and delete hooks.
- itemGuard (cmd/cairnd/itemguard835.go): links and personal grants refused
  on a replaced item are marked, audited (share-item-replaced) and rung once;
  unreadable ids refuse with an hourly WARN; bounded WARN map (4096).
  newItemIDAt/newEnsureItemID read through the stack, then the recovery read.
- stampItemIDs (cmd/cairnd/itemstamp835.go): one-time stamp of existing
  records under the share-itemids.json claim (stale after 15 min).
- scopeGrants drops personal grants paused by Deleted files and passes ID
  and ItemID; statePaths lists share-itemids.json;
  share.EditorBackupName delegates to storage.EditorBackupName.
- main.go wires the hooks, SetPersonalEntryHook, SetOwnerRecords(ownerDrv),
  the public handler's guard fields, scope's WithItemGuard, the bell and
  the stamp after the space registration.
- pathreuse835_test.go: only reuseRig.wire changed; new tests
  TestPathReuse835OutsideCairn and TestSavePatterns835.
- Existing test changed: TestSpaceShareHooksWired now expects the composed
  hooks in main.go (reason: #835 actrec gets the space hooks composed with
  the personal ones; the space hooks are still wired once).
TestCountAt835 expectations change: a record already paused by an earlier
Deleted files entry is no longer counted by CountAt (N4).
Frames D1 to D3, F1 and F2 of the approved mockup: state chips (icon,
text, tip as description) on my links and shares, Copy link dimmed for
paused-trash, item-missing and item-replaced, a grant's state in place of
its role select, "from <person>" on handed-over rows, Turn on (POST
/api/v1/shares/{token}/resume) with focus kept on the row's Copy link,
the Handed over to you filter and notices, the share-links-handed and
share-item-replaced bells, notifPrefShareActivityD as approved.

Existing test changed: web/test/devices900fix.test.js passes lfBellSh to
the lifted renderBell body (renderBell now asks the #835 bells after
shareBellText; the test supplied every other free name already).
Frames A1 to A3, B1, B2 (code text), C1 to C4 of the approved mockup
(pure:links-follow-files), the I18N block after moveOutGo, and the
#1045 tpuAudited and trashRetHint texts with the markup fallbacks.

The share pane's link list now maps the Shares rows' stored path
(/home/<me>/...) to the person's view path and lists links only
(shareLoadLinks matched no Personal link with homes on).

Existing tests changed, with reasons:
- qa693: askDanger gains the focus option; the fact-row dialog count is
  47 (+2: the Personal move-out confirm, the Restore confirm with shares).
- trash908: the person's restore says its line through restoredLine,
  which keeps restoredAsName.
- devices897c: the bulk move also collects the items kept in Personal.
- share1002s2: the Add handler's harness passes shareFollowSync (the
  pane re-checks its follow hint after an Add).
Existing tests changed (reason): xferscope, depoutage (xferFactLinks and
xferFactLinkFrozen retired, spec 11.4); dlgcanon, depoutage (the dialog's
link counts moved into the links-follow-admin block); qa2 (xferScNothing
changed, spec 11.3); xfer-dialog (the harness loads the new block and
xferKeep; one new #835 case).
fix(#835): the space editor backup rule holds only inside the same folder, as the owner records'
All checks were successful
ci / test-and-build (pull_request) Successful in 30m52s
23e72c7ca8
Cordy merged commit ed11e00c89 into main 2026-10-31 07:10:26 +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#1052
No description provided.