bib: attach_file records unresolved storage_path — P37 worktree left a dead .worktrees/ path on the CY2027 Addendum B attachment #628

Closed
opened 2026-08-17 15:07:49 +00:00 by kert · 0 comments
Owner

Found while executing #625's verification: pfs.nprm._discover_addendum_b('sup:2027_PFS_NPRM') returns /home/kert/stack/.worktrees/p37/data/storage/BIEQHVTM/…xlsx, which no longer exists — P37 ran in a worktree (main was owned by #618), the worktree's data/ pointed at the real data directory, and Store.attach_file stored str(dest) without resolving symlinks (src/bib/store.py:526). The file itself is safe at the canonical data/storage/BIEQHVTM/…; only the recorded path string is dead. Same failure family as #619 (publish_replica symlink resolution).

Audit: exactly 1 affected row (SELECT key FROM attachments WHERE storage_path LIKE '%.worktrees%' → BIEQHVTM).

Fix:

  1. Code: attach_file stores str(dest.resolve()) so future worktree runs record the canonical path (regression test with a symlinked storage dir).
  2. Data: rewrite BIEQHVTM's storage_path to the canonical location.

Blocks the #626 sync only insofar as bib.sync pushes attachments by storage_path — repair before syncing.

Found while executing #625's verification: `pfs.nprm._discover_addendum_b('sup:2027_PFS_NPRM')` returns `/home/kert/stack/.worktrees/p37/data/storage/BIEQHVTM/…xlsx`, which no longer exists — P37 ran in a worktree (main was owned by #618), the worktree's `data/` pointed at the real data directory, and `Store.attach_file` stored `str(dest)` without resolving symlinks (src/bib/store.py:526). The file itself is safe at the canonical `data/storage/BIEQHVTM/…`; only the recorded path string is dead. Same failure family as #619 (publish_replica symlink resolution). Audit: exactly 1 affected row (`SELECT key FROM attachments WHERE storage_path LIKE '%.worktrees%'` → BIEQHVTM). Fix: 1. Code: `attach_file` stores `str(dest.resolve())` so future worktree runs record the canonical path (regression test with a symlinked storage dir). 2. Data: rewrite BIEQHVTM's storage_path to the canonical location. Blocks the #626 sync only insofar as `bib.sync` pushes attachments by storage_path — repair before syncing.
kert added this to the P38: Zotero Rule Sync — upsert tag merge, tag repair, nightly rules scope milestone 2026-08-17 15:07:49 +00:00
kert added the bibdata labels 2026-08-17 15:07:49 +00:00
kert closed this issue 2026-08-17 15:13:23 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: homelab/stack#628