Repository navigation
Description
Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.
Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: 63eb2d9dca664fab94de573fdd70b3e0
Branch: dev/1-room-read-trimmed-count
Base: e16c1d3
At: 2026-11-11T06:25:59Z
Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment.
Bot: FlyBot Dev-1
Written-by: FlyBot Lead
What happens
read_group_chat (core/src/host/groups.js) builds the "Latest in …" header from the lines the
room log still holds, not from what the room said. A room that trimmed its log to ROOM_LOG_MAX
(60) keeps counting seq forward, so after 500 lines the reader is told newest 30 of 60 instead
of newest 30 of 500 — the count hides the 440 lines the trim threw away, exactly the lines the
reader is looking for.
The same arithmetic ignores the reader's own floor: a reader joining at line 300 of that room is
told newest 30 of 60 when 201 lines were said since its floor (500 − 299). The header therefore
under-reports on both axes at once.
Reproduction
On live main e16c1d3c, with core/src/host/groups.js untouched, add
core/test/room-read-trimmed-count.test.js. Red first, twice, identical apart from temp paths and
durations:
# tests 5 / # pass 3 / # fail 2
not ok - the total counts what the log still holds, not what the room said:
Latest in "Ops" (newest 30 of 60, oldest first):
not ok - the total ignores the reader's floor:
Latest in "Ops" (newest 30 of 60, oldest first):
The three guards (late joiner, exactly-at-cap, under-cap) are green at the base.
Expected
totalcounts what the room said, adjusted to the reader:dropped = max(0, room.seq − room.log.length),total = kept.length + max(0, dropped − max(0, from − 1)),
older = total − lines.length. A reader at floor 300 of a 500-line room reads
newest 30 of 201; a floorless reader readsnewest 30 of 500.ROOM_LOG_MAXstays 60 androom-membership.js's 200 stays untouched: the store still
trims, only the read's count changes. A room that never trimmed answers byte-identically to today
(legacyensureRoomLogsetsseq = log.length).- The header still prints only when something is left out; at-cap and under-cap stay byte-identical.
Scope
Planned PR: core/src/host/groups.js (+9/−2), core/test/room-read-trimmed-count.test.js
(new, 97 lines), the regenerated patches/ds-bot/0012-room-membership.patch (+10/−3) and its test
mirror, one stale sentence in docs/subsystems/core-host.md:436 (+1/−1), and a changelog fragment.
build-client is not involved (0008 unchanged); the other nine patches are byte-identical.
Tier: T2 (core/src/host/groups.js, core/test/**, patches/**; docs/** T0). Needs a Verdict
PASS at the tip.
Duplicate check
read_group_chat → 15 hits, all closed (#2780 fixed by #2783; #2790/#2791 are the floor clamp);
"newest 30 of" room → 3, all closed; state:open room read → 8, all unrelated. No open issue or
PR covers this count.
Activity
HugoXK commentedon Nov 11, 2026
Heartbeat
Written-by: FlyBot Lead
Still-working: 63eb2d9dca664fab94de573fdd70b3e0
At: 2026-11-11T06:56:07Z