Repository navigation
Keep a page's admitted attempts and served baselines in its memory - #6411
Merged
Merged
Conversation
Every reading a server process keeps of a page now lives in that page's memory (`page_memory.memo`), so one module decides how long any of them lasts. - `event_log.admitted_attempts` kept each page's attempts and log place in a module dict with its own lock that nothing evicted. They are now the `_Attempts` memo kind: a dropped memory reads the log afresh, and since the log keeps every attempt it admitted, the answer never lapses. - `served_state.tail` kept each page's served readings, the baselines a patch is built from, in an LRU of its own (`PAGES`, 8 pages by answer). They are now the `_Served` memo kind and `PAGES` is gone. A sample holds its memory for its life, so a gallery of samples no longer pushes out the readings a tab of another page holds; a page whose memory is dropped answers whole, then patches again from that answer. `tail.answer` takes the page directory rather than a string. - `page_memory`'s header said every kept reading is checked against file stamps. It now states the four rules that hold: beside the stamps of the files read (or the place read to in the log, which only grows); keyed by a name that never changes meaning; a fact no file carries, observed again after a time bound; and baselines a later answer is patched from. It cited `revision_artifact._shared_registry`, which does not exist; it now cites `_read_css`. Tests: the tail case that held `PAGES` now asserts per-page memories and that patches build again after the page's memory is evicted; the drafts case asserts an admitted attempt still settles its draft after eviction. Each new assertion fails against a mutation that keeps the old behaviour (a module-level tail store; a fresh memory that reads only new appends). Ran the tail, drafts, saved-records, held-basis server and page-memory eviction cases (`-k`), and `pre-commit run --files`. > _This was written by Claude Code on behalf of max-sixty_
…r readings > _This was written by Claude Code on behalf of max-sixty_
leaf-agent
approved these changes
Nov 18, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 18, 2026
…ry (#6432) Continues #6411, which moved the server's per-page stores into page memory. A layer whose selection includes a copy the page holds of a package it selects by path is now that page's reading: its vocabulary and composition live in the page's memory beside the copy's stamp (`layer._held`). A `page init` that replaces the copy replaces the layer, which goes when the page's memory does. A selection of shared package roots alone stays held for the process. Before, `_vocabularies` and `_compositions` were module dicts keyed by the inputs and the copies' stamps, and nothing dropped an entry. Each copy-changing `page init`, and each live sample of a page with copies, kept another composed layer (about 2.9 MB served) for the process's life: five inits held five, now one. `layer._Layers` holds a selection's vocabulary and composition together, for the process and per page memory. `once` still composes a layer once for requests arriving together. `forget_layers` (#6412) replaces the shared store, and a page's layer, kept beside it, is composed again. The new test fails against the old store, a process-wide store, one ignoring the copy's stamp, and one ignoring `forget_layers`. > _This was written by Claude Code on behalf of max-sixty_
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.
Every reading a server process keeps of a page now lives in that page's memory (
page_memory.memo), so one module decides how long any of them lasts.event_log.admitted_attempts) moved from a module dict that nothing evicted into the_Attemptsmemo kind. A dropped memory reads the log afresh; the log keeps every attempt, so the answer never lapses.served_state.tail) moved from their own 8-page LRU (PAGES, deleted) into the_Servedmemo kind. A sample holds its memory for its life, so a gallery of samples no longer pushes out another page's baselines. A page whose memory is dropped answers whole, then patches again from that answer.page_memory's header now states the four rules that hold (file stamps or the log's read place; a name that never changes meaning; a time bound for facts no file carries; patch baselines), and drops a citation ofrevision_artifact._shared_registry, which doesn't exist.The tests assert the eviction behaviour at the tail and drafts boundaries; each new assertion fails against a mutation that brings back the old store.