Repository navigation
Conversation
Design Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)Design-level review of Design-Verdict: PASS cannot evaluate: missing screenshot or recording of the new catch-up bar beside the graph age and the box-count waiting chip. This PR adds both, and the evidence list for this revision is empty. BlockersNo rendered evidence for new graph surfaces Notes
[DESIGN-REVIEWED] 96d2040 Description read[DESCRIPTION-READ] ec1393f9042270dda44a709c968a998ac5dd338a3280bc2c1ff1c935f54b7856 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing screenshots of the Memory graph's new states. The PR supplies no image, so the blind read was not performed and nobody has seen what this diff adds. Evidence gaps
Notes
[UX-REVIEWED] 96d2040 Description read[DESCRIPTION-READ] 19196efac8255ae1b39534aaaf826fb8a1b7c7219aada1637d0c782acf7450e5 That sha256 names everything this verdict read: the PR description, plus the 3 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 The main change, answering from the layout and catching up in the background, holds up. Two things are notes, not blockers: placement changes ride along without a reported defect, and the change reverses a step the base RFC still records. Notes
What this change shipsInventory (10 items) — 8 justifiedIntent: open the Memory graph without waiting for the layout to catch up with the store, and never show a forgotten memory. FIX.
[FIRST-PRINCIPLES-REVIEWED] 96d2040 Description read[DESCRIPTION-READ] bad5f072e59ce74468f85f58600dd2bc19f3474be9bd032d6b602498a8a0e43f 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: |
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: |
7d782e3 to
f095f18
Compare
f6128dd to
d95f1fb
Compare
f095f18 to
f24f2e1
Compare
|
|
|
d95f1fb to
889dcaa
Compare
f24f2e1 to
3fcab1f
Compare
|
889dcaa to
cdca114
Compare
3fcab1f to
48b1f48
Compare
… the background Restacked onto #47741 as one commit (its seven commits each conflicted with the removal of the signed-in person there). It holds: - answer graph requests from the layout and catch it up in the background - keep forgotten words and ids out while the layout catches up - read forgotten rows before the layout; a placement batch is no new build - a box count waits for the pass that is due; hold Refresh's pass in its test - show the count's in-progress state while a box count waits - a box count names the revision it counted at - the box-count revision test is held at the box read the hand-off uses
48b1f48 to
96d2040
Compare
Problem / Motivation
Goal: The Memory graph answers from its layout at once and brings the layout up to date in the background, with real counts on screen, and never shows a forgotten memory's words or dot while it does.
Today every graph request (overview, dots, nodes, search, box count) first brings the layout file up to date with the store when the store changed. On a store that was written to since the last read, a person waits for that work before anything is drawn, and Refresh blocks the request that asked for it.
Why it matters
Opening the graph after a gateway restart, or after an agent wrote many memories, is the slow moment people see. The design in RFC #47713 (the memory graph's server layout) makes the layout file the answer and the catch-up background work; this PR is that step for the requests.
Not a goal
What changed (motivation → approach → change)
Requests waited for the catch-up → they now read the layout file as it is, and the catch-up runs in the background in batches of
PLACE_BATCHrows under the file's lock (memory_graph_service.py,memory_graph_sidecar.py). The design follows RFC #47713.pass_asked,pass_done) and writes only into the build it planned against (same_build,LayoutReplaced).forget_marks). Every reply reads only the log entries after those marks, keeps the ones not live now, and leaves them out (memory_graph_forgotten.forgotten_in): a dots page and a node page leave the dot out, a link to it goes with it, a box (memory_edit._with_box) leaves it out, and a topic that holds it goes unnamed in every overview and poll. So the cost follows the number of changes since the last pass, not the size of the store. Each reply reads the forgotten rows before it reads the layout, so a pass that ends between the two reads has already removed the row (and cleared its topic's name) from what is read after. A layout file with no marks yet (a fresh build before its first pass) is compared with the store whole. Main today never shows these, because it waited for the catch-up; this PR keeps it that way.poll=1). At mostREFRESH_WAIT_MS(60 s).REFRESH_WAIT_MS; a 503 and a pass the server reports failed stay answers (graphPicture.ts,poll).SELECT_WAIT_SECS, 10 s;StoreGraph.wait_for_due_pass), so the layout it names is the one its hand-off to the list and Copy to reads next; main refuses a box after placements on purpose, so the hand-off keeps its exact layout check. The count's reply names the revision it was counted at, never one read after it, so the hand-off takes exactly the rows counted (testa box count names the revision it counted at).MemoryGraphTab.tsx):Laying out N memories · x of N, the same strings beside the age), else "Loading graph data…". Never blank, never the old number: a recount over a swap or a forget shows the same state in the chip's number. No bar is drawn for it.SELECT_WAIT_SECS), so the person always gets a number; a failed count shows the read-error notice with Retry.pages.overview.memoryGraphTab.loading_graph_data,build_titleandbuild_count, joined by " · " as the topic line already joins its parts._read_at_one_layout).Laying out N memorieswith rows placed of N while it catches up,Reading memorieswith memories read of the total on a first open, beside the age when nothing waits on it (useGraphPicture.ts,GraphAge.tsx). The catch-up poll goes through the base PR's forget check (startedBeforeForget) like every other graph read.stale_memory_box.Backwards compatibility
Compatible: every route keeps its fields; the overview adds
catchup,pass_askedandpass_done, and acceptspoll=1; an older page that ignores them reads as before.Removes nothing: no route, field or stored data is removed; the layout file gains meta keys (
slots,slots_checked) that an older gateway ignores.Tests
test/test_memory_graph_serve.py: requests answer while a pass is held; one pass at a time; Refresh's pass by number while another reader asks for more; a forgotten memory's text, raw id, opaque id and a topic name made from it are in no reply before, during or after the pass, and a box counts only live memories in every phase; the forgotten rows read from the logs since the marks equal the whole comparison (an experience and a fact), and a memory written again is not held back; a pass that ends between a reply's two reads leaks nothing (overview, dots page, node-page links, box count); a reply read across a placement batch names the newer placement and one read across a rebuild says "changed"; a box count reads the box again when a batch lands between its reads; a box counted while a pass is due hands off under the layout that pass leaves (the list answers 200, not 409). A count whose due pass outlasts the wait answers anyway (test_a_box_count_answers_when_the_due_pass_outlasts_its_wait); the tab shows the waiting state and Escape still drops the box (says the box is being counted while the count waits, and Escape still drops it).test/test_memory_graph_slots.py: slot counts for an older layout, a full topic's next slot, the once-per-build check.website/src/test/memoryGraphCatchUp.test.tsx: the stages and counts, a catch-up end moves nothing, a failed progress poll is asked again, a poll asked before a forget is dropped and asked again, Refresh asks a lost catch-up poll again and swaps once, Refresh takes a 503 on its poll as the answer, Refresh waits for its own pass.Overview open time, 30,368-memory synthetic store (store O's 26,479 rows plus copies of its facts with their vectors, 227 topics), one host, serial, the handler timed in process. Cold is a new
StoreGraphas after a gateway restart, with the OS file cache warm; warm is three opens after it. Three runs each:a7a4ae393c57f7498e5907ed(the filter as in this head; the head after it only reorders reads)The forgotten filter alone takes 0.5-0.7 ms per reply. A first version that compared every layout row with the store on each overview added about 65 ms (cold 148-175 ms, warm 93-102 ms) and was replaced by the marks above.
Proof: not provable -- other: prove.py was not run from this scratch clone; each new test was mutation-checked red instead
Local: backend graph, copy and edit files 787 passed (serial, homes pinned to scratch); 14 graph frontend files 287 passed;
tsc -b; eslint with no warnings; docs-lint.Manual verification
Pod frames from this head follow in this description.
Real-machine verification
Machine: one cloud host, Linux x86_64, 32 vCPU; a throwaway pod on a fresh home with a synthetic store, headless Chromium.
Before (base): a graph request after a store write waits for the catch-up.
After (this head): frames follow in this description.
Cleanup: the pod is brought down and its worktree removed after the frames.
Screenshots / video
Frames from this head follow.
Related Issues
Stacked on #47741; base
crew/slack/graph-stored-picture. Design: RFC #47713.Known limits:
Sibling sweep
Swept: git grep -n "nodes_in_box|sidecar.links|ids_at_revision|sidecar.clusters" -- src/kiro_crew/
Sibling: src/kiro_crew/dashboard/handlers/memory_graph_layout_api.py -- changed here
Sibling: src/kiro_crew/memory_edit.py -- changed here
Sibling: src/kiro_crew/memory_graph_selection.py -- not affected -- it reads placed matches of live search scores only
Pattern harvest
Rule candidate: review-prompt
Pattern: a reply built from a derived index (layout file, cache) must filter by the live source when the index can lag it
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...); PR Hygiene does not count commitsContribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.