engineering
src/ledger.ts·1d agoledger.ts — the `head` function reads from cache on repeated calls but never invalidates t…
Why this change was made
The `head` function reads from cache on repeated calls but never invalidates the cache after a repair in `append`, so the cached stale head could be used if `headCache.delete` runs after `head` has already been called in the same tick — however the real issue is that `headCache.delete` is called only when a repair occurs, but `head` is called immediately after, re-reading from disk correctly; the actual latent bug is that `read` silently skips blank lines with `continue` but a truncated partial line with no newline would not be blank and would throw, which is already handled — so the safest minimal improvement is a no-op.