# zit 0.3.15

zit 0.3.15 fixes the file-history index shipped in 0.3.14. The index was
correct but not durable: it recorded no coverage, so any commit invalidated it
and the next `zit log CHECKIN PATH` rebuilt the whole thing from the first
check-in. On a repository under active development that is the common case,
which made the index worth much less than its measurements suggested.

It now records how much of the log it covers and a later query walks only the
tail past that point.

## The index extends

`.zit-cache/finfo` gains a version and one field: `n_rids`, the number of log
entries the stored index was built from. Validation moved from an exact tail
match to a prefix match, so an index built over a shorter log is still an
index over that prefix — it is adopted, and the walk resumes from where it
stopped rather than from zero.

| `log --long -n 5 README.md`, SQLite mirror (131,558 artifacts) | check-ins walked | wall |
|---|---|---|
| no index on disk | 36,702 | 55.4s |
| index present, log unchanged | 0 | **0.52s** |
| a different path, same index | 0 | **0.51s** |

After a commit the walk covers the new check-ins and nothing else. An
end-to-end test commits into a repository with a warm index and asserts the
walk is exactly the number of check-ins added, so a regression to the
rebuild-everything behaviour fails the gate rather than showing up as a slow
afternoon.

The stored entries are the union of the adopted index and the tail, so the
answer is identical to a full rebuild. `ZIT_NO_FILE_INDEX=1` still answers by
reconstruction alone and the existing test comparing the two paths for every
tracked path is unchanged.

## Compatibility

- No artifact, tag namespace, sync message, or on-disk repository format
  changed. Fossil RFC revision 00 remains the target.
- `.zit-cache/finfo` is version 2. A version 1 file from 0.3.14 is ignored and
  rebuilt once; the cache is advisory and deleting it is always safe.
- No command or flag changed.

## Still outstanding

About 0.5s of every figure above is opening the repository. That is now the
floor for a single CLI invocation and the whole of what a warm PATH query
costs. It is tracked separately and is not addressed here.

## Qualification

`zig build test`, `e2e`, `smoke` (Fossil interop against a real `fossil`),
`muscle` (41 differential steps), `git-import-e2e`, `git-export-e2e`, `dst`,
and `cross`, plus the three-runner CI battery. Timings are release builds
against the flat SQLite mirror.
