Repository navigation
The Review queue opens a pending proposal by its address and names who proposed it - #2161
Conversation
…o proposed it A reviewer of proposed memory changes needs a link to one proposal, the identity that proposed it, and the complete text in front of both decisions. memory.proposals takes memory_keys (at most 500 keys) and lists only the pending proposals under them; total and count_only count the same rows. Keys that do not fit one bound parameter are refused with a 422 before any read. Each listed proposal carries actor, the identity the server recorded from the writer's token, beside agent, the label the client sent. A high row is listed with an empty content_sha256, because the list leaves no audit record and the hash of a short secret can be guessed: the hash comes with the value from memory.get_by_id, which audits that read. The Review queue's address carries its open tab (?tab=) and the proposal under review (?key=), so a link, a reload and Back reopen both. The Proposals table names each row's proposer and is one tab stop; a row's key opens its review. The review shows the proposer, the agent, when the fact was first proposed and its graded runs above the complete text, takes a reason for a rejection and holds both decisions, so neither is made without the text on screen. A rejection sends the hash served with that text and the reason; an acceptance sends that hash and no reason. Settings drops a tab value that another page wrote to the address, since both pages own that key. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Main adds the worker setup ops and this branch adds memory_keys and actor to memory.proposals, so both sides rewrite sdk/go/wire/models.gen.go and sdk/rust/src/wire_models.rs. The two files are regenerated from the merged models; every other file merges without a conflict and each generator's check reports its file current. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
…view names its key Server: - `memory.proposals` measures the whole `memory_keys` parameter as the driver renders it (`ch_params.fits`) and refuses with a 422 what does not fit, one key included. The comparison of chunk lengths passed a lone key of any size, since `chunks` yields a value longer than the bound alone, and ClickHouse answered a field over its limit with an error the transport serves as a 500. - The `count_only` comment names `memory_keys`, which the count narrows by. The `actor` comment names a pipeline's own actor, which comes from no token. - The op's description names `actor` in its second sentence. Its first sentence fits the 200 characters of the generated summary, and the whole text fits the 280 of the compact MCP description. Dashboard: - The read of the key in the address changes nothing when the address names another key, or none, by the time it answers. A review opened by a click while that read is out stays open with its own text, and a failure of that read raises no toast. - The review names the key it decides, first among its facts. A review opened from the address has no row on screen behind it to name the key. - The panel passes the typed reason with either decision, and `decideProposals` alone drops it from an acceptance. - `matches` and `fromAddress` replace two names that shadowed `held` and `linked`, and the comments on the shared `tab` parameter say "it", not "the key". Docs: the address takes the key percent-encoded, the review shows the key, and `actor` can be a pipeline's own actor. Tests: a lone key over the bound, alone and named twice, is refused for the list and the count; 500 copies of one key are asked as one; `fits` at its boundary and with escaped quotes; the late read of the address's key answering with a match, with no match and with a failure; the posted body of an acceptance holds no reason. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
… an open review's key changes nothing Dashboard: - Dismissing the notice above the Proposals table focuses the panel, the wrapper a decision hands the focus to. The notice unmounts with the button that dismissed it, which left the focus on the page body. - The read of the key in the address changes nothing when a review of that key is open by the time it answers. The check of the address passed that answer, since the address still names the key: a match opened the review again, which cleared a typed reason and read the text a second time (a second `memory.sensitive_read` audit row for a `high` proposal), no match or several closed it under a notice, and a failure raised a toast. The panel keeps the key under review in a ref for that check. Docs: the Proposals section names both bounds of `memory_keys`, 500 keys and one 64 KiB parameter, and the 422 a list over either answers. Tests: the dismissed notice leaves the focus on the panel; the late read of the address's key, answering with a match, with no match and with a failure, also runs with the review of that same key opened by a click, and every case keeps the typed reason. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
…in its address Main adds the Definitions tab to the Review queue and this branch writes the open tab to the address, so both sides edit `ReviewQueue.tsx`, its test, the Review queue row of `docs/features/dashboard.md`, one line of `docs/guides/without-the-dashboard.md` and `tests/analyzer/shapes.txt`. - `ReviewQueue.tsx` keeps both: the Definitions tab and its reason, and the tab read from the address. `pending` gains `definitions: false`, since the tab has no probe to wait for and the record must name every tab. - The Definitions test resets the address after each `cleanup()`. A picked tab stays in the address, so the next render of the same test opened on Definitions and read the list before the test expected it. - `docs/features/dashboard.md` carries both edits of the Review queue row, and `docs/guides/without-the-dashboard.md` both rows, proposals and definitions. - `tests/analyzer/shapes.txt` is regenerated from the merged builders. Every other file merges without a conflict, and each generator's check reports its file current. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…eason Dashboard: the Proposals review closes, hands the focus to the panel and reads the list again only after `memory.proposal_decide` answers. A call that throws (a timeout, or a 503 the caller retries) raises the "Decision failed" toast and leaves the dialog as it is: the complete text, the typed reason and the key in the address stay, and both decisions are offered again. The close ran in `finally`, so a failed rejection discarded its reason while the proposal was still pending. Tests: a rejected `decideProposals` leaves the dialog open with its text, the typed reason and the address, reads the list no second time, and the second try sends the same reason. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The comment on `memory_keys` is one sentence: "Only pending proposals under these keys, cut by `limit` like any listing; empty lists every proposal." The generated reference keeps a field's first sentence, and the second one, which said `limit` still applies, was left out of `docs/reference/operations/memory.md`. The field takes 500 keys and `limit` defaults to 50, so a caller who names 200 keys gets 50 rows. `total` and `count_only` say what they count in their own descriptions. `docs/reference/operations/memory.md` is regenerated; every other generator's check reports its file current. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The Review queue leaves its open tab as it is when Back or Forward lands on an address with no `tab`. The one case that dispatched `popstate` did so at an address that names `tab=duplicates`, so a page that reset the tab to Conflicts on such an entry passed every case. The new case lets the first count move the page to Proposals, which writes no tab, dispatches `popstate` at the same address and expects Proposals still selected. It fails against a `sync` that resets the tab. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Main adds six statement heads to `tests/analyzer/shapes.txt` for the erasure of read receipts, and this branch carries the heads of the `memory.proposals` read by key. The file merges without a conflict and is what `python -m tests.analyzer.corpus --write` writes from the merged builders. No other file is changed on both sides, and each generator's check reports its file current. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5c6ea6c. Configure here.
| if (tabOffered || tabPending) return; | ||
| setTab("conflicts"); | ||
| setViewParam("tab", null); | ||
| }, [tabOffered, tabPending]); |
There was a problem hiding this comment.
Failed auto probe sticks the tab
Medium Severity
A link to Auto-resolved stays pending when sharedHasAutoResolved fails, because that failure leaves probedAuto unset. pending.auto stays true, so the fallback never runs and the Auto-resolved tab never appears. The address keeps tab=auto while Conflicts stays on screen, and choosing the highlighted Conflicts tab does not clear it.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 5c6ea6c. Configure here.
| if (tabOffered || tabPending) return; | ||
| setTab("conflicts"); | ||
| setViewParam("tab", null); | ||
| }, [tabOffered, tabPending]); |
There was a problem hiding this comment.
Probe error drops the deep link
Medium Severity
A failed Learnings or Exceptions probe is stored as an empty list. That is no longer pending and not offered, so the fallback removes tab from the address. A reload then opens Conflicts instead of asking for that tab again.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 5c6ea6c. Configure here.


Related: #1144
Related: #1763
Related: #1232
Part of #1144. It does not close it.
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
Server:
memory.proposalstakesmemory_keysto list only the pending proposals under those keys, names who proposed each one inactor, and lists ahighproposal with an emptycontent_sha256. Dashboard: the Review queue's address carries its tab and the proposal under review (/admin/review_queue?tab=proposals&key=<key>), the Proposals table names each proposer, and a proposal's key opens a review with the key, the proposer, the graded runs, the complete text, a reason for a rejection and both decisions.Why
A person who reviews proposed memory changes works from the Proposals tab of the Review queue. On
mainthat tab cannot be linked to: the page always opens on Conflicts or on what its count says, so a message that asks someone to look at one proposal can only say where to click. A row shows the agent label the writing client sent and not the identity the server recorded, so the reviewer cannot tell which person or service proposed a fact, and cannot see that the proposal is their own before the server refuses the acceptance. A rejection is a row-menu item that sends no reason and is made without the complete text on screen. Andmemory.proposalslists ahighrow's content hash in a read that leaves no audit record, although the hash of a short secret can be guessed.This change gives one proposal an address and puts what a reviewer weighs in one place:
memory.proposalsreads by key.memory_keys(at most 500 keys, each at least one character) lists only the pending proposals under those keys.limitstill applies, andtotalandcount_onlycount the matching rows. The keys travel as one bound array parameter. The handler measures that parameter as the driver renders it, and keys that do not fit one parameter (64 KiB, half of ClickHouse's default field limit), one long key included, are refused with a 422 before any read. The filter is one more condition beside the scope predicates of the read, which are unchanged, so a key outside the caller's reach answers as a key with no proposal.actoron each listed proposal. The identity the server recorded for the write, besideagent:human:<subject>orprocess:<subject>from the writer's token, or a pipeline's own actor (such asprocess:session_contrast) for a proposal the server wrote.highrow in the list.content_sha256is""for ahighrow. The hash comes with the value frommemory.get_by_id, which audits the read of ahighrow.?tab=names the open Review queue tab and?key=the proposal under review. A tab picked by the person is written for every tab, Conflicts included, so a reload keeps it over what the count says. The move the page makes on its own to Proposals writes nothing. A tab the address names is held while the probe that offers it is unanswered, and falls back to Conflicts, in the address too, when the probe finds nothing. A namespace switch drops both keys. Akeywith notabopens Proposals.memory.proposalswithmemory_keysof that key beside its list read, and matches the answer by key. One match opens the review. Several matches, no match, and a server that ignored the filter and whose list does not hold the key each show a notice above the table that says which; dismissing it drops the key and hands the focus to the panel. A key outside the caller's reach shows the notice of a missing proposal. The address takes the key percent-encoded. An answer that arrives when the address names another key, or none, or when a review of that key is open, changes nothing: a review that a click opened while the read was out stays open with its own text and its typed reason.memory.proposal_decideanswers. A call that fails (a timeout, or a 503 the caller retries) raises a toast and leaves the review open with its text and the typed reason, and both decisions are offered again. The Decision column, the inline Accept button and the row menu are removed: every role that reads the list opens the review, and a role that cannot decide sees both decisions with the role they need.Design decisions taken inside this scope:
tableaves the open tab as it is, and one with nokeycloses an open review.Scope and risk
server/memory/api/models_proposals.py,server/memory/app/proposals_ops.py: the two fields, the key filter, the refusal of keys that do not fit one parameter, the empty hash for ahighrow.server/core/ch_params.py:fits, whether one parameter carries a whole list.server/transport/mcp_descriptions.py: the op's description namesactorandmemory_keysin its second sentence, so the one-line summary in the generated reference is the one onmain, and at 280 characters the compact MCP description carries the text whole. No table, column, setting or migration.docs/reference/operations/memory.mdandtests/analyzer/shapes.txt. The large diff ofsdk/rust/src/wire_models.rsis the generator renumbering itsdefault_NNNNhelpers after one new defaulted field; no other Rust type changes. The comment onmemory_keysis one sentence, since the generated reference keeps a field's first sentence: its row says thatlimitcuts the listing.frontend/src/views/admin/ReviewQueue.tsx,frontend/src/views/admin/Proposals.tsx,frontend/src/api/review.ts: as described above.frontend/src/views/Setup.tsx: Settings drops atabvalue that is not one of its tabs, since both pages own the key and a navigation carries it between them.mainadded to the Review queue (The Review queue lists a namespace's shared definitions, each with its status and the names another definition serves #2160) behaves like the other tabs here: its pick is written to the address,?tab=definitionsopens it, and it is never held, since no probe offers it (pending.definitionsisfalse). The Review queue row ofdocs/features/dashboard.mdcarries both edits, anddocs/guides/without-the-dashboard.mdboth rows, proposals and definitions.frontend/src/lib/state.ts:VIEW_QUERY_KEYSgains"admin:review_queue": ["tab", "key"]andSWITCH_CLEARSgains"key". The four inline reads of the current history entry's state insheetEntry,linkedAgent,entryNamespaceandstampForcall one helper,entryState(), which takes 73 bytes off the index chunk without a change of behaviour. The helper was written when the two new keys put the chunk 17 bytes over its budget. Since thenmainmoved two entries of the role table incanCall.tsout of that chunk, and with every change of this pull request on currentmainthe chunk is 121,732 bytes of the 122,880 allowed.INDEX_BUDGET_BYTESis unchanged.docs/features/memory/writing.md, the Review queue row and the paragraph under it indocs/features/dashboard.md, and one row indocs/guides/without-the-dashboard.md.memory.proposal_decide; the note under the table and the toasts; the guard for a key that more than one listed proposal holds, which shows both decisions unavailable inside the review.What could break:
ANDbeside the read's own scope predicates, which are unchanged.test_a_key_outside_the_read_scope_reads_as_missingreads another user's key under anown_userscope and gets no row and a count of 0.highproposal with the listed hash. It gets""and its acceptance is left undecided until it reads the hash withmemory.get_by_id. The dashboard already reads it there.taborkeyis not moved by the first count. An address with neither behaves as onmain.Compatibility, rollout and rollback
memory.proposalsgains the request fieldmemory_keys(default empty, which lists every proposal) and the reply fieldactoron each proposal.content_sha256of a listedhighrow is"": a client that accepted a sensitive proposal with the listed hash reads it withmemory.get_by_id. The op is experimental. No field is removed.memory_keys, names it inignored_argsand answers its whole list; the dashboard matches the rows by key and says when the proposal is not among the rows listed. It sends noactor; the Proposed by cell is empty and the review leaves that line out. It serves ahighrow's hash, which the dashboard does not use.advicetomemory.proposals, and then carries the rebase of the lines both touch (MemoryProposalin the model and inreview.ts,HEADERS, the tab's tests). If this one merges first, that one carries it. Preserve stored JSON in memory reads and MCP replies #2064 edits the review's read andProposals.test.tsx: whichever of the two lands second rebases those lines.rustfmt,gofmtorshfmt. The Rust and Go op tables were generated with therustfmtof Rust 1.85.1 and thegofmtof the Go toolchain CI pins, taken from a local toolchain folder and not installed.make formatstops at itsshfmtcheck, so the formatters ran one by one (ruff format, Biome, Prettier) over the changed files; no shell file is changed.Tests
Run on the pushed head, which holds current
main, against a ClickHouse container and a server started from it for these tests.mainwas merged twice for this push. The second merge changes no dashboard, SDK or generator file, so the dashboard runs, the build and the budget below are those of the commit before it.ruff format --check server tests scripts sdk/python extractor: 5261 files already formatted.ruff check server extractor sdk/python tests scripts .claude: all checks passed.make typecheck: the mypy gate reports 0 errors, andmypy --strict sdk/python/loomfinds no issue in 71 source files.make lint, with the pinnedrustfmtandgofmtonPATH, on the commit before the second merge: every generator--checkreports its file current, the reach census is ok, and Biome reports no finding infrontend/src. On the head, every generator's--checkand the reach census ran again with the same result.pytest tests/unit/test_proposal_triage.py tests/unit/test_proposals.py tests/unit/test_high_rows_sql.py tests/unit/test_ch_params.py -n 2: 85 passed.test_proposal_triage.pyruns the handler's SQL on clickhouse-local against the memory tables' DDL:test_the_listing_names_the_proposertest_memory_keys_lists_only_those_pending_keys(a decided row of an asked key and a pending row of another key are left out; a repeated key is asked once: 500 copies of one 400-byte key list its row, and the same call is refused when the handler does not de-duplicate)test_memory_keys_narrows_count_onlytest_a_key_outside_the_read_scope_reads_as_missing(anown_userscope, the list and the count)test_a_high_proposal_is_listed_without_its_hashtest_keys_too_long_for_one_read_are_refused_before_any_read(500 keys, and one key longer than the parameter, alone and named twice; the list and the count). The one-key cases reach the store read with the comparison of chunk lengths and are refused withfits.test_an_empty_key_is_refused_by_the_modeltests/unit/test_ch_params.py::test_fits_measures_the_whole_parameter_as_rendered(a lone value over the bound, the last byte that fits, a value of quote characters measured as escaped, an empty list)pytest tests/analyzer -n 2against the container: 12 passed. After each mergetests/analyzer/shapes.txtis whatpython -m tests.analyzer.corpus --writewrites from the merged builders: the first merge conflicts in it, the second merges it as text and the regenerated file is the same.test_package_contracts,test_op_transport_contract,test_tunable_constants,test_store_names_refused,test_degraded_unnoted,test_public_copy,test_doc_links,test_agent_instructions) withtests/analyzerand-n 2, with no ClickHouse configured: 610 passed and 2 skipped, the two analyzer cases that need one and pass in the run above.pytest tests/unit/test_mcp_listing_budget.py tests/unit/test_mcp_initialize_surface.py tests/unit/test_hidden_op_says_why.py tests/unit/test_sdk_surface_contract.py tests/unit/test_op_reach_census.py tests/unit/test_page_summary.py tests/unit/test_dashboard_routes.py tests/unit/test_page_field_lists_name_server_fields.py -n 2: 365 passed.pytest tests/integration/test_proposal_triage.py: 1 passed.test_a_proposal_is_read_by_key_with_its_proposerwrites two proposals with a minted service token, reads one bymemory_keys, compares every field of the answer with whatmemory.get_by_idserves for that row, and reads acount_onlyof 1. The run setsLOOM_CH_PASSWORDas the CI job does, which the purge of the test's org signs in with.--maxWorkers=1 --testTimeout=30000(the six this pull request changes,Proposals.test.tsx,ReviewQueue.test.tsx,Setup.title.test.tsx,state.test.ts,state.namespace.test.tsandapi/review.test.ts, andDefinitions.test.tsxfrommain): 7 files and 223 tests passed. The longer test timeout is for the shared machine under load; no test file sets one.decideProposalsreject. It fails on the code that closed the review infinally(the dialog is gone after the failed call) and passes with the close after the answered call. It also checks the address keeps the key, the list is read no second time, and the second try sends the same reason.popstateat the same address. Against asyncthat resets the tab to Conflicts on such an entry it is the one case of the file's 97 that fails.main, renders the page three times. On the merged page the pick of the first render stays in the address, so without a reset of the address after eachcleanup()the third render opens on Definitions and reads the list before the case expects it: the case fails without the two resets and passes with them, as the Duplicates case beside it does.onDismiss. "Accept sends no reason" runs the real client over a stubbedfetchand compares the posted body.callBudget.test.tsx,Setup.blacklist.test.tsxandSetup.structure.test.tsx, which render the changed pages, in one run withSetup.title.test.tsx,state.test.ts,state.namespace.test.ts,api/review.test.tsandDefinitions.test.tsx: 8 files and 115 tests passed.App.boot.test.tsxandSidebar.test.tsx, which this branch does not change, with--maxWorkers=1 --testTimeout=30000: 2 files and 106 tests passed.npm --prefix frontend run build: built, sotsc -bpasses on the merged page.npm --prefix frontend run budget:bundle-budget: OK, index chunk 121,732 bytes of 122,880, stylesheets 37.8 kB and boot scripts 188.6 kB gzipped.count_only: one key of 140,000 bytes, that key named three times, one key of 66,000 quote characters and one key of 70,000 bytes each answer 422VALIDATION_FAILED; one key of 60,000 bytes, two short keys and one 400-byte key named 500 times answer 200. No commit since changes the handler orch_params.fits.frontend/e2e/list-tables.spec.tsandfrontend/e2e/definitions.spec.ts. The machine has no browser for the spec runner, and the one it downloads does not start without system libraries that need root (libatk-1.0.so.0). CI runs them; the first gains the Proposals table at 1400 px, at 375 px and at 1280 px beside the docked assistant, and the second, frommain, opens the Definitions tab on the merged page.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. Checked by running the gates listed under Tests against a ClickHouse and a server started for this branch.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump), the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py) and the standalone skill bundles (python3 scripts/codegen/standalone_skills.py).main; no merged migration is edited. (No migration.)hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version. (No plugin file changes.)npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code