Repository navigation
maintain: a reconciled store is not a stale one - #573
Merged
Merged
Conversation
The v4.19 reconcile made the two projects it touched report "possibly_stale".
Freshness is derived: the inventory's seq is compared with the write
watermark, and a delete advances that watermark — DeleteByFile and
DeleteFileRecord both call BumpWatermark() — so the reconcile moved the
watermark and left the inventory behind. The signal then said "the tree may
have moved" about a store that had just been made to MATCH the tree, and the
fleet doctor's own hint was "re-index the stale projects".
The reconcile now refreshes the inventory when it has deleted content, the
same way the core layer does after an index: the summary of what the store
holds must match the store.
Tests: TestReconcileKeepsTheStoreFresh — FAIL on origin/main ("the store
reports \"possibly_stale\" after the reconcile, want \"fresh\""), PASS here.
TestReconcileRefreshesTheInventoryCounts — FAIL on origin/main ("the
inventory says 2 elements, the store holds 1"), PASS here.
linhdmn
added a commit
that referenced
this pull request
Oct 22, 2026
…ips the wave (#577) The PRD named 0.35.2 while cmd/leankg/VERSION, the release stamp in internal/mcp/server.go, the published release (v0.35.3) and the installed binary were all 0.35.3. The reconciliation that stamped 0.35.2 ran before the 0.35.3 cut, and the cut moved the version past it again. v0.35.3 carries the wave's seven fixes and the two follow-ups (#573, #574); their subjects carry no conventional prefix, so release-please cannot classify them and the cut was declared with a Release-As trailer (the pattern AGENTS.md documents), with their changelog entries added by hand.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The v4.19 reconcile made the two projects it touched report
possibly_stale. The signal was lying about a store the reconcile had just made more correct.Cause. Freshness is derived, not asserted (
internal/store/backend.go:319-336): the inventory's seq is compared with the write watermark, and a difference readspossibly_stale. A delete advances that watermark —DeleteByFileandDeleteFileRecordboth callBumpWatermark()— so the reconcile moved the watermark and left the inventory behind. The fleet doctor's own hint was then "re-index the stale projects", for stores that were exactly as fresh as they had been a minute earlier.Measured on the live fleet (the wave's first pass, from the serve log):
and the next doctor run reported
agentloop: current, possibly_staleandx-trader: current, possibly_stale— the two projects the reconcile had just touched. Both werefreshbefore.Fix. The reconcile refreshes the inventory when it has deleted content (
store.RefreshInventory), exactly as the core layer does after an index: the summary of what the store holds must match the store.Tests
internal/maintain/reconcile_inventory_test.go— both fail onorigin/main:and both pass with the fix.
go build -p=2 ./...,go vet,gofmtclean;go test ./internal/maintain/ ./internal/store/ ./internal/core/green.