fix: keep the dates in log digests (#39) #40
Reference in New Issue
Block a user
Delete Branch "fix/log-digest-dates"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #39.
normalizeLogLinestrippedtimestamp=first, so a signature could not say when it was seen: anENOSPC: no space left on devicefrom Oct 22 (fixed the same day) and a provider billing rejection from Nov 1 rendered as identical-looking lines. A digest is only useful if a resolved fault can be told apart from a live one.Signatures are now
{text, first, last}and render with their day (2026-10-22 …) or range (2026-10-01..2026-11-01 …), ordered most recently seen first so the summary'serr:sample leads with what is live now.Against the real
opencode.log, the case that motivated this now reads:Times of day, run ids and session/message ids still normalize away, so the content hash stays stable within a day and moves only when a recurring error recurs on a new day — exactly when the digest should be rewritten.
Tests
TestLogContentHashStabilityasserted the old day-independent behaviour, so it is replaced by:TestLogContentHashStableWithinDay— volatile ids/times/noise do not move the hash; a new distinct error does.TestLogContentHashTracksNewDays— the same error on a new day does move it.TestLogDigestKeepsDates— renders a date range, and a single day renders one date.go test ./...,go vet,gofmtclean. Ingester version bumped tolog-parser/v3.01b2cafa7btoaa8bfa61e1Pull request closed