Repository navigation
Open the part a search hit was said in (#3114) - #3191
Conversation
The palette's whole-text rows named the turn a hit belongs to but dropped the part the host already knew, so a hit in an earlier part was only labelled Earlier part and the click landed on the start of the current part. chats.search now answers part (the hit's own Session id) for the caller's own Bot chats, and the client opens that part at its turn; a part the chat does not own, or the session list no longer holds, keeps the current part and gives the seek up.
|
Written-by: Rework Verdict: INC — T3,tip 逐条实测(每条给证据)
缺口(不满足,故 INC,未入队)
红先实测(本机做不全,如实写) 把 我量到
其中第一条是本机环境:这棵树上没有 处置 两处缺口我都没改代码(按纪律不由本节点改),交 Dev:
补齐后在同一 tip 之上重出 Verdict(更正用 未做:未改任何代码/测试,未推分支(tip 未变),未入队,未写 |
The review at 4bcf0611 found two gaps. The core-client page still described a
whole-text row as openSession(id, { turn }) and named no openTarget branch,
though a row whose part is another chat's part opens the current part and does
not seek. And openTarget tested only undefined for "no part", so a part that is
not a string fell through to the no-seek fallback instead of the contract's
current-part seek.
Document the row's { turn, part } and the openTarget branches, guard on
typeof part !== 'string' first, and pin the guard with a #3114 case; the client
bundle and the patch mirrors are regenerated.
|
Verdict: PASS at 6a3562b Tip SHA: 6a3562b Read at 2026-11-19T00:33Z from the tip tarball of The two gaps the INC named are both closed
Sampled items (all as the brief asked)
Red first, measured hereRan at this tip: Red-first detail: the red tree is the tip with only The numbers match the PR body's Checks at the tip and the route18 check-runs on Budget
Checkpoint in the bodyParses: |
Written-by: Dev
Fixes #3190
Part of #3114
Owner: Dev
Reviewer: Reviewer
Tier: T3
Checkpoint
{
"pr": 3191,
"claim": "Dev",
"issue": 3190,
"summary": "A palette hit in an earlier part was only labelled Earlier part and the click landed at the start of the current part. chats.search now answers part, the hit's own Session id, for the caller's own Bot chats; a room's row carries none. The client hands that part to openTarget: the named part opens when the chat owns it and the shell lists it, otherwise the current part stays and the seek is given up, and a part that is not a string takes the current-part seek. The core-client page and the guard both follow that contract now, with a case pinning it.",
"files": [
"core/src/host/channel.js",
"core/src/client/text.js",
"core/src/client/index.js",
"core/src/client/palette.js",
"core/test/chat-index-writers.test.js",
"core/test/land-on.test.js",
"core/test/palette-preview.test.js",
"docs/subsystems/core-host.md",
"docs/subsystems/core-client.md",
"changelog.d/3114-history-hit-part.added.md",
"core/client.js",
"patches/ds-bot/0005-social-seams.patch"
],
"checks": { "ran": "TZ=UTC TMPDIR=/data/flybot-tmp npm run verify", "result": "green", "at": "6a3562bf4d733cda1c599555295aa8c4409a1223" },
"next": "none — ready for review"
}
What changed
The host already knew where a hit was:
searchHomeChatreturns the part's own Session id asrow.session, andchats.searchconsumed it insessionToChatand dropped it. The handler now keeps the parts that came from the caller's own Bot chats (ownParts, after the samesessionOwnedBytest) and names one back aspart— conditionally, so a row without it has no key at all, notnull. A room's row carries none: its member part is not a chat the palette may open.On the client,
openTarget(roster, sessions, id, part)(text.js) is the one decision: an id the roster does not hold keeps the id fallback; a row with no part — or with a part that is not a string — opens the current part with the seek; a part the chat owns (sessionIdorparts) and the shell'ssessions.byIdholds opens with the seek; anything else opens the current part with no seek, because the same turn number there is another message.openSession(id, { turn, part })callsopenTargetand gatesseekTurnonseek. The palette'sEarlier partbadge and itsrunnow come from the row's part when it has one, and from the current part's outline when it does not — the dedupe keys (chat:turn,chat:turn:n) are untouched.Rework after the review at
4bcf0611(INC, two gaps, no code changed by the reviewer):docs/subsystems/core-client.mdL261 now states the row'sopenSession(id, { turn, part })and theopenTargetbranches: an unknown id keeps its id and seeks; a row with no part, or a part that is not a string, opens the current part and seeks; a part the chat owns and the shell lists opens that part and seeks; any other part opens the current part with no seek; and a row with no part whose turn the current part's outline does not hold is still markedEarlier partand opens with no turn. The page is now+2/−2againstmainas the spec asks.text.jsopenTargetguards ontypeof part !== 'string'first, so a number never reaches the no-seek fallback, andland-on.test.jspins it with a new#3114case (part5→ current part,seek: true), kept apart from the cases that pinseek: false(another chat's part, a part the shell does not list).core/client.js,patches/ds-bot/0001-core-fixes.patch,patches/ds-bot/0008-client-bundle.patchand thepatches/ds-bot/files/test/land-on.test.jsmirror.Directly opening the part is the route, not
earlierPage: its cursor chain pages one part at a time (EARLIER_PAGE = 60) and would leave holes between parts, whileuiWorkspace.openSessiontakes a part id as it is.Red first
Measured on this tree (the harness packages are installed here, so the host-side file loads), four source files reverted to
mainand only the new tests kept:The three reds the change is about, and the fourth:
#3114: a chats.search row names the part the hit was said in—[['a', undefined, 5]]where[['a', 'older', 5]]is expected.#3114: a hit the host places in an earlier part opens that part at its turn—openSession[0][1]isundefined, expected's1-old'(the old palette drops the part).#3114: a named part is opened only when the chat owns it and the shell lists it—openTarget is not a function(the export does not exist onmain).#3114: a part that is not a string opens the current part and keeps the seek(new) — alsoopenTarget is not a function: onmainthere is no function to pin, so this case cannot be green before the fix either.With the sources in:
43/43(chat-index-writers 10, palette-preview 24, land-on 9).Why the numbers differ from the spec and from the review, stated rather than copied:
35 / 32 / 3counted theland-on.test.jsred as a whole-file load failure, because that version importedopenTargetstatically. Here it is imported withawait import(...), so the missing export fails the case alone and the file's other cases still run — more tests counted, one more red (the new guard case, which shares the same missing export).33 / 30 / 3was measured on a machine with no harness install:chat-index-writers.test.jsdied at load withERR_MODULE_NOT_FOUND: Cannot find package '@deepseek-ai/dsh-llm', so its 10 tests are absent and the host-side red cannot be seen there. On this tree that file loads and its#3114case is red in its own right; 33 + 10 = 43.Verification at the tip
Ran at this tip:
--checkexit 0generaterewrote0001-core-fixes.patch,0008-client-bundle.patchandfiles/test/land-on.test.js;check→ok 10 patches apply cleanly in order,ok core/ equals ds-bot/ + patches/ds-bot/, nodiffers fromline;canonicalexit 0arch-docs: OK (18 changed file(s)), exit 043/43(chat-index-writers 10, palette-preview 24, land-on 9)docs/subsystems/core-client.mdagainstmain:2 2(L261 rewritten with theopenTargetbranches)text.js:typeof part !== 'string'guard first inopenTarget, pinned by the new#3114casecore/src core/test docs changelog.d:119 13(the docs step alone is107 13; the rest is the guard's 2 comment lines and the new case's 10 lines)git diff --name-only main= the same 18 files;grep -c 'Policy-sign:'= 0Not run: the live smoke test (
dev/bench.sh smoke), which needs a DSH checkout and a free port; the merge-tree judgement, which belongs to the queue. Not attempted: reaching an earlier part throughearlierPage— the design deliberately opens the part directly, and its cursor chain would leave holes between parts. Also not attempted: a room's row carryingpart— a room's member part is not a chat the palette opens, and the test pins'part' in row === false.