Repository navigation
fix(sidebar): nest federated workers under their remote conductor - #14907
Conversation
… nest
The conductor lane nests a row under the row whose key matches parent.key
within the same origin, and it already did so for peer rows -- but the hub's
peer-slot allowlist (_clean_peer_slot) dropped parent and lineage_pending,
and useInstanceSessions never read them. So every session a remote crew's
conductor opened rendered at the top level of this dashboard as a stray,
wearing no chevron, while the peer's own sidebar nested it.
Forward parent as {slot, key} through the same redact+clamp sink as key,
omit it when the citation has no string key, and forward lineage_pending
only when literally true. The hook keeps only parent.key, the one field the
lane resolves, so a peer row is read exactly like a local one.
Pins: hub forwards/omits/clamps the citation (5 backend tests); the hook
forwards it and drops malformed shapes (2); the lane nests peer workers
under their peer conductor, shut by default, with no stray glyph (1).
Reverting either the hub or the hook forwarding reddens its pin.
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS All verification ran against a fetch-shim harness; worth one pass on a real federated peer to confirm the live wire matches the shim's shape. [DESIGN-REVIEWED] 28f6eca Description read[DESCRIPTION-READ] 5eac9db50b02b1cd547deb4ebb70b0d98165c57801ca97782ee0168d7fa9c888 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS Collapsed remote crews speak only through count badges a first-time user can just guess at; hover tooltips are the sole decode layer. Watch
[UX-REVIEWED] 28f6eca Description read[DESCRIPTION-READ] cbb782b3adb85064a25f08dc9d79d5e7acc2ad8c5f1202f765768213b57d920b That sha256 names everything this verdict read: the PR description, plus the 6 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Confirm the #12757 doc pin ("no lineage crosses that trust boundary") described a gap, not a deliberate withholding — the base frontend already consuming peer citations says gap. Not justified as shipped
What this change shipsInventory (7 items) — 5 justifiedIntent: FIX — sessions a connected crew opened nest under that crew's conductor in the hub's sidebar; the citation was dropped at the hub's peer-slot allowlist and the hook.
Consumer counts run: [FIRST-PRINCIPLES-REVIEWED] 28f6eca Description read[DESCRIPTION-READ] fde45791de5127042503b1752e6b06a00ce1177c88bfe357396cc4c6916b0db4 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsThe hub-driven citation drop compares the raw peer value, while the value it forwards is the FINDING — src/kiro_crew/dashboard/handlers_instances.py:1954 — [OPUS-REVIEWED] 28f6eca Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
…dd capture harness Review round 1 (Opus, First Principles): - forward parent.slot alongside parent.key at both hops: three lane readers dereference it (orphanCitation, citesParent, the citedCreatorRef move baseline), so a peer child flattened by search now wears the same opened-by glyph a local child does, and a peer-side re-parent auto-opens; a citation with only slot (creator gone) is the orphan case and crosses as such - suppress a citation naming a hub-driven peer slot: the driven row is already filtered so its key stays off the wire, and the citation would carry the same key by another route; PeerSlots now hands the driven set to the shaper - feature-map Sessions row rewritten: peer rows nest, citation clamped and redacted, resolved within peer_id only - capture harness (capture/session-tree-peer-lineage.*): before / shut / opened frames through the real ChatSidebar + useInstanceSessions with a fetch shim on the two federated routes; the after frame is a fresh load, not a payload swap, which the lane would read as an adopt
9a79367 to
28f6eca
Compare
iamwhatever
left a comment
There was a problem hiding this comment.
Reviewed. _clean_peer_parent runs both halves of parent through the same redact-then-clamp path as key, drops a citation with neither half, keeps the slot-only orphan case, and citations resolve only within one peer_id so a peer row cannot nest under a local row. Nothing reaches a non-owner. Tests cover malformed shapes, orphan, driven-citation drop, redaction and clamping.
Non-blocking: the driven-key check at handlers_instances.py:1954 compares the raw value before sanitizing, same as the existing row filter at :2193; comparing after _cap_str in both places would close a tiny gap. Also note temp-screenshots/ PNGs are committed.
Problem / Motivation
Goal: Sessions a connected crew opened nest under that crew's conductor in the hub's sidebar, the way the crew's own sidebar shows them.
With sessions federated from a connected crew (the
On worker-1rows), the chat sidebar's conductor lane renders every remote worker at the top level as a stray. The crew's own sidebar nests the same workers under the conductor that opened them; the hub's sidebar shows a flat list ofOn worker-1 -- click to open hererows with no chevron and nothing to fold. On a hub attached to a busy crew this is dozens of rows.Why it matters
The conductor lane exists to make a crew read as one unit of work: one row with a count, the workers behind a chevron. A remote crew is exactly the case where the person is not looking at the crew's own dashboard, so the hub view is the only view they have -- and it is the one that scatters the workers.
Not a goal
parent.keywithin a row's own origin.peer_idonly.What changed (motivation → approach → change)
Symptom: every federated worker is a top-level row. Root cause: the citation never reached the lane.
_clean_peer_slot(the hub's allowlist forGET /api/instances/{id}/chat-slots) forwardedkey,title,agent, three timestamps and two booleans and droppedparentandlineage_pending;useInstanceSessionsread the same fields and nothing else. The tree existed on the peer and was stripped one hop from the reader.Change, at both hops, in the shape a local
Slotcarries:_clean_peer_parentshapesparentto{slot, key}, each half through the same redact-then-clamp sink askey; a citation with neither half a string is no citation and is omitted. A citation with onlyslotis the orphan case (lineage_parentssendskey: nullwhen the creator closed) and crosses as{slot}.lineage_pendingis forwarded only when literallyTrue, omitted otherwise -- the local payload's presence semantics.PeerSlotsnow hands the shaper thedrivenset it already computed. The child ships as a root: its creator is on screen as the local row that drives it, which the lane could not hang a peer row from anyway.keyis what the lane nests on;slotfeedsorphanCitation,citesParentand thecitedCreatorRefmove baseline, so a peer child flattened by search wears the same "opened by" glyph a local child does, and a peer-side re-parent auto-opens the destination like a local adopt.docs/feature-map/README.mdSessions row: the sentence saying peer rows always render as roots is replaced by the new rule.website/capture/session-tree-peer-lineage.*+website/scripts/capture-session-tree-peer-lineage.mjs: the realChatSidebarand realuseInstanceSessionsover a fetch shim answering/api/instancesand the chat-slots route.Backwards compatibility
Compatible: the route gains two optional keys on a row; every existing reader ignores unknown keys, and a peer on an older build that sends no
parentproduces exactly today's rows.Tests
Backend
test/test_remote_crew_peer_slots.py(49 passed):parentand asserts extra keys inside the citation are strippedparent+lineage_pendingslotwhenkeyis null; a citation naming a hub-driven slot is dropped while a sibling citing another creator keeps its parent, and the driven key appears nowhere in the reply;lineage_pendingonly when literally true;parent.keyis redacted and clamped likekeyFrontend (71 passed across the two files):
useInstanceSessions.test.tsx: no citation -> noparent/lineage_pendingproperty; both halves forwarded; malformed shapes dropped;{slot}alone keptChatSidebar.conductorLane.test.tsx: a peer conductor with two peer workers and a same-key local row renders two roots shut by default, count2on the peer conductor and none on the local twin, no orphan glyph; opening the chevron shows both workers at depth 1; a search flattens the peer child and it wears thecites-parentglyphMutation: reverting the hub forwarding reddens 4 backend tests; reverting the driven suppression reddens its pin; dropping
slotfrom the hook reddens 2 hook tests.tsc --noEmitclean, eslint clean on the changed files, mypy clean onhandlers_instances.py, ruff check clean.Manual verification
node scripts/capture-session-tree-peer-lineage.mjsagainst the dev server: 21 checks,RESULT: ok. It asserts the before frame offers no lane (no row cites anyone), the after frame has the peer conductor shut with count 3, the awaiting-approval badge and the running badge, and the opened frame nests all three workers at depth 1 with the hub's local rows untouched.Screenshots / video
Before -- the hub's list with the citation stripped at the hub hop. No row cites anyone, so the lane is not offered; three
On worker-1workers and their lead sit flat among the hub's own sessions:After, shut by default -- the peer lead is one row: count 3, one worker awaiting approval, one running:
After, opened -- the three workers nest one level under it; the hub's own two sessions are unchanged:
Related Issues
Follow-up to #14462 (the same symptom for a crew member's own thread on the local gateway).
Pattern harvest
Rule candidate: review-prompt
Pattern: an allowlist at a trust boundary silently drops a field a downstream consumer already reads; the consumer degrades (flat instead of nested) rather than failing, so nothing red points at the boundary. Pair every allowlist with a test that enumerates the consumer's reads.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)