]> git.giacomolli.uk - onechat/commit
Add the compaction view
authorAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 14:39:32 +0000 (11:39 -0300)
committerAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 14:39:32 +0000 (11:39 -0300)
commite5343bd4c3ec69192e92f4be339b855eef36b6ec
tree20df612a5a55eb06b29b425c7ecf848d19e36782
parent9f17bfb1173524553fff5301b0664267b430e6e3
Add the compaction view

A compaction reads the chat view merged further, at the limits of 16 to
32 KB, so that it has context to resolve references without the whole
chat. The compaction view takes each new line of the chat. It merges in
one batch from above 32 KB down to 16 KB, and again when the chat view
merges: then it first takes each merge of the chat view, so it stays the
chat view merged further. Compactions share its prefix and so read each
other's view from the prompt cache. view.json saves it with the chat
view, and a restart loads both as they are.

The context of a build ends at its node: before the message of a leaf,
or after the last message of a merge. It stops at the first line that is
not built, so a compaction never sees a pending mark or a part of a
message.

Issue: beb9a70
memory.go
memory_test.go
view.go
view_test.go