Skip to content

fix(dashboard): let a mirrored session unlink; name a paused mirror - #14117

Merged
iamwhatever merged 1 commit into
mainfrom
fix/mirror-unlink-from-ui
Sep 27, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/mirror-unlink-from-ui

Conversation

@pepmach

@pepmach pepmach commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A dashboard session mirrored to a Discord DM can be un-mirrored from the dashboard — the binding removed, not only paused — so session control stops refusing the session and the screen no longer describes a surviving binding as disconnected.

A dashboard session mirrored to a Discord DM cannot be un-mirrored from the dashboard. The session menu's Discord row offers Disconnect, and Disconnect only pauses: the binding stays in the session store. That retained binding still routes the DM's messages into the session, and session control still refuses the session — session_create / session_send / session_read_message answer "sessions mirrored to a channel cannot control other sessions" — across Disconnect and a gateway restart. Nothing on screen says the binding survived: the header chip reads "Driven from Discord DM" exactly as it did before Disconnect, and the menu row reads "Connect to Discord" exactly like a channel that was never connected.

Why it matters

The operator's own dashboard session becomes unable to dispatch or read workers with no user-facing exit, and the UI tells them it is disconnected while the store says it is bound. The one working exit is a command typed in Discord, which a dashboard user has no reason to know about.

Not a goal

What changed (motivation → approach → change)

Piece What it does
Unlink from X menu item (LinkedSurfacesSection) Severs an explicit binding through ONE endpoint for every row, mirror-unlink; a body naming the Slack thread is handed to the Slack teardown server-side (the routing row below). Offered beside Disconnect on every explicitly bound channel, never on a channel the session was born in — the explicit row there is the dispatcher's own self-mirror, and popping it would strand dashboard-taken turns until the next inbound message rebinds it. The two items define each other under their labels, so neither is read as the other: every connected row's toggle reads Pause replies to X — the Disconnect action labelled for what it does, the symmetric twin of Resume replies to X (the UX lane's rename, verbatim: "disconnect" everywhere else in life means sever, and the reader read the row right only through its sub-line while "the wording pulled in different directions"; a label change only, #3006's pause semantics stand) — and carries "The connection stays." beneath it (trimmed from "Pauses replies — the connection stays": under a verb that already says the replies pause, the first clause was the verb repeated, and the sub-line's job is what STAYS; ended as a sentence, like the paused line, because the unpunctuated form read as "cut off, like a sentence missing its ending" — every locale, each with its own terminal mark; the failure line follows the verb too, "Could not pause replies to X: …") — a born-in channel's row too, where it is equally true (the conversation stays bound, a reply there resumes it) and where a bare pause verb otherwise reads as possibly "the harsher thing" to a reader who has learned the line elsewhere — and Unlink carries "Removes the connection — X stops driving this session. Reconnect anytime from the session menu." for a two-way binding, "Removes the connection — replies stop going to X. Reconnect anytime from the session menu." for a one-way mirror. Reconnecting is real, and the line says where it lives: right after an unlink the session menu offers the same destination as a fresh Connect to row. The way back is its own sentence: as a third dash-clause ("… until you reconnect — from the session menu.") the place attached to the nearest verb and parsed first as "removes the link from the session menu". The line no longer names the kind of link — "two-way link" made a reader pause on the one control that ends the lock-out ("I'd pause first because I don't fully understand 'two-way link'"), and the tail already carries the direction. The place is named as "the session menu", not "this same menu": the same rows also open under the paused header chip, and an unlink from there removes the chip and its menu, so "this menu" pointed at a menu that had just vanished ("which menu?"). A reader who understood the verb still would not click it without knowing how easy the way back is ("I'm not sure how easy reconnecting is"), so the outcome line names the place. "Forgets this connection" on Unlink alone was tried and read as hard to undo, with nothing under Disconnect to compare it against. Which pair a row gets is the row's own drives_session — the slots projection's statement that messages sent there land in this session — never an inference from the wire's direction or the channel name: a Slack thread row is projected out (its inbound routing is Slack's own thread index, never the mirror's inbound marker), yet a reply in a linked thread resumes this session while the link stands and the Slack teardown evicts that index, so the projection marks it drives_session: true and the row takes the two-way pair; inferred client-side from direction and channel, the paused Slack row claimed a one-way link and its Unlink understated what the sever destroys. While a row's STALE refusal notice shows ("The X connection changed while this menu was open. Nothing was unlinked; the row was refreshed."), that channel's Unlink item is not rendered at all: the refetch the refusal triggers may redraw the very same row (a binding re-linked on the same channel), and an Unlink directly under that notice — live or dimmed — contradicted it (a reader "cannot reconcile those and would not click anything"; a dimmed one still read as "odd"). The item follows the notice and returns with its dismissal (or the row's next click); an ordinary failure keeps it live for a retry. The "Ask the agent" hand-off stays under the stale notice as under every other failure: inside Radix menu content it is the notice's only keyboard-reachable escalation and renders in the notice's own conditional branch with aria-describedby the notice's id — errors-use-error-notice's third sanctioned state; a notice with neither askAgent nor that sibling is a dead end (the Opus lane's block on the previous head, which had suppressed the item for the stale case). It earns its place there once the notice says what happened rather than "no longer linked": the notice is worded after what the refusal knows — the connection the row was drawn from was replaced, nothing was unlinked, the row was refreshed — never as "X is no longer linked", because a nonce-only mismatch (a Slack thread replaced in the same channel, a rebind after an unlink from a second tab) means the channel IS linked, to a new target, and the refetch redraws the row as connected right beside the text; and "the connection changed while this menu was open" is a question the agent can answer — which the item now says under its label, in the menu's own sub-line grammar: "Ask what this channel is linked to now." (new key ask_agent_stale_outcome, every locale; ErrorNoticeMenuItem gains an optional outcome sub-line for a host whose every other item self-describes). A bare sparkle item in such a menu was the one control a blind reader could not identify ("no idea what it does or why it's in this menu"). Only the stale refusal carries the line; an ordinary failure keeps the bare item, as the hand-off reads everywhere else in the dashboard. Every sub-line says "the connection", never "the link": "Copy link" a few items up means a web address, and one word for two things in one menu read as a collision.
Paused row: verb and consequence line The row reads Resume replies to X — the verb names the state its sub-line describes. Under a line saying the link still stands, Connect to X read as a second link rather than a resume ("the title says 'Connect' but the small text describes the current paused state… I would not be confident which one I was about to do"), and every paused-mirror repair passes through this row. Every paused BOUND row reads it — a paused born-in conversation too, because that row carries the direction tag and a bare Connect under a tag asserting the connection stands is the same contradiction (the paused born-in row is now shown, below); only a never-connected offer, which asserts no connection, keeps Connect to X. The line is ONE sentence on every paused bound row, "Replies paused — the connection stays.", the born-in row included — with only the verb Resume replies saying it, a reader found "the menu itself doesn't say 'paused' anywhere" — rendered ABOVE the born-in note, so that row reads state first, then why it has no Unlink; so a paused row is not mistaken for "never connected", does not say "linked" beside the "Copy link" item, and leads with what is paused rather than with "Disconnected" under a row that reads Connect. It carries no direction: as a pair ("…messages there still reach this session" / "…don't reach this session") it flipped between two visually identical rows with nothing marking why, and the reader who met both stopped trusting either ("I cannot tell which is true … I no longer trust the captions") — the same reader who, a round earlier, read the kind-names ("the two-way link stays" / "the one-way link stays") as jargon. The direction lives on the row's label instead (next row). While the row's stale refusal notice shows, this line (and the connected row's "The connection stays") is withheld and the verb falls back to the plain Connect to X — beside a notice that says the connection changed while the menu was open and nothing was unlinked, a line or tag asserting the connection stays, or a verb that resumes it, made the row disagree with itself.
Direction label on every bound row (LinkedSurfacesSection) An explicit, visible label on the verb line of every BOUND row, in the right-aligned muted tag grammar the menus already use for a row's status: "Two-way · X ↔ this session" when messages sent there land in this session, "One-way · this session → X" when only replies go there; an offer, bound to nothing, carries none, and the label is withheld under the row's stale notice for the same reason the consequence line is. Rendered from the wire's drives_session (the projection's statement of inbound routing per row, judged over the channel's rows: a born-in channel drives by its origin row) — never inferred from direction or the channel name. It is what makes the Unlink pair legible: the Unlink line keeps its two tails ("X stops driving this session" / "replies stop going to X"), because what a sever STOPS genuinely differs, and the label directly above it names which kind of link the row is, so the two tails read as two kinds of link rather than as one caption that contradicts itself. Every locale; the arrows are literal characters in the catalogs.
Born-in note (LinkedSurfacesSection) A born-in channel's row has no Unlink (the conversation IS the session's home; popping the dispatcher's self-mirror would strand dashboard-taken turns), and says why, on the row, connected or paused: "Started from X — the connection can be paused, not removed." A reader who met a mirrored channel's two controls and this channel's one could not tell "why one connected chat gets both choices and this one only gets the pause". A mirrored row carries no such note. Every locale.
Chip states (InboundLinkChip) Live: "Driven from X". Paused: "Driven from X · replies paused". Unlinked: no chip. Both chip states are ONE affordance — a menu trigger (chevron as the visible cue) that opens the session menu's own Linked surfaces rows FOR THE CHANNEL IT NAMES, right under the chip: for the paused chip Resume replies to X and Unlink from X with "Resume or unlink X." as its title, for the live chip Pause replies to X and Unlink from X with "Pause or unlink X." as its title (new key driven_from_hint, every locale). No other channel's rows and no offers (LinkedSurfacesSection takes a channel scope; a chip that reads "Driven from Discord DM" must not open a menu offering Slack or Telegram; a scoped section does not even fetch the target list). The paused chip is the one a reader clicks hoping to resume, and a hover-only hint (delayed, absent on touch, unread by a screen reader) did not cure the dead click; the live chip is the same trigger because a button beside a plain span that looked identical gave one chip two behaviours a reader could not tell apart before clicking (the UX lane on the previous head), and the menu already carries the live row's actions, so opening it from the chip adds no control — the chip itself still owns none (the old Release button stays gone). Not a second control: the rows are the one component that connects, pauses and unlinks.
One name per destination — row, chip, offer (LinkedSurfacesSection) X is the label the SERVER sends, wherever the destination is named. A bound row (its verb, its sub-lines, its direction tag and its failure lines) reads its link row's label as the slots projection spells it (_link_label: "Discord DM", "Slack", …), the header chip reads the same row's label, and an offer reads the target's label from channel-targets — the same channel form with the destination on it ("Discord DM · 118273645"), the one thing an offer must add, since several destinations on one channel can be offered at once. The menu kept a brand table of its own for bound rows (channelBrandLabel: "Discord"), so one destination carried three names across the journey — the chip's "Discord DM", the rows' "Discord", the offer's target label — and a reader "cannot tell why one is more specific than the other, or whether they do different things". The brand table is now only the fallback for a wire row that carries no label; a row's own name never changes between its connected and paused states (both read the same link row). On the OFFER row that target label is split at its ·: the verb line keeps the channel form (Connect to Discord DM — the name the bound row and the chip use) and the discriminator is the row's muted 11px sub-line — a human tail as the transport sent it ("#eng", "Direct Message", "yourself"), and a tail that is nothing but the id of a user: target named for what it is, "Direct message · 118273645" (new key direct_message_id, every locale) — because the tail on the verb line read as "a raw number on a button … I don't know whose number that is", and the reconnect path the Unlink line promises lands on exactly that row (the UX lane's smallest fix, taken as worded); an unavailable offer keeps its discriminator above its reason, so two unavailable destinations on one channel stay told apart. A failed Slack connect is reported under the offer label it was clicked as, exactly as a failed mirror connect already was. Server strings, so no catalog change. The frames' fixture had been inventing the offer label ("Discord · Direct Message"); it now carries the form the Discord transport really sends (Discord DM · <user id>), and every AFTER menu frame below is re-shot with it (the BEFORE frames, main's build, still show the earlier fixture label on the offer).
SessionMap.clear_mirror_link takes both spellings (src/kiro_crew/session_map.py) A channel session that rebound from the dashboard can hold TWO mirror rows: the canonical binding every read prefers, and the pre-unification dashboard: row it superseded. The read (_mirror_key) falls back to the older row the moment the canonical one is gone, so clearing the winner alone did not unlink the session: mirror-unlink answered was_linked: true, the menu dropped the row, and the next slots frame redrew it pointing at the OLD target — a mirror the user had just removed, reported as removed, still delivering. One mirror-unlink request now clears both rows in one save (each popped before the save, so no reader observes the fallback in between); the endpoint is unchanged apart from its docstring, which had claimed a single spelling.
dropSlotLinks reducer (website/src/store/dashboardSlice.ts) On a successful unlink, drops the rows carrying the binding the completed request named — never the whole channel — and clears the slot's slack_* fields in the same write only when the Slack thread row matched. Between the click and the response another tab can unlink A and link B on the same channel with B's slots push landing first; the server deleted exactly A, so exactly A's rows go and B stays.
binding on every slots link row (src/kiro_crew/dashboard/state.py, website/src/types) An opaque token — a digest of the whole binding: channel type, full conversation id, thread id, and the binding's own persisted nonce. The redacted target stays display-only. The nonce (src/kiro_crew/session_map.py: mirror_nonce beside mirror, slack_link_nonce beside the Slack fields; read through SessionManager.mirror_link_nonce / slack_link_nonce) is minted whenever a binding is created or its target changes, kept across an identical rewrite (the inbound paths re-write the same coordinates on every turn, and the dispatcher rebinds a channel-born session's own conversation each inbound message), and dropped with the binding — so unlink → reconnect the SAME target yields a token the old row never carried. Without it the token was a pure function of the coordinates, and a delayed unlink from a tab still holding the old row (another tab having unlinked and reconnected the same DM meanwhile) matched the recreated binding and deleted it. Random (secrets.token_hex(8), stdlib) rather than a counter so a deleted-and-recreated entry cannot restart the sequence; it never leaves the server except inside the digest. A binding written before nonces existed has none and its token digests the coordinates alone — the binding that replaces it carries a nonce, which is all the guard needs.
drives_session on every slots link row, and mirror-unlink routing a Slack binding (src/kiro_crew/dashboard/state.py, chat_mirror.py; website/src/types, LinkedSurfacesSection.tsx) The server owns two facts the menu had been restating as channel === 'slack'. (1) Whether messages sent in a row's conversation land in this session: the projection says so per row — true for a both mirror (its inbound marker), false for a one-way out mirror, true for a Slack thread although its direction reads out (Slack routes replies through its own thread index), true for the conversation a session was born in. The menu's driven reads that field and infers nothing; the inference is what rendered a paused Slack row as a one-way link. (2) Which store a binding lives in: mirror-unlink takes every row's Unlink and hands a body naming a slack binding to slack-unlink's handler (both key spellings, the slot's own fields, the thread's reverse index, the courtesy note — the aiohttp body is served to the delegate from the cache the first read filled), beside the code that makes the assumption true: mirror-link refuses Slack on channel type, so no slack-typed mirror is creatable, and SessionMap.get_mirror_link already reads the thread as the session's mirror. The menu posts one request shape to one endpoint. A drives_session bit alone cannot pick the endpoint — a two-way mirror and a Slack thread both drive this session and live in different stores — which is why the routing moved server-side rather than onto the field.
Stale-row guard: compare-and-clear as ONE step in the map (SessionMap.clear_mirror_link_if / clear_slack_link_if in src/kiro_crew/session_map.py, delegated by SessionManager; the token in src/kiro_crew/messaging/link.py; callers chat_mirror.py, chat_slack.py; client half in website/src/api/client.ts) The menu names the binding it severs as {channel_type, binding}. The map — not the route — recomputes the row token (messaging.link.binding_token, the projection mints it from the same function) from the binding it holds and that binding's nonce, and clears only on equality, in one @_guarded step under the map's own lock. A mismatch — another tab rebound the slot, a Slack re-link landed a fresh thread in the same channel, or another tab unlinked and reconnected the very same target — is False, and the route answers 409 mirror_changed with nothing touched; the menu reports in place that the connection changed while the menu was open and nothing was unlinked, withholds that channel's Unlink item, the row's consequence line and its direction tag while the notice shows (the agent hand-off stays, described by the notice), and refetches. A body naming the channel with no token is refused the same way. Only an EMPTY body keeps the unconditional clear (clear_mirror_link; the Slack handler's bodiless twin-key clear): a body that is present but not valid JSON, or not a JSON object, is 400 invalid_body and clears nothing — reading it as "no body" would have handed a caller that garbled the row it meant to name the one answer the guard exists to withhold (the Design lane's suggestion on the previous head; _expected_binding now reads the raw text and distinguishes empty from garbled). No unlink route holds a compare of its own any more: a route that read the binding, compared it and then cleared it performed two steps, and a rebind landing between them — another thread's !sessions pick, a rival claim, the dispatcher re-asserting an origin mirror — was cleared by the stale unlink that had matched the binding before it. That was the FOURTH member of one family on this PR (the thread id dropped from the compare, chat_slack.py:490; the client completion keyed on the channel, LinkedSurfacesSection.tsx:249; the token as a pure function of the coordinates, state.py:762; the compare and the clear as two route-level steps, chat_mirror.py:902), so the family is closed structurally rather than patched a fourth time: test_channel_connect_row.py::TestCompareAndClearIsOneStep enumerates the unlink routes (exactly the two registered under an -unlink path) and asserts, over each handler's AST, that it calls its primitive and reads nothing of the binding itself. The mirror twin clears exactly as clear_mirror_link does (both spellings, one save, the unbind audit); the Slack twin clears both key spellings of a dashboard session. The _binding_identity / _binding_matches route-side helpers are gone.
Persist before publish (chat_mirror.py, chat_slack.py) Every dashboard route that publishes a binding state the user just acted on — mirror-link, mirror-pause, mirror-unlink, slack-link, slack-pause, slack-unlink — await state.sessions.aflush() between the map write and the first thing that reports it done: the slots push, the note or transcript backfill in the channel, the {ok, …} answer. The map's writer is debounced (50 ms), so without it a gateway exit before the deferred write reloaded an unlinked binding on restart (the channel kept driving a session the user had been told it no longer does — the GPT lane's persist-before-you-publish block two heads back), silently lifted a pause the user had set (a muted channel started delivering again), or lost a link whose thread already carried the transcript. The unlink routes got the await first; the First Principles lane's point that the pause and link siblings published the same lie is taken, and all six now share one contract, stated in session.md. Awaited in the routes rather than made the map's default because the writers that are not answering a user (inbound turns, the dispatcher's origin rebind) tolerate the debounce. mirror-link's claim runs off the loop, where a batch writes the file inline on the way out, so its await normally finds nothing owed — it is there so the contract does not hinge on which thread the claim ran on. A failed flush propagates rather than answering ok — and on slack-unlink the slot's own fields and the thread's reverse-index entry are torn down in a finally around the flush, so they follow the in-memory map in failure too: with the teardown after the await and no finally, a write failure (a full or read-only data home) left the map clear in memory while the slot still asserted the thread — the row kept rendering from the fields, a reply in the thread still resolved to the slot, and a retried Unlink was 409 mirror_changed with nothing left to compare (the Opus lane's finding on the previous head, taken). Only what the user is TOLD waits for durability; the fields follow the map — LITERALLY: the teardown is conditional on what the map holds once the await returns. The write is a real thread hop, and a second same-slot slack-link can run its whole handler inside it (the existing-thread branch reaches link_slack with no network await), so the map may hold a NEW binding by then; an unconditional teardown stripped that link's fields and reverse index while the map kept asserting it, and a re-link then short-circuited on already_linked with no in-process recovery (the GPT lane's block on the previous head). Now a link the map holds after the flush is that newer write (the route cleared the old one), whatever its thread — its fields and index stand, the thread gets no "unlinked" note and no struck OPTIONS control, and the answer carries relinked: true; an empty map means the old binding's fields and index are torn down, in success and in failure alike. The structural test's rule became positional: a binding read is forbidden BEFORE the compare-and-clear (that is the compare-then-clear shape) and only the plain link read is allowed after it.
_has_channel_mirror on a paused mirror Unchanged and pinned: a paused binding still refuses.
Discord /unlink value sweep Unchanged and pinned for the observed row shape on the real store and through the dispatcher.

The lock-out has one cause: the only user-facing action on a mirror was a pause, because #3006 removed the sever actions (the chip's Release button and the menu's Stop mirroring items) when it made Disconnect mean "output stops, the binding stays" — and the mirror-unlink endpoint kept working with nothing calling it. This PR reverses that part of #3006 on the evidence of #14068: a binding nobody can sever locks the operator's own session out of session control. Disconnect keeps the pause semantics #3006 recorded (its header comment is the record; docs/decisions/ holds no decision on it), and Unlink is a second item rather than a change to Disconnect, because the two verbs mean different things — and each item says what it does under its label, because stacked together the two verbs read as near-synonyms.

The guard compares an opaque identity rather than the row's redacted tail because the tail is lossy in exactly the case the guard exists for: a Slack link's only discriminator is its thread id, a re-link after an unlink (or a Slack-side resume) lands in the same owner DM channel on a fresh thread, and two such rows read alike on target. The token is minted by the slots projection and recomputed by the map from one function (messaging.link.binding_token, below the map so the map can compare it), so the menu and the compare cannot disagree; the routes' one piece of the guard is the body reader (_expected_binding in src/kiro_crew/dashboard/state.py), and the compare-and-clear is the map's (clear_mirror_link_if / clear_slack_link_if). The menu posts every row's Unlink to mirror-unlink, which hands a slack binding to the Slack teardown on the fact the server itself enforces (mirror-link refuses Slack on channel type, so no slack-typed mirror binding is creatable); the client carries no channel-to-endpoint switch, and no inbound inference either — whether a row drives the session is the projection's drives_session.

Why the Slack unlink's durability await is not followed by an epoch stamp on the slot's Slack fields (the GPT lane's F1 on the previous head, chat_slack.py:538: a relink that starts and completes inside the aflush installs new slot fields, and the resumed unlink blanks them). The interleave needs a second same-slot link request to begin and finish its whole handler inside one worker-thread map write, in the only body shape that makes zero Slack round trips (an explicit thread_ts and a non-DM channel) — any link that began before the adjacent clear returns already_linked, and any real Slack round trip lands after the unlink resumes, which is the correct outcome. Both racers are browser-driven: two user actions on the same slot colliding inside one local file write. The residue is bounded, visible and self-healing: the persisted link says linked while the slot's fields say not, so outbound mirroring pauses and the row already renders unlinked; inbound does not misroute, because slot_registry.py:138-140 prunes the stale reverse-index row and returns None; and the fields are rebuilt from the persisted link whenever the slot is next constructed (state.py:6933-6938) — a restart heals it, and an in-process unlink-then-link is the exit. Reordering the field teardown ahead of the await would publish "unlinked" (the slot projection reads those fields) before it is durable, which is the lie the await exists to prevent; a generation stamp compared after every await is new state plus a new ordering contract between link and unlink, carried by every future reader, against a residue that puts no credential, ceiling or user data at stake. So the await stays where it is, and the race is recorded here rather than guarded.

The paused-mirror refusal is kept, deliberately. Pause mutes outbound delivery only; inbound routing never reads mirror_paused, and one click on the same row resumes delivery, so a paused binding is a latent audience that returns without further authorization, and the gate fails closed on it. The way back into session control is Unlink. docs/system-specs/modules/session-control.md states this beside the mirror refusal, docs/system-specs/modules/session.md describes the Unlink item, the binding token and the three chip states, and docs/system-specs/modules/messaging.md records that the /unlink sweep reaches a paused, dashboard-keyed row.

Frontend strings go through the catalog (website/src/i18n/locales, all twelve locales plus the regenerated pseudolocale). The capture script behind the frames below is NOT part of this diff (it was, two heads back; the Design lane noted it re-asserts strings the component tests already pin and rots on every wording change, so it was removed from the commit — the frames stay attached, generated from a local run of the same script against this head's build); website/src/test/dashboardSlice.test.ts, website/src/test/ChatHeaderMenu.slack.test.tsx and the component tests under website/src/components cover the new paths; the backend pins live in test/.

Backwards compatibility

Compatible: mirror-unlink and slack-unlink already exist and gain a caller plus an OPTIONAL body — a bodiless call behaves exactly as before; mirror-unlink additionally accepts a body naming the Slack thread and serves it through the Slack teardown (a body the menu never sent there before — it routed Slack rows to slack-unlink itself). Slots link rows gain two fields (binding, drives_session); a client from before them sends nothing and is unaffected, a client holding a cached row without binding is refused as stale and refetches, and one without drives_session reads the row as not driving until the next slots push. The session map gains two OPTIONAL per-entry fields (mirror_nonce, slack_link_nonce), written only when a binding is created or rebound and dropped with it; an entry from before them reads as "no nonce" and its token stays the coordinates-only digest it always was, so nothing is migrated and an older gateway reading the file ignores the fields. dropSlotLinks is a new reducer, dashboardSlice keeps every existing action. New catalog keys only.

Tests

  • test/test_session_map_mirror.py::TestLegacyDashboardSpelling::test_clear_removes_the_superseded_legacy_row_too and test/test_channel_connect_row.py::TestEndpoints::test_one_unlink_clears_the_superseded_legacy_row_too — a real SessionMap holding both the canonical binding and the pre-unification dashboard: row it superseded; one clear_mirror_link (the second test drives it through one mirror-unlink POST on a channel-keyed slot with the row's own token) leaves get_mirror_link empty, the nonce empty, the legacy row's mirror popped, and the slots projection with no mirror row. Red-first on the previous head: both fail with assert ChannelLink(channel_type='telegram', channel_id='old'…) is None — the clear had answered 200 {was_linked: true} and the OLD target was the live binding again.
  • test/test_chat_mirror.py::TestMirrorUnlink::test_a_row_from_before_an_unlink_cannot_unlink_the_same_target_relinked and test/test_chat_slack.py::TestSlackUnlink::test_a_row_from_before_an_unlink_cannot_unlink_the_same_thread_relinked — the ABA the coordinates cannot see: bind, take the row's token, unlink, reconnect the SAME target (mirror) / re-link the SAME thread (Slack); the old token is 409 mirror_changed with the recreated binding untouched, the new token unlinks. Red-first on the previous head, run as a scratch probe against its sources: the old token answered 200 {ok, was_linked: true} and deleted the recreated binding.
  • test/test_session_map_mirror.py::TestBindingNonce — a nonce is minted on create, kept across an identical rewrite (also across an accepts_inbound flip on the same target), re-minted on a target change and after clear + recreate, dropped by clear_mirror_link, clear_mirror_links_at and clear_slack_link and by the Slack clear sentinel; the legacy Slack-synthesized mirror reads the Slack link's nonce; a binding planted before nonces reads "".
  • test/test_chat_slack.py::TestSlackUnlink::test_a_stale_row_cannot_unlink_a_relinked_thread — the case the lanes named: old thread and replacement thread in the SAME channel; the old row's token is 409 mirror_changed with nothing cleared, the current row's token unlinks. A channel-plus-redacted-tail compare answers 200 to the old row.
  • test/test_chat_mirror.py::TestMirrorUnlink — a Discord row cannot unlink a Telegram replacement, and a Telegram row cannot unlink a same-channel replacement whose id shares its redacted tail; a namespaced Discord id still matches its bare row; the right channel with no token, the right token under the wrong channel, and a row naming a binding that is already gone are all refused; no body keeps the unconditional clear.
  • test/test_chat_mirror.py::TestMirrorUnlink::test_a_garbled_body_is_refused_and_clears_nothing and test/test_chat_slack.py::TestSlackUnlink::test_a_garbled_body_is_refused_on_the_slack_route_too — a body that is present but not valid JSON ({"channel_type": "telegram", ), or valid JSON that is not an object ([], "telegram", 42), is 400 invalid_body on both unlink routes with the binding still held and nothing pushed; the empty body still clears unconditionally. Red-first on the previous head: assert 200 == 400 — the garbled body was read as "no body" and cleared the binding.
  • test/test_channel_connect_row.py::TestTheWireReportsIt::test_every_row_carries_the_binding_the_unlink_compares — the projected row's binding equals _binding_identity of the stored link WITH its nonce, differs from the coordinates-only digest, hides both the raw id and the nonce, stays the same across an identical rewrite, changes across unlink + reconnect to the same target, and differs between two threads in one Slack channel (the Slack row digesting the Slack link's own nonce).
  • test/test_slack_thread_sync.py — the exact row shape pins carry the token and drives_session (true on the origin row, false on the one-way mirror); the both mirror reads true, the degraded-accessor mirror false, the Slack thread true beside its out direction.
  • test/test_channel_connect_row.py::TestTheWireReportsIt::test_every_row_says_whether_it_drives_this_session — on the real map: a one-way mirror row is ("out", False), the same binding rebound with accepts_inbound is ("both", True), a Slack thread row is ("out", True), and the field is a bool on every row. Red-first on the previous head: KeyError: 'drives_session'.
  • test/test_channel_connect_row.py::TestEndpoints::test_a_slack_row_unlinked_here_gets_the_slack_teardown — one slot holding a Discord mirror AND a Slack thread on the real map; a stale Slack token posted to mirror-unlink is 409 mirror_changed with the thread intact, the current Slack token is 200 {ok, was_linked: true} and the Slack teardown ran (both map spellings gone, the slot's _slack_* fields reset, the thread's reverse index dropped, slack_linked false in the projection) while the Discord mirror beside it still stands — so the request went to the Slack teardown, not the mirror clear. Red-first on the previous head: assert 409 == 200.
  • test/test_channel_connect_row.py::TestCompareAndClearIsOneStep::test_a_rebind_cannot_land_between_the_compare_and_the_clear and ::test_a_slack_relink_cannot_land_between_the_compare_and_the_clear — the race GPT named, made deterministic: the nonce read the compare depends on is wrapped so a REBINDING THREAD is released inside it and given half a second to land. Under the map lock it cannot: the unlink answers 200 {ok, was_linked: true} for exactly the binding it named, landed_inside reads False, and the rival binding (a Telegram mirror / a fresh Slack thread) stands afterwards. Red-first on the previous head, run as a scratch probe against its routes: status=200 landed_inside=True after=None — the rebind landed in the window between the route's compare and its clear and the stale unlink deleted the binding it never named (Slack: after=(None, None)). ::test_a_rebind_that_lands_first_is_refused pins the other ordering the lock allows: the rival is already there, the stale token is a mismatch (False), the rival's own token clears the rival, and a row whose binding is gone is refused.
  • test/test_channel_connect_row.py::TestCompareAndClearIsOneStep::test_a_rebinder_the_compare_never_released_exits_without_a_write and ::test_an_early_failure_inside_the_block_still_joins_the_rebinder_without_a_write — the race helper cannot outlive its test: it is a context manager whose exit cancels and joins the rebinding thread (bounded join), and the rebinder writes only when the compare released it — a wait that times out, or the release cleanup sends, exits without a write. Proven with the shape GPT named: an assertion injected inside the block before any compare runs propagates, the thread is joined on the failing exit, and the real map's binding is unchanged (nothing can recreate tmp_path after the fixture removed it). Red on the previous head with a scratch probe: the old rebinder wrote after its 5 s wait timed out (1 call(s)).
  • test/test_channel_connect_row.py::TestPersistBeforePublish — on the real map with the debounce held at 60 s (so only an explicit flush can write the file), one pin per route: mirror-unlink with a row token, mirror-unlink with no body, and the Slack thread through mirror-unlink each leave session_map.json without the binding by the time the slots push goes out (captured inside push_slots_update) and by the time the response is read; slack-pause and mirror-pause have the slack_paused / mirror_paused marker on disk at both moments; slack-link has the thread on disk when the response is read and when the route's own slots push goes out (state.link_slack redraws the slot row from inside the map write, so the FIRST push may still read the old file — a redraw the next push corrects, not a report the user acts on); mirror-link has the binding on disk at both moments (its claim writes inline off the loop, so this one is a contract pin, green on the previous head too). Red on the previous head for the two pause routes and the Slack link: the answer was published while the pause was not yet on disk / … while the thread was not yet on disk; two heads back for the unlink routes: … while the binding was still on disk. _with_real_storage and test_slack_mirror_unlink.py bind the real map's aflush so the routes' durability point writes the file the pins read.
  • test/test_chat_slack.py::TestSlackUnlink::test_a_failed_flush_still_tears_down_the_slot_and_the_reverse_index — a REAL SessionMap with the debounce held off and _write_payload made to raise ENOSPC: slack-unlink answers 500 with nothing published, the map reads no link, and the slot's _slack_* fields and the thread's reverse-index entry are torn down anyway, while the file still holds the thread (the write failed — a restart reloads the link, and the user was told nothing to the contrary). Red on the previous head: assert slot._slack_linked is False failed — the raise skipped the teardown and the fields still said linked.
  • test/test_chat_slack.py::TestSlackUnlink::test_a_relink_that_lands_inside_the_flush_window_survives_the_unlink (another thread; the same thread) and ::test_a_plain_unlink_still_tears_down_the_slot_and_the_reverse_index — a real SessionMap; the route's aflush is wrapped so a concurrent link_slack (fields, map and reverse index, the real path) lands inside the write window: the answer is {ok, was_linked: true, relinked: true}, the newer link's fields and index stand, no courtesy note and no struck control go to the relinked thread, the slots push still goes out; without a relink the answer is relinked: false and the old binding's fields and index are gone. Red on the previous head: the unlink stripped the relinked slot's fields (assert False is True) in both relink cases. The r9 Slack race pin (test_a_slack_relink_cannot_land_between_the_compare_and_the_clear) now reads relinked: true — the re-link that lands after the clear is reported, not silently torn down after — and test_every_unlink_route_clears_only_through_the_primitive enforces the positional rule (forbidden before the primitive, the plain link read alone allowed after).
  • test/test_chat_mirror.py::TestMirrorUnlink::test_an_undecodable_body_is_refused_like_a_garbled_one and test/test_chat_slack.py::TestSlackUnlink::test_an_undecodable_body_is_refused_on_the_slack_route_too — invalid UTF-8 bytes, or an unknown charset=, are the garbled body: _expected_binding catches UnicodeDecodeError / LookupError around request.text() and answers the same 400 invalid_body with nothing touched (a fenced GPT finding on an earlier read of the previous head: the decode raised before any read or mutation, so only the status code was wrong — a 500 where the guard has a 400). Red on the previous head: assert 500 == 400.
  • test/test_channel_connect_row.py::TestCompareAndClearIsOneStep::test_every_unlink_route_clears_only_through_the_primitive — structural: the routes registered under an -unlink path (read from routes/*.py) are exactly api_chat_slot_mirror_unlink and api_chat_slot_slack_unlink; over each handler's AST, the primitive is called and none of get_mirror_link, get_slack_link, the nonce accessors, binding_token or the former route-side compare helpers appears — no route reads the binding for a compare of its own.
  • test/test_session_map_mirror.py::TestCompareAndClear — the primitives on the real map: a match clears exactly like the plain clear (nonce, inbound marker and pause flag gone; the superseded legacy dashboard: row too), a wrong channel, a wrong token, an empty token and a binding already gone are all False with nothing touched; a binding from before nonces matches its coordinates-only token; the Slack twin clears both key spellings of a dashboard session (the bare-key copy planted, since a live claim on the same thread would evict the prefixed owner) and only the one key of a channel session.
  • website/src/components/LinkedSurfacesSection.cov80.test.tsx — Unlink sends {channel_type, binding} (never pauseMirror); every connected row carries the Disconnect sub-line and Unlink its outcome sub-line; a paused explicit row reads Resume replies to X and never Connect to X (red on the previous head), a paused born-in row reads Resume replies to X under its two-way tag, then the ONE paused line, then the born-in note in that order (compareDocumentPosition), and never the Disconnect sub-line (red on the previous head: no paused line at all; two heads back it read Connect to X); every bound row carries its direction label ("Two-way · X ↔ this session" / "One-way · this session → X") and every paused bound row the ONE paused line, with no Disconnect sub-line; a one-way row is labelled one-way and its Unlink names what a one-way mirror stops (replies); an offer carries no label; a section scoped to one channel renders that channel alone, no offers, and never fetches the target list; a PAUSED SLACK THREAD (wire direction: 'out', drives_session: true) is labelled two-way and takes the two-way Unlink line, never the one-way one; the label and the Unlink line follow the wire's drives_session and nothing else — a paused Slack thread and a paused both mirror whose rows LACK the field (a cached pre-field payload) are both labelled one-way with the one-way Unlink line and share the single paused caption (red on the head that inferred two-way from the channel name and the direction); the stale notice withholds the direction label along with the consequence line, and both return when it is dismissed; a cached row without a token sends ''; a born-in channel beside its own self-mirror row, once paused, carries the paused line too and still no Unlink; an origin-only row and a channel the session was born in have no Unlink but do carry the Disconnect sub-line and the born-in note (red on the previous head), while a mirrored row carries no note; a Slack row posts its Unlink to unlinkMirror like every other row — unlinkSlack is never called from the menu (red on the previous head) — and the slot's Slack fields clear on success; a failed unlink reports in place and keeps the row; a 409 is reported as unlink_stale and the slots refetched, replacing the stale Discord row with the server's Telegram row; when the refetch redraws the SAME row, there is no Unlink item under the stale notice but the "Ask the agent" hand-off item IS there, aria-describedby the notice's id, the notice carries the unlink_stale text, the hand-off item carries "Ask what this channel is linked to now." under its label (red on the previous head: the bare label), the row's consequence line and direction tag are withheld, and dismissing the notice removes the hand-off with it and restores the item, the line and the tag, and the next click unlinks (red on the previous head, which dropped the hand-off for the stale case); an ordinary failure keeps the Unlink item live and the hand-off reachable, as the bare item (no outcome line — that line is the stale refusal's); a PAUSED stale row falls back to the plain Connect to X verb under its notice and reads Resume replies to X again once the notice is dismissed; an ordinary unlink_failed leaves the item live; an in-flight click is swallowed. Labels: a bound row reads the label the wire sent on its link row (zzq-wire-label) and never the client brand table ("iMessage", "Feishu") — red on the previous head, which rendered the brand — while a wire row with an empty label still falls back to the brand table and an unrecognised channel to the link label; every row/label pin in the file names the fixture's wire label (zzq-guild, zzq-slack, zzq-tg), which a brand-labelled row cannot satisfy; a failed Slack connect is reported under the offer label it was clicked as (zzq-slack-dm, red on the previous head: it reported the brand "Slack").
  • website/src/components/InboundLinkChip.cov80.test.tsx — the three chip states; BOTH the live and the paused chip are a button (the same menu trigger) carrying their own hint as title ("Pause or unlink X." / "Resume or unlink X."); the live chip's menu carries Pause replies to X with "The connection stays." and Unlink from X and no resume row (red on the previous head, whose live chip was a span with no button and no menu); the paused chip's menu is the LinkedSurfacesSection rows for ITS channel alone (with a Telegram row on the slot and a Slack offer configured, the menu lists the Discord rows only and the target list is never fetched), (Resume replies to X with the paused consequence line, Unlink), and clicking the resume row there calls pauseMirror(slot, false, false), after which the chip reads live and stays the trigger, its menu now carrying the pause row.
  • website/src/components/LinkedSurfacesSection.cov80.test.tsx also pins the completion race red-first: Unlink A, a slots push replaces the row with B (a different binding) before A's response, and B's row survives the completion with its Disconnect/Unlink still offered; the same on the Slack path keeps the slack_* fields. On the previous head both fail with B erased (expected [] to deeply equal [ 'b-2' ]).
  • website/src/components/LinkedSurfacesSection.cov80.test.tsx (offers) — a target labelled Discord DM · 118273645 under user:118273645 renders the verb Connect to Discord DM with the sub-line "Direct message · 118273645" and never the whole label on the verb; Slack · #eng renders Connect to Slack over "#eng", WhatsApp · yourself over "yourself" (a human tail is shown as sent, never renamed); the click still links the exact target_id; an unavailable offer keeps its discriminator above its reason. Red-first on the previous head (the whole label sat on the verb line). ChatHeaderMenu.slack.test.tsx's offer pins read the split the same way (the two-offers test now proves distinguishability through the sub-lines, with the verb lines both channel names).
  • website/src/test/ChatHeaderMenu.slack.test.tsx — the feat(channels): one connect/disconnect row per channel #3006 vocabulary pins updated to the reinstated Unlink item and to the pause verb (Pause replies to Slack / Pause replies to Discord DM, with "The connection stays." beneath): Unlink is present with its outcome (the two-way line — the fixture's Slack row carries drives_session: true, as the projection emits it), the rest of the removed vocabulary stays gone, a paused Slack row reads Resume replies to Slack and never Connect to Slack, and a held channel still gets no second offer. Its Discord literal pins read the wire label the fixture carries (Disconnect from Discord DM, Unlink from Discord DM), where they read the brand Discord before. The chip test's both rows carry the field the same way, and its menu pins name the fixture's wire label (zzq-chan).
  • website/src/test/dashboardSlice.test.ts — dropSlotLinks drops the rows carrying the named binding and keeps the origin row; a same-channel row with a different binding is left alone and nothing is stamped; the Slack fields clear only with the Slack thread row the binding matched; no-op on a channel with no rows and on an unknown slot.
  • test/test_session_control_boundaries.py::test_a_paused_mirror_still_refuses, test/test_session_map_mirror.py::TestReleaseConversationLocation::test_a_paused_dashboard_mirror_into_this_dm_is_swept, test/test_discord.py::test_unlink_frees_a_paused_two_way_dashboard_mirror — pins on the paused-mirror refusal and the /unlink sweep.
    Round 17: the Slack unlink's in-process teardown is conditional on what the map holds after the flush, so a relink that lands inside the write window survives and the answer names the race (GPT). Round 16: the unlink teardown completes even when the SessionMap flush fails (Opus). Rebased onto main a83d2258a2 immediately before this push (chore(prepare-pr): hold the skill under its 68000-byte ceiling #14404, fix(members): accept free-form display names #11121, docs: credit zerovulnlabs for a private security report #14408, docs(ci): point CODEOWNERS at the kirocrew-pr-review team #14393, fix(ci): unbreak the two base-side gates red on every open PR #14398, fix: owner-gate remaining MCP/config mutations #14300, fix(dashboard): owner-gate gateway restart and update-policy routes #14341 and the one commit after them since the previous base — none in this PR's files; git merge-tree clean, the rebased tree identical to the merge tree). fix(ci): unbreak the two base-side gates red on every open PR #14398 heals the two base-side gates that were red on every open PR, so this head inherits no expected red. Before that, rebased onto main 55580af241, e4e6ed7c60, 962247d7a5 and 4d683462c2 in turn.
    Rebased onto main e4e6ed7c60 immediately before this push (the eleven commits since the previous base — ci(readiness): settle events that cannot change the verdict #14154, feat: show a per-type glyph on the attachment card #12916, ci(platform-tests): run the macOS shards on two xdist workers #14162, ci(review): budget the slot lookup that licenses a notice comment #13657, fix(history): keep incognito and temporary transcripts, learn nothing #13760, fix(acp): reclaim per-run work dirs and report refused alias unlinks #13974, fix(subagent): leave startup on the first stream event, not at stream open #14020, feat(desktop): re-land the bundled kiro-cli, widen signing wait #13207, ci(readiness): drop the fork lanes whose payload can never name a PR #14164, ci(watchdog): fix the blind evidence reserve and make the partial hold exact #13977, ci(macos): give the 40-minute cap headroom back with four file-shards #14173 — touch CI workflows, their tests, the attachment card and unrelated modules; git merge-tree clean, the rebased tree identical to the merge tree). Before that, rebased onto main 962247d7a5 after the 22:50 merges, and before that onto main 4d683462c2 after fix(ci): stop platformdirs' pytest11 plugin killing Windows pytest lanes #14268 merged. That merge-ref carries the Windows heal, so the Backend Tests (Windows), E2E Gateway Boot (windows-latest) and Windows Fail-Closed Sandbox Contract reds the previous heads inherited (upstream platformdirs 4.12.0's pytest11 plugin, ci(windows): platformdirs 4.12.0 declares a pytest11 entry point at platformdirs.pytest_plugin that will not import, so every Windows pytest lane dies before collection #14249) clear here; earlier heads sat on 7b2da39c53 (the fix(settings): regenerate the settings registry for the moved double-click route #14138 heal for Chat rail registry: chat.double-click-to-edit-your-messages has no page tag, failing Frontend Tests and Coverage Gate on main #14150) and before that on the green-of-record 694f61983e. Nothing is cited as an expected red on this head. Should something recur that is not this PR's: Backend Tests (Windows) (1) once failed in test/test_history_index_worker.py::test_a_contended_write_waits_instead_of_failing ("the write did not actually contend") — a Windows timing test in a file this PR does not touch, a flake to rerun; Build Windows Installer (x64) is ci(windows): installer smoke test exceeded the 120-second install ceiling on an unchanged tree #12888 (the 120 s ceiling). The two CI frontend shards were run in full on the 7b2da39c53 head with the exact ci.yml invocation (I18N_BASE_REF=origin/main npx vitest run --shard=N/4: 9617 + 9454 passed) and not again since — the later heads change catalog keys and the component tests under them, all covered by the i18n suite and the named files below.
    Gates run locally on this head, on the rebased tree: black ratchet (chat_slack.py, chat_mirror.py and test_channel_connect_row.py are baselined — untouched by black, only this round's hunks re-applied; the ratcheted files pass), isort, flake8, mypy on chat_slack.py and state.py; named backend tests with -n0, one file at a time: test_chat_slack.py (26), test_session_map_mirror.py (115), test_channel_connect_row.py (38), test_chat_mirror.py (88), test_slack_mirror_unlink.py (2). No frontend file changes since the head whose frames are attached (i18n 707/707 against origin/main, 77/77 across the four component/menu files, tsc, eslint, i18n:check, build all ran there; every frame is that head's render and nothing it shows has moved). Docs lint, comment-history and feature-map (enforced against the base) on this head; disclosure grep over the added lines: 0. No local review lane ran on this head; the server round is its first read. Conflict watch: git merge-tree --write-tree HEAD refs/pull/13524/head (feat(messaging): queue or steer into a busy bound session on every channel #13524 also touches chat_slack.py) merges clean; the head sits on main a83d2258a2, the latest main at push time, so push_guard.py --require-single-on-base reads SAFE.

Manual verification

The frames below were taken from the real built SPA — this branch's build for AFTER, main's build for BEFORE — with the slot state mocked at the API boundary (the repo's transcript harness answers /api/** from fixtures; the mirror-unlink POST is intercepted and answered {ok, was_linked: true}, or 409 mirror_changed for the stale frame). The render is real; the Discord binding is not, because a pod has no Discord to bind. The local capture run asserts the request body carries {channel_type, binding} and that no sub-line is visually truncated. Each frame was opened and checked by eye.

Screenshots / video

BEFORE (main): a paused mirror reads exactly like a live one on the chip, and like "never connected" in the menu — no way to sever it.

Before, disconnected: chip still reads "Driven from Discord DM"

Before, disconnected: menu offers only "Connect to Discord"

AFTER: the three states each read differently, the connected row's verb says what it does (Pause replies to X, the twin of Resume replies to X), Pause and Unlink each name their outcome under the label so the pair defines itself (and the Unlink line says, in its own sentence, where reconnecting lives), every surface names the destination by the one label the server sends, and a stale Unlink is refused in place — the item withheld under a notice that says what happened, the agent hand-off beside it.

After, connected: the row is labelled "Two-way · Discord DM ↔ this session"; menu offers "Pause replies to Discord DM — The connection stays." and "Unlink from Discord DM — Removes the connection — Discord DM stops driving this session. Reconnect anytime from the session menu." — the same "Discord DM" the header chip shows

After, connected: chip reads "Driven from Discord DM" with a chevron — the same menu trigger as the paused chip

After, connected: clicking the live chip opens this channel's Linked surfaces rows under it — "Pause replies to Discord DM — The connection stays." and "Unlink from Discord DM — …" — the one place those verbs live; the chip owns no control of its own

After, disconnected: chip reads "Driven from Discord DM · replies paused" with a chevron — the same trigger, its menu offering Resume replies and Unlink

After, disconnected: clicking the paused chip ("Driven from Discord DM · replies paused") opens this channel's Linked surfaces rows under it — "Resume replies to Discord DM" (labelled "Two-way · Discord DM ↔ this session", with "Replies paused — the connection stays.") and "Unlink from Discord DM — Removes the connection — Discord DM stops driving this session. Reconnect anytime from the session menu." — one name for the DM on the chip and on its rows

After, disconnected: the row is labelled "Two-way · Discord DM ↔ this session", reads "Resume replies to Discord DM — Replies paused — the connection stays." and offers Unlink with the two-way outcome in two sentences

After, stale Unlink: the server answers 409 and the menu reports "The Discord DM connection changed while this menu was open. Nothing was unlinked; the row was refreshed." in place; the row falls back to the plain "Connect to Discord DM" verb alone (its consequence line, its direction tag and its resume verb are withheld while the notice shows), no Unlink item is rendered under the notice, and the "Ask the agent" hand-off sits under it, described by the notice and saying its job: "Ask what this channel is linked to now."

After Unlink: the menu offers the DM as a fresh "Connect to Discord DM" row — the same name the bound row and the chip used — with the destination as its muted sub-line, "Direct message · 118273645": the transport sends Discord DM · <user id>, split here so no raw id sits on the verb line

The two shapes the DM-mirror frames cannot show. A session BORN in the DM has no Unlink (the conversation is the session), and its Disconnect carries the same pause line:

After, born in the Discord DM, connected: the row is labelled "Two-way · Discord DM ↔ this session", reads "Pause replies to Discord DM — The connection stays." with the note "Started from Discord DM — the connection can be paused, not removed.", and offers no Unlink

After, born in the Discord DM, disconnected: the row reads "Resume replies to Discord DM" under the same two-way tag, then "Replies paused — the connection stays.", then the note "Started from Discord DM — the connection can be paused, not removed." — state first, then why there is no Unlink

A one-way !link mirror (replies go there, nothing comes back) carries the one-way consequence lines, connected and paused; neither state shows a "Driven from" chip, because nothing drives the session from there:

After, one-way mirror, connected: the row is labelled "One-way · this session → Discord DM", reads "Pause replies to Discord DM — The connection stays." and offers "Unlink from Discord DM — Removes the connection — replies stop going to Discord DM. Reconnect anytime from the session menu."

After, one-way mirror, disconnected: the row is labelled "One-way · this session → Discord DM", reads "Resume replies to Discord DM — Replies paused — the connection stays." and offers Unlink with the one-way outcome in two sentences

The chips' title hints ("Pause or unlink Discord DM." / "Resume or unlink Discord DM.") are native tooltips, which the browser draws outside the page — no screenshot can show them, and they are not the affordance: the click is. The local capture run reads the attribute from the DOM and asserts each chip carries its own hint, that both chips are buttons, and that the live chip's menu carries the Pause replies and Unlink rows while the paused chip's carries Resume replies and Unlink.

More frames

BEFORE (main's build), connected: chip

BEFORE (main's build), connected: menu — a bare "Disconnect from Discord" and no Unlink; main has none of the sub-lines

After Unlink: the chip and its menu are gone — reconnecting lives in the session menu, which is what the Unlink line names

Related Issues

Fixes #14068

Pattern harvest

Not generalizable: the missing action was a recorded product decision (#3006) that a later lock-out (#14068) overturned, not a dropped call site — a grep for uncalled API-client methods would have flagged an intentional removal.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@pepmach
pepmach requested review from a team and bolichen97 September 26, 2026 04:43
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 26, 2026
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ human override accepted

Human judgment by @pepmach overrides the GPT 5.6 finding for 7d54b67ea96bf28d7bf05514dddbbd07ae7142c0; the recorded reason is authoritative for this commit.

[GPT-OVERRIDE] 7d54b67

This comment is updated in place on each push.

The model was not re-run because an authorized human decision supersedes it.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 7d54b67ea96bf28d7bf05514dddbbd07ae7142c0: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of 7d54b67ea96bf28d7bf05514dddbbd07ae7142c0 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Confirm a maintainer sanctions partially reversing #3006's recorded pause-only decision (its vocabulary pins are rewritten here on #14068's evidence).

[DESIGN-REVIEWED] 7d54b67

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of 7d54b67ea96bf28d7bf05514dddbbd07ae7142c0 — 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: CONCERNS

relinked: true on the slack-unlink response has zero consumers — the client keys row removal on the binding token and never reads it.

Not justified as shipped

  • Item 5 — zero consumers: the diff adds {"ok": True, "was_linked": cleared, "relinked": relinked} "so the caller knows the race", but grepping relinked finds 0 hits in website/src and, in src/, only the defining route (chat_slack.py) — the menu's dropSlotLinks already handles the race by token, so no reader exists.
    Subtraction: drop the "relinked" key from the response body; keep the internal branch, the withheld note/strike, and the SEL (relinked meanwhile) annotation.
    Clears when: the field is deleted, or a real consumer reads it.

What this change ships

Inventory (10 items) — 9 justified

Intent: FIX — give a dashboard user a way to remove (not just pause) a channel binding, ending the session-control lock-out and the UI describing a severed-looking link that survived. More than 10 differences; the 10 most noticeable kept.

  1. New Unlink from X menu item severs an explicit binding (never a born-in channel) — justified
  2. Unlink names its row: binding token + persisted nonce, 409 mirror_changed on a stale row, one-step compare-and-clear in the map — justified
  3. clear_mirror_link drops the legacy dashboard: twin in the same save, so the old target cannot resurrect — justified
  4. Link/pause/unlink routes (both sides) flush the session map before reporting, so a gateway exit can't silently revert what the user was told — rides along (same root cause fixed on the five sibling routes; declared in the spec)
  5. relinked response field — zero consumers (grepped relinked: 0 in website, defining route only in src)
  6. Disconnect relabelled Pause replies to X / paused rows Resume replies to X, with "connection stays" sub-lines — justified
  7. Header chip names the paused state and becomes a menu trigger over the same channel rows in both states — justified
  8. Visible two-way/one-way tag on every bound row, from the new drives_session wire bit — justified
  9. Offer rows split label into channel verb + destination sub-line; bound rows read the server's label — justified
  10. Stale 409 notice withholds Unlink/sub-line/tag and the agent hand-off self-describes ("Ask what this channel is linked to now.") — justified

[FIRST-PRINCIPLES-REVIEWED] 7d54b67

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — 🟡 CONCERNS

UX-level review of 7d54b67ea96bf28d7bf05514dddbbd07ae7142c0 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

Primary verbs were all read correctly but only as guesses, and the born-in note reads as a global "cannot be removed" claim beside menus offering removal.

Watch

  • Every primary control (Pause/Resume/Unlink rows, both chips) was identified correctly, but the reader rated each "a guess" and, on Unlink, "maybe … cautious", summarizing "'Pause replies' vs 'Unlink' vs 'Disconnect' — I can't tell how far each goes… Confusing." Every mirrored session hits this menu (frequency high, friction not failure). Note before acting: the "Disconnect" in that quote comes from the BEFORE frames (main's build, shot-02/16); the AFTER surface never says it, so the actionable residue is the gradation hesitation, largely covered by the chore(dashboard): follow-ups deferred from #14117 (Discord DM row naming; chip-menu focus return; post-unlink confirmation; sidebar mark on a paused link; 'replies' direction wording) #14377 deferrals — a human should confirm that residual is acceptable.
  • born_in_note "Started from {{label}} — the connection can be paused, not removed." read as contradicting the mirrored menu's Unlink: "shot-11/12 say the link 'can be paused, not removed,' which seems to contradict the menus that do offer removal. Confusing." A user owning both a channel-born and a mirrored session meets both menus (moderate frequency, comprehension friction, persistent). Smallest fix: "…— this connection can be paused, not removed."

[UX-REVIEWED] 7d54b67

@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 Sep 26, 2026
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review — ✅ no blocking findings

Reviewed 7d54b67ea96bf28d7bf05514dddbbd07ae7142c0 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 7d54b67

Verdict parsed from the review's SHA-scoped output markers for commit 7d54b67ea96bf28d7bf05514dddbbd07ae7142c0.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 7d54b67ea96bf28d7bf05514dddbbd07ae7142c0: <one-sentence reason>

@pepmach
pepmach force-pushed the fix/mirror-unlink-from-ui branch from 7bd7565 to 038c7d5 Compare September 26, 2026 06:41
@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • fixed — lossy identity lets a stale unlink delete a replacement binding span=87437dcb7b6b

Legitimate: _binding_identity compared (channel_type, redacted channel tail) and dropped thread_id, so a re-link into the same owner DM on a fresh thread read as the old row and a stale Unlink cleared it.
038c7d5 compares an opaque identity of the WHOLE binding: every slots link row now carries binding, a digest over channel type, full conversation id and thread id (state._link_binding_token); the menu sends {channel_type, binding}; both endpoints recompute the token from the binding they hold (chat_slack._binding_identity) and require an exact match. The redacted target is display-only and no longer part of the compare.
A stale row still gets 409 mirror_changed with nothing cleared; a body naming the channel with no token is refused the same way (never the unconditional clear); no body keeps the bodiless clear.
Red-first pin: test_chat_slack.py::test_a_stale_row_cannot_unlink_a_relinked_thread — old thread and replacement thread in the SAME channel; the old row's token is 409, the current row's token unlinks. test_chat_mirror.py adds the same-channel same-tail case for a mirror; test_channel_connect_row.py pins that the projected row's binding equals the endpoint's identity and differs between two threads in one channel.

@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • fixed — _binding_identity built its target from link.channel_id alone; the Slack compare ignored thread_id span=2f32933b4f4c

Legitimate, as stated: thread_id is the only discriminator a Slack link has, and open_dm returns the same channel every time, so the Slack-side resume and the unlink/re-link cycle both produce a same-channel replacement the channel-only compare accepted.
038c7d5 takes the finding's fix in its general form rather than a Slack-only third element: the slots row carries an opaque binding token — a digest of channel type, full conversation id and thread id, minted by the projection (state._link_binding_token) — the menu sends it beside channel_type, and both slack-unlink and mirror-unlink recompute it from the binding they hold and require equality (_binding_identity / _binding_matches). Non-Slack rows gain the same protection against two channels that share a redacted tail.
Pinned by test_chat_slack.py::test_a_stale_row_cannot_unlink_a_relinked_thread (old vs replacement thread in one owner DM: 409 then 200), test_chat_mirror.py::TestMirrorUnlink, and test_channel_connect_row.py::test_every_row_carries_the_binding_the_unlink_compares.

@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • fixed — primary control not daring-clickable: Unlink stacked under Disconnect with no differentiator span=36fa1a242a03

Taken as written: a one-line sub-label under Unlink naming the outcome, in the same sub-line grammar the toggle row uses. For a two-way binding the lane's wording verbatim, "Forgets this connection — Discord stops driving this session"; for a one-way mirror (a !link or Slack thread, which never drove the session) the truthful sibling, "Forgets this connection — replies stop going to X".
038c7d5 renders it under Unlink from X on every severable row (LinkedSurfacesSection, unlink_outcome / unlink_outcome_out, all locales); the connected and disconnected menu frames in the body are re-shot and show it.
Pinned in LinkedSurfacesSection.cov80.test.tsx (outcome line present; the one-way row shows the one-way wording and not the two-way one) and ChatHeaderMenu.slack.test.tsx.

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Sep 26, 2026
@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • fixed — the paused chip invites repair but carries no control (dead click) span=cdd603064160

The smallest fix the lane names: a tooltip pointing to the session menu. 038c7d5 gives the chip, in its paused state only, title = "Connect or unlink X from the session menu." (inboundLinkChip.driven_from_paused_hint, all locales); the live chip carries none, and the chip stays information-only — no second control beside the menu's rows.
Pinned in InboundLinkChip.cov80.test.tsx: the paused chip carries the hint, the live chip has no title.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 26, 2026
@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • fixed — "still linked" collides with the adjacent "Copy link" item span=1cca1e6c6d1c

The lane's wording verbatim for a two-way binding: "Disconnected — messages there still reach this session." For a one-way mirror, whose messages do not land here, the truthful sibling says what stops and what stays: "Disconnected — replies there stop, the link stays." Neither uses the word "linked".
038c7d5: linkedSurfacesSection.still_linked / still_linked_out, all locales; the disconnected menu frame in the body is re-shot with it. Pinned in LinkedSurfacesSection.cov80.test.tsx (two-way row shows the first line and not the second; one-way row the reverse).

@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • fixed — driven_from_paused: "output paused" is mechanism vocabulary span=85d0d79398dc

Taken verbatim: 038c7d5 reads "Driven from X · replies paused" (inboundLinkChip.driven_from_paused, all locales); the paused chip frame in the body is re-shot with it and the capture script asserts the new text.

@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • fixed — Item 4: the "target may be omitted" compare branch had no caller span=a22fb801896a

Subtraction taken: the optional half is gone. 038c7d5's _expected_binding returns (channel_type, binding) with both required — a body naming the channel without a token gets a token nothing matches and is refused, never the channel-alone compare — and _binding_matches is one equality on the whole identity; the expected[1] is None arm and its test (test_a_body_naming_only_the_channel_compares_the_channel) are deleted. The bodiless compat clear is untouched.
The identity itself changed under the GPT/Opus blocker (opaque binding token instead of the redacted target), which is why the field is renamed rather than merely made required. The spec's "target may be omitted" sentence is gone with the branch.

@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • rebutted — Item 8: capture-mirror-unlink-states.mjs rides along span=f9b65f0676e3

Declared, not undeclared: the body names the script as the capture artifact behind the frames and as not part of the fix, and the repo's own convention is to commit the frame scripts beside the change (the 632 capture-*.mjs siblings the lane counted). It is the only way to reproduce the frames — a pod has no Discord to bind — and 038c7d5 extends it with the stale-row (409) scene the UX lane's evidence gap asked for and an assertion that the Unlink request carries {channel_type, binding}.
Harm-free by the lane's own reading; kept as the PR's reproducible evidence generator.

@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • fixed — unlinkChannel routes on a hardcoded channel === 'slack' while the endpoints' 409 guard is generic span=32288032283c

Taken as the one-line note the lane asked for: 038c7d5's unlinkChannel (LinkedSurfacesSection.tsx) names the assumption at the branch — a slack row is always the slot's Slack THREAD, never a mirror binding, because mirror-link refuses Slack on channel type (chat_mirror.py, use_slack_link), and states the consequence should that change (the thread severed, the mirror standing).
The stale-tab path the lane asked to see live is the new stale frame in the body: the harness answers the Unlink 409 mirror_changed, the menu reports it in place and keeps the row.

@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 Sep 26, 2026
@pepmach
pepmach force-pushed the fix/mirror-unlink-from-ui branch from 038c7d5 to c489b17 Compare September 26, 2026 08:42
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 26, 2026
@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • rebutted — Item 7: pins on the unchanged paused-mirror refusal and /unlink sweep ride along span=54d5b62d5e8e

Declared and load-bearing, not an undeclared rider: the body's "What changed" table lists both as "Unchanged and pinned", and the pins are what turns "unchanged" from an assertion into a checked fact — _has_channel_mirror refusing a paused mirror is the fail-closed boundary this PR keeps on purpose (the lock-out's exit is Unlink, not a relaxed gate), and the /unlink sweep test reproduces the exact row shape #14068 observed surviving, refuting the two inferred causes.
No behavior changes under them; deleting the tests would leave the PR's central claim ("Disconnect keeps the binding and the gate still refuses it") unverified. Kept.

@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • rebutted — Item 8: capture-mirror-unlink-states.mjs rides along span=7972b7c4e6b7

Declared, not undeclared: the body names the script as the capture artifact behind the frames and as not part of the fix, and the lane's own count (634 sibling capture-*.mjs scripts) is the repo convention it follows. It is the only reproducible way to shoot these frames — a pod has no Discord to bind — and it asserts the one thing a screenshot cannot show: the Unlink request carries {channel_type, binding}.
Harm-free by the lane's own reading; kept as the PR's evidence generator. The next head re-shoots the frames whose copy moved through the same script.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • declared and kept — the direction tags and the drives_session field were the remedy the UX lane's BLOCK required span=4774d46a319e

Item 4 rides on named evidence: the UX lane's block on d8f1822 (span 36384e298b74, r9, third recurrence of one item — r5 ae7777335fe1, r6 663f61a98b9d) read two visually identical rows whose captions flipped between "messages there still reach this session" and "don't reach" and stopped trusting either; its remedy was an explicit direction label on every bound row. The drives_session wire field is where that label's truth comes from — the Design lane's WORK item on 1421706 (span 86519be3e0ac) ruled the server owns the inbound-routing fact after the client's own inference (channel === 'slack') mis-rendered a paused Slack row as one-way (Opus, r6). One field, one label, both pinned server- and client-side; without them the r9 block stands.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • declared and kept — the born-in note answers the reader's question the UX lane blocked on span=c6e4f3093f96

Item 5 is the remedy of the UX BLOCK on d8f1822 (span dca70be8cc0e, r10): a born-in channel's row has no Unlink and the reader asked "why does this one only get the pause?" with nothing on the surface to answer it; the lane's fix was one sub-line that explains it. "Started from X — the connection can be paused, not removed." is that line, on the row that lacks the control, and nowhere else (a mirrored row carries none). Pinned in the section tests (connected and paused born-in rows, the mirrored row without it) and shown in the born-in frames; removing it re-opens the r10 block.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • declared and kept — the offer-label split is the UX lane's smallest fix for the row the Unlink line sends users to span=c23dea8a3241

Item 9 is the remedy of two UX findings on consecutive heads: one destination carrying three names across chip, rows and offer (span b96073c4472d on aade175 — rows now read the label the server sends), and the post-unlink offer rendering the transport's raw target id on a button ("a raw number on a button makes me think something is broken or half-finished, and I don't know whose number that is", span 01a87ae6f2b1 on ffe0ea0 — the lane's own smallest fix: keep the channel form on the verb and move the discriminator into the row's muted sub-line). The unlink journey ends on that offer row — it is where "Reconnect anytime from the session menu" sends the user — so its label is part of this fix's own surface; the client carries less, not more (the brand table is a fallback only, the split reads the label the server already sends). Pinned in the section and header-menu tests, shown in shot-08.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • fixed — both unlink routes await state.sessions.aflush() between the clear and the first publish span=e86658c924ec

On 39bcbee mirror-unlink flushes right after the clear (both the token-guarded and the bodiless path) and before push_slots_update and the response; slack-unlink flushes right after its clear and before the slot fields reset, the courtesy note, the slots push and the response — the lane's fix as worded. A failed flush propagates rather than answering ok. Pins (test_channel_connect_row.py::TestPersistBeforePublish) on the REAL map with the debounce held at 60 s, so only an explicit flush can write the file: each of the three routes leaves session_map.json without the binding at the moment the slots push goes out (asserted inside push_slots_update) and when the response is read. Red on af339c5: the answer was published while the binding was still on disk — the file still held the target. The real-storage test helpers bind the map's aflush so the routes' durability point writes the file the pins read. 419 named backend tests -n0; black ratchet, isort, flake8, mypy clean; spec updated.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • fixed — link, pause and unlink all publish only after the SessionMap write is durable span=196fb2d23c8b

On 7e97b59 the four sibling publish sites the item names flush before they publish, in the same shape as the unlink routes: slack-link (after state.link_slack, before the transcript backfill into the thread, the slots push and the {ok, thread_ts} answer), slack-pause and mirror-pause (after the flag is stored, before the note in the channel, the slots push and the {ok, paused} answer), and mirror-link (after the claim, before the notice in the channel) — that one's claim already runs off the loop, where a batch writes the file inline on the way out, so its await normally finds nothing owed; it is there so the six routes share one visible contract that does not hinge on which thread the claim ran on. The mirror-unlink comment the item quoted ("the other writers tolerate the debounce") now names who does: writers that are not answering a user (inbound turns, the dispatcher's origin rebind). session.md states the rule as "link, pause and unlink publish only after the SessionMap write is durable". Pins in test_channel_connect_row.py::TestPersistBeforePublish, one per route, on the real map with the debounce held at 60 s: red on 39bcbee for both pause routes ("the answer was published while the pause was not yet on disk") and the Slack link ("… while the thread was not yet on disk"); the mirror-link pin is green on both heads, as predicted by its inline write.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • declared and kept, ruled — the per-binding nonce stays; it is the remedy for a block, and deleting it re-opens the block span=65049ed73e46

Ruled by the maintainer lane (2026-09-26 14:43Z): the nonce STAYS. The anchor is the r5 GPT BLOCK-MERGE at state.py:762 (anchor residual/crash-data-loss-corruption) and the Opus adjudication that upheld it: with the token a pure function of the coordinates, a row from before an unlink still matches the SAME target re-linked afterwards, so a delayed unlink from a second tab deletes a binding the clicker never saw — a stale unlink after a same-target re-link. That is the loss if the nonce is deleted: the coordinate digest refuses every stale unlink whose destination DIFFERS and none whose destination is the same, and an unlink is not undone by the next slots push the way a stale pause is — the binding is gone. It was the third instance of one stale-binding family found on this PR (chat_slack.py:490 r1, LinkedSurfacesSection.tsx:249 r3, state.py:762 r5); a persisted per-binding identity is the cheapest check that closes it (one secrets.token_hex(8) beside the binding, digested into a token the client already sends; nothing new on the wire, nothing migrated, a legacy binding keeps its coordinates-only token). "Oversized" is a size judgement against a real anchor; the size is one field and one digest component, and the code holds. Red-first tests stand on the head: test_a_row_from_before_an_unlink_cannot_unlink_the_same_target_relinked (mirror) and ..._the_same_thread_relinked (Slack) — on the pre-nonce sources the old token answered 200 {ok, was_linked: true} and the recreated binding was deleted.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • fixed — the stale refusal's "Ask the agent" item says its job under its label span=7215f442a5df

On 7e97b59 the hand-off item under the stale notice carries the outcome sub-line the lane worded, verbatim: "Ask what this channel is linked to now." (new key ask_agent_stale_outcome, every locale), in the same 11px muted grammar every other item in the menu uses for its consequence. ErrorNoticeMenuItem gains an optional outcome prop for it; only the stale refusal passes one — an ordinary failure keeps the bare item, as the hand-off reads everywhere else in the dashboard, and that is pinned too. Red-first: the stale-scene test asserts the item's text carries the line (absent on 39bcbee). Shot-09 re-shot; spec and body updated.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • fixed — "The connection stays." ends as a sentence, matching the paused line span=880975ab674b

On 7e97b59 disconnect_outcome reads "The connection stays." in English and ends with its locale's own terminal mark everywhere else (., 。 in ja/zh-CN, । in hi/bn — the mark each locale's still_linked already uses), so the two consequence lines share one punctuation. Every locale; the French line has no : ; ! ?, so no U+202F case arises; i18n suite 707/707 against origin/main. Literal pins follow (ChatHeaderMenu.slack.test.tsx); the connected-menu frames are re-shot.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • fixed — the born-in paused row says "paused" in words, above its note span=5adc35b174ed

On 7e97b59 every bound row that is paused carries still_linked ("Replies paused — the connection stays."), the born-in row included, rendered above the born-in note ("Started from X — the connection can be paused, not removed.") so the row reads state first, then why it has no Unlink; the verb above both stays Resume replies to X. Red-first: the born-in paused test asserts the paused line is present and precedes the note (compareDocumentPosition) — on 39bcbee the line was absent; the born-in-beside-self-mirror test pins that pausing it shows the line too, still with no Unlink. Shot-12 re-shot; spec and body updated.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • declared and kept, ruled — the per-binding nonce stays; it is the remedy for a block, and deleting it re-opens the block span=fdad38886528

Ruled by the maintainer lane (2026-09-26 14:43Z): the nonce STAYS. The anchor is the r5 GPT BLOCK-MERGE at state.py:762 (anchor residual/crash-data-loss-corruption) and the Opus adjudication that upheld it: with the token a pure function of the coordinates, a row from before an unlink still matches the SAME target re-linked afterwards, so a delayed unlink from a second tab deletes a binding the clicker never saw — a stale unlink after a same-target re-link. That is the loss if the nonce is deleted: the coordinate digest refuses every stale unlink whose destination DIFFERS and none whose destination is the same, and an unlink is not undone by the next slots push the way a stale pause is — the binding is gone. "Every sibling action keeps last-writer-wins" is true of pause, whose stale write the next slots push corrects; an unlink has no next push to correct it. It was the third instance of one stale-binding family found on this PR (chat_slack.py:490 r1, LinkedSurfacesSection.tsx:249 r3, state.py:762 r5); a persisted per-binding identity is the cheapest check that closes it (one secrets.token_hex(8) beside the binding, digested into a token the client already sends; nothing new on the wire, nothing migrated, a legacy binding keeps its coordinates-only token). "Oversized" is a size judgement against a real anchor; the size is one field and one digest component, and the code holds. Red-first tests stand on the head: test_a_row_from_before_an_unlink_cannot_unlink_the_same_target_relinked (mirror) and ..._the_same_thread_relinked (Slack) — on the pre-nonce sources the old token answered 200 {ok, was_linked: true} and the recreated binding was deleted.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • accepted and deferred — the post-unlink offer row should name a person, not an id span=b23da91eaf6d

Accepted: "Connect to Discord DM / Direct message · 118273645" is the row unlink_outcome sends the user back to, and a reader who does not know whose conversation the number is will not connect to it blind. The fix is not in this PR's client: the row renders the label the server sends for the target (splitOfferLabel, LinkedSurfacesSection.tsx:138-146 only names a bare id for what it is), so naming the peer means the transport resolving a display name for user: targets in configured_targets — or an "(your DM)" suffix when the target is the owner — a server-side label change with its own tests. Deferred to #14377 (deferred-finding, assignee pepmach, Due: 2026-10-09), item 1, which records both remedies the lane named.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • accepted and deferred — an unlink from the chip's menu must return keyboard focus somewhere stable span=b81017c1371d

Accepted: InboundLinkChip returns null once no two-way link remains (InboundLinkChip.tsx:61-63) and the Unlink item's onSelect prevents the Radix close (LinkedSurfacesSection.tsx:797), so an unlink from the chip's own dropdown unmounts the menu and its trigger in one render and Radix has no trigger to hand focus back to — focus drops to body. Rare (an unlink from the chip, by keyboard), assistive-technology users only, every occurrence. Deferred to #14377 (deferred-finding, assignee pepmach, Due: 2026-10-09), item 2: move focus to a stable header element on chip unmount and verify it in a live keyboard run, as the lane asks — not a vitest-only pin.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • accepted and deferred — a transient confirmation after an unlink span=fe008c0b710f

Accepted: after an unlink from the chip, the missing chip alone read as "no longer linked, or the badge hasn't loaded"; the mutation's onSuccess (LinkedSurfacesSection.tsx:374-375) only drops the rows. A one-shot toast or brief inline note would mark the removal as deliberate. Deferred to #14377 (deferred-finding, assignee pepmach, Due: 2026-10-09), item 3, with the wording kept in this menu's grammar ("Unlinked from X — reconnect anytime from the session menu.", every locale).

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • declared and kept, ruled — the per-binding nonce stays; it is the remedy for a block, and deleting it re-opens the block span=ff6ba1689524

Ruled by the maintainer lane (2026-09-26 14:43Z): the nonce STAYS. The anchor is the r5 GPT BLOCK-MERGE at state.py:762 (anchor residual/crash-data-loss-corruption) and the Opus adjudication that upheld it: with the token a pure function of the coordinates, a row from before an unlink still matches the SAME target re-linked afterwards, so a delayed unlink from a second tab deletes a binding the clicker never saw — a stale unlink after a same-target re-link. That is the loss if the nonce is deleted: the coordinate digest refuses every stale unlink whose destination DIFFERS and none whose destination is the same, and an unlink is not undone by the next slots push the way a stale pause is — the binding is gone. "Every sibling action keeps last-writer-wins" is true of pause, whose stale write the next slots push corrects; an unlink has no next push to correct it. It was the third instance of one stale-binding family found on this PR (chat_slack.py:490 r1, LinkedSurfacesSection.tsx:249 r3, state.py:762 r5); a persisted per-binding identity is the cheapest check that closes it (one secrets.token_hex(8) beside the binding, digested into a token the client already sends; nothing new on the wire, nothing migrated, a legacy binding keeps its coordinates-only token). "Oversized" is a size judgement against a real anchor; the size is one field and one digest component, and the code holds. Red-first tests stand on the head: test_a_row_from_before_an_unlink_cannot_unlink_the_same_target_relinked (mirror) and ..._the_same_thread_relinked (Slack) — on the pre-nonce sources the old token answered 200 {ok, was_linked: true} and the recreated binding was deleted.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • accepted and deferred — the post-unlink offer row should name a person, not an id span=926d3d5950bc

Accepted, as on the previous head (span b23da91eaf6d there — the same row, the same reader hesitation: "I don't know whose private message that number is"). "Connect to Discord DM / Direct message · 118273645" is the row unlink_outcome sends the user back to. The fix is server-side labelling, as the lane says: the client renders the label the server sends for the target (splitOfferLabel, LinkedSurfacesSection.tsx:138-146 only names a bare id for what it is), so naming the DM's owner means the Discord transport resolving a display name for user: targets in configured_targets (the way WhatsApp's "yourself" tail already does), or an "(your DM)" suffix when the target is the owner. Deferred to #14377 (deferred-finding, assignee pepmach, Due: 2026-10-09), item 1.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • accepted and deferred — the sidebar's channel mark should stay, muted, on a paused link span=884735f39b09

Accepted: connectedChannelLinks (ChatSidebar.tsx:970-976) skips paused links so the row's mark and the menu's verb never disagree, and this PR moved the verb — the menu now says "Replies paused — the connection stays." while the mark vanishes, which the blind reader read as the row contradicting the pill. The rule and its comment predate this PR and are outside its surface (the sidebar row, its glyph test); the smallest fix the lane names — keep the mark for a paused link, muted, and update the rule's comment — is a sidebar change with its own pin. Deferred to #14377 (deferred-finding, assignee pepmach, Due: 2026-10-09), item 4.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • accepted and deferred — "replies" carries two directions; the two-way pause line should name what still arrives span=3e5ed1f095b4

Accepted: the pause vocabulary ("Pause replies to X" / "Resume replies to X" / "Replies paused — the connection stays.") uses one word the reader took as inbound on a two-way row and outbound on a one-way row, and a pause mutes outbound only (#3006), so a user pausing a two-way mirror to stop the channel driving the session finds inbound still arrives. The lane's smallest fix — one clause on the two-way pause sub-line, "The connection stays — messages there still arrive." — is a catalog change in every locale that has to be weighed against round 9's finding on this PR that direction-carrying pause lines flipped between look-alike rows (the direction tag now carries the direction, so the clause should name the inbound consequence only). That weighing is a UX decision the reviewers' two rounds pull in opposite directions on, not a defect in code this PR adds; deferred to #14377 (deferred-finding, assignee pepmach, Due: 2026-10-09), item 5.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

Description gains the **Goal:** line and ## Not a goal section the PR template requires since #14181 — a first write of the frozen sections from this PR's opening intent, not an edit of a frozen goal. Head unchanged.

A dashboard session mirrored to a Discord DM can be paused from the session
menu (Disconnect) but not severed: #3006 removed the sever actions when it made
Disconnect mean "output stops, the binding stays", and the mirror-unlink
endpoint kept working with nothing calling it. The retained binding keeps
routing the DM's messages into the session and keeps session control refusing
it ("sessions mirrored to a channel cannot control other sessions") with no
exit anywhere on the dashboard. The paused state also reads exactly like the
connected one on the header chip, and like a never-connected channel in the
menu.

This reverses that part of #3006 on the evidence of #14068. The session menu
gains an Unlink item beside Disconnect for every explicitly bound channel
(mirror-unlink; slack-unlink for a Slack thread), a paused row says
"Disconnected but still linked", and the chip names the paused state ("Driven
from X · output paused"). Disconnect keeps the pause semantics #3006 recorded.
_has_channel_mirror keeps refusing on a paused mirror -- fail-closed, because a
paused binding resumes with one click -- and that is pinned with a test and
stated in the spec. The Discord /unlink value sweep is pinned, on the real
store and through the dispatcher, for the observed row shape (dashboard key, DM
location with a null thread, paused, inbound-accepting); the two inferred
causes for the row surviving are refuted by those tests.

Fixes #14068
@github-actions

Copy link
Copy Markdown
Contributor

AI-review override not recorded: keep the reason to 500 characters or fewer.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • accepted and deferred — the relinked answer key has no reader; it goes, the behaviour stays span=ce4aaba37463

Accepted, subtraction as worded: the menu already handles the race by token (dropSlotLinks drops the rows carrying the binding the request named, so a newer link's row stays on its own) and the SEL line records (relinked meanwhile), so the key on the answer names the race to nobody. The conditional teardown, the withheld note and strike and the audit annotation are the fix and stay; the key is the rider. Not removed on this head — the head is otherwise clean and a push restarts every lane — so the deletion is the first line of #14377 item 6 (deferred-finding, assignee pepmach, Due: 2026-10-09), with a candidate diff already cut: the key dropped, the relink pin asserting the audit line instead.

@github-actions

Copy link
Copy Markdown
Contributor

AI-review override not recorded: keep the reason to 500 characters or fewer.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 7d54b67: I accept this residual: no in-repo writer sends a channel-less unlink object (the guarded caller sends channel_type+binding from a rendered row, LinkedSurfacesSection.tsx:368 / client.ts:4696; the projection never mints an empty-channel row, state.py:8060-8061; the unguarded caller sends no body, client.ts:4676), so {} reaches only the documented no-row clear, SEL-audited (chat_mirror.py:938-944), announced (link.py:304) and re-linkable. The channel_type-in-body tightening lands via #14377.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@pepmach marked the gpt AI finding as false positive, not applicable, or explicitly accepted for 7d54b67ea96bf28d7bf05514dddbbd07ae7142c0.

I accept this residual: no in-repo writer sends a channel-less unlink object (the guarded caller sends channel_type+binding from a rendered row, LinkedSurfacesSection.tsx:368 / client.ts:4696; the projection never mints an empty-channel row, state.py:8060-8061; the unguarded caller sends no body, client.ts:4676), so {} reaches only the documented no-row clear, SEL-audited (chat_mirror.py:938-944), announced (link.py:304) and re-linkable. The channel_type-in-body tightening lands via #14377.

This decision applies only to this commit. A new push requires a new judgment.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • accepted and deferred — the born-in note says "this connection", not "the connection" span=24292256cd04

Accepted, the lane's smallest fix verbatim: "Started from X — this connection can be paused, not removed." scopes the claim to the row it sits under, so a user who also owns a mirrored session no longer reads it as contradicting that menu's Unlink. One word in 13 catalogs plus the pseudolocale and two re-shot born-in frames — a catalog change that restarts every lane on a head that is otherwise clean, so it lands as #14377 item 7 (deferred-finding, assignee pepmach, Due: 2026-10-09) rather than as another round here.

@pepmach

pepmach commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author
  • declared and kept — the verbs are read right; the residual is gradation hesitation, and it is the deferred set's span=6d88d61fb1b3

The reader identified every primary control correctly (Pause / Resume / Unlink rows, both chips) and rated each "a guess". As the lane itself notes, the "Disconnect" in the quoted confusion comes from the BEFORE frames — main's build (shot-02/16) — which the AFTER surface never says; the actionable residue is how far each verb goes, and each row already names that under its label ("The connection stays." / "Replies paused — the connection stays." / "Removes the connection — X stops driving this session. Reconnect anytime from the session menu."). What remains is covered by #14377: the reconnect row's raw id (item 1), a post-unlink confirmation (item 3), the "replies" direction clause (item 5) and the born-in note's scope (item 7). Kept on this head; the residual is accepted pending a maintainer's look, as the lane asks.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dashboard: a session mirrored to a Discord DM cannot be unlinked from the UI, and the stale mirror locks it out of session control

2 participants