Repository navigation
fix(console): a cited passage opens in a body reader beside the answer, verified citations only (objectstack#39507) - #39777
Draft
objectstack-fleet[bot] wants to merge 10 commits into
Draft
objectstack-fleet[bot] wants to merge 10 commits into
objectstack-fleet[bot] wants to merge 10 commits into
Conversation
… body reader beside the conversation (#39507) The passages an answer quotes from its verified record citations are marked in place (whole, or as an excerpt inside quotation marks) and open their record in a body reader: the field the record's context pack declares as body, scrolled to the passage, with the answer's other passages of the record marked lightly. The ai:chat page opens it on the right, the assistant drawer's rail on the left; it resizes and closes on a page change. A host with a reader lists no leftover chips (citationList: 'none'). Citations survive a reload, read back off the cite_records result. Part of #39505. Claude-Session: https://claude.ai/code/session_07e67131-392a-47b3-9266-6907acc22e29 Co-authored-by: Claude <noreply@anthropic.com>
…s its cited passage (#39507) An answer that quotes 「…前半……后半…」 was read as one excerpt the passage does not hold, so the passage stayed plain. The excerpt is now read as its pieces around the ellipsis, each of which must be in the passage. Claude-Session: https://claude.ai/code/session_07e67131-392a-47b3-9266-6907acc22e29 Co-authored-by: Claude <noreply@anthropic.com>
…found in the records it links to (objectstack#39507) On 20 questions on a real deployment the model handed over 69 passages, all verified, but its answers quoted 74 in their 依据 and only 55 could be opened: 13 it never handed over, 2 were table rows quoted with `|`. - `locateQuotes` (ChatbotEnhanced prop; ChatPane passes the body reader's): the quoted pieces no citation covers are looked up in the bodies of the records the answer links to, as the signed-in user; a piece found is a citation of that record. Each record is read once per page. - A quote splits at `|` / `|` as well as at an ellipsis; the block quoting the most of a passage is the one marked; fenced blocks are not quotes. - CitedAnswer opens the answer's record links with every passage it cites. Claude-Session: https://claude.ai/code/session_07e67131-392a-47b3-9266-6907acc22e29 Co-authored-by: Claude <noreply@anthropic.com>
… in the rows the record's context pack reads with it (objectstack#39507) A policy's attachments (its pack's `related` rows) hold text its body does not: on 20 real questions 7 of the passages an answer quoted were only there. `locateQuotes` now reads those rows too (as the signed-in user, at most 50 per list) after the record's own body, and cites a passage one holds to that row, which the reader then opens. Claude-Session: https://claude.ai/code/session_07e67131-392a-47b3-9266-6907acc22e29 Co-authored-by: Claude <noreply@anthropic.com>
…e answer's line names (objectstack#39507) On 3030 a 附件2《职工慰问申请表》 line quoting its field labels opened 附件3《职工奖励申请表》: both forms carry the same labels, and the lookup cited the first row holding them. `locateQuotes` now takes each quote's answer line; among the places holding a quote, the one whose name (title, label, display name) the line spells wins, then the one holding more of the line's quotes, then the first. Claude-Session: https://claude.ai/code/session_07e67131-392a-47b3-9266-6907acc22e29 Co-authored-by: Claude <noreply@anthropic.com>
…ed in both (objectstack#39507) On 3030 an answer quoted 「禁止利用起重机吊具运送或起升人员」 in its prose and again in its 依据; only the first block was marked, so the 依据 line could not be opened. Every block quoting the longest excerpt of a cited passage is marked now; a block quoting a shorter excerpt still is not. Claude-Session: https://claude.ai/code/session_07e67131-392a-47b3-9266-6907acc22e29 Co-authored-by: Claude <noreply@anthropic.com>
…line default (objectstack#39507) check-i18n-call-site-keys flagged default-value drift: the call site said 'Resize' while en renders 'Drag to resize; double-click to reset'. Claude-Session: https://claude.ai/code/session_07e67131-392a-47b3-9266-6907acc22e29 Co-authored-by: Claude <noreply@anthropic.com>
…on a phone (objectstack#39507) Route B of the ruling on the card: the browser-side lookup of quoted passages the turn did not cite is removed (the `locateQuotes` prop, the reader's lookup member, the ChatPane pass-through, the related-row read and the pack `related` reader, the helpers only it used, and its test file). A passage the answer quotes that no verified citation covers stays plain text. Kept: the excerpt marking, and a record link in a cited answer opening its record with every passage of it the answer cites. - The reader host keeps the default list: a verified citation the answer does not quote is a chip under it (ADR-0160 D9, no more and no fewer). The `citationList` prop and `CitedAnswer`'s `listLeftover` are removed. - The ai:chat page passes no reader side on a phone. - The changeset says what ships. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1cnRvyiAqrarmDhZV
…top (objectstack#39507) check-test-source-alias: the page's chat reaches a dynamic import of @object-ui/plugin-grid; the test pays that load during collection. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1cnRvyiAqrarmDhZV
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1cnRvyiAqrarmDhZV
Contributor
Author
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4d1cnRvyiAqrarmDhZV Final head for L1 (delta of #39568's L1 7428252501) · 2026-12-05T03:22Z · zone em-admin
|
This branch has not been deployed
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.
Requested by Elon · project thread
Fixes #39507
Part of #39505
Clause-②: yes (widening)
Metadata-protocol: none
Supersedes #39568 (same work, cut from its head
efe83e2a0b, with route B of ruling 7428662922 applied). The ADR-0160 amendment, #39570, lands first or together with this PR, unchanged; this PR does not touch it.维护者速读
What changes
locateQuotesprop ofChatbotEnhancedand its type, the reader'slocateQuotesmember, theChatPanepass-through, the related-row read (readHeldTexts) and the packrelatedreader (relatedOfPacks,ReaderPack.related), the helpers only the lookup used (bodyReadingsOf,linkedRecordsOf,proseOf,LocatedQuote), andRecordReader.locateQuotes-39507.test.tsx. A passage an answer quotes that no verified citation covers now stays plain text. No i18n key was used only by the removed code, so the packs are unchanged.|; the block quoting the most of a passage is marked), and a record link in a cited answer opening its record with every passage of it the answer cites (CitedAnswer).citationListprop andCitedAnswer'slistLeftoverare removed.ai:chatpage passes no reader side on a phone (recordReaderSide={phone ? undefined : 'right'}), so a record opens there as it always has.hydratedMessagesToChatMessagesnamed; internal modules no longer presented as package API.recordReaderSide, reload of citations off thecite_recordsresult, citations drawn once under a turn's answer, i18n.Read first (by risk):
ui/packages/plugin-chatbot/src/CitedAnswer.tsx: the lookup hook is gone;citationsis the turn's verified list only;rest(the chips) is no longer switchable.ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx:citedis now "has visible prose and verified citations", nothing else.ui/packages/app-shell/src/console/ai/AppAskPage.tsx: the phone condition onrecordReaderSide.Tests
ChatbotEnhanced.recordCitations-37365.test.tsx: the four lookup cases and thecitationList: nonecase are removed. New: a quoted passage no citation covers stays plain text while the 出处 link opens the record with the cited passages (siblingQuotes), with no fetch; an answer with no citations marks nothing and lists nothing. The excerpt cases (table row with|, two blocks quoting alike, the block quoting the most) are kept.AppAskPage.recordReaderSide-39507.test.tsx(F3): below the phone breakpoint the page mounts the conversation as asheetwith no reader side; CONTROL: on a wider window it isfullwith the reader on the right. Ablated: with the phone condition removed on disk the case fails ("Expected the element to have attribute"), restored it passes.Acceptance notes
describe, ruling record 6583487846) would place it inAppAskPage-37788.test.tsx, which is outside this PR's file surface. Named for the reviewer to decide.efe83e2a0b, not from the later7ef56ef5.origin/main(64b295cdd7) is merged in once, as the seat authorised, ata85960dd0f. The delta againstmainis still exactly these 27 files.Verification
Two-minute check: on the
ai:chatpage, ask a question whose answer cites a policy; the quoted cited passage is underlined and opens the reader on the right; a quoted line the turn did not cite is plain text; a verified citation the answer does not quote appears as a chip under it. Narrow the window below 768px and click the same passage: the record opens as a page, with no reader.Local readings, head
a85960dd0f, after the merge oforigin/main. The first round, at0c715fdfda, is kept below.vitestoverpackages/app-shell/src/console/ai/plusChatbotEnhanced.recordCitations-37365: 47 files, 313 passed.@object-ui/plugin-chatbotand@object-ui/app-shelltype-check: exit 0.check:generated: up to date.--ran: 42 derived, 42 run, all exit 0, includingsnapshot-next --self-test.Fixes #39507.First round, head
0c715fdfda:Tests and type-check
vitest run packages/plugin-chatbot/(fromui/): 92 files, 897 passed, 4 failed inspec-symbol-batch6.test.tsbecause the specdisthad been rebuilt without declarations; after a spec build with declarations that file is 22 of 22 passed. Read on378fcf2d4b(the later commit touches only the app-shell test).vitest run packages/app-shell/src/console/ai/: 46 files, 293 tests passed (on378fcf2d4b); the F3 file again on0c715fdfda: 1 of 1 passed.pnpm --filter @object-ui/plugin-chatbot type-checkexit 0;pnpm --filter @object-ui/app-shell type-checkexit 0 (after building each package's dependency closure)..ts/.tsxfiles: 0 errors (6 warnings, all on lines this PR does not change).Gates (dispatch-gates --commands, reconciled with --ran: 41 derived, 41 run, 0 NOT-MEASURED, 0 UNRUN)
pnpm --dir ui exec vitest run scripts/(172 files passed, 2 skipped) andpnpm check:test-source-alias(red on the first head: the new test now loads@object-ui/plugin-gridat module top, then green).node scripts/ci/snapshot-next.mjs --self-testexit 1 on that pre-merge tree. It was fixed onmainby fix(ci): pin the snapshot-next stable-lane self-test to a fixed clock #39763 and is green ata85960dd0f.Generated by Claude Code