Repository navigation
observe-metrics: fit lines that grow with the fleet under 4096 bytes - #994
Merged
Merged
Conversation
A log line is at most 4096 bytes (LINE_MAX), and two writes of the
supervisor's tick build text from the fleet's own words with no cap:
- observeFindings: a metrics finding's detail goes into its observation
as is. move-stalled names every goal waiting on a stuck root ("N goals
wait on it: ...") and every move finding carries a title nothing caps,
so on a big fleet one detail passes the limit. appendLog then dies,
and the die aborts the whole tick: the findings after it, the out line,
the stuck-work digest, the worktree tidy and the hub's moves cache.
- the stuck-work digest names up to ten items by title and move words.
Ten long titles pass the limit; the die is caught (a warning), so the
owner's Inbox question is simply never asked. This is the write that
failed on main 8cb127d after "recorded 41 spend line(s) and 6 new
observation(s)" was printed.
Now an observation whose line would not fit keeps the longest cut of its
detail that does, ending "... (whole text: docs/devteam/run/observations/
<hash>.txt)", the whole text in that file (one per source_key, rewritten
each time); only when even an empty detail can't fit does the fix hint
give way. Each finding's write runs with dieThrows, so a line the log
still refuses costs that finding alone, with a warning. The digest names
as many of its first ten items as its line has room for and counts the
rest ("- +N more"), deterministic in the items and the time, so the
same-list and within-the-list checks read it back unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…data scrapes class lines) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
PR #994 review a: observe-metrics lines over 4096 bytes (observation fitting + stuck-digest fitting)
What I ran vs only readRan (scratch clone,
Read only:
FindingsFindings: none at Critical or Important. Notes
Opened by the box operator. Verdict: APPROVE b4738a5 |
Member
Author
PR #994 review d1: delta since APPROVE at b4738a5 (main merge)
What I checked
Tests (scratch clone at the head, DEVTEAM_HUB_PORT=4998 DEVTEAM_BOX=off,
|
| file | result |
|---|---|
| test/observe-metrics-line-size.test.mjs | ok (2/2) |
| test/wait-standing-digest.test.mjs | ok |
| test/next-moves-findings.test.mjs | ok |
| test/next-moves-findings.output.test.mjs | ok |
| test/next-moves-findings.owed.test.mjs | ok |
| test/exterior-plain.names.test.mjs | ok |
| test/exterior-plain.stale.test.mjs | ok |
| test/ack-budget.inbox.test.mjs | ok |
Totals: 8 files, 155 tests, 0 failed, exit 0.
Verdict: APPROVE ddcd3a8
Opened by the box operator.
Member
Author
PR #994 review d2: delta since APPROVE at ddcd3a8
What I ran vs only read
FindingsFindings: none. Notes
Opened by the box operator. Verdict: APPROVE 0e4d38d |
Member
Author
PR #994 review d3: delta since APPROVE at 0e4d38d (flaky.json only)
What I ran vs only read
FindingsFindings: none. Notes
Opened by the box operator. Verdict: APPROVE aba6e35 |
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.
Cause
A log line is at most 4096 bytes (
LINE_MAX);appendLogdies on a longer one. Two writes inobserve-metricsbuild text from the fleet's own words with no cap:keepStuckDigest, run after the tick'srecorded …line). It names up to ten stuck items by title and move words, and titles have no cap. Ten long ones pass 4096 bytes.writeStuckDigestcatches the die, so the run goes on (devteam: log line is over 4096 bytes…thenwarning: the stuck-work digest was not written), but the owner's Inbox question is never asked. The report on main 8cb127d printed the 4096 message afterrecorded 41 spend line(s) and 6 new observation(s). Only writes after that line can explain it, so this is almost certainly the write that failed there. No observation was lost, and the tidy and moves cache that come after it still ran.observeFindingswrites each metrics finding'sdetailas it is.move-stalledlists every goal waiting on a stuck root (N goals wait on it: "…", "…"), and every move finding carries a title. On a big fleet one detail can pass the limit. Here the die is not caught: it ends the whole tick, losing the remaining findings, the tick's line, the digest, the worktree tidy and the hub's moves cache. The checked spend and learning lines have fixed shapes.Fix
fitObservation: an observation whose line wouldn't fit keeps the longest cut of its detail that does. The cut ends… (whole text: docs/devteam/run/observations/<hash>.txt), and that file holds the whole text. There is one file persource_key, rewritten each time, and the dir is registered viarunPath. The fix hint is shortened only when even an empty detail can't fit.dieThrows. A line the log still refuses costs that one finding (with a warning), not the run.- +N more). Which items it names depends only on the items and the time, so thesame/withinchecks read an asked digest back unchanged.Kept small to stay clear of #982 (observe-metrics-fast):
cmdObserveMetricsitself is untouched.Tests
test/observe-metrics-line-size.test.mjs:move-owedfinding. Before the fixobserve-metricsexits 1 with the 4096 message. After it, the observation is written at ≤ 4096 bytes and names a file that holds the whole title.+N more, its line is ≤ 4096 bytes, and the next run keeps it as is.Mutation check: with the script reverted to main, both tests fail with the reported message. Nearby suites pass locally: wait-standing-digest, stalled-vs-waiting, next-moves-findings, observe-metrics-overdue, ooda-learning, every-report-findings, fleet-idle. One gap: no test covers the per-finding skip, because no fixture finding I found makes a line too long even with an empty detail and fix hint. Files in
run/observations/are bounded by the number of distinct oversized findings, and nothing prunes them yet.Opened by the box operator.
🤖 Generated with Claude Code