Files
Strata/engine
Niko1221 ef5ceb9e91 Inkling: the conversation cache writes a file only when the conversation leaves memory, and keeps one file per chat (0.2.25 item 1, part 4; REPROC's e2e findings)
Design (3 lines): with a RAM park cache (--slot-cache-mib) a park writes no file; a conversation goes to a file when the RAM cache drops it, when it does not fit there, and when the engine stops
(the slots' conversations are parked, then everything in RAM is written, most recently used first, at most one cap's worth); with no RAM park cache it is still written when its slot is overwritten
(the only place it can go). ConvDisk::save removes the earlier turns of the same chat (tokens a strict prefix of the new file's, same pictures) right after the write, and covered() lets the serve loop skip a
conversation that a file (its own or a longer turn of the chat) already serves. Restore, identity checks, the cap and the near-cap handling are unchanged.

Why: REPROC's real app e2e (restart 25 s -> 3.8 s at 43K) found that every park also wrote about 770 MiB in 0.5 s per title or summary request (doubling its cost, many GB per hour of agent chat, SSD wear) and that one
chat left 3 files (2.3 GB). ink_serve.h: disk_write() (serialize + save + log) used by park_make_room (drop), park_current (does not fit; no RAM cache) and the stop pass; ink_conv_disk.h: covered(),
superseded(), the removal; docs/DETAILS.md.
Tests: unit (ink_conv_disk_test): a longer turn removes the shorter file at once and a restart sees one file per chat, covered() (own file, a prefix of a longer turn, not a longer turn, not with another picture);
mock (test_shared_prefix.py, real serve loop, 4 new): with a RAM cache a park writes no file and the stop writes the chat and the helper, a conversation dropped from the RAM cache is written and read back
(reuse 39 of 40), only the newest file of a chat stays (2 files, not 3, and the newest serves the next turn), another chat's file is kept. 4 host tests pass on p1006 (mock suite 51 tests). Not run: the app e2e (REPROC reruns e2e_chain3.sh).
2026-12-02 17:57:54 +01:00
..