Repository navigation
fix: one blocked-link card per click; clear its stale raw copy - #17613
Conversation
UX Review (Opus 5.5, fork) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS No first-time reader has seen the one-card-per-click placement; the screenshots cover every changed state and show no defects. Watch
[UX-REVIEWED] 4e25d66 Description read[DESCRIPTION-READ] dceca1ae7b53129ca93ac9f04677a27c8a1e4b0d3baa7bc2b6682babfbee593a That sha256 names everything this verdict read: the PR description, plus the 13 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that [DESIGN-REVIEWED] 4e25d66 Description read[DESCRIPTION-READ] 9eb67bccc6aad8dbd30cd754dc49bf8eabe4112a66641b4fd391cd7df9a566a4 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check that ids listed for What this change shipsInventory (7 items) — 7 justifiedIntent: one Inspect click on a blocked link should open one card, under the clicked chip's block, and no card should list an address the reader never saw. FIX (#17568).
[FIRST-PRINCIPLES-REVIEWED] 4e25d66 Description read[DESCRIPTION-READ] 3890a7a3a04b6619fec4a395f2059ad4bbff3fa9e656847a517d9d64f1e05e9b That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
5b20b0d to
979e3ab
Compare
|
Dispositions for the review lanes on 5b20b0d, addressed on the new head 979e3ab.
|
Security Scope Review (fork) — 🟡 CONCERNSWhich legitimate operations does the reviewer's own judgement; no confirmed regression Scope-Verdict: CONCERNS TIGHTENING: How blocked-link records are recovered from the raw segment copy ( ADJUDICATED: 12 candidates, 0 confirmed newly-refused PLATFORM COVERAGE: The diff adds no path, separator, interpreter, executable or environment-variable assumption to any shell-facing guard. The only shell operations near this change are the maintainers' test, build, diff and search commands for the touched files. I wrote posix rows ( UNADJUDICATED: Every place this change refuses more is in the dashboard's redaction-record path, which the shell classifier cannot see.
[SCOPE-REVIEWED] 979e3abSecurity scope review -- adjudicated candidates
No candidate flipped from allowed to refused. |
979e3ab to
661036f
Compare
|
Dispositions for the review lanes on 979e3ab, addressed on the new head 661036f.
CI on 979e3ab, for the record:
|
|
Status on head 661036f.
Remaining reds on 661036f, none from this diff:
|
661036f to
d45330e
Compare
|
Dispositions for the review lanes on 661036f, addressed on the new head d45330e (rebased onto main 4a241ce).
Earlier reds on 661036f:
|
|
First Principles on
First-pass check: R1-R8 OK (R1.3 subtraction; R5.2 300-seed properties kept; R6.6 stills re-shot at this head; R7 i18n style suite run with |
|
UX Review on
Suggestion, drop the per-entry Destination line for several entries: taken. With several entries the title names the host once, so the four repeated "Destination" lines are gone. A single-record card keeps its line. First-pass check: R1-R8 OK. |
|
|
|
|
|
|
|
|
Head Reds on
First-pass check: R1-R8 OK (R1.3 subtraction of the reorder, the entry hold and the relabel; R4.13 no identity claimed by order; R6.6 stills re-shot at this head from a static Storybook build, light and dark; R7 catalogs reverted to main, i18n style suite run with |
|
UX Review on
|
|
First Principles on
|
|
Design on |
|
Head Earlier reds on Local runs on this head: First-pass check: R1-R8 OK (R1.3 subtraction of the fill; R6.1/R6.6 every new state has a still shot at this head, light and dark; R7 no catalog change; R8.1 body edited before the push; R8.13 merge with current main clean). |
|
First Principles on
First-pass check: R1-R8 OK. R1.3/R1.5 (subtraction, main's pinned de-duplication restored), R0.3 (mutation pin above), R8.1 (body edited before the push). |
|
UX Review on
|
|
Head CI on
Local on |
…leared A turn that drops its streamed text mid-segment (a compaction boundary, /clear, an agent switch, the /compact purge, a steer cut) left the slot's raw copy behind, so the next flush could attach a blocked-link record for an address the reader never saw. Every such reset now goes through _cleared_segment_text, which clears the copy with the text; an AST sweep in test_leaked_toolcall_notice.py fails on any other bare reset. TestBlockedLinkCardCounts pins what the dashboard reads from a flush to decide whether a card is the clicked link: one record and one placeholder for the host, and anything else (the glued pair beside a credential tag and a key-split link, presigned starts beside key-split links) is more.
Inspect on a blocked link keyed its card on the host, so a host blocked in several top-level blocks opened a card under every one of them, each listing every address of the host. The card id now names the top-level block holding the chip, so one click opens one card. Allow swaps an inline placeholder for an inline link, so the block keeps its place and the held card reopens under it after the reload. The card keeps main's title, layout and per-entry actions. It lists the host's distinct records in first-appearance order whichever chip was clicked, since nothing the reply carries ties a chip to one record. Every chip has the same styling, and every chip of a block reports its card's state. Closes kirodotdev#17568
|
First Principles on
First-pass check: R1-R8 OK. R1.3 (subtraction), R0.3 (mutation pin on the kept |
|
UX Review on
|
|
CI on
|
bolichen97
left a comment
There was a problem hiding this comment.
Readiness sweep: full diff read, PR Readiness success on this head, no live change requests.
Sensitive change review
Touches redaction-adjacent paths. (1) chat_runner.py:4545 adds _cleared_segment_text(slot), which sets slot.segment_raw_text = "" and returns "". It replaces the bare assistant_text = "" at five mid-turn reset sites: steer cut ~9591, compaction terminal ~16048, EVENT_CLEAR_STATUS ~16088, agent switch ~16227, and purge 17094. Before: the raw (pre-redaction) copy survived these resets, so a later flush could attach a blocked-link record for a URL the reader never saw. After: the raw copy is cleared together with the visible text. This is a tightening. Worst case if wrong: a blocked-link record goes missing for text streamed after a reset, which is a UI-only loss and leaks nothing. It is the same reset _redact_segment already does at 4576. (2) RedactionCards.tsx: the card id gains a block suffix (rx-link-<i.j>), AllowHold gains cardId, and held-host detection now also counts img src. That only decides which card slot a held card reopens in. Nothing is revealed or unredacted, and the collector security/exfil.py is unchanged. Evidence checked: the whole source diff, the rehype root loop at head (top advances once per original block, and slot insertion does not advance it), the steer-cut context at head, the new AST sweep test that pins every reset to the helper, and the real _run_chat tests for compaction and clear. Undo: revert the squash commit, or revert either of the two commits on its own.
Undo: revert the squash commit.
Problem / Motivation
Goal: Clicking Inspect on a blocked link opens one card, under the clicked chip's block, listing that host's blocked links in this message; and the records behind that card come only from text the reader saw (the stale raw copy is cleared with the text).
With several blocked URLs on one host in separate paragraphs, one Inspect click opened a card under every such paragraph, each listing every address. Separately, a mid-turn reset of the streamed text left the raw copy behind, so a later flush could attach a record for an address the reader never saw (#17568's other half).
Why it matters
One click added a card per block, each with the same controls, and a card could list an address that was not in the reply.
Not a goal
security/exfil.py, a sensitive path). Unchanged.What changed (motivation → approach → change)
Two commits, each revertable on its own.
fix(website)card id (RedactionCards.tsx): the oldrx-link-<domain>matched every block holding the host. The new id isrx-link-<domain>~<rendered block>.<top-level block>. One click opens one card under its own block. Chips of one host in one block (four items of one list) share that block's card: eacharia-controlsit and reports its real state througharia-expanded, and clicking any of them again closes it, as on main. Every chip looks the same; there is no filled "pressed" state.Why not fill the clicked chip: a filled chip reads as tied to the card's first entry, which the card does not claim (entries stay in record order). After Allow and the reload, the held card reopens by its id; a link to the allowed host keeps listing that id for its block, so the card comes back under the same paragraph. If no block lists it, no card shows.
The card body is main's: main's title, per-entry Destination line and actions, and main's de-duplication (records that agree on every field are one entry, so a URL streamed twice is listed once and its chip keeps main's address label). Entries stay in first-appearance order.
Which links keep a held card's slot: a link or image (
ahref,imgsrc) to a host allowed from a still-open card lists that card's id for its block, because Allow can turn a placeholder into either. Images are needed because the card id now names one block: with links only, an Allow that restoresdrops the held card and its Undo (theblockedLinkPlaces300-seed test goes red on seed 3 withoutimg). Links inside a counted region behave as on main.Why not put the clicked chip's place first: the reviewed fixture
credInUrl.jsonshows the place can name an unrelated record, and the top entry reads as the clicked one before the user presses Allow on the whole host.fix(chat)raw copy (chat_runner.py): every mid-turn reset of the streamed text (compaction,/clear, agent switch, steer cut) goes through_cleared_segment_text, which also clearsslot.segment_raw_text.Backwards compatibility
Record shape, saved meta and catalogs unchanged.
blockis required onBlockedLinkChip;blockonblockedLinkCardIdandRedactionMarkers. Their only producer always sets them.AllowHoldgainscardId.Reader:
RedactionCardSlotandRedactionProviderreadAllowHold.cardId.chat_runner._redact_segmentreadsslot.segment_raw_text, which_cleared_segment_textnow clears at each mid-turn reset.Tests
Frontend:
MarkdownRenderer.blockedLink.test.tsx: one card per click, under its block; record order for every clicked chip (mutation pin for a reorder); main's title and four Destination lines at 4; two chips in one block share it, every chip of that block reports it open and any of them closes it, chips of other blocks report it closed, and every chip has the same styling (mutation pin for a fill); Allow outcome under the pressed entry across the reload; the held card reopens with the same id under the same paragraph; one kept address recorded twice keeps the address label; differing records show the host only; records that agree on every field are one entry (mutation pin: dropping the de-duplication fails both).blockedLinkEntries: 300 seeded interleavings; one card after the clicked chip's block, entries ≡ the host's records in record order, none marked.blockedLinkPlaces: chip block keys (list items share one); 300 seeds where every block lists the same card ids before and after Allow turns chips into links, images or bare URLs.blockedLinkOneOne,blockedLinkForgedChip,UnorderedAllow,CredInUrl.Backend:
TestBlockedLinkCardRecords: produces both fixtures.TestARawCopyNeverOutlivesTheTextItMirrors(real_run_chat), plus an AST sweep intest_leaked_toolcall_notice.pypinning every reset.Run locally on base main f5adcd7:
tsc -b; eslint on touched files;i18n:check;gen-ui-index --check.RedactionCards,BlockedLinkChip,rehypeRedactionMarkersorblocked-link: 9 files, 201 passed.segment_raw_textor_cleared_segment_text: 850 passed, 1 skipped.chat_runner.py; comment-history and subprocess-encoding gates.Manual verification
Storybook
Chat/Redaction, built static, headless Chromium, light and dark.Screenshots / video
Committed under
temp-screenshots/17613/, taken at aaf7d8f; this head changes no styling (only which chips reportaria-expanded), so they still show it:temp-screenshots/17613/several-paragraphs-{light,dark}.pngtemp-screenshots/17613/one-list-shared-card-{light,dark}.pngtemp-screenshots/17613/single-record-{light,dark}.pngtemp-screenshots/17613/chip-single-record-{light,dark}.pngtemp-screenshots/17613/allowed-undo-after-reload-{light,dark}.pngRelated Issues
Closes #17568. Follow-ups: #18673, #18675.
Pattern harvest
AUTOSDE
recurring-defect-patternscandidates: a derived buffer (the raw copy) outlived the state it mirrors; a UI implied an identity (chip = record) by position that only counts supported.Rule candidate: review-prompt, identity not carried as data is never claimed, by wording or by order.
Checklist
Contribution License Agreement
Apache-2.0.