Repository navigation
fix(chat): show only the host on a blocked-link chip - #20267
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This PR rewrites the chip rule in RFC §3, whose base status is What this change shipsInventory (7 items) — 7 justifiedIntent: stop a Blocked link chip from claiming a removed link went to an address it never went to. This is a FIX (#18673).
[FIRST-PRINCIPLES-REVIEWED] 8fbe4a8 Description read[DESCRIPTION-READ] 6aad116c4698deae950cbb504295421aeddf8aad5f8309c4fcdd9067bf9020d1 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The card still makes the claim the chip gave up: a lone record with a kept URL keeps showing its full address and "Open once" under any chip of that host. Watch
[DESIGN-REVIEWED] 8fbe4a8 Description read[DESCRIPTION-READ] 7187a3197c4039c04235e1fb3891ac0d7a846078bfad19a5bc13f633d126805f 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 |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Check whether the plain-text [UX-REVIEWED] 8fbe4a8 Description read[DESCRIPTION-READ] 1cc73cb68d9b59d2639c8c5aa92d36876213a90e64927109e33445e68b2b8aba That sha256 names everything this verdict read: the PR description, plus the 9 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 |
Opus 5.5 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: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 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: |
bfc7489 to
ef67f15
Compare
[operator: bolichen97] |
[operator: bolichen97] |
[operator: bolichen97] |
[operator: bolichen97] |
[operator: bolichen97] |
[operator: bolichen97] |
2663eab to
357f8bf
Compare
The chip named a record's path and query length whenever its host had exactly one record in the message. One record does not prove it is this chip's link: a placeholder can have no record of its own (a presigned link split at its query), and the rendered text can hold more chips than the saved text has placeholders (an entity-encoded or escaped bracket). So the chip could name a different address than the one it replaced, and the card then appeared to confirm it. The chip now shows the host alone. The card still lists each record under its own address, reason and actions. The unused `link_query` string leaves the catalogs, and the RFC §3 chip rule says what the chip may show and why. Closes #18673
357f8bf to
8fbe4a8
Compare
[operator: bolichen97] |
[operator: bolichen97] |
[operator: bolichen97] |
[operator: bolichen97] |
[operator: bolichen97] |
[operator: bolichen97] |
[operator: bolichen97] |
[operator: bolichen97] |
[operator: bolichen97] |
[operator: bolichen97] |
|
HOLD at 8fbe4a8. This PR makes a Blocked link chip show only its host (RedactionCards.tsx L1202). A single record never proves it is that chip's link, so this fix is right. The card is byte-identical to main, and every current-head AI item has a disposition. What blocks approval:
#20279 describes This clears when a maintainer rules on the chip rule and reviews the change, and the description links #20303 and #20279. CI on this head is green. I read the tests but did not run them. — crew-pr-reviewer (r100) |
mbriones98
left a comment
There was a problem hiding this comment.
Checks green and PR Readiness passed at 8fbe4a8; non-feature change.
Problem / Motivation
Goal: A Blocked link chip names only what it can prove about its own link: the site name.
The chip prints a record's path and query length beside the host whenever the host has exactly one blocked-link record in the message. One record does not prove it is this chip's link. A presigned S3 link is split at
&X-Amz-Date, so its placeholder has no record of its own; a second same-host URL that a credential pass redacted does have a record (/other-a). Where the presigned link was, the chip readsmy-bucket.s3.us-east-1.amazonaws.com/other-a ⋯ query 41 chars. Markdown such as[REDACTED: suspicious URL to h.example-sink.net]renders to a chip no record stands behind, and it readsh.example-sink.net/real ⋯ query 290 charslike the real one.Why it matters
The reader is told the removed link went to an address it never went to, and the details card then appears to confirm it. A chip that can name the wrong address is worse than one that names only the host, because the whole point of the chip is to tell the reader what was removed.
Not a goal
path/query_charshold.What changed (motivation → approach → change)
The chip reads the host's record group and, when the group has one record, prints that record's path and
query_chars. Nothing ties a chip to a record: the saved placeholder carries only the host, a placeholder can have no record, and the rendered text can hold more chips than placeholders. So "one record" never means "this chip's record".BlockedLinkChipinwebsite/src/components/RedactionCards.tsxdrops the single-record branch and prints the host alone. The card is unchanged: a lone record keeps main's shape (Destination host, reason, the kept full address or the withheld note), and several records are listed each under its own address, where no entry is presented as the link clicked. A lone record's path is therefore shown nowhere, on purpose: under a card titled "This link is blocked" it would make the same unprovable claim the chip made. Thecomponents.redaction.link_querystring has no caller left, so it leaves every catalog underwebsite/src/i18n/locales/(en-XA is regenerated bygen-pseudolocale.mjs). The chip rule indocs/request-for-change/rfc-redaction-explain-and-reveal.md§3 says what the chip may show and why, anddocs/system-specs/modules/security.mdnames the host-only label.website/scripts/capture-blocked-link-chip-host-only.mjsshoots the two cases from the issue against the built dashboard and fails if any chip shows a path or query length.host/other-a ⋯ query 41 charshosthost/real ⋯ query 290 charson bothhoston bothhosthostThe presigned-link tail (
&X-Amz-Date=…) that runs on as plain text beside the chip comes from the redaction split itself and is on main today; this PR leaves it as it is.Backwards compatibility
Compatible: the chip is display only; no API, record shape, or stored message changes. The card still shows every record's path, reason and full address.
Reader:
website/src/components/RedactionCards.tsx:BlockedLinkChip-- chat -- the only consumer ofcomponents.redaction.link_query; the branch that read it is gone, andwebsite/src/i18n/deadKeys.test.tsholds its baseline because the key leaves with its caller.Tests
website/src/test/MarkdownRenderer.blockedLink.test.tsx: the one-record chip shows the host alone and noblocked-link-query; a twice-recorded address and two differing records both label the chip with the host.website/src/test/MarkdownRenderer.blockedLinkOneOne.test.tsx: theblockedLinkOneOne.jsoncase (one placeholder, one record of another address) names the host and not/other-aon the chip; its card names the host and never/other-aas the link, with no full-URL view.website/src/test/MarkdownRenderer.blockedLinkForgedChip.test.tsx: a forged chip and the real chip beside it both show the host alone, with no path or query length, before each opens the honest host list.RedactionCards.tsxat main, six of these fail; with the change, all pass.Manual verification
Built the dashboard and ran
node website/scripts/capture-blocked-link-chip-host-only.mjs: three chips, every target equals its host, no query-length span, and the presigned-link chip's card names the host, never/other-a, with no full-URL view.Screenshots / video
Before (main): the presigned-link chip names
/other-aand41 chars; bothh.example-sink.netchips name/realand290 chars.After: every chip names its host alone; the forged chip's card explains the one real record of
h.example-sink.netas on main.After, the presigned-link chip's card: the lone record's full address is withheld; the card names the host and the reason and nowhere says
/other-ais the removed link.Light theme
Related Issues
Closes #18673
Pattern harvest
Rule candidate: review-prompt
Pattern: a UI label built from a lookup that returns one item treats "exactly one candidate" as "the matching one" without a key that proves the match.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)