Catch-up: leave the source number spent when nothing is said; no write-back (numbers only go up, A-431)

Builds: design 47 G A-490k, A-431

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
2026-11-19 23:23:29 +01:00
parent a9dde25859
commit a1f556d38b
@@ -252,19 +252,10 @@ func (ix *Indexer) sayCaughtUp(ctx context.Context, written []string, heads map[
if len(merges) == 0 {
return
}
ix.mu.Lock()
was, had := ix.saidSource[TrunkBranch]
ix.mu.Unlock()
branch, src, took := ix.takenWhat(ctx, claimed, Applied{Written: written})
if len(took) == 0 {
// Nothing is said, so the source number is not spent (takenWhat took it).
ix.mu.Lock()
if had {
ix.saidSource[branch] = was
} else {
delete(ix.saidSource, branch)
}
ix.mu.Unlock()
// Nothing is said; the source number takenWhat took is left spent: a gap is harmless, a number said twice or going
// backwards is not (A-431).
return
}
revision := ix.PinPipelines(ctx, branch, src, took)