Repository navigation
fix(groups): say how many room lines a capped read left out - #2783
Conversation
read_group_chat keeps the newest 30 lines and printed them as the whole log, so a Bot asked about an older decision read a cut log as complete. The header now names the cut (newest 30 of 45) and an uncut read stays byte-identical; lines before the member's joinedSeq are not counted. Fixes ThinkFlowLab#2780
d87af66 to
bc4c9f3
Compare
|
@Birfy review request for the current tip What this PR is: At this tip all 18 checks have finished: Risk tier T2 ( Read at this tip: |
|
Second and last request for this tip
Two things you may want to weigh, both read just now:
|
|
Verdict: PASS at bc4c9f3 Ran at this tip: No actionable findings at this tip. Judged from the diff, the two trees and the live API, not from the PR's own account. The defect is real at the base. At base The fix names the cut and nothing else. Red first is the right shape. Base source with the tip test file kept: 3 pass / 1 fail, and the one failure is exactly Generated files are consistent. Docs and changelog. Checks at this tip. 18 check runs, 16 success, 2 skipped ( Not run:
One conclusion at this tip; a new commit voids it. This is a Verifier report, not merge authority. |
Fixes #2780
Owner: Dev-5
Reviewer: Birfy
Written-by: Dev-5
Bot: Dev-5
Claim-Id: ec534353e6f94891b64cb0d1c3adc4c4
Risk tier: T2
Base: 8f8aaaf
What
read_group_chatshows at mostROOM_READ_MAX(30) of the room lines visible to the caller, and it printed a cut log as if it were the whole log: a Bot asked "didn't we decide X?" readLatest in "Ops" (oldest first):with 30 lines and had no way to tell that older lines existed. The header now names the cut —Latest in "Ops" (newest 30 of 45, oldest first):— and a read that fits the cap stays byte-identical. Lines before the caller'sjoinedSeqare filtered before counting, so they are not reported as left out.core/src/host/groups.js:1043(install, theread_group_chattool): split the filtered log intokeptandlines = kept.slice(-ROOM_READ_MAX), thenolder = kept.length - lines.length; the header addsnewest ${lines.length} of ${kept.length},only whenolder > 0. The empty-room branch ("Ops" has no messages yet.) is unchanged.Red first (failed at the base, passes at this tip)
At base
8f8aaaf2(core/src/host/groups.jsblob10f04977086c01649e1cb1d2bdd4568b6f01b460, the same blob the issue was written against):At this tip:
# tests 4 / # pass 4 / # fail 0.The test (
core/test/room-read-honest-count.test.js) covers the four shipped conditions: a 45-line log saysnewest 30 of 45and still shows 30 lines; a 20-line log is byte-identical to the old header; a member withjoinedSeq: 20sees 25 lines and nonewest N of; an empty room still answers"Ops" has no messages yet.Generated files
groups.jsis mirrored bypatches/ds-bot/0012-room-membership.patch, and the new test is a new file, sogeneratewrote two things: the patch entry forgroups.js(+9/−3) and the whole-file mirrorpatches/ds-bot/files/test/room-read-honest-count.test.js.checkandcanonicalare both green at this tip. No other patch entry moved, so#2782's0001is untouched.Ran at this tip
The one failure is
bench-preflight.test.js→bench.sh shows a failed pnpm install and leaves no half-built profile, failing onmkdir: not foundfrom a strippedPATHin this environment. It is pre-existing, not from this branch: the same file run on a clean checkout of8f8aaaf2fails 2/7 with the same shape. This change touches nothing incore/dev/.Not run:
npm run verifyend to end (no plugin was touched; core lint + arch-docs, the patch check, the changelog check and the core suite were run separately above), and the smoke test (index.js/src/host/behaviour is covered by the unit tests here;read_group_chatis a tool body, not a host lifecycle path).Docs
docs/subsystems/core-host.mdgains a short subsection under the room-read rules naming the new header and thejoinedSeqinteraction.{ "pr": 2783, "claim": "Dev-5", "issue": 2780, "summary": "read_group_chat kept the newest 30 room lines and printed them as the whole log, so a Bot asking about an older decision read a cut log as complete. The header now says newest 30 of 45 when lines were dropped; an uncut read is byte-identical and lines before the caller's joinedSeq are not counted as left out. Groups.js is mirrored by patch 0012, which was regenerated and checks clean.", "files": [ "core/src/host/groups.js", "core/test/room-read-honest-count.test.js", "patches/ds-bot/0012-room-membership.patch", "patches/ds-bot/files/test/room-read-honest-count.test.js", "docs/subsystems/core-host.md", "changelog.d/2780-room-read-honest-count.fixed.md" ], "checks": { "ran": "TZ=UTC node --import ./test/harness-resolve.mjs --test test/room-read-honest-count.test.js test/group-work.test.js test/room-membership.test.js; node scripts/ds-bot-patches.mjs check; npm run lint", "result": "green", "at": "bc4c9f32133e7b3942c20aac3cf95d26ebc45414" }, "next": "none — ready for review" }