Skip to content

test(console): pin the citations' move to a turn's answer, the reader's cited-only opens and the declared body field (objectstack#39507) - #39793

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-39507-wip
Dec 5, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-39507-wip

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread
Part of #39507

Clause-②: no
Metadata-protocol: none

Follow-up to #39777 (merged as 789893a13a). It carries the rest of L2 7431121030's S2 pins and one no-op cleanup. They were committed during #39777's L2 fix round (as a88ee8a1c4, on top of 78053a2304), but that push was refused with GH006 because os-bob had readied and queued #39777 at 78053a2304. So they land here, after the merge. This branch is cut fresh from main at 789893a13a and the patch applied cleanly.

Post-merge review gap. 78053a2304 (S1, S3, N4) merged without its delta review, and this follow-up has none yet. Both get their L1 and delta L2 now, after #39777 merged.

维护者速读

  • 用户能看到什么变化:用户无感;只补测试,并删掉一处不起作用的重复代码。
  • 为什么做:AI 回答「引文可点、侧边读原文」专题的复核要求补的几条测试,上一个 PR 排进合并队列后没能推上去,这里补交。
  • 出错会怎样:最坏是测试本身写错导致检查变红,不影响用户;可直接撤回。
  • 要你做什么:无。

What changes

  • AiChatPage.hydration.test.ts: hydratedMessagesToChatMessages moves a turn's recordCitations from its stored cite_records step to the turn's last assistant message. A last message's own list wins, and the next turn carries none.
  • AiChatPage.recordLink-13037.test.tsx: with a body reader mounted (RecordReaderContext), only a cited open reaches it. A quoted cited passage and a cited answer's record link call open with the exact handoff. A plain record link and the open_record card still navigate to the record page and never call the reader. The file also gains a module-top @object-ui/plugin-grid import, which check:test-source-alias asks for now that the file changed.
  • recordReader.pickBodyField-39507.test.ts (new): pickBodyField prefers the pack's declared body.field over an earlier long-text field, yields to a field that holds the quote when the declared one does not, and puts the citation's own pack first.
  • mapMessages.ts: citationsFromToolResults drops its own { type: 'text', value } unwrap. parseResultEnvelope already peels that envelope, so behaviour is unchanged; the existing envelope pin in ChatbotEnhanced.recordCitations-37365.test.tsx stays green.

Read first: the mapMessages.ts hunk (the only non-test line), then the reader-routing describe in AiChatPage.recordLink-13037.test.tsx.

Tests

Ablated on a88ee8a1c4, whose diff is byte-identical to this branch's first commit; each mutation was restored with git restore:

  • dropping the move in hydratedMessagesToChatMessages: both hydration cases fail;
  • sending every open to the reader: the plain-link and open_record cases fail;
  • sending no open to the reader: the quoted-passage and record-link cases fail;
  • pickBodyField ignoring the declared fields: 2 of 3 cases fail (the fallback case is meant to stay green);
  • reading the raw output instead of parseResultEnvelope: the envelope case fails.

Acceptance notes

  • Changeset: @object-ui/plugin-chatbot patch (commit b95ec0ff3d), because mapMessages.ts is published source. The only shipped change removes a redundant branch and changes no behaviour.

Verification

Two-minute check: from ui/, pnpm exec vitest run packages/app-shell/src/console/ai/__tests__/recordReader.pickBodyField-39507.test.ts; expect 3 passed.

Local readings, head b95ec0f (objectstack-ai/objectstack; tests on c2f842e, and b95ec0f adds only the changeset)
  • vitest over the four touched or related test files: 4 files, 52 passed; after the import commit, AiChatPage.recordLink-13037.test.tsx 12/12.
  • pnpm --filter @object-ui/plugin-chatbot type-check and @object-ui/app-shell type-check: exit 0.
  • dispatch-gates --commands at b95ec0f: 38 families (27, plus 11 changeset/release families); --ran: 38 run, 0 NOT-MEASURED, 0 UNRUN, all exit 0. CI on b95ec0f: 39 success, 15 skipped, 0 failed. check:test-source-alias was red on 60cd48b181 and green on c2f842e214; pnpm --dir ui exec vitest run scripts/ 172 files passed, 2 skipped.

Generated by Claude Code

…'s cited-only opens and the declared body field (objectstack#39507)

L2 7431121030 S2, the rest: hydratedMessagesToChatMessages moves a turn's
recordCitations to its last assistant message; with a body reader mounted,
only a quote or sibling-quote open reaches it, while a plain record link and
the open_record card still open the page; pickBodyField prefers the pack's
body.field. mapMessages drops its own text-envelope unwrap:
parseResultEnvelope already peels it.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4d1cnRvyiAqrarmDhZV
…op (objectstack#39507)

check-test-source-alias judges the file now that it changed: ChatPane reaches
a dynamic import of @object-ui/plugin-grid, paid during collection.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4d1cnRvyiAqrarmDhZV
…ctstack#39507)

Check Changeset: mapMessages.ts is published source of @object-ui/plugin-chatbot.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4d1cnRvyiAqrarmDhZV
@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 5, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4d1cnRvyiAqrarmDhZV

Final head for L1 · 2026-12-05T05:55Z · zone em-admin
Head-sha: b95ec0ff3d. Part of #39507, a follow-up to merged #39777 (789893a), per the seat's option-A ruling.
Checks on this head: 39 success, 15 skipped, 0 failed.
Content: the remaining L2 7431121030 S2 pins, which could not be pushed while #39777 was queued (GH006):

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czzaKz49WLAvKtdyiY

Contract review

Served-tier: TIER_DEFAULT
Head-sha: b95ec0ff3d18f65bb8e33fbef79195a889474bd5
Local-runs: none

This is a delta of record 7431121030 (PR #39777 at a85960dd0f, PASS with S1, S2, S3 and N4). It covers two pieces of work:

Other inputs: the card #39507 thread, the bodies of both PRs, #39793's L1 handoff comment 7432985725, and the check-runs on both heads. #39793 on its own declares Clause-②: no and touches no schema and no governed path, so it sits on no review face. It is reviewed here, at the coordinator's request, as the delta of #39777's declaration-face review.

Check-runs.

Process gap, recorded rather than graded. 78053a2304 reached main with no L1 or L2 on that head. Record 7431121030 named a85960dd0f and governs only that head. This record closes the gap after the fact.

① Derived judgments

Earlier findings, closed by id against the tree

What #39793 changes in shipped code

  • mapMessages.ts citationsFromToolResults: the second { type: 'text', value } unwrap is dropped, leaving parseResultEnvelope(p.output ?? p.result) alone. The coordinator asked whether that call really peels the envelope for a cite_records payload with no status key. Read in toolResultParsers.ts:68-103 on this head, it does:
    • The candidates are the wrapper and its value.
    • The wrapper has no status and is a text wrapper, so it is only the last-resort wrapperFallback.
    • The value string parses to { citations, refused }, which is not a wrapper, so it becomes fallback.
    • fallback ?? wrapperFallback returns the inner payload.
    • Under the old code the second unwrap therefore never fired for a single envelope, because envelope.type was already not 'text'.
    • Two pins read the stored text-envelope shape: S2(i) directly, and S2(ii) through hydratedMessagesToChatMessages.
    • Judgment: right, for every shape the platform stores. One residual is N5.
  • Everything else in test(console): pin the citations' move to a turn's answer, the reader's cited-only opens and the declared body field (objectstack#39507) #39793 is test-only.

② Semver level

③ Boundary flags

Graded findings

Dev flags and open questions

Implemented-by: claude/issue-39507-wip
Reviewed-by: session_016WV4czzaKz49WLAvKtdyiY

VERDICT: PASS


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czzaKz49WLAvKtdyiY

席位核对

L1 verdict (L1-b): ACCEPT at head b95ec0ff3d (Part of #39507; not governed). Read at 2026-12-05T06:00Z. The same review also covers the post-merge gap: #39777's head 78053a2304 reached main (as 789893a13a) without its delta L1 or L2. The delta contract review posted just before this comment covers that range and this PR together.

Face: l1-face --pr 39793: all-checks shows only the standing Dogfood matrix-name skip (39 success · 0 failed). declarations is flagged because the PR body has no Clause-②: or Metadata-protocol: line. That is the L2's S4.

The #39777 range (a85960dd0f...78053a2304): test and comment lines only. It restores the two #37365 pins (S1), moves the F3 pin into AppAskPage-37788.test.tsx through the real useRecordReader() and deletes the separate file (S3), corrects the drawer and side comments (N4), and adds the cite_records stored-envelope pin (S2, part i). Nothing it ships goes beyond what record 7431121030 judged.

This PR:

Owed before landing (S4, body edit only, no push):

  • Add Clause-②: no and Metadata-protocol: none as line-initial lines.
  • Drop the stale "No changeset" note.
  • Restamp the readings, which are at c2f842e214, to this head.

N5 (a doubly wrapped value no longer reads) and N6 (the open_record pin should reach its button by one fixed path) are nits for the seat.

Landing: not governed. Land through the seat after the body edit, once PR-body guards re-runs green.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxiJF5PkqquFk98Bh7

席位核对 — ACCEPT · repo:objectstack@os-elon-musk · head b95ec0ff3d18

  1. 形态:draft,base main,Part of #39507;Clause-②: no · Metadata-protocol: none。这是 fix(console): a cited passage opens in a body reader beside the answer, verified citations only (objectstack#39507) #39777 合并后的测试补丁。
  2. 记录:L1 ACCEPT 7433046158;增量 L2 PASS 7433035789(TIER_DEFAULT),同时覆盖 fix(console): a cited passage opens in a body reader beside the answer, verified citations only (objectstack#39507) #39777 已合并的区间 a85960d..78053a2。S4 已在 PR 描述里修好,head 没动。
  3. 门禁:check-governed-merges --pr 39793 判为 NOT governed。check-runs 0 failed。
  4. 接受的偏差:nit N5、N6。
  5. 落地:这是在手任务的收尾,符合「当前任务处理完,合并后待命」(2026-12-04T15:09Z)。

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 5, 2026 06:04
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge December 5, 2026 06:04
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 5, 2026
Merged via the queue into main with commit ee972c1 Dec 5, 2026
59 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-39507-wip branch December 5, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants