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
- Start watch mode with
--follow-symlinks internal and an internal symlink target.
- Confirm the symlinked file is indexed.
- Retarget the same link to a file outside the workspace.
- 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.
Summary
cdidx index <project> --watch --follow-symlinks internalcan 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
--follow-symlinks internaland an internal symlink target.This was identified while auditing #5091; that issue's explicit
--filesvalidation change does not address this pre-existing watch-classification gap.