Files
pad/internal
xarmian e9af504cbc test(store): pin DR-15 attachment clone/move/bundle semantics (TASK-2478)
Three store-level pinning tests for PLAN-2392's DR-15 — no behavior changes,
locking down assumptions the copy / move / bundle paths rely on silently:

- Clone independence: a cross-workspace copy mints a fresh, live attachment row
  that shares only the bytes (content hash), and soft-deleting the clone or the
  source never cascades to the other (both directions pinned; there is no
  store-level attachment restore, so delete stands in for the row-separation
  invariant a restore would ride).
- A move charges both workspaces: ArchiveSource soft-deletes only the source
  ITEM; the source attachment rows (the original attached via item_id) stay live
  and their bytes are counted in both workspaces' storage usage. The clones land
  live on the copied item with the variant reparented to the new original.
- Bundle round-trip orphan: WorkspaceAttachmentsForExport includes a live
  attachment whose parent item is soft-deleted, while ExportWorkspace's item list
  excludes that item — the divergence that leaves import unable to remap ItemID
  (handlers_import_bundle.go:479-510), landing the row as an orphan. Pinned as
  known behavior, not fixed.

Dual-dialect (store helpers only; passes under make test-pg). Each pin was
mutation-verified to fail when its behavior regresses (content-hash delete
cascade, archive→attachment cascade by item_id, and an export that stops
excluding soft-deleted items), and reviewed to a fresh-angle CLEAN.

Claude-Session: https://claude.ai/code/session_01WFBYxdBuSZs2tjipATxAZu
2026-08-08 20:03:11 +00:00
..
2026-03-26 01:52:36 +00:00