Skip to content

Keep a page's admitted attempts and served baselines in its memory - #6411

Merged
max-sixty merged 2 commits into
mainfrom
agent-afc62a9df2764227b
Nov 18, 2026
Merged

max-sixty merged 2 commits into
mainfrom
agent-afc62a9df2764227b

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

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.

  • Admitted attempts (event_log.admitted_attempts) moved from a module dict that nothing evicted into the _Attempts memo kind. A dropped memory reads the log afresh; the log keeps every attempt, so the answer never lapses.
  • Served baselines (served_state.tail) moved from their own 8-page LRU (PAGES, deleted) into the _Served memo 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 of revision_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.

This was written by Claude Code on behalf of max-sixty

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_
@max-sixty
max-sixty merged commit 3f45929 into main Nov 18, 2026
5 checks passed
@max-sixty
max-sixty deleted the agent-afc62a9df2764227b branch November 18, 2026 20:37
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_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants