Skip to content

Keep query and status indexed-HEAD stamps consistent #4854

Description

@Widthdom

Summary

After a --changed-between refresh, query envelopes keep the old full-scan indexed_at_head_sha while status reports the latest indexed HEAD. The same DB therefore presents two incompatible freshness stamps.

Audit ID: O-21. Reproduced on v1.40.3.

Existing issue relationship

Residual/regression related to closed #1509, #1527, and #4313, which established HEAD/freshness/status contracts.

Expected behavior

Each stamp must have one stable meaning. All commands reading the same DB should expose the current indexed checkout, or explicitly separate latest-delta HEAD from full-scan baseline.

PR scope

Keep this to persisted HEAD provenance and response naming/compatibility.

Implementation guide for Codex 5.6 sol xhigh

  • Define and document indexed_at_head_sha semantics across full, files, commits, and changed-between updates.
  • Update the stamp transactionally with the committed index delta.
  • If the legacy field meant full-scan baseline, add an explicit field and compatibility mapping rather than silently changing old DB reads.
  • Add branch-switch/delta/full-scan fixtures and compare status/query/MCP envelopes.
  • Run full tests and add a bilingual changelog fragment referencing the prior issues.

Acceptance criteria

  • Status and queries agree after every refresh mode.
  • The latest stamp never advances on a failed/rolled-back update.
  • Any full-scan baseline is separately named and documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .NET codebugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions