Integrate dz fixpath for broken dazzlelink recovery
Problem
When a file is renamed or moved within a library, both absolute and relative paths in a dazzlelink become stale. Currently there is no recovery mechanism -- the dazzlelink is simply broken:
$ dazzlelink execute "Taleb - The Black Swan (see Philosophy)"
Error: Target not found via absolute path
Error: Target not found via relative path
Error: All resolution methods failed
Meanwhile, dz fixpath (from DazzleCMD) already has file search, fuzzy matching, and ranking capabilities that could locate the moved file by name.
Proposed solution
Add fixpath as an optional fallback at the end of the execute resolution chain, and a new reconnect command for batch repair.
Execute fallback (step 5, after #13's chain):
1. Try target_path (absolute)
2. Try target_relative (from dazzlelink dir)
3. Try path_representations (UNC, drive)
4. Try dz fixpath --find --fast <filename> <-- NEW
5. Fail with diagnostic message
New reconnect command:
dazzlelink reconnect "D:\M\Literature\Books" # scan and fix broken links
dazzlelink reconnect --dry-run "D:\M\Literature\Books" # report only
dazzlelink reconnect --auto-update "D:\M\Literature" # fix and update dazzlelink JSON
Implementation approach
Phase 1: fixpath as execute fallback
- In
execute_dazzlelink(): after all stored paths fail, extract filename from target_path
- Shell out to
dz fixpath --find --fast --print <filename> or import as library
- If found, open the resolved path
- Optionally prompt user to update the dazzlelink with the new path
Phase 2: reconnect command
- Scan directory for dazzlelink files
- For each, run the resolution chain
- Collect broken links
- For each broken link, invoke fixpath search
- Report results; optionally auto-update
Configuration:
config.fixpath_enabled: Whether to use fixpath fallback (default: true if dz fixpath available)
config.fixpath_search_dirs: Directories to search (default: library root)
config.fixpath_auto_update: Whether to auto-update dazzlelinks when fixpath resolves (default: false, prompt)
Design considerations
- fixpath is an external dependency (DazzleCMD). The integration should be optional -- if
dz fixpath isn't installed, the fallback is skipped gracefully.
- Auto-updating dazzlelinks after fixpath resolution should be opt-in, not default. Moving a file and having all references auto-update is powerful but potentially dangerous.
- The
reconnect command is analogous to dazzlelink check (which reports broken symlinks) but adds the repair capability.
Acceptance criteria
Related issues
Analysis
See 2026-03-30__22-32-33__dazzlelink-relative-paths-for-library-crossrefs.md for detailed design analysis.
Integrate dz fixpath for broken dazzlelink recovery
Problem
When a file is renamed or moved within a library, both absolute and relative paths in a dazzlelink become stale. Currently there is no recovery mechanism -- the dazzlelink is simply broken:
$ dazzlelink execute "Taleb - The Black Swan (see Philosophy)" Error: Target not found via absolute path Error: Target not found via relative path Error: All resolution methods failedMeanwhile,
dz fixpath(from DazzleCMD) already has file search, fuzzy matching, and ranking capabilities that could locate the moved file by name.Proposed solution
Add fixpath as an optional fallback at the end of the
executeresolution chain, and a newreconnectcommand for batch repair.Execute fallback (step 5, after #13's chain):
New
reconnectcommand:Implementation approach
Phase 1: fixpath as execute fallback
execute_dazzlelink(): after all stored paths fail, extract filename fromtarget_pathdz fixpath --find --fast --print <filename>or import as libraryPhase 2:
reconnectcommandConfiguration:
config.fixpath_enabled: Whether to use fixpath fallback (default: true ifdz fixpathavailable)config.fixpath_search_dirs: Directories to search (default: library root)config.fixpath_auto_update: Whether to auto-update dazzlelinks when fixpath resolves (default: false, prompt)Design considerations
dz fixpathisn't installed, the fallback is skipped gracefully.reconnectcommand is analogous todazzlelink check(which reports broken symlinks) but adds the repair capability.Acceptance criteria
executeinvokes fixpath as a last-resort fallback when all stored paths faildz fixpathis not availablereconnectcommand scans a directory for broken dazzlelinksreconnect --dry-runreports broken links without modifying anythingreconnect --auto-updatefixes broken dazzlelinks by updating stored pathsreconnectrepairs broken dazzlelinks in batchRelated issues
Analysis
See
2026-03-30__22-32-33__dazzlelink-relative-paths-for-library-crossrefs.mdfor detailed design analysis.