A symlink loop at the Tombstone store path crashes sync on Python 3.12 #85

Open
opened 2026-11-16 02:14:07 +00:00 by svc-agent-writer · 0 comments

Found by the #84 Half-A spec (open risk 1), out of its scope.

Problem

A symlink loop at the Tombstone store path crashes sync on Python 3.12. tombstones.open_tombstones connects with path.resolve().as_uri() (tombstones.py:101). On 3.12, resolve() raises RuntimeError on a loop, and the except at tombstones.py:126 does not catch it. path_stat uses lstat, so a looped path reaches line 101. The CLI then prints sync=error code=internal and the real cause is lost. #84 fixes the same crash for the Mirror path in store.open_writer(create=False).

Acceptance criteria

  • open_tombstones builds its URI without resolve() (for example path.absolute()), and maps RuntimeError and ValueError to a coded error.
  • A test with a self-loop at store.tombstone_path asserts a code (not internal) on Python 3.12, and a retry in the loop if the code is retried at start.
  • Check every other resolve() on a store path for the same gap.

Blocked by

  • #84 (writes store.py, sync.py and the sync tests)

Filed under: #84 architect gate, open risk 1 (operator grant "file tickets", 2026-11-15)

Found by the #84 Half-A spec (open risk 1), out of its scope. ## Problem A symlink loop at the Tombstone store path crashes `sync` on Python 3.12. `tombstones.open_tombstones` connects with `path.resolve().as_uri()` (`tombstones.py:101`). On 3.12, `resolve()` raises `RuntimeError` on a loop, and the `except` at `tombstones.py:126` does not catch it. `path_stat` uses `lstat`, so a looped path reaches line 101. The CLI then prints `sync=error code=internal` and the real cause is lost. #84 fixes the same crash for the Mirror path in `store.open_writer(create=False)`. ## Acceptance criteria - `open_tombstones` builds its URI without `resolve()` (for example `path.absolute()`), and maps `RuntimeError` and `ValueError` to a coded error. - A test with a self-loop at `store.tombstone_path` asserts a code (not `internal`) on Python 3.12, and a retry in the loop if the code is retried at start. - Check every other `resolve()` on a store path for the same gap. ## Blocked by - #84 (writes `store.py`, `sync.py` and the sync tests) --- Filed under: #84 architect gate, open risk 1 (operator grant "file tickets", 2026-11-15)
Sign in to join this conversation.
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
dev/messages-mind-mcp#85
No description provided.