Summary
After committing a change and running a commit-scoped refresh with a hex SHA, status --check --json can still fail with reason head_changed because workspace_check.indexed_head_commit remains on the prior full-scan commit even though indexed_head_sha has advanced to the current HEAD and commits_ahead_of_indexed_head is 0.
Reproduction observed
- Commit a small change.
- Run: dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll index . --commits --json
- Run: dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll status --check --json
Actual
status --check exits stale with workspace_check.reason: head_changed, while the newer indexed-head fields show the current HEAD.
Expected
A successful commit-scoped refresh that stamps indexed_head_sha to the current HEAD should satisfy the HEAD freshness check, or the status output should make clear that only a full scan can satisfy status --check.
Context
Discovered while following the issue-fix workflow after #2038. This is separate from that fix.
Summary
After committing a change and running a commit-scoped refresh with a hex SHA, status --check --json can still fail with reason head_changed because workspace_check.indexed_head_commit remains on the prior full-scan commit even though indexed_head_sha has advanced to the current HEAD and commits_ahead_of_indexed_head is 0.
Reproduction observed
Actual
status --check exits stale with workspace_check.reason: head_changed, while the newer indexed-head fields show the current HEAD.
Expected
A successful commit-scoped refresh that stamps indexed_head_sha to the current HEAD should satisfy the HEAD freshness check, or the status output should make clear that only a full scan can satisfy status --check.
Context
Discovered while following the issue-fix workflow after #2038. This is separate from that fix.