Background
Indexing-related tests fail on Windows where path comparisons across different canonicalization layers (drive letter case, short-name vs long-name, separator) don't match. Symptoms include `kind=None` where `'memory'` was expected, chunks not getting deleted because their source paths don't compare equal to `memory_dirs`, etc.
Symptoms
```
FAILED test_web_routes.py::TestSources::test_kind_set_when_source_under_memory_dir
AssertionError: assert None == 'memory'
FAILED test_web_routes.py::TestRemoveMemoryDirChunkCleanup::test_delete_chunks_true_removes_matching_source_files
assert 0 == 4
FAILED test_web_routes.py::TestUploadsUsage::test_populated
assert 0 == 2
```
The pattern: chunks have a source path stored at index time; later code compares against a configured `memory_dir`. On POSIX both go through `Path.resolve()` consistently. On Windows, the resolution may differ (drive case, `\\?\\` long-path prefix, short `8.3` form) so equality fails.
Affected files (estimated)
- `packages/memtomem/tests/test_indexing_engine.py` — 11 failures
- `packages/memtomem/tests/test_web_routes.py::TestSources` / `TestRemoveMemoryDirChunkCleanup` / `TestUploadsUsage`
- Possibly: `test_dirty.py`, `test_index_debounce.py`
Fix direction
- Audit the production code that compares `chunk.metadata.source_file` against `memory_dirs` — confirm both go through identical canonicalization (`Path.resolve()` after a consistent normalization).
- Consider storing canonical paths at index time so later comparison is just `==`, no resolve-on-read race.
- Test fixtures may need to use `tmp_path.resolve()` consistently to avoid `8.3` vs long-path mismatches.
Refs
🤖 Generated with Claude Code
Background
Indexing-related tests fail on Windows where path comparisons across different canonicalization layers (drive letter case, short-name vs long-name, separator) don't match. Symptoms include `kind=None` where `'memory'` was expected, chunks not getting deleted because their source paths don't compare equal to `memory_dirs`, etc.
Symptoms
```
FAILED test_web_routes.py::TestSources::test_kind_set_when_source_under_memory_dir
AssertionError: assert None == 'memory'
FAILED test_web_routes.py::TestRemoveMemoryDirChunkCleanup::test_delete_chunks_true_removes_matching_source_files
assert 0 == 4
FAILED test_web_routes.py::TestUploadsUsage::test_populated
assert 0 == 2
```
The pattern: chunks have a source path stored at index time; later code compares against a configured `memory_dir`. On POSIX both go through `Path.resolve()` consistently. On Windows, the resolution may differ (drive case, `\\?\\` long-path prefix, short `8.3` form) so equality fails.
Affected files (estimated)
Fix direction
Refs
🤖 Generated with Claude Code