Slice 023: Context compaction + session lineage - #32
Merged
Merged
Conversation
… slice opens ROADMAP row 023 to in_progress. NOTES.md records that req_llm exposes no tokenizer and no context window for the owner's models (an estimate and a configured window with a documented floor), that the fake's object generation answers "fake", then the eight-line build plan, the two-item manual queue, and three deviations stated before any code. plan_check: PASS. Signed-off-by: Ayla Croft <aylacroft@proton.me>
… state and the fork, the UI and the eval harness
Lines 1 to 7 of the G1 plan. Trinity.Memory (the context's boundary:
Trinity and LLM, never Sessions) with Tokens (bytes over three plus four
per message, calibrated high against the provider's own count; the
window from the registry entry's context_tokens, 32,768 when absent;
soft 70 % and hard 90 %) and Compactor (plan/2 pure over the history,
compact/3 through generate_object with a plain-text fallback when the
provider answers no object or an empty one, the row's attributes
returned for the Session to write: range, digests, the four fields, the
maximum taint of the inputs). The Session estimates the request before
every model call: over soft it enters compacting (012's empty state),
writes the row and broadcasts {:compaction, row}; over hard afterwards
it forks: a child session with parent_id, the compaction first, the
user's message second, the child's turn started, the parent closed with
a row naming the child and {:forked, id} broadcast (the eighth and ninth
event shapes). Prompt folds the newest compaction into the system prompt
(inside <untrusted> when tainted) and drops the rows it covers. The
provider turns a response with no object into a transient error the
retry covers. The chat: the context indicator, the compaction card with
a link to the first covered row, the redirect on a fork. The eval
harness under test/evals (tag :eval, excluded by default): three
scripted conversations, fact survival, a table written to proof/,
TRINITY_EVAL_MODEL to pick the model. The fake's object/1 and
object_delay/1. DataCase takes an ownership_timeout tag.
Tests: Tokens, plan/2, the prompt's folding, AC1 (200 turns: naive 9,283
tokens, 2,101 after compaction, soft 4,200, three compactions), AC2 (the
rows remain, seqs gapless, the range on the row), AC3 (killed in
compacting: nothing written, the retry compacts once, no shared range),
AC6 (the fork: parent_id, the compaction first, the message second, the
child answers), the indicator, the card, the redirect. The live eval on
nvidia:nemotron: 17 of 18 facts, 0.944 (proof/eval-2026-09-20.md);
openrouter:ling's free tier ran out of daily requests mid-measurement.
Gate exit 0, 264 tests; credo --strict --all clean.
Signed-off-by: Ayla Croft <aylacroft@proton.me>
PROOF.md with every criterion's evidence: AC1 with its numbers (9,283 naive, 2,101 after compaction, soft 4,200), AC2, AC3 and AC6 from the tests, AC4 from the live eval on nvidia:nemotron (17 of 18, 0.944, the table in proof/), AC5 from the tests and two screenshots. NOTES.md carries the nine findings and the follow-ups. coverage.tsv: 023 at 75.39% from 74.85%. ROADMAP row 023 to done. Gate exit 0, 264 tests. Signed-off-by: Ayla Croft <aylacroft@proton.me>
Signed-off-by: Ayla Croft <aylacroft@proton.me>
…nit's idle
The postgres job (run 35534378835) read the init's idle and rendered
before the turn ("both sides are exactly equal"); the same race as
NOTES finding 9, on a slower pool. NOTES finding 10.
Signed-off-by: Ayla Croft <aylacroft@proton.me>
…he previous commit described) Signed-off-by: Ayla Croft <aylacroft@proton.me>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slice 023 per
slices/023-context-compaction/SLICE.md. Evidence in itsPROOF.md; the measured facts, findings and follow-ups in itsNOTES.md.Trinity.Memory(Tokens, Compactor): an estimate before every model call, compaction into a row that points at what it summarised (nothing edited or deleted), the newest compaction folded into the system prompt, the fork past the hard threshold into a child withparent_id.compaction,forked); the provider treats a missing object as transient; the compactor falls back to plain text.mix test --only eval): 17 of 18 facts survived on nvidia:nemotron (0.944).proof/).