Skip to content

Reconcile indexed symlinks retargeted outside the workspace in watch mode #5120

Description

@Widthdom

Summary

cdidx index <project> --watch --follow-symlinks internal can leave stale indexed content when an already indexed in-workspace symlink is retargeted outside the workspace.

The watch classifier evaluates the retargeted path under the configured symlink policy. Once the target is outside the workspace, path filtering reports the path as outside the project root and watch classification maps that result to Ignore. The event is therefore dropped before an explicit update or reconciliation scan can remove the previously indexed row.

Expected behavior

A retarget event for a previously indexed symlink should reach cleanup/reconciliation even when the new target is no longer allowed by the active symlink policy. The stale indexed row should not remain queryable after the watch batch settles.

Suggested regression coverage

  1. Start watch mode with --follow-symlinks internal and an internal symlink target.
  2. Confirm the symlinked file is indexed.
  3. Retarget the same link to a file outside the workspace.
  4. Verify watch processing removes or reconciles the old indexed row without following the disallowed target.

This was identified while auditing #5091; that issue's explicit --files validation change does not address this pre-existing watch-classification gap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions