Repository navigation
Lean sessions: where long-session requests go, and flag-gated prototypes - #50
Draft
solvyxtech wants to merge 3 commits into
Draft
solvyxtech wants to merge 3 commits into
solvyxtech wants to merge 3 commits into
Conversation
added 3 commits
October 7, 2026 23:37
test/lean-breakdown.ts splits every request body into system prompt, pinned note, digest, tool schemas, user/assistant/tool messages and envelope, and measures old results, repeated lines, superseded output, the cacheable prefix and a cache-weighted total. test/lean-sessions.test.ts runs lean-budget scenario d and replays two real 80-93 step bench runs call for call from their exuviae (fixtures plus scripts/lean-replay-extract.py). Scripted providers only.
- MAAT_LEAN_SHED_AT: auto-shed threshold when none is configured - MAAT_LEAN_SHED_MINFREE: a shed cut on user turns must free this share of the history, else it cuts on recent messages (fixes a shed that freed 0.7% and a plan that returned null and stopped auto-shed) - MAAT_LEAN_AGE (+ _ARGS): older tool results and long arguments go on the wire as their ends plus a pointer to the full text in .maat/out; batched, or timed as a soft shed with at= - MAAT_LEAN_SUPERSEDE: elide per call instead of per step (a write to one file elided every result of the step that read it), bash reruns with new output, plain cat/sed -n reads of a file written since scripts/lean-sessions-measure.mjs runs every flag over every scenario.
A rerun with a longer timeout_s exists because of the earlier result (the timeout and how to avoid it); eliding it lost the reason. harness.test.ts caught it with MAAT_LEAN_SUPERSEDE=1.
solvyxtech
pushed a commit
that referenced
this pull request
Oct 8, 2026
…ighter supersede - A shed that cuts on recent messages keeps the latest criteria note (now tagged molt.criteria) and the live bar refusal verbatim after the digest, instead of excerpting them to 300 chars. - Min-free falls back only when the kept user turns are mostly Maat's notes; an interactive session is cut on user turns as before. - A bash read answered with a same-call pointer is not noted as a read, so a later write still elides the full copy. - The rerun key sorts its keys; background runs take no part in rerun supersession; commands:[...] calls stay out (noted in a comment). - Docs and the test header cite PR #50 instead of a report not on this base.
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.
Measurement study of where a long session's request characters go, plus prototypes behind
MAAT_LEAN_*env flags. No default changes; every flag is off unless set. Full write-up:reports/lean-sessions-study.md(local reports dir).Breakdown (flags off, scripted providers, no paid calls)
Scenarios: lean-budget d, plus two real Mistral Large 4 bench runs (80 and 93 requests) replayed call for call from their exuviae. The duration-bug replay sends 3.01M estimated tokens; the real run billed 3.06M.
The system prompt and tool schemas are a small, cached cost, and nothing changing sits early in the prompt. The session's size is set by the 60k auto-shed threshold.
Prototypes (total chars / cache-weighted, vs baseline)
MAAT_LEAN_SHED_AT=30000MAAT_LEAN_SHED_AT=40000MAAT_LEAN_AGE=1+_ARGS=1(batched ageing)MAAT_LEAN_AGE=at=30000,batch=0+_ARGS=1(soft shed)MAAT_LEAN_SHED_MINFREE=0.25MAAT_LEAN_SUPERSEDE=1Cache-weighted counts cached prefix chars at 10%.
Defects found
planShedreturns null and auto-shed never fires again.SHED_MINFREEfixes both.dur.pyalso elidedtest_dur.py, which had been read in the same step.SUPERSEDEmakes elision per call.Checks
AGE. That fails only d's "the long session never shed" mechanism check: ageing keeps the history under 60k. Its numbers are well under the ceilings.npm run checkpasses with each flag on. BatchedAGEfails the same single test; e2e and self-check pass when run separately.