Repository: cppa-cursor-browser
Assignee: Brad @bradjin8
Severity: Medium
Problem
The normalize_file_path function exists in two independent copies: one in utils/path_helpers.py (used by the web app) and one inside scripts/export.py (used by CLI export). Both copies contain Windows-specific logic — backslash normalization, drive-letter lowercasing, file:/// URI handling — but they are maintained independently. A bug fix or enhancement to one copy does not propagate to the other. Since neither copy is exercised on actual Windows in CI (see item 3), divergence between the two implementations is undetectable until a user reports broken behavior on one code path but not the other.
Acceptance Criteria
Implementation Notes
This item is a prerequisite cleanup that naturally feeds into item 1 (full export script refactoring) and depends on item 4 (pyproject.toml) for clean imports. If item 4 is not yet landed, the sys.path.insert hack can temporarily enable the import, but the cleaner sequencing is: item 4 → item 5 → item 1. When deduplicating, compare the two implementations line-by-line to ensure neither has a bug fix the other lacks — merge the best of both into the canonical utils/path_helpers.py version.
References
- Eval finding: test 4
- Cluster:
path-normalization-duplication
- Related files:
utils/path_helpers.py, scripts/export.py (search for def normalize_file_path)
- Compounds: COMPOUND-A (parallel impl blocks utility consolidation), COMPOUND-D (path duplication + single-OS CI)
Repository: cppa-cursor-browser
Assignee: Brad @bradjin8
Severity: Medium
Problem
The
normalize_file_pathfunction exists in two independent copies: one inutils/path_helpers.py(used by the web app) and one insidescripts/export.py(used by CLI export). Both copies contain Windows-specific logic — backslash normalization, drive-letter lowercasing,file:///URI handling — but they are maintained independently. A bug fix or enhancement to one copy does not propagate to the other. Since neither copy is exercised on actual Windows in CI (see item 3), divergence between the two implementations is undetectable until a user reports broken behavior on one code path but not the other.Acceptance Criteria
normalize_file_pathimplementation exists in the codebase (inutils/path_helpers.py)scripts/export.pyimportsnormalize_file_pathfromutils/path_helpers.pyinstead of defining its own copynormalize_file_pathwith Windows-style paths,file:///URIs, percent-encoded characters, and edge cases (spaces,#in paths)scripts/export.py(audit forto_epoch_msand similar)Implementation Notes
This item is a prerequisite cleanup that naturally feeds into item 1 (full export script refactoring) and depends on item 4 (pyproject.toml) for clean imports. If item 4 is not yet landed, the
sys.path.inserthack can temporarily enable the import, but the cleaner sequencing is: item 4 → item 5 → item 1. When deduplicating, compare the two implementations line-by-line to ensure neither has a bug fix the other lacks — merge the best of both into the canonicalutils/path_helpers.pyversion.References
path-normalization-duplicationutils/path_helpers.py,scripts/export.py(search fordef normalize_file_path)