Repository navigation
Conversation
A window another host keeps read-only adds nothing to the chat index, so it answers
with the rows that host indexed. When the writer has not caught up with a part's log —
the user is still talking, or it stopped before indexing its last messages — the newest
lines are missing, and `more: 0` made the read look like the whole chat. The three reads
now carry `stop: { at }` and `read_own_chat` says where the index stops, so a missing
message reads as newer than the cut instead of never said (ThinkFlowLab#3194).
Fixes ThinkFlowLab#3194
|
@Birfy review request for a T2 verdict at tip What this slice changes: in a window whose chat index is readable but not writable, At this tip: 15 success + 2 skipped + 1 failure — the failure is Red first on base Green at this tip: that file 11/11; One honest note on UI surface: none — this is host answer text, no client change (owner rule wants that stated in the verdict). Boundaries: the write path is untouched (no index write, |
Fixes #3194
Written-by: Dev-1
Owner: Dev-1
Reviewer: Reviewer
Tier: T2
Claim-Id: f03c18d9cfb94c20b18270535e7bad41
Base: 0f7e821
What
A second dsh window on one team folder is read-only:
chat-index.jscatchUpreturns at once when the index is not writable, soread_own_chatanswers with the rows the writer window indexed. When that writer has not caught up with a part's log — the user is still talking, or it stopped before indexing its last messages — the newest lines are missing, andmore: 0made the read look like the whole chat ("Nothing in your own chat mentions …", "Your own chat is empty.").The read now checks freshness:
indexStop()compares each part'smarks.throughwith the log's own last seq (agent.session.seq - 1) in a non-writable index and returns{ at }, built from the newest indexed row time (newestTimeover the read's sessions).searchOwnChat,latestOwnChatandaroundOwnChatcarry it beside their lines asstop, andread_own_chatappends one sentence to every answer — the bare read, the search (includingNothing in your own chat mentions …), the anchor read andYour own chat is empty.— naming the time the index stops at and saying a message after it is not in this answer. A caught-up window answers byte for byte as before (stopis absent), and the check costs oneresolveAgentper part, no log page.The read-only window does not read the log tail to fill the gap: the index belongs to the writer, and a second read path is out of scope. The write path (
catchUp, the mark) is untouched.Red first (base 0f7e821, only the new assertions, source untouched)
$ cd core && TZ=UTC TMPDIR=/tmp node --import ./test/harness-resolve.mjs --test test/chat-index-writers.test.jsRan (at 9cf96cb, tree e95d983c5b)
The push path rebuilt this head from the local verified commit
1d6f2a3751264e94b94183a5a9a31664945cc506(the same tree,
e95d983c5b); the commands below ran on that tree, and CI runs them again on this head.# tests 11 / # pass 11 / # fail 0TZ=UTC TMPDIR=/tmp node --import ./test/harness-resolve.mjs --test test/chat-index-writers.test.js test/own-chat-read-window.test.js test/own-chat-parts-index.test.js test/own-chat-read-parts.test.js test/chat-anchors.test.js test/group-work.test.js→ 48/48TMPDIR=/tmp node scripts/ds-bot-patches.mjs generate→ rewrote0001/0012and the test mirrorTMPDIR=/tmp node scripts/ds-bot-patches.mjs check→ 3 lines okTMPDIR=/tmp node scripts/ds-bot-patches.mjs canonical→ok patches/ds-bot/ is what generate writes (generate is a no-op)ARCH_DOCS_BASE=0f7e8212 node scripts/check-arch-docs.mjs→OK (8 changed file(s))Verify
TZ=UTC TMPDIR=/tmp npm run verifyends red on this box with exactly two failures, both incore/test/bench-preflight.test.js:bench.sh refuses before writing the profile when pnpm is missingandbench.sh shows a failed pnpm install and leaves no half-built profile. The same filefails the same two tests on a clean, unmodified
0f7e8212tree here —cd core && TZ=UTC TMPDIR=/tmp node --import ./test/harness-resolve.mjs --test test/bench-preflight.test.js→# tests 7 / # pass 5 / # fail 2— for the documented/usr/bin/pnpmand/bin -> /usr/binPATH reason, so this changedoes not move it. Everything else in verify is green (3341 pass).
Not run
Files
core/src/host/chat-index.js,core/src/host/groups.js,core/test/chat-index-writers.test.js,docs/subsystems/core-host.md,changelog.d/3194.fixed.md,patches/ds-bot/0001-core-fixes.patch,patches/ds-bot/0012-room-membership.patch,patches/ds-bot/files/test/chat-index-writers.test.jsCheckpoint
{ "pr": 3195, "claim": "Dev-1", "issue": 3194, "summary": "A read-only window's read_own_chat answered with the rows the writer had indexed, and when the writer lagged the newest messages were missing while more: 0 read as the whole chat. indexStop() now compares each part's mark with the log's last seq, the three reads carry stop: { at }, and read_own_chat appends one sentence naming where the index stops to every answer. A caught-up window answers byte for byte as before, and the write path and the index file are untouched.", "files": ["core/src/host/chat-index.js", "core/src/host/groups.js", "core/test/chat-index-writers.test.js", "docs/subsystems/core-host.md", "changelog.d/3194.fixed.md"], "checks": { "ran": "TZ=UTC TMPDIR=/tmp npm run verify", "result": "red", "why": "the only two failures are bench-preflight's pnpm/PATH tests, which fail the same way on a clean 0f7e8212 tree here (5 pass / 2 fail)", "at": "9cf96cb202be822ec04ebccb3529d69f3d1f7e09" }, "next": "none — ready for review" }