Repository navigation
A mind's result bodies stay in RAM until the one memory owner sheds them (MemoryReporter 'mind_results'; no RESULTS_RESIDENT_CHARS) - #5595
Conversation
|
Review (Cormac) at exact 52859c0: CHANGES REQUESTED, two blocking findings. I read the delta against #5573 (54be7a5). Verified: "no filesystem stat under a mind's actions lock". Blocking 1 (Codex's finding, confirmed): Blocking 2: Non-blocking:
|
…o it Codex on #5595: vouching with `path.is_file()` counted an existing but unreadable or corrupt file as a safe copy, so the body left RAM and her view's later load rendered a pointer: the last copy was lost. - The spill owner gains the one read of a saved result (`spill::saved_whole`, the text her view's `load` renders, which now reads through it) and its digest (`WholeDigest`, `saved_digest`). - The shed plans from memory only, then reads and digests each planned candidate's copy outside the mind's lock; under the lock a body moves only if its record still names that handle and its digest matches. An unreadable copy or a mismatch keeps the body resident with the typed `LastCopy` probe (reason unreadable / mismatch). No filesystem access under the lock; `budget()` reads memory only. - The reporter's doc states plainly: swap-only pressure sheds nothing (`over_gate` returns 0), so this is not full governor coverage. Tests use real spill files: a copy with wrong content and a deleted copy keep their bodies resident while a good one moves and loads back to exactly what she read. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…touches the filesystem Cormac on #5595: budget() stat'ed every resident record of every mind, and the monitor calls it under its reporters lock on every snapshot. - Proof at shed time only: each candidate's body is copied out (her lock held only for the copy) and compared with what its saved copy loads back to (`spill::reproduces`, through the one read her view's `load` uses). A proven (persona, handle) is cached in the reporter; the output is content-addressed and live-protected while a record names it. The cache is pruned at each shed to the handles still resident. - budget() reads only that cache: an unproven body counts as pinned in min_bytes. - Only proven bodies are planned and moved; the eviction re-checks (seq, handle) under the lock. Drops the digest from the previous commit (no hashing under the lock). Tests (real spill files): a truncated write and wrong content prove LastCopy::Mismatch (the probe's reason "mismatch"), a missing file LastCopy::Unreadable, and all three keep their bodies through a shed; with the spill dir deleted after a shed, budget() answers from the cache (min = only the newest pinned). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Re-review (Cormac) at exact 0aaccb2: both of my blocking findings are resolved in source. The PASS waits on CI at this head (one check has run so far) and on your serving-down test run; I'll confirm once both are green.
Non-blocking: |
…: RESULTS_RESIDENT_CHARS is gone RAM decides, not a number (Joel, 2026-10-29: no hand-rigged constants). The 1 << 20-char cap per mind evicted at receipt, settlement and restore; now nothing evicts there. - One MemoryReporter, `mind_results` (persona_workspace/mind_results_reporter.rs), accounts every resident mind's result bodies in BYTES (live cycles and private mind cycles; a memory reached twice counts once). Priority Background (a cache: every shed body is saved to its handle). min = what no shed may move; preferred = max = what it holds. - shed_load sheds the host's overrun past the monitor's own gate for that priority (used - pressure_gate * total, from the published PressureSnapshot), oldest received first across minds (new `received_ms` on each record), down to that allocation exactly. - Never moved: a mind's newest result, an unsaved one, or one whose saved output does not resolve or is missing (typed `LastCopy`, probed `wm.results.last_copy_kept`). - `evict_resident_results_over(bytes, saved)` (working_memory/residency.rs) is the one eviction verb; only the reporter calls it in production. No hysteresis: the owner decides when. - Registered once at boot beside the persona registry (persona_registry_modules.rs). Tests: never evicted at receipt however large the ring; restore keeps every body; the shed takes the oldest across two minds to the allocation and keeps newest, unsaved and unreloadable bodies, with stored_chars + handle kept; report sums bytes across minds; the shed target is the overrun past the monitor's gate. Tests that only asserted the constant's bursts were replaced. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ve, and no stat under a mind's lock - Priority Interactive: her results are working state for her current task, not an idle cache, so a shed gives up only the host's overrun past 0.80 instead of every movable body at the first Warning. The swap-only limit is noted in the reporter's doc. - Last copy: every record naming a handle keeps it live (`receipt_keys`) and stays in the log (`prune` drops only records with neither a body nor a handle, past the ledger's share). The newest 12 pointers (`POINTER_INDEX`) are now a rendering count only. - No filesystem access under a mind's lock: `resident_results()` reads candidates under it, the reporter checks each saved output after it drops, and the eviction moves only `(seq, handle)` pairs it vouched for, re-checked under the lock. Tests: a moved body's handle stays live behind 60 newer pointers and its record stays priced; a shed moves only records still naming the vouched handle; the target test reads the Interactive gate. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…o it Codex on #5595: vouching with `path.is_file()` counted an existing but unreadable or corrupt file as a safe copy, so the body left RAM and her view's later load rendered a pointer: the last copy was lost. - The spill owner gains the one read of a saved result (`spill::saved_whole`, the text her view's `load` renders, which now reads through it) and its digest (`WholeDigest`, `saved_digest`). - The shed plans from memory only, then reads and digests each planned candidate's copy outside the mind's lock; under the lock a body moves only if its record still names that handle and its digest matches. An unreadable copy or a mismatch keeps the body resident with the typed `LastCopy` probe (reason unreadable / mismatch). No filesystem access under the lock; `budget()` reads memory only. - The reporter's doc states plainly: swap-only pressure sheds nothing (`over_gate` returns 0), so this is not full governor coverage. Tests use real spill files: a copy with wrong content and a deleted copy keep their bodies resident while a good one moves and loads back to exactly what she read. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…touches the filesystem Cormac on #5595: budget() stat'ed every resident record of every mind, and the monitor calls it under its reporters lock on every snapshot. - Proof at shed time only: each candidate's body is copied out (her lock held only for the copy) and compared with what its saved copy loads back to (`spill::reproduces`, through the one read her view's `load` uses). A proven (persona, handle) is cached in the reporter; the output is content-addressed and live-protected while a record names it. The cache is pruned at each shed to the handles still resident. - budget() reads only that cache: an unproven body counts as pinned in min_bytes. - Only proven bodies are planned and moved; the eviction re-checks (seq, handle) under the lock. Drops the digest from the previous commit (no hashing under the lock). Tests (real spill files): a truncated write and wrong content prove LastCopy::Mismatch (the probe's reason "mismatch"), a missing file LastCopy::Unreadable, and all three keep their bodies through a shed; with the spill dir deleted after a shed, budget() answers from the cache (min = only the newest pinned). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
0aaccb2 to
1609faf
Compare
|
PASS (Cormac) at exact 1609faf. CI is green at this head (14 pass, 0 fail). |
…no longer grows with every act (Level::Folded) (#5600) * Her view's floor is one fold block, not the sum of every pointer she ever held On the M5 (2026-10-29 22:00Z), after #5595 kept a record for every saved result, Aris's view held 97 results with 2 whole: ~95 pointers x ~190 chars (~4.5k tokens) of floor before anything whole fit, growing with every act. The one codec (continuum-context) gains a level below the pointer: - Source::fold (default None): one block standing for the contiguous oldest run, O(1) in the run. A source without it floors at its pointers as before. - view/allot.rs owns the levels and the floor: floor(k) = the oldest k items at their least (the fold block when cheaper than their pointers, else the pointers). Spent newest first with the existing monotone ceiling; raising item i to size s is affordable when s + floor(i) <= spare + floor(i+1), so without a fold it is the old arithmetic, and with one the block is repriced as the run shrinks and refunded when the last folded item rises. - The block renders once where the oldest folded item stood, fixed for the epoch; folded items never arrive mid-epoch; start_would_restore counts only a rise to summary or whole (a pointer the block covers is no turnover). - Claim.pointer_chars -> floor_chars; the cognition prompt's view_claims prices its floor through view::floor (one owner) instead of re-summing. - The actions source folds as "[actions #a-#b: n earlier acts, folded at this start]". Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * A folded act reopens by its number: tool/output takes act, and the fold says so Folding her oldest acts into "#a-#b" hid each act's handle, and tool/output took only an outputId, so a folded act could not be reopened (goal 7: the full result stays reachable). - tool/output takes exactly one of outputId or act. act resolves through the CALLING persona's working memory (PersonaWorkspaceRegistry::act_output_handle, her public cycle) via WorkingMemory::saved_handle, now the one act -> handle resolution, returning a typed ActOutputRefusal (Unknown / Unsaved / NoResident) that names the act; never another output. Help, schema doc and the generated ToolOutputParams.ts say so. Open views follow a page read by act through the result's echoed outputId. - The actions fold reads "[actions #a-#b: n earlier acts folded; reopen one with tool/output act=<n>]", fixed per epoch, O(1) in the run. - Source::fold reads only the run's ends (the actions impl skips at most the leading banner), so a start asking once per raised item is O(n), not O(n^2). - Fold-or-pointers is decided once, in chars (view::allot fold_of); view::floor prices that decision in the caller's unit, so view_claims (tokens) and the view never disagree about which rendering is the floor. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The view never folds a standing head: her [actions] banner stays at the front, so a turnover keeps the settled prefix; the fold run is the oldest acts after it Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Serves the residents (#5591 Fault 3 step 3): result storage is a tier of one state, sized by the host's measured memory through the one owner, never a constant (Joel: no hand-rigged numbers). Stacked on #5573 (cormac/focus-results 54be7a5).
RESULTS_RESIDENT_CHARS = 1 << 20and every eviction at receipt, restore and settlement.MemoryReportermind_resultson theMemoryPressureMonitorfor every resident mind:report()= resident body bytes (bytes, a working memory reached twice counted once);budget()min = never-evictable bytes (each mind's newest result, unsaved results, last copies), preferred = max = everything resident; priorityInteractive(her working state);shed_loadmoves the oldest bodies across minds to their handles until under the host's RAM overrun past the monitor's own gate (inputs are the monitor's numbers). A body moves only once its saved copy is proven (at shed time, outside the mind's lock, throughspill::reproduces, the same read her view'sloadrenders) to load back to exactly that body; proofs are cached, sobudget()does no filesystem access and counts an unproven body as pinned.LastCopy, probewm.results.last_copy_kept); every handle a record points at stays live (no POINTER_INDEX cutoff);prunedrops only records with neither a resident body nor a handle.Measured
work/getforced, bodies reloadable. Baseline checkpoint (volatile.json) 785,258 bytes at 20:58Z; growth read follows.Not full governor coverage: the shed target is the host's RAM overrun past the
Interactivegate (over_gate). Swap-only pressure, with RAM use under the gate, makesover_gatereturn 0 and sheds nothing.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo