iterate.com / kernel

git clone https://git.iterate.com/repos/kernel

Catalog: say when a watched row changes, as it is

The text of CatalogRow (iterate/api) and the header of awake.ts said that a
working context sends its summary at most once in 15 s. That is the floor for
a context that works with no change of its activity stack. A working context
sends a changed summary when its activity stack changed or it said what it is,
at most once in 100 ms (AWAKE_ACTIVITY_DEBOUNCE_MS), as before pull #17. So
the watched row of a context whose log grows fast changes up to ten times a
second.

Found on iterate.com after the deploy of 6f4fd09: the Dash's author counted
the frames of one page, and the rule in the text did not fit them. Measured
there from a session of my own: 269 writes to the copy and 284 summaries that
changed nothing in 90 s, with 8 to 15 contexts awake.

Comments only: no statement of code changes.

Session: agy b859a067-e1f8-4f91-8d14-337c9a19b40b on beelink
Worker: claude 02c7d409-d06c-4792-af54-c1861507c2e0 on beelink

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

Jonas Templestein, 2026-11-27 00:01 UTC · b5bee93eb56138212ac7d62b429120b81ed7af56 · parent 6f4fd09

2 files changed

M core/itx/src/context/awake.ts
@@ -13,10 +13,13 @@
 // - One Durable Object accepts 32,768 sockets. A dial refused past that is logged, and that
 //   context is missing from the list: nothing else depends on the socket.
 //
-// The same socket carries what a context says about itself (context-summary.ts), at most once per
-// 15 s while it works and once before it closes. The accepting context keeps the newest of each in
-// one SQLite row (context-catalog.ts): one row written per wake of a context, beside the rows that
-// wake writes in its own log.
+// The same socket carries what a context says about itself (context-summary.ts). While it works:
+// when its activity stack changed or it said what it is, at most once per
+// `AWAKE_ACTIVITY_DEBOUNCE_MS`; with no such change, once per `AWAKE_SUMMARY_EVERY_MS`. And once
+// before it closes. A summary equal to the last one sent is not sent. The accepting context keeps
+// the newest of each in one SQLite row (context-catalog.ts), written when the summary differs
+// from the row: at least one row written per wake of a context, and for a context whose log
+// grows fast up to ten a second, beside the rows that the wake writes in its own log.
 //
 // THE CATALOG ANSWERS EACH SUMMARY, on the same socket: it kept it, or it refused it. A context
 // that goes quiet keeps its socket until its last summary is answered, at most
M core/lib/src/api.ts
@@ -1873,8 +1873,11 @@
 
 /** ONE CONTEXT AS A WATCH SENDS IT: its listing without `awake` and `activities` (the awake list
  *  is a watch of its own, `{ awake: true }`), the two values that the orders sort by, and the
- *  catalog's revision at which the row last changed. A row changes when its context says
- *  something new of itself: at most once in 15 s while it works, and once when it goes quiet. */
+ *  catalog's revision at which the row last changed. A ROW CHANGES WHEN ITS CONTEXT'S SUMMARY
+ *  DOES, in something that the row holds: the counts and times of its events, its storage, what
+ *  it says of itself. A context that works sends a changed summary at most once in 100 ms, and
+ *  its last one when it goes quiet. So the row of a context whose log grows fast changes up to
+ *  ten times a second: a watcher that draws should not draw at each frame. */
 export type CatalogRow = Omit<ContextListing, "awake" | "activities"> & {
   /** What the order `active` sorts by, in milliseconds: when the context was last active
    *  (`lastActivityAt`, or `lastEventAt` when it has had no activity of its own). */