Bug Description
When attempting to reindex a file (e.g., `viking://user/wangyd/memories/profile.md`), the lock acquisition fails with error:
```
[POINT] Failed to create lock file: plugin error: failed to open file: Not a directory (os error 20)
```
Root Cause
In `openviking/storage/transaction/path_lock.py:67`:
```python
def _get_lock_path(self, path: str) -> str:
path = path.rstrip("/")
return f"{path}/{LOCK_FILE_NAME}" # LOCK_FILE_NAME = ".path.ovlock"
```
This generates lock path `/local/default/user/wangyd/memories/profile.md/.path.ovlock` for a file path, but `profile.md` is a file, not a directory. Creating a file under a file path causes "Not a directory" OS error.
Expected Behavior
For file paths, the lock file should be placed in the parent directory or use a different naming scheme.
Environment
- OpenViking version: 0.3.14
- Platform: macOS (darwin)
- Python: 3.14
Steps to Reproduce
- Start OpenViking server
- Run `ov reindex 'viking://user/wangyd/memories/profile.md' --wait`
- Observe error: `LockAcquisitionError: Failed to acquire point lock for ['/local/default/user/wangyd/memories/profile.md']`
Suggested Fix
Modify `_get_lock_path` to detect if path is a file and place lock file in parent directory (e.g., `/path/to/.file.md.ovlock`).
Bug Description
When attempting to reindex a file (e.g., `viking://user/wangyd/memories/profile.md`), the lock acquisition fails with error:
```
[POINT] Failed to create lock file: plugin error: failed to open file: Not a directory (os error 20)
```
Root Cause
In `openviking/storage/transaction/path_lock.py:67`:
```python
def _get_lock_path(self, path: str) -> str:
path = path.rstrip("/")
return f"{path}/{LOCK_FILE_NAME}" # LOCK_FILE_NAME = ".path.ovlock"
```
This generates lock path `/local/default/user/wangyd/memories/profile.md/.path.ovlock` for a file path, but `profile.md` is a file, not a directory. Creating a file under a file path causes "Not a directory" OS error.
Expected Behavior
For file paths, the lock file should be placed in the parent directory or use a different naming scheme.
Environment
Steps to Reproduce
Suggested Fix
Modify `_get_lock_path` to detect if path is a file and place lock file in parent directory (e.g., `/path/to/.file.md.ovlock`).