Skip to content

fix(cascade): reconcile vanished source paths as deletes#346

Draft
SiyaoZheng wants to merge 1 commit into
EverMind-AI:mainfrom
SiyaoZheng:fix/cascade-vanished-paths
Draft

fix(cascade): reconcile vanished source paths as deletes#346
SiyaoZheng wants to merge 1 commit into
EverMind-AI:mainfrom
SiyaoZheng:fix/cascade-vanished-paths

Conversation

@SiyaoZheng

@SiyaoZheng SiyaoZheng commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Reconcile stale add/modify cascade events as deletes when their source Markdown path has disappeared before processing.

The filesystem watcher can enqueue an add or modify event, then the path can be deleted or replaced before the worker reads it. The resulting FileNotFoundError was treated as a permanent failure, leaving an old row indexed even though the source of truth no longer existed.

The worker now checks the source path when a handler raises FileNotFoundError:

  • if the source path is gone, it runs the handler's idempotent delete path;
  • if the source still exists, it treats the error as recoverable so an unrelated missing dependency is not mistaken for source deletion.

Area

  • Architecture method
  • Benchmark
  • Use case
  • Documentation
  • Developer experience
  • CI, build, or release

Verification

uv run pytest tests/unit/test_memory/test_cascade/test_worker.py -q
24 passed

make ci
1501 unit tests passed; 78 integration tests passed (6 deselected);
lint, architecture contracts, OpenAPI drift, package build, and wheel smoke test passed

Checklist

  • I kept the change scoped to the relevant area.
  • I am opening this from a separate branch, not pushing directly to main.
  • No documentation change is required because the public API and configuration are unchanged.
  • I added or updated tests when the change affects behavior.
  • I did not commit secrets, .env files, dependency folders, or generated output.
  • Active relative links in Markdown files resolve.

Notes for Reviewers

The regression tests cover both the vanished-source reconciliation path and the guard that preserves retry behavior when the source still exists.

By submitting this pull request, I agree that my contribution is licensed under the Apache License 2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant