Skip to content

fix: one blocked-link card per click; clear its stale raw copy - #17613

Merged
bolichen97 merged 2 commits into
kirodotdev:mainfrom
jeeshofone:fix/17568-inspect-one-card
Oct 14, 2026
Merged

bolichen97 merged 2 commits into
kirodotdev:mainfrom
jeeshofone:fix/17568-inspect-one-card

Conversation

@jeeshofone

@jeeshofone jeeshofone commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

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

What changed (motivation → approach → change)

Two commits, each revertable on its own.

fix(website) card id (RedactionCards.tsx): the old rx-link-<domain> matched every block holding the host. The new id is rx-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: each aria-controls it and reports its real state through aria-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 (a href, img src) 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 restores ![…](url) drops the held card and its Undo (the blockedLinkPlaces 300-seed test goes red on seed 3 without img). Links inside a counted region behave as on main.

Why not put the clicked chip's place first: the reviewed fixture credInUrl.json shows 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 clears slot.segment_raw_text.

Backwards compatibility

Record shape, saved meta and catalogs unchanged. block is required on BlockedLinkChip; block on blockedLinkCardId and RedactionMarkers. Their only producer always sets them. AllowHold gains cardId.

Reader: RedactionCardSlot and RedactionProvider read AllowHold.cardId. chat_runner._redact_segment reads slot.segment_raw_text, which _cleared_segment_text now 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 in test_leaked_toolcall_notice.py pinning every reset.

Run locally on base main f5adcd7:

  • tsc -b; eslint on touched files; i18n:check; gen-ui-index --check.
  • vitest: every test file naming RedactionCards, BlockedLinkChip, rehypeRedactionMarkers or blocked-link: 9 files, 201 passed.
  • pytest: the touched backend tests plus every test file naming segment_raw_text or _cleared_segment_text: 850 passed, 1 skipped.
  • black (baselined), isort, flake8, mypy on 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 report aria-expanded), so they still show it:

  • Inspect on the third of four paragraphs: one card under it, main's title, entries in record order: temp-screenshots/17613/several-paragraphs-{light,dark}.png
  • Four chips in one list share one card; no chip is styled as the clicked one: temp-screenshots/17613/one-list-shared-card-{light,dark}.png
  • One record: main's chip label and main's card: temp-screenshots/17613/single-record-{light,dark}.png
  • A closed one-record chip with main's label: temp-screenshots/17613/chip-single-record-{light,dark}.png
  • After Allow and the reload: the same card under its paragraph, "Allowed · Undo" under the entry Allow was pressed on: temp-screenshots/17613/allowed-undo-after-reload-{light,dark}.png

Related Issues

Closes #17568. Follow-ups: #18673, #18675.

Pattern harvest

AUTOSDE recurring-defect-patterns candidates: 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

  • At most two commits, Conventional Commits titles
  • Tests pass and new tests added
  • Self-review
  • No secrets or internal references

Contribution License Agreement

Apache-2.0.

@jeeshofone
jeeshofone requested a review from a team as a code owner October 7, 2026 05:18
@jeeshofone
jeeshofone requested a review from CrysisDeu October 7, 2026 05:18
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — 🟡 CONCERNS

UX-level review of 4e25d662dd3e902f4e834ab56a63ee24bb47b354 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

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

  • No sign of which chip opened the card. In a list, clicking any of the four chips opens one shared card under the whole list (one-list-shared-card-*). Every chip is styled the same, so nothing on screen shows which chip opened the card or that clicking it again closes it. Only a blind read can tell whether users see the card as theirs. This happens on every list that holds several links to one host, so it matters on a daily surface. A maintainer can push the branch to this repo to get that read.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 4e25d662dd3e902f4e834ab56a63ee24bb47b354 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Check that useBlockAssembler splits the reloaded, link-restored reply into the same blocks; the held card's <block>.<top> id depends on 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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 4e25d662dd3e902f4e834ab56a63ee24bb47b354 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Check that ids listed for img links to an allowed host don't open a held card under an image the user never clicked from.

What this change ships

Inventory (7 items) — 7 justified

Intent: 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).

  1. One Inspect click opens one card under the clicked chip's block, not one under every block for that host — justified
  2. Chips for one host inside one block (list items) share that block's card, and each reports open/closed — justified
  3. After Allow and the reload, the held card reopens under the same paragraph, using the AllowHold.cardId it now carries — justified
  4. A restored image (img src) to an allowed host also keeps the held card's slot, not only an a href — justified
  5. Every mid-turn reset (compaction, /clear, agent switch, steer cut, blank segment) also clears the raw copy, through _cleared_segment_text. All 5 non-flush resets are converted; the other 4 bare resets come right after _flush_segment — justified
  6. An AST sweep test fails any new bare reset that skips the helper — justified
  7. Four new Storybook stories and screenshots under temp-screenshots/ (a path the repo already excludes from CI) — justified

[FIRST-PRINCIPLES-REVIEWED] 4e25d66

Description read

[DESCRIPTION-READ] 3890a7a3a04b6619fec4a395f2059ad4bbff3fa9e656847a517d9d64f1e05e9b

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed 4e25d662dd3e902f4e834ab56a63ee24bb47b354 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 4e25d66

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 4e25d662dd3e902f4e834ab56a63ee24bb47b354 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 4e25d66

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 7, 2026
@jeeshofone
jeeshofone force-pushed the fix/17568-inspect-one-card branch from 5b20b0d to 979e3ab Compare October 7, 2026 06:07
@jeeshofone

Copy link
Copy Markdown
Contributor Author

Dispositions for the review lanes on 5b20b0d, addressed on the new head 979e3ab.

ai-review-disposition target=design head=979e3ab74
Watch "the frontend reverses a documented backend decision": fixed. The concern was right, and it was more than undocumented: _redact_segment in dashboard/chat_runner.py appended records recovered from the raw segment copy after the streamed text's own records, so in that merge case one host's records could leave placeholder order while their count still matched. That path now keeps each host's records in the raw copy's order, and a host with a record the raw copy lacks gets no recovered records, since no order is known for it. Pinned by test_one_hosts_records_follow_its_placeholders_when_the_texts_differ and test_a_host_the_raw_copy_cannot_place_keeps_only_its_own_records (both fail on origin/main) and, for the collector, test_redaction_blocked_links.py::test_one_hosts_records_follow_its_placeholders. The "no positional index" docstring in security/exfil.py now states the order as the contract and how the dashboard pairs by it, and the blocked-link records paragraph in docs/system-specs/modules/security.md records it. bounded_blocked_links only drops records, which leaves the counts unequal, so the card marks nothing in that case.

ai-review-disposition target=first-principles head=979e3ab74
Item 7 (host-wide fallback with no production writer): fixed. AllowHold.cardId is required, holdCardId and its fallback are gone, and the entry receives its card's id as a prop, so the one production writer always passes it. The test hold now carries a cardId.

ai-review-disposition target=ux head=979e3ab74
Evidence gaps: both states are now in the description as committed stills: the one card with Undo under "Stale for a week" after Allow and the reload (allowed-reload-dark.png), and a bulleted list of four chips with the first and then the fourth chip's card open (list-first-chip-dark.png, list-fourth-chip-dark.png). Each comes from a new story in Redaction.stories.tsx.
Watch "the mark is the only thing tying the card to the chip": fixed with the smaller of the two suggestions. The marked entry is now listed first as well as underlined and aria-current, so the reader does not search for it; the tests assert the order. When the counts do not pair, the card keeps its usual order and no mark. Explaining that in the card would need new copy in every locale, which is outside this fix.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Security Scope Review (fork) — 🟡 CONCERNS

Which legitimate operations does 979e3ab7486279c0f96bc4ed6c800b7efb514e9f newly refuse? Model proposes, scripts/deny_diff.py decides — updated in place on each push. A script-confirmed regression blocks PR readiness.

the reviewer's own judgement; no confirmed regression

Scope-Verdict: CONCERNS

TIGHTENING: How blocked-link records are recovered from the raw segment copy (chat_runner._redact_segment). The deny composite is not changed. The one threat it refuses is a chip whose position matches the wrong recorded address: a host with a record the raw copy lacks gets no raw records added — unplaced = { r.get("domain") for r in blocked_links if (r.get("url") or (r.get("domain"), r.get("path"))) not in raw_index } … if key not in seen and record.get("domain") not in unplaced and placeholder in redacted:. On the dashboard, the matching rule is that a chip is matched to a record only when the host's placeholder count equals its record count (paired = new Set([...total].filter(([d, n]) => !heldDomains.has(d) && records.get(d) === n)…)).

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 (.venv/bin/python -m pytest …, npx vitest run …, git diff -- src/..., rg, ls). I wrote windows rows (.venv\Scripts\python.exe -m pytest test\..., npx.cmd vitest run src\test\..., a backslash git diff pathspec). I wrote one any row (npm run build-storybook). No assumed platform is left without a row.

UNADJUDICATED: Every place this change refuses more is in the dashboard's redaction-record path, which the shell classifier cannot see.

  • Guard 1: chat_runner._redact_segment (unplaced filter). Call path: the assistant stream accumulates in _accumulate_segment_raw, then _flush_segment, then _redact_segment, then meta["blocked_links"], which the dashboard reads. What it newly refuses: a host whose placeholder text and raw copy disagree on even one URL now loses every recovered record for that host, not only the conflicting one. The test test_a_host_the_raw_copy_cannot_place_keeps_only_its_own_records pins this: /kept is dropped even though it is in both copies. A placeholder with no record stays plain text, so the reader loses the Blocked link chip and its Open once and Allow for this host for that URL. Inputs I would have submitted: a streamed reply where one URL on reviews.corp.example was redacted mid-stream and a second URL on the same host was cut at a delta boundary. Also a reflowed tail (plan-marker stripping) that changes one of three same-host URLs. In both, the expected record count is the full set and the new count is a subset.
  • Guard 2: MarkdownRenderer paired / occurrence gate and BlockedLinkCard marking. Call path: blockMarkers, then rehypeRedactionMarkers, then the occurrence on BlockedLinkChip, then openMark. It refuses only the address mark, not the chip, so it removes no capability. One input I could not get a verdict for: a held host (heldDomains) re-rendered after Allow. It keeps its card through hold.cardId. A hold saved before this change has no cardId, so openId !== hold.cardId releases it right away, and an Undo that was on screen across the upgrade reload disappears.
  • Narrowing (argued, not confirmed): guard 1 could exclude only the raw records whose position the conflicting key would shift, not the whole host. Or it could keep all recovered records and simply leave the host unpaired, since the dashboard already declines to mark when the counts differ. Either way the misplaced-mark threat stays refused and the chips stay.

[SCOPE-REVIEWED] 979e3ab

Security scope review -- adjudicated candidates

  • macos-latest (platform posix): 8 classified, 0 newly refused, 8 still allowed.
  • ubuntu-latest (platform posix): 8 classified, 0 newly refused, 8 still allowed.
  • windows-latest (platform windows): 5 classified, 0 newly refused, 5 still allowed.

No candidate flipped from allowed to refused.

@jeeshofone
jeeshofone force-pushed the fix/17568-inspect-one-card branch from 979e3ab to 661036f Compare October 7, 2026 07:30
@jeeshofone

Copy link
Copy Markdown
Contributor Author

Dispositions for the review lanes on 979e3ab, addressed on the new head 661036f.

ai-review-disposition target=first-principles head=661036f0c
Item 3 (reorder) and item 4 (Report link rule): fixed by subtraction. The card renders the host's records in record order again, with only the underline and aria-current on the marked entry, and the Report link reads group[0].rule as on main.

ai-review-disposition target=ux head=661036f0c
Blocker "the open card reorders its list in place": fixed by taking the first suggested fix. Rows stay in first-appearance order and only the mark moves. That also matches the First Principles ruling against the reorder. No scroll-into-view was added: the card opens directly under the block holding the chip, and the review lanes ask for no new motion.
Evidence gap: list-mark-moves-dark.webm in the description records Inspect on the first, fourth and second chip of one list. The card stays open and in place, and only the mark moves. The list stills were re-captured on this head.
Watch "nothing in the card says so": held. A label needs new copy in every locale, which the PR's Not a goal leaves out. The underline is backed by aria-current for assistive technology.

ai-review-disposition target=design head=661036f0c
PASS note about a placeholder the model typed itself: such a placeholder adds to the host's placeholder count without adding a record, so the counts no longer match and nothing is marked. The PR's repeated-URL test covers the same "more placeholders than records" shape.
Also on this head: the security/exfil.py docstring amendment is reverted. That path is gated by Sensitive Change Review, which a fork PR cannot pass. The contract it stated stays recorded in docs/system-specs/modules/security.md and in _redact_segment's docstring, and the collector order is pinned by test_redaction_blocked_links.py::test_one_hosts_records_follow_its_placeholders.

CI on 979e3ab, for the record:

  • Backend Tests (3.12, 2): test_memv2_audit_c_runtime.py::test_http_deadline_wraps_real_recall_handler[True] is outside this diff and passes 3 of 3 locally. It is the recall-deadline ordering class fix(test): order worker entry before the recall deadline in memv2 tests #12785 addressed. This is a first sighting on this PR, and the new head retries it.
  • Backend Tests (Windows) (2): test_security_gate_liveness.py::test_the_package_stays_within_its_line_budget (28575 > 28572) was this PR's own three docstring lines in security/exfil.py. Those lines are reverted on this head.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 7, 2026
@jeeshofone

Copy link
Copy Markdown
Contributor Author

Status on head 661036f.

ai-review-disposition target=ux head=661036f0c
Watch 1 ("This link" tag or tint): held. A visible tag is new copy in every locale, which this PR's Not a goal leaves out. The mark is the underline on the entry's address plus aria-current, and it is the only emphasis in the card.
Watch 2: the description's Manual verification line still says "/stale first and marked" from the earlier head. On this head entries keep record order, so /stale is third and marked, which is what the stills and the recording show. I am leaving the description as it is, because editing it after a push cancels the review lanes on this head. The next push will correct the line.

Remaining reds on 661036f, none from this diff:

  • Backend Tests (3.12, 6): test_dashboard_server_composition_contract.py::test_the_dashboard_boot_keeps_its_chain_hooks_and_order fails on the boot hook order (_kick_deferred_transcript_removal vs await_crewmate_prune_settled, one extra _dispatch_healthy_boot_marker). This PR does not touch the dashboard boot. The test passes locally on this head, and the same test has failed on another unrelated PR, so I treat it as order-dependent and not caused by this change.
  • Backend Lint & Type Check (3.12): cancelled during the mypy step at the job's time ceiling. mypy on the changed Python files passes locally.
  • Coverage Gate and PR Readiness fail closed on the two above.

@jeeshofone
jeeshofone force-pushed the fix/17568-inspect-one-card branch from 661036f to d45330e Compare October 7, 2026 09:37
@jeeshofone

Copy link
Copy Markdown
Contributor Author

Dispositions for the review lanes on 661036f, addressed on the new head d45330e (rebased onto main 4a241ce).

ai-review-disposition target=ux head=d45330e6a
Watch 1 ("This link" tag or tint): fixed with the tint, which needs no new copy. The marked entry's block now gets a light warn tint (bg-warn/10) beside the underline and aria-current. Every entry of a multi-address card carries the same inset, so moving the mark moves only the tint and no row shifts. A card that cannot pair placeholders with records tints nothing. Pinned in MarkdownRenderer.blockedLink.test.tsx: the tint is on the marked entry only, and is absent in the unpaired case. Removing the tint fails the first test. The stills and the recording in the description were re-captured on this head, in dark and light.
Watch 2 (description says /stale first): fixed. The Manual verification line now says /stale is third in record order, underlined and tinted, which is what after-dark.png and after-light.png show. No scroll-into-view was added: the card opens directly under the block holding the chip.

Earlier reds on 661036f:

  • Backend Tests (3.12, 6), test_dashboard_server_composition_contract.py::test_the_dashboard_boot_keeps_its_chain_hooks_and_order: passes locally on main 0d885e6 with this commit applied, and again on this head. CI's merge ran against an intermediate main. This PR does not touch the dashboard boot.
  • Backend Lint & Type Check (3.12) was cancelled during mypy at the job's time limit. This push runs it again.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision labels Oct 7, 2026
@jeeshofone

Copy link
Copy Markdown
Contributor Author

First Principles on 7a62253aa, answered at head 4a9e224fd (rebased onto main b4c0378b6; the GuideLayer red on the old head was #18771, fixed on main).

  • Item 3, reload relocation (oversized): taken as the subtraction you named. registerSlot, SlotIds, ends, the slotGeneration retargeting effect, AllowHold.link, blockedLinkCardPlace and the anchor/image link counting are deleted, along with the merge story, its stills and recording, and the merge tests. The card id is rx-link-<domain>~<rendered block>.<top-level block>; a held card reopens by hold.cardId, and if no block lists it no card shows. blockedLinkPlaces.test.ts now runs 300 seeds asserting every block lists the same card ids before and after Allow turns chips into links, images or bare URLs.
  • Item 4, title (inherited): taken. One record keeps main's link_title ("This link is blocked. It cannot open or preview."), restored verbatim from main in all 13 catalogs, and shows no scope line. Several records keep link_title_set and link_card_scope. Pinned in titles one record with main's title and several by the set.
  • Item 6, identical records (inherited): taken. A chip whose records all name the same kept address (a URL streamed twice) keeps main's single-address label. Withheld addresses never count as the same, because nothing shows them, so two withheld twins still show the host only. Pinned in labels the chip with the address when one kept address is recorded twice and labels the chip with the host alone when two records differ or are withheld.

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 I18N_BASE_REF; R8.13 rebased because main touched the catalogs).

@jeeshofone

Copy link
Copy Markdown
Contributor Author

UX Review on 7a62253aa, answered at head 4a9e224fd.

  1. The clicked link is buried: taken. Each chip now carries its place among the host's placeholders in the whole message, code included, so the places line up with the backend's records. The card lists the record in the clicked chip's place first and the rest in record order (several-paragraphs-*.png: "/stale" now leads). It is only an order. Nothing marks or names it as the clicked link, because a stray or forged chip shifts the places. Pinned in puts the clicked chip's place first in every block and in the 300-seed blockedLinkEntries property.
  2. The scope line on a single record: taken. One record shows main's title, "This link is blocked. It cannot open or preview.", which restores the line saying what blocked means, and no scope line (single-record-*.png). The scope line shows only when the card lists several.
  3. "Allowed" next to live Allow buttons: not in this PR. Main has the same per-entry behaviour, and an earlier round took it out of this PR as out of scope for the Goal (one card per Inspect click). It is tracked with a design in Blocked-link card does not reflect Allow across entries/title #18675.
  4. The card can move after a reload: resolved by removal. The relocation machinery is gone (see the First Principles disposition). A held card reopens under the block that lists its own id, which Allow leaves in place, so it no longer jumps between blocks. The recording of the move is deleted with it.

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.

@jeeshofone

Copy link
Copy Markdown
Contributor Author
  • The card's ordering presents a guess as an answer: fixed at c49accb43.

The clicked-place reorder is removed: place/order in BlockedLinkCard, linkBase, countBlockedLinkPlaceholders and the cross-block counting pass are deleted. Entries are in record order whichever chip was clicked, so the credInUrl case can no longer put /other-b on top under chip 2. The chip number left on BlockedLinkChip is only unique within its rendered block, so only the clicked chip's Inspect renders pressed; nothing orders by it. Pinned in lists every address of the host in record order, whichever chip was clicked (all four chips) and in the 300-seed blockedLinkEntries property, which now asserts record order. A placeholder→record id stays #18673.

@jeeshofone

Copy link
Copy Markdown
Contributor Author
  • A backend fix is bundled into a fix(website) PR: fixed at c49accb43.

The raw-copy reset is its own commit, fix(chat): clear the raw segment copy whenever the streamed text is cleared, revertable on its own and containing only chat_runner.py and its tests. The PR title is now fix: one blocked-link card per click; clear its stale raw copy, and the Goal names both halves.

@jeeshofone

Copy link
Copy Markdown
Contributor Author
  • Item 3, the clicked-place reorder (oversized): taken as the subtraction you named, at c49accb43.

place/order, linkBase, countBlockedLinkPlaceholders and the chip number as an order are deleted. Entries are listed in record order (pinned for every chip, and in the 300-seed property). The remaining chip prop is a per-block counter used only for which Inspect shows pressed.

@jeeshofone

Copy link
Copy Markdown
Contributor Author
  • Item 6, AllowHold.entry (enters the Not-a-goal): taken, at c49accb43.

AllowHold.entry and the ordinal comparison are deleted; the hold keeps only cardId. The entry seeds its outcome from the hold exactly as on main, so how Allow is reflected across entries is main's behaviour again, tracked in #18675.

@jeeshofone

Copy link
Copy Markdown
Contributor Author
  • Item 4, link_title_set / link_card_scope and the dropped Destination line (rides along): taken, at c49accb43.

Both keys are removed from all 13 catalogs and pluralKeys.json; the catalogs are byte-identical to main. The card uses main's link_title and main's per-entry Destination line and target row. Pinned in keeps main's title and per-entry Destination line when the card lists several links. Stills re-shot.

@jeeshofone

Copy link
Copy Markdown
Contributor Author
  • Same action offered four times, nothing marks the clicked link: holding position, at c49accb43.

Marking the clicked entry needs an identity the reply does not carry: placeholders, records and chips come from different passes, and the PR's own credInUrl fixture shows the chip's place naming an unrelated record. Putting it first was itself flagged by Design and First Principles on this head as a guess presented as an answer, so this head removes the ordering and lists entries in record order. A real mark needs the backend's placeholder→record id (#18673). One "Allow for this host" per entry is main's per-entry layout, unchanged here; a single host-level action belongs to #18675's rework of the card's actions. I'm not adding either here, because both lanes above ask this PR to stay at the Goal (one card per click).

@jeeshofone

Copy link
Copy Markdown
Contributor Author

This is main's behaviour: each entry keeps its own outcome, and the sibling buttons stay until the card remounts. At c49accb43 the PR no longer changes it (AllowHold.entry is deleted, per First Principles item 6), and the multi-entry card is main's layout again, not a new one. On a remount every entry picks the host's outcome up from the hold, as on main. The fix (one host-level outcome for the card) is designed in #18675.

@jeeshofone

Copy link
Copy Markdown
Contributor Author

Head c49accb43: rebased onto main 10350b729 (conflict in test/test_chat_runner_coverage.py only: main added a cadence test beside our new class; both kept). Main has moved 7 commits since, none touching our files; git merge-tree is clean.

Reds on 4a9e224fd, none from this diff:

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 I18N_BASE_REF=origin/main; R8.1 body edited before the push; R8.13 merge with current main clean).

@jeeshofone

Copy link
Copy Markdown
Contributor Author

UX Review on c49accb43, answered at head d47c90563.

  • BLOCK, evidence gap (a card holding two records that agree on every field): fixed. New stories BlockedLinkWithheldTwins and BlockedLinkKeptTwins, shot at this head in light and dark: temp-screenshots/17613/withheld-twins-{light,dark}.png (address withheld, so the chip names the host alone; two entries) and temp-screenshots/17613/kept-twins-{light,dark}.png (one kept address recorded twice, so the chip keeps the address; two entries).
  • Watch 1, the filled Inspect suggests the clicked link is listed first: fixed by removing the filled state. Every chip now has the same styling, so nothing ties the clicked chip to an entry. Only the clicked chip reports aria-expanded. Pinned by reports only the clicked chip as expanded, and styles every chip alike (red with the fill restored). The other stills were re-shot at this head; one-list-filled-chip-* is replaced by one-list-shared-card-*.
  • Watch 2, the clicked chip is marked by colour alone: moot, since the colour mark is gone with Watch 1.
  • Suggestion, "Link 1 of 2" numbering: holding. It adds a new string family across every catalog for a case the card already shows truthfully (each placeholder is its own record). Carrying a placeholder-to-record id, which would make that numbering meaningful, is Blocked-link chip names a record it cannot prove #18673.

@jeeshofone

Copy link
Copy Markdown
Contributor Author

First Principles on c49accb43, answered at head d47c90563.

  • Item 2, the filled Inspect style (rides along): taken. The filled state is removed. Only aria-expanded stays per chip; without it, every chip of the host would report the shared card as its own.
  • Item 8, the Storybook stories (rides along): holding. They are how the committed stills are produced, and the UX lane's evidence gap on this head needed two more of them (the twin cases). They ship no runtime code.
  • Check that block indices stay the same across the Allow reload: covered by the held card reopens with the same id under the same paragraph and by blockedLinkPlaces (300 seeds where every block lists the same card ids before and after Allow turns chips into links, images or bare URLs).

@jeeshofone

Copy link
Copy Markdown
Contributor Author

Design on c49accb43 (PASS), answered at head d47c90563: a URL streamed twice showing two identical entries is intended. Each placeholder is its own record, and merging them would claim the two placeholders are the same link, which no count proves. The body declares it under "What changed", it is pinned by lists two records that agree on every field as two entries, and it now has stills: temp-screenshots/17613/withheld-twins-* and kept-twins-*.

@jeeshofone

Copy link
Copy Markdown
Contributor Author

Head d47c90563: one push. It removes the filled Inspect state (UX Watch and FP item 2) and adds twin-entry stories and stills (UX evidence gap). It is rebased onto main 365d87c23 with no conflicts.

Earlier reds on 4a9e224fd were not from this diff: E2E member-memory.spec.ts:710 hit the run's time bound (#18185 / #18632), and Backend Tests (3.12, 2) test_cancellation_during_the_spawn_still_reaps is main-side #19451. On c49accb43 every check passed except UX.

Local runs on this head: tsc -b; eslint on touched files; i18n:check; gen-ui-index --check; vitest src/test/MarkdownRenderer*, blockedLinkPlaces, src/components (169 files, 2579 passed) and src/i18n/ with I18N_BASE_REF=origin/main (48 files, 784 passed); pytest on the touched backend tests (560 passed); comment-history (merge-base scoped).

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).

@jeeshofone

Copy link
Copy Markdown
Contributor Author

First Principles on d47c90563, answered at head aaf7d8fa1.

  • Item 4, record de-duplication removed (rides along): taken. blockedLinksForDomain is main's again, including its docstring. Records that agree on every field are one entry. Every field the chip and entry show is true of either record, so merging them hides nothing a reader could act on. Pinned by lists records that agree on every field as one entry, as on main, which goes red when the de-duplication is dropped.
  • Item 5, sameKeptAddress: deleted. The chip uses main's group.length === 1 again. labels the chip with the address when one kept address is recorded twice still passes and also goes red without the de-duplication.
  • Item 6, image src and inject-only slots (undeclared): declared in the body under What changed. A link or image to a host allowed from a still-open card keeps that card's slot, because Allow can turn a placeholder into either. Links inside a counted region (inside another link or in code) add no slot, since no chip can sit there.
  • The two twin stories and their four stills are removed, because the twin card is main's again.

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).

@jeeshofone

Copy link
Copy Markdown
Contributor Author

UX Review on d47c90563, answered at head aaf7d8fa1.

  • Watch 1, duplicate entries in the twins card: fixed. The card de-duplicates again as on main, so a URL streamed twice is one entry with one set of buttons. The twin stills are removed because that card is main's again.
  • Watch 2, the first entry doesn't match the clicked chip: holding, Blocked-link chip names a record it cannot prove #18673. The reply carries no link between a placeholder and its record, so no entry can honestly be put first or marked. The card lists the host's addresses in first-appearance order and claims none as the clicked one.
  • Watch 3, no first-time reader: holding. This lane can't run a blind read. The committed stills cover every changed state at this head.

@jeeshofone

Copy link
Copy Markdown
Contributor Author

Head aaf7d8fa1 (replaces d47c90563): one push, rebased onto main de2d143dc (47 commits, no conflicts; git range-diff shows both commits unchanged by the rebase). The website commit then restores main's record de-duplication (First Principles items 4 and 5, UX Watch 1) and drops the twin stories and stills. The backend commit is unchanged.

CI on d47c90563:

  • Backend Tests (3.12, 4): test/test_kas_mcp_sign_in.py::test_an_unauthorized_server_gets_the_live_consent_url failed with JSONDecodeError: the stub's capture file was still empty when the test read it. This PR touches no ACP/KAS code. The file passes 30/30 locally on this head, and no issue tracks it. If it fails again, I'll file it as a flake.
  • GPT 6.1 "verdict not published" and Opus 5.5 "review incomplete": lane publication failures, not findings. This head runs both again.
  • Coverage Gate / PR Readiness: fail closed on the shard above.

Local on aaf7d8fa1: tsc -b, eslint on the touched files, i18n:check, gen-ui-index --check. vitest MarkdownRenderer*, Redaction*, blockedLink* and src/stories: 65 files, 950 passed. pytest over every test file naming dashboard.chat_runner: 10526 passed, 4 skipped.

…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
@jeeshofone

Copy link
Copy Markdown
Contributor Author

First Principles on aaf7d8fa1, answered at head 4e25d662d (rebased onto main f5adcd76a, still two commits).

  • Item 3, per-chip aria-expanded (rides along): taken as the subtraction you named. OpenCard.chip, openChip, the chip's chip property and its chips++ counter in rehypeRedactionMarkers, and toggle's third parameter are deleted. Every chip keeps aria-expanded={openId === id} with the block-scoped id, so the chips of one block all report their shared card's real state, and clicking any of them again closes it, as on main. Pinned by two chips of the host in one block share its one card (all four report true, a click on the fourth closes the card) and by the four-paragraph test (chips of the other blocks report false and control other card ids).
  • Item 4, slots for img and for links in counted regions: the counted-region half is reverted. The mode === 'inject' condition is gone, so links there behave exactly as on main. The img half is kept, because the Goal's block-scoped card id needs it. When the id names one block and only a counts, an Allow that restores ![…](url) leaves no slot listing the held card, so the card and its Undo vanish. On main the host-wide id still found another block. Mutation: dropping img turns blockedLinkPlaces "lists the same card ids per block after Allow…" red on seed 3. The body says this under What changed.

First-pass check: R1-R8 OK. R1.3 (subtraction), R0.3 (mutation pin on the kept img branch), R8.1 (body edited before the push), R8.13 (rebased; the range-diff for the website commit is =, and the chat commit only picks up main's ends_turn=False context line).

@jeeshofone

Copy link
Copy Markdown
Contributor Author

UX Review on aaf7d8fa1, answered at head 4e25d662d.

  • Watch 1, nothing marks which entry belongs to the clicked chip: holding, Blocked-link chip names a record it cannot prove #18673, as the lane notes. The reply carries no link from a placeholder to its record, so no entry can honestly be marked or put first.
  • Watch 2, after Allow the title and sibling Allow buttons still say blocked: holding, as main's behaviour, under Blocked-link card does not reflect Allow across entries/title #18675, whose scope already covers the title and the sibling buttons.
  • The cap note (no blind read of per-chip aria-expanded): that mechanism is removed at this head. Every chip of a block reports its shared card's state, as on main, so no per-chip state is left to read. Styling is unchanged, so the committed stills still show this head.

@jeeshofone

Copy link
Copy Markdown
Contributor Author

CI on aaf7d8fa1, answered at head 4e25d662d.

  • Backend Tests (Windows) (3): test_vector_memory_bulk_pacing.py::test_semantic_and_lesson_sweeps_are_paced_too is outside this diff. Main fixed it in fix(test): stub the bulk-pacing sleep on the store, not the stdlib #19674 (ddc908bb5), and this head is rebased past that commit. It passes locally on the rebased tree (15 passed).
  • PR Readiness: failed closed on the red above plus the two advisory lanes. Both lanes are answered in the comments above.

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inspect on a blocked link opens one card per block and lists every URL of the host

3 participants