Repository navigation
fix(decisions): gate memory.recall on an open owner dashboard - #32076
Conversation
72d0240 to
d788b2a
Compare
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change narrows one egress gate, fails closed, takes nothing away, and is easy to revert. Notes
[DESIGN-REVIEWED] d3465a9 Description read[DESCRIPTION-READ] 8da3dc5ce683ac02dd4b9246dfd6eac52c866d00b37505d38100d587a8c9d6ec That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. This is a mechanism-level fix to the What this change shipsInventory (4 items) — 4 justifiedIntent: the owner wants recalled memory to leave the machine only while they are actually viewing the dashboard. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] d3465a9 Description read[DESCRIPTION-READ] 264983615ec7f35b3f77ebdf7139c28bbf79f98e861822dd9b2d693f44645d75 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
|
[operator: bolichen97] The red Backend Tests shard 2 (Linux and Windows) and the Coverage Gate on d788b2a come from main, not this change: |
Boot restores slots and publishes their keys to the dashboard-surfaced set before any browser connects, and they stay published after the last one closes. The memory.recall gate read only that set, so a recall in a restored tab could send recalled memory to the decision provider with nobody there to read the receipt. The gate now also needs an open owner dashboard socket, read in the same predicate at the early refusal and at the egress. Part of #12532
d788b2a to
d3465a9
Compare
|
Rebased: main moved in docs/system-specs/modules/, src/kiro_crew/dashboard/handlers/, src/kiro_crew/decisions/ and test/ (including test/test_security_gate_liveness.py, whose package line budget main has since raised) since this head went green (b764e20 -> f58c3cf); CI re-running. [operator: bolichen97] |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved: PR Readiness passed on d3465a9, and all five review lanes (Opus 5.5, GPT 6.1, Design, UX, First Principles) report no blocking finding on this head. No conflict and no open change request.
Boot restores slots and publishes their keys to the dashboard-surfaced set before any browser connects, and they stay published after the last one closes. The memory.recall gate read only that set, so a recall in a restored tab could send recalled memory to the decision provider with nobody there to read the receipt. The gate now also needs an open owner dashboard socket, read in the same predicate at the early refusal and at the egress. Part of #12532 (cherry picked from commit c2d3166) Backport note: the recall call keeps release's arguments (no conversation_id, feat #30968) and gains the state argument. The memory_recall.py docstring and the tab-closed test's docstring keep release's wording with the open owner dashboard added.
Problem / Motivation
Goal: Jev only judges a
memory_recallresult while the owner actually has the dashboard open, so recalled memory is never sent for a restored tab nobody is looking at.After a gateway restart, the restored chat tabs count as "open in the dashboard" before any browser connects, and they keep counting after the last browser closes. If the agent in one of those tabs calls
memory_recall, thememory.recalldecision point sends snippets of the recalled memories to the decision provider and stamps a receipt on a reply that nobody is there to read.Why it matters
The
memory.recallgate exists so recalled memory leaves the machine only when the owner is reading that conversation. Owners who consented to recalled-memory egress get egress on conversations they are not watching: every boot with restored tabs, and every time the browser is closed while a tab stays open.Not a goal
has_dashboard_surface. Every other reader keeps its current answer.What changed (motivation → approach → change)
Symptom: a recall in a restored tab is judged with no dashboard connected. Root cause: the gate in
dashboard/handlers/memory_member.pyreads onlysession_surface.dashboard_surfaced_keys(), which boot fills from the restored slot table before any browser connects. That set tracks tabs, not viewers.The gate now also needs an open owner dashboard socket (
_owner_dashboard_open: one ofstate._owner_ws_clientsthat is not closed). The check lives in the same predicate, so the early refusal and thestill_watchedread just before the egress both apply it. A recall with no owner dashboard open returns the full similarity result, the same answer a cron or sub-agent recall already gets. The decisions spec (docs/system-specs/modules/decisions.mdsection 13) and the point's contract indecisions/points/memory_recall.pystate the rule.Backwards compatibility
Compatible: the recall route answers the same way in every case; the only difference is that Jev is not asked when no owner dashboard socket is open, and that case returns the unnarrowed result, which is what every refused decision already returns.
Removes nothing: no route, field, key or stored row changes; the decision is skipped in one more case and its fallback is the existing one.
Tests
test_a_published_slot_with_no_dashboard_open_is_not_decided_for: a session that is in the published set with no owner socket registered (the boot state) sends nothing to the provider, writes no decision row, and gets the whole similarity result back; the same session with an open owner socket is decided for.test_a_tab_closed_during_the_search_sends_nothingruns twice: closing the tab mid-search, and closing the owner's last dashboard socket mid-search while it stays registered. Both send nothing, which pins the read at the egress, not only the early refusal._requesthelper puts one open owner socket on the state by default, so every other test intest/test_decisions_memory_recall_reachable.pykeeps exercising the decided path.Proof: PROVEN test/test_decisions_memory_recall_reachable.py::TestOnlyACommittedRecallLeavesAReceipt::test_a_tab_closed_during_the_search_sends_nothing[dashboard], test/test_decisions_memory_recall_reachable.py::TestTheGatesStillHold::test_a_published_slot_with_no_dashboard_open_is_not_decided_for (head d788b2a)
Determinism: the whole file passed 10 runs at
-n0, 5 runs at-n 4 --dist loadgroup --max-worker-restart=2besidetest_decisions_memory_recall.pyandtest_decisions_memory_recall_apply.py, and one shuffled run (seed 5207). The new and changed tests use a temp store and an in-process fake provider, with no sleep or clock wait.Manual verification
N/A - unit coverage sufficient: the test drives the real recall route, decision gate, consent and decision log with only the provider transport faked.
Related Issues
Part of #12532
Sibling sweep
Swept:
git grep -n "dashboard_surfaced_keys\|has_dashboard_surface" -- src/kiro_crew/Sibling: src/kiro_crew/dashboard/handlers/memory_member.py:139 -- changed here
Sibling: src/kiro_crew/directive_origin.py:27 -- not affected -- it asks whether a session could show a card, and sends nothing off the machine
Sibling: src/kiro_crew/dashboard/session_directive_apply.py:176 -- not affected -- it decides where a directive card renders; a browser that connects later reads it from the slot
Pattern harvest
Not generalizable: the published surfaced set is read as an egress gate in one place only, and every other reader asks a capability question that the slot table answers correctly.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)