Skip to content

status --check remains stale after commit-scoped index refresh #2473

Description

@Widthdom

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

  1. Commit a small change.
  2. Run: dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll index . --commits --json
  3. 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.

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