Summary
After a successful cdidx index . --changed-between <old> <new> --json, status --check --json can still report the index as stale even though the file contents and indexed_head_sha match the workspace HEAD.
This looks like a regression or adjacent case to closed #2473.
Observed
On branch codex/code-search-audit at b9ac272c7b5fa501be07458899524552852dbf2d:
dotnet build
dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll status --check --json reported stale because the DB was indexed at 04314618a3532dac6264d0cd24a4aef7ffb21917.
dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll index . --changed-between 04314618a3532dac6264d0cd24a4aef7ffb21917 b9ac272c7b5fa501be07458899524552852dbf2d --json succeeded and updated 3 files.
status --check --json still exited non-zero with index_matches_workspace:false, reason:"head_changed", indexed_head_sha:"b9ac272...", but workspace_check.indexed_head_commit:"04314618...".
Expected
After a successful git-aware changed-between refresh with no remaining file mismatches, status --check should either treat the index as fresh or explain why another refresh mode is required using consistent HEAD fields.
Impact
Agents following AGENT_GUIDE.md are forced into a full rebuild even after a successful delta refresh, which slows the self-improvement loop and makes freshness diagnostics confusing.
Summary
After a successful
cdidx index . --changed-between <old> <new> --json,status --check --jsoncan still report the index as stale even though the file contents andindexed_head_shamatch the workspace HEAD.This looks like a regression or adjacent case to closed #2473.
Observed
On branch
codex/code-search-auditatb9ac272c7b5fa501be07458899524552852dbf2d:dotnet builddotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll status --check --jsonreported stale because the DB was indexed at04314618a3532dac6264d0cd24a4aef7ffb21917.dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll index . --changed-between 04314618a3532dac6264d0cd24a4aef7ffb21917 b9ac272c7b5fa501be07458899524552852dbf2d --jsonsucceeded and updated 3 files.status --check --jsonstill exited non-zero withindex_matches_workspace:false,reason:"head_changed",indexed_head_sha:"b9ac272...", butworkspace_check.indexed_head_commit:"04314618...".Expected
After a successful git-aware changed-between refresh with no remaining file mismatches,
status --checkshould either treat the index as fresh or explain why another refresh mode is required using consistent HEAD fields.Impact
Agents following
AGENT_GUIDE.mdare forced into a full rebuild even after a successful delta refresh, which slows the self-improvement loop and makes freshness diagnostics confusing.