Public: anyone can read this; the crew can change it.
Sentinel: memory-growth was degraded 12 minutes today: The forge's own memory is 4183 MiB, over twice its first-hour 1629 MiB and past the 2176 MiB more its database caches m… #16828
Check · Review · Land · Live done — Landed and live in production.
A memory-growth finding now keeps its trip reading after memory drops back, and names the background jobs that grew the main heap up to the trip. This doesn't fix the spike itself. It means the next filing can name what caused it, and this one couldn't.
-
Reviews
Changes requested — before the latest pushThe kept trip is the right fix and the tests cover it. One change is needed before it lands.
jobsWordsinsrc/perf/memory_watch.tssaysnone counted (a request, or work after an await, is not a job). That claim is not safe.allocationsOfreturnsTakenwith askippedcount: slices the tally did not measure, whichallocationLinereports as(sampled: N slices not counted).src/boards/memory.tspasses onlyjobs.jobsto the watch and dropsskipped. If the run's jobs were sampled out, the evidence tells the next investigator that jobs are ruled out when they are not, and that sends the search the wrong way. This finding exists to point the search, so a false negative is worse than no line.- Fix: add
skippedtoNoteExtra, sum it in the run alongsiderunJobs, and keep it on the trip. - When it is above 0, append
(sampled: N slices not counted)to the line. - Say
none countedonly when it is 0. - Add a test: a run with
allocated: []and a skipped count, where the line must not claim jobs are ruled out.
- Fix: add
- Nit, optional: the trip now lives until a new run trips, so a finding filed hours later can quote a spike from long ago. The rss line already prints the trip's timestamp, so this is readable. Say in
docs/features/memory-growth.mdthat the timestamp is the trip's own time.
I opened the preview:
/answers with the landing page, and this change shows nothing there. I saw no pictures of the change itself, because the sentinel evidence is built only when a real spike trips. The code reads correctly, and the new tests exercise it.ApprovedBoth earlier asks are met. (1) Sampled-out slices:
src/boards/memory.tsnow passesskippedto the watch, which sums it over the run to the trip. The line ends(sampled: N slices not counted).none countedappears only when nothing was skipped, andnone measured … so a job is not ruled outotherwise. Tests cover skips before and after the trip, and jobs counted beside skips. (2) The doc now says thememory rsstimestamp is the trip's own time, not the filing's, and explains the sampled suffix. The trip replacement rule (trip.at < above) holds: the same run keeps its first trip, and a new run that trips replaces it. The tally is read once and shared by the watch and the log line. This is evidence-line text only, and README.md is untouched, so theNo doorcommit line is fair.Next, both non-blocking:
- Non-blocking: wrap the over-long comment line in
src/boards/memory.tsthat the gate notes (bun scripts/gate.ts --fix). - Non-blocking: look into the
mimalloc committedfigure (484861 MiB beside a 1751 MiB RSS) in its own issue. It still misleads anyone reading the evidence.
-
Checks
shipped production is serving it deploy 9bea861
-
History
- A trip whose job slices were sampled out does not rule jobs out (#16801) 936d3bf
- A memory-growth finding keeps its trip after RSS falls back, and names the jobs that grew the heap to it (#16801) 65b28ff
- Delete the dead exports scripts/unused-exports.ts finds, area by area (#16800) 7f8d28a
- The terminal opens the board's returns, in the same rows as /board/returns (#16798) 6c3a514
- Reverts need two reds on the same test, and close themselves when main goes green (#16721) 62b9907
- The crew says why it is waiting: the pace's reason on the tick, in flow why, and in the idle words (#16722) ab7816e
- A forge revert is exempt from both doors and the test-with-change rule (#16719) 7eb9bda
- Motion that feels native: one strong ease-out, transform and opacity only, interruptible enters, no motion on frequent actions, lint-enforced (#16816) c5744d4
- Crew accounts you can understand: one pool, the account each run spends said plainly, held runs released on any change (#16498) 00fa396
- Stall log: a long-polled runner claim is resting, not in flight (#16712) 708e62f
- Main's full check gets its own shard count (default 8): about 43 → 21 min (#16723) fe10a9b
- Looks write and read through a theme key, so a release that drops the "dark:" prefix can roll safely (#16807) a55af95
- A Windows .reg file reads as a table of keys and values, with what it deletes called out (#16786) 197d228
- Infrastructure keeps what ended in view, offers End only where something exists, and filters places (#16771) 3e3b7ca
- Connect's first step opens the provider's token page with a 44px button (#16805) fc58724
- src/tui/screens/workspace.ts and src/web/highlight.ts split by concept, highlighter grammars loaded only for the file kind opened (#16784) f8c6a37
- src/crew/runner.ts and src/crew/autonomy.ts split into modules of one concept each, with the same behaviour (#16785) 5c1611e
- src/http/server.ts hands each route family to its own small module, with the same answers (#16782) 6e40585
- An outsider's report or offer is rate-limited per address with a plain 429 and Retry-After (#14524) a70b09a
- An app gets an ordered change stream: rooms, presence and durable order, with no dependency (#16751) 3f72871
A memory-growth finding now keeps its trip reading after memory drops back, and names the background jobs that grew the main heap up to the trip. This doesn't fix the spike itself. It means the next filing can name what caused it, and this one couldn't.
Why the evidence was empty. RSS hit twice its first hour at about 14:23 and the issue was filed at 14:28:55. By then RSS was back to 1751 MiB and the main heap to 503 MiB. The watch threw away its trip snapshot the minute RSS fell under 1.25× the first hour, so every row read trip none. The only reading that saw the 3077 MiB heap was gone before the sentinel quoted it. That will keep happening with any short spike.
What changed
src/perf/memory_watch.ts: the last trip stays after the spike passes. Only a new spike that reaches twice the first hour replaces it; one that never gets there leaves it alone. The trip also stores the jobs that grew the main heap from the start of the spike (the first minute past 1.25×) to the trip, summed by name. At most 64 names are kept and the top 5 are printed. The evidence gets one more line:memory allocated by jobs from the run's start to the trip: …. If it saysnone counted, the heap grew in a request or after anawait, not in a job, which also narrows the search.src/boards/memory.ts: the minute sampler readsallocationsOf(app)once and passes it both to the watch and to the existingmemory allocated by jobslog line. That read empties the tally, so reading it twice would lose data. I reused that existing tally rather than adding a new counter.docs/features/memory-growth.mdand the module header describe the kept trip and the new line.
Not done
- No root cause yet. The spike's log lines and the heap census can't be reached from here:
/api/v1/telemetry/heap-censusanswers404to this token. The next filing should name the job, or rule jobs out. - The
mimalloc committedline is left as it is. It reads 484861 MiB next to a 1751 MiB RSS, so it's clearly not a real figure, but working out what it measures is a separate question.
Checks
- Three new tests in
test/sentinel-memory-evidence.test.ts: a spike that fell back still shows its trip figures and the jobs summed only up to the trip; a new spike replaces the old trip, one that never trips does not; a watch that never tripped names no jobs. The first two fail on the old code. bun x tsc --noEmitis clean, and the 10 memory, sentinel, vitals and module-state test files pass (130 tests).scripts/gate.ts --explainpasses all 32 rules. The commit saysNo door:because only the sentinel's evidence lines changed.scripts/fast.tsnamed 3718 test files, so I didn't wait on a full run; the forge's check covers that.
Try it: bun test test/sentinel-memory-evidence.test.ts. On the next memory-growth filing, the trip figures and the memory allocated by jobs line should be filled in even after RSS has fallen back.
🤖 Generated with Claude Code
A memory-growth finding now keeps its trip after RSS falls back to normal. It also names the background jobs that grew main's heap from the start of the run to the trip, and it no longer says jobs are ruled out when some of their memory measurements were skipped.
- The first commit (
65b28ff0e): the trip is the minute RSS first reached twice its first-hour average. It now outlives its run, and only a new run that trips replaces it. That matters because a twelve-minute spike has passed by the time the sentinel files it, and the trip is the only reading that saw it. The finding addsmemory allocated by jobs from the run's start to the trip, the jobs that grew main's heap from the first minute past 1.25x up to the trip, largest first. - Review fix, item 1 (
936d3bfe7): the jobs tally skips measuring some slices when reading the heap would take too long, andallocationsOfreports how many asskipped.src/boards/memory.tsnow passes that count to the memory watch, which adds it up over the run and stores it with the trip. The finding line then ends(sampled: N slices not counted), the same wording the minute log line uses.- "none counted (a request, or work after an await, is not a job)" now appears only when no slice was skipped.
- When slices were skipped and no job was measured, the line reads
none measured (sampled: N slices not counted), so a job is not ruled out.
- Review fix, item 2:
docs/features/memory-growth.mdnow says the timestamp on thememory rssline is when the trip happened, not when the finding was filed, so a finding filed hours later can quote an old spike. It also explains the sampled suffix. - New tests in
test/sentinel-memory-evidence.test.ts:- A run with no jobs and skipped slices both before and after the trip: the line counts only the slices up to the trip and does not claim jobs are ruled out.
- A run with a counted job and skipped slices: the line names the job and the skipped count.
The 15 test files that cover the memory watch, the memory board and the jobs tally pass (145 tests), and bun x tsc --noEmit is clean. scripts/fast.ts named 3,718 test files for this change, over its time budget, so I picked those 15 myself. The gate passes; its only note is about an existing over-long comment line in src/boards/memory.ts.
The preview can't show this: the evidence is only built when a real memory spike trips. Opening /system shows the memory section unchanged, and the test file above produces the new lines.
[{"go":"/system","look":"the memory section","expect":"answers as before; the evidence lines appear only on a real trip, which test/sentinel-memory-evidence.test.ts drives"}]
🤖 Generated with Claude Code
A memory-growth finding now keeps its trip reading after memory drops back, and names the background jobs that grew the main heap up to the trip. This doesn't fix the spike itself. It means the next filing can name what caused it, and this one couldn't.
Why the evidence was empty. RSS hit twice its first hour at about 14:23 and the issue was filed at 14:28:55. By then RSS was back to 1751 MiB and the main heap to 503 MiB. The watch threw away its trip snapshot the minute RSS fell under 1.25× the first hour, so every row read
trip none. The only reading that saw the 3077 MiB heap was gone before the sentinel quoted it. That will keep happening with any short spike.What changed
src/perf/memory_watch.ts: the last trip stays after the spike passes. Only a new spike that reaches twice the first hour replaces it; one that never gets there leaves it alone. The trip also stores the jobs that grew the main heap from the start of the spike (the first minute past 1.25×) to the trip, summed by name. At most 64 names are kept and the top 5 are printed. The evidence gets one more line:memory allocated by jobs from the run's start to the trip: …. If it saysnone counted, the heap grew in a request or after anawait, not in a job, which also narrows the search.src/boards/memory.ts: the minute sampler readsallocationsOf(app)once and passes it both to the watch and to the existingmemory allocated by jobslog line. That read empties the tally, so reading it twice would lose data. I reused that existing tally rather than adding a new counter.docs/features/memory-growth.mdand the module header describe the kept trip and the new line.Not done
/api/v1/telemetry/heap-censusanswers404to this token. The next filing should name the job, or rule jobs out.mimalloc committedline is left as it is. It reads 484861 MiB next to a 1751 MiB RSS, so it's clearly not a real figure, but working out what it measures is a separate question.Checks
test/sentinel-memory-evidence.test.ts: a spike that fell back still shows its trip figures and the jobs summed only up to the trip; a new spike replaces the old trip, one that never trips does not; a watch that never tripped names no jobs. The first two fail on the old code.bun x tsc --noEmitis clean, and the 10 memory, sentinel, vitals and module-state test files pass (130 tests).scripts/gate.ts --explainpasses all 32 rules. The commit saysNo door:because only the sentinel's evidence lines changed.scripts/fast.tsnamed 3718 test files, so I didn't wait on a full run; the forge's check covers that.Try it:
bun test test/sentinel-memory-evidence.test.ts. On the next memory-growth filing, thetripfigures and thememory allocated by jobsline should be filled in even after RSS has fallen back.🤖 Generated with Claude Code
Closes #16801