Skip to content

maintain: heal the inventory a reconcile left behind - #574

Merged
linhdmn merged 1 commit into
mainfrom
fix/reconcile-heal-inventory
Oct 21, 2026
Merged

linhdmn merged 1 commit into
mainfrom
fix/reconcile-heal-inventory

Conversation

@linhdmn

@linhdmn linhdmn commented Oct 21, 2026

Copy link
Copy Markdown
Member

The previous fix made the reconcile refresh the inventory only when the pass had deleted something. That prevents the false possibly_stale — but it does not heal the two live projects the wave's first pass had already invalidated: their watermark had moved, their summary had not, and the next pass found nothing to delete and so refreshed nothing.

The rule is now the honest one: the reconcile makes the store's summary match the store. The inventory is refreshed whenever it is behind the watermark — because this pass deleted content, or because an earlier pass did.

The refresh stays conditional, because every content-writing path already refreshes the inventory (the CLI index, the core import, the watcher, the embedder, gc): so the hourly pass does not write to every store every hour, and a summary that is behind is one this pass (or an earlier one) invalidated.

Test

TestReconcileHealsAnInventoryLeftBehind — FAIL on origin/main:

--- FAIL: TestReconcileHealsAnInventoryLeftBehind
    the store reports "possibly_stale" after the reconcile, want "fresh" — the pass must heal the inventory it left behind

PASS here. go build -p=2 ./..., go vet, gofmt clean; go test ./internal/maintain/ -count=1 green.

The refresh added with the reconcile only ran when the pass had deleted
something, so it prevented the false "possibly_stale" but did not heal the
two live projects the wave's first pass had already invalidated: their
watermark had moved, their summary had not, and the next pass found nothing
to delete and so refreshed nothing.

The rule is now the honest one: the reconcile makes the store's summary match
the store. The inventory is refreshed whenever it is behind the watermark,
and the refresh stays conditional because every content-writing path already
refreshes it (the CLI index, the core import, the watcher, the embedder, gc)
— so the pass does not write to every store every hour, and a summary that is
behind is one this pass (or an earlier one) invalidated.

Test: TestReconcileHealsAnInventoryLeftBehind — FAIL on origin/main ("the
pass must heal the inventory it left behind"), PASS here.
@linhdmn
linhdmn merged commit 944f614 into main Oct 21, 2026
5 checks passed
@linhdmn
linhdmn deleted the fix/reconcile-heal-inventory branch October 21, 2026 18:42
linhdmn added a commit that referenced this pull request Oct 22, 2026
The two follow-up fixes (#573, #574) carry no conventional commit prefix, so
release-please reads them as unreleasable and no release was cut for them.
They are on main and in the shipped binary; they are simply not in a tagged
release. The trailer forces the cut.

Release-As: 0.35.3
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant