Repository navigation
refactor(chat-core): drop ChatPage's duplicate stop_event / notice / mcp_oauth rows (P5-c) - #9577
Conversation
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Deletes a proven-identical duplicate, and the new parity contract pins the whole drift class shut, not just these three ids. I verified the load-bearing claims independently: [DESIGN-REVIEWED] bc2ad83 |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of All claims verified: the default registry draws the three rows from the same components, First-Principles-Verdict: PASS Author states tests were "updated, not run locally" — the rewritten source-contract pins are regex-fragile, so confirm CI green before merge. What this change shipsInventory (8 items) — 8 justifiedIntent: delete ChatPage's last three private copies of rows the shared SDK registry already draws identically (chat-core RFC P5-c, #9571) — a FIX (removal of duplication), not an addition.
Subtractions
[FIRST-PRINCIPLES-REVIEWED] bc2ad83 |
UX Review (Fable 5) — ✅ PASSUX-level review of The blind read confirms the before/after screenshots render the transcript identically in both themes, and the diff is a pure renderer-deduplication with no user-facing string, control, or state added or changed. Nothing in the blind reader's confusions traces to this PR's surface — all pre-existing UI. UX-Verdict: PASS Behavior-preserving deletion of duplicate renderers; blind reader confirmed before/after transcripts match word-for-word in both themes, so nothing a user sees changed. [UX-REVIEWED] bc2ad83 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
…mcp_oauth rows (P5-c) After P5-b (#8733) ChatPage still re-registered three rows the SDK default registry already draws from the same component and the same inputs: `stop_event` (StopEventCard), `notice` (NoticeCard) and `mcp_oauth` (renderMcpOAuthMessage behind ctx.hideCardOwnedOAuth, which the page already sets to connectionsUiOn). ChatPage's `ctx.row` is a keyed passthrough, so the page's copies and the defaults rendered identically; the copies were the last places a shared row was wired a second time on one surface -- the drift class the P1 parity contract exists to close. Delete the three host entries and their imports; the rows resolve to the registry defaults, exactly as they do in ChatPane (split panes, Crew Members DM). Pin it: chatRolesParity.contract.test.ts now rejects any page-written entry that reuses a default id other than the documented `undrawn` narrowing, and the two source-contract tests that pinned the old copies (ChatPage.mcpOAuth, NoticeCard registry wiring) pin the new shape instead. RFC §4.2 records P5-a/b/c. Evidence (real pod, main vs branch, light + dark): the main-chat transcript column is pixel-identical before/after; the Crew Members DM draws the same stop card, notice cards and OAuth banners. Closes #9571
ea99006 to
bc2ad83
Compare
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
iamwhatever
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: refactor (12 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: code-move only -- deletes ChatPage's private stop_event / notice / mcp_oauth renderer entries so all three rows come from the shared app-sdk default registry that already draws them from the same component and inputs; no behaviour change. Spec files changed as a ride-along (a minority of the diff on both file count and changed lines), not reviewed as a design decision: docs/request-for-change/rfc-chat-core-extraction.md.
…mcp_oauth rows (P5-c) (kirodotdev#9577) After P5-b (kirodotdev#8733) ChatPage still re-registered three rows the SDK default registry already draws from the same component and the same inputs: `stop_event` (StopEventCard), `notice` (NoticeCard) and `mcp_oauth` (renderMcpOAuthMessage behind ctx.hideCardOwnedOAuth, which the page already sets to connectionsUiOn). ChatPage's `ctx.row` is a keyed passthrough, so the page's copies and the defaults rendered identically; the copies were the last places a shared row was wired a second time on one surface -- the drift class the P1 parity contract exists to close. Delete the three host entries and their imports; the rows resolve to the registry defaults, exactly as they do in ChatPane (split panes, Crew Members DM). Pin it: chatRolesParity.contract.test.ts now rejects any page-written entry that reuses a default id other than the documented `undrawn` narrowing, and the two source-contract tests that pinned the old copies (ChatPage.mcpOAuth, NoticeCard registry wiring) pin the new shape instead. RFC §4.2 records P5-a/b/c. Evidence (real pod, main vs branch, light + dark): the main-chat transcript column is pixel-identical before/after; the Crew Members DM draws the same stop card, notice cards and OAuth banners. Closes kirodotdev#9571
Closes #9571 — chat-core RFC (
docs/request-for-change/rfc-chat-core-extraction.md) phase P5-c.Summary
After P5-b (#8733)
ChatPage.tsxstill re-registered three rows the SDK default registry (app-sdk/messageRenderers.tsx) already draws from the same component and the same inputs:defaultMessageRenderersdrawsstop_event<StopEventCard key={meta.id ?? ctx.key} message={m} />ctx.row(<StopEventCard message={m} />)notice<NoticeCard key={ctx.key} content={m.content} />ctx.row(<NoticeCard content={m.content} />)mcp_oauth<div key>{renderMcpOAuthMessage(m, connectionsUiOn)}</div>ctx.row(renderMcpOAuthMessage(m, ctx.hideCardOwnedOAuth))ChatPage's
ctx.rowis a keyed<Fragment>and itsctx.hideCardOwnedOAuthis alreadyconnectionsUiOn, so each pair rendered identically (the OAuth entry differed by one bare<div>inside the row'spx-4 … py-1block). These copies were the last places a shared row was wired a second time on one surface — the drift class that once shippedmcp_oauthwired in app-sdk and raw on the main chat.Correction to the brief that scheduled this slice: ChatPane / Crew Members DM already rendered these three rows through the SDK defaults, and ChatPage has no artifact-specific renderer (
handleArtifactOpen/artifactPathsare assistant-bubble props).transcriptRenderers.test.tsxalso already pins that the factory keeps no secondstop_eventcopy. So P5-c is a deletion on ChatPage, not an addition tocreateTranscriptRenderers— a third copy would be the opposite of the RFC's goal.Changes
website/src/pages/ChatPage.tsx: delete thestop_event,notice,mcp_oauthhost entries and theStopEventCard/NoticeCard/renderMcpOAuthMessageimports; dropconnectionsUiOnfrom the renderer memo's deps (it still feedsctx.hideCardOwnedOAuth). Precedence comment updated.website/src/pages/chat/transcriptRenderers.tsx: header comment no longer lists the stop/OAuth rows as page-only.website/src/test/chatRolesParity.contract.test.ts: newPAGE_OVERRIDE_IDS(onlyundrawn) + a test that rejects any page-written entry reusing another default id, and asserts the three imports are gone.website/src/test/ChatPage.mcpOAuth.test.tsx: rewritten for the new shape — default registry claimsmcp_oauth, page does not shadow it (nomcp_oauthentry, no banner import, onlyhidden_invisible_assistantas a'*'entry),hideCardOwnedOAuth: connectionsUiOnreaches the registry through ctx.website/src/test/NoticeCard.test.tsx: the registry-wiring test now pins the absence of a pagenoticeentry.Resolution-order note: with the page's
stop_eventgone, the registry's shape-matched default sits first in the merged list (ahead of the shared spread) instead of after it. The only shared entry that could have claimed a stop row first issubagent_completion, whose predicate never matches a stop envelope, so no row resolves differently.Evidence (real pod, light + dark)
Same fixture transcript (stop card, two notice rows, three OAuth banner states: expired-after-reload / authenticated / expired) seeded into the main chat and a Crew Members DM on a pod built from
origin/mainand one built from this branch.Main chat — before (main) vs after (branch). Pixel diff of the transcript column: 0 differing pixels in both themes; the only full-page differences are the top-bar clock/update chip.
Crew Members DM (ChatPane) on this branch — stop card, notice cards and OAuth banners, drawn by the same registry defaults the page now reads:
The
notionbanner carried a liveoauth_urlin the fixture but renders as expired on both pods: the persist-side redaction blanks the URL on reload (pre-existing behaviour, unrelated to this PR). A live "Authorize" banner needs an in-session OAuth request, which the fixture cannot produce.Verification
npx tsc --noEmitclean;npx eslintclean on every touched file.