Repository navigation
The namespace settings show and change the proposal policy and the coverage sweep - #2213
Merged
Merged
Conversation
…verage sweep A namespace's proposal_policy and coverage_sweep were set only by a hand-written namespace.register call: the dashboard's namespace client did not carry either field and the settings dialog had no control for them. The dialog's memory-namespace block gains two controls. Proposals: the passed and failed graded-run counts that mark a proposal ready to accept, whether rejecting is by a person only or automatic, and, when automatic, the failed count that rejects one (0 never rejects). A count commits on blur or Enter when it is a whole number in the op's range and differs from the stored one; the policy is sent whole. The text says that Loom never accepts a proposal. Coverage sweep: Let Loom decide, Always or Never, where Let Loom decide sends an explicit null. registerNamespace sends each field only when the caller set it, so a null sweep reaches the server and an unrelated save keeps both stored values. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…rejecting modes The server marks a proposal ready to reject at reject_after_fails failed graded runs whatever the policy's mode, and the Proposals tab shows that mark. The settings dialog drew the count only under "Automatically". Under "By a person only" a stored count stayed in force with no field to read, change or clear it, and picking "Automatically" saved it back as a count that rejects. The count is a field in both modes. Under "By a person only" its label is "Failed graded runs that mark ready to reject" and its line is "A proposal is marked ready to reject after this many failed graded runs. 0 never marks one." Under "Automatically" the label and the line are unchanged. The ProposalPolicy comment and the dashboard page say the same. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #1144
Related: #1232
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):
A memory namespace's settings in the dashboard show and change its proposal policy (the passed and failed graded-run counts that mark a proposal ready to accept, the failed count that marks one ready to reject, and whether that count also rejects it) and its extraction coverage sweep (let Loom decide, always, never).
Why
A namespace's
proposal_policyandcoverage_sweepcould be set only by anamespace.registercall written by hand. The op takes and returns both, and the SDKs andloom call namespace.registerpass them, but the dashboard's namespace client (frontend/src/api/admin.ts) carried neither field and the settings dialog had no control for them. An admin who works in the dashboard could not see which policy a namespace runs with, or turn the sweep on for a namespace of dense material.Scope and risk
Dashboard and docs only. No op, field, handler, statement, table or setting changes.
Both controls sit in the settings dialog's memory-namespace block, after the capture checkbox, in their own component (
frontend/src/flows/NamespacePolicyControls.tsx), as the budget fields are. Each save goes through the dialog'ssave(patch): onenamespace.registerthat carries the fields a re-registration would otherwise reset, then a freshnamespace.get.modemanual) or "Automatically" (auto). A third count (0 to 1000) is shown in both modes, because the server marks a proposal ready to reject at it whatever the mode. Under "By a person only" it is "Failed graded runs that mark ready to reject", with the line "A proposal is marked ready to reject after this many failed graded runs. 0 never marks one." Under "Automatically" it is "Failed graded runs that reject", with the line "Reject a proposal after this many failed graded runs. 0 never rejects." A fixed line closes the group: "Loom never accepts a proposal. An admin of this namespace who did not propose it accepts it." A namespace with no stored policy shows the defaults: by a person only, 2, 0, 0.null), "Always" (true), "Never" (false), with the hint "After extracting facts from a conversation, Loom reads the turns no fact came from once more. It finds more facts in dense material and costs one more model call. Left to Loom, it runs only on fact-dense turns." "Let Loom decide" sends an explicitnull; an answer without the field reads as "Let Loom decide".The words agree with the op's descriptions: the policy only rejects, on failed graded runs under
auto; no policy accepts a proposal; in either mode the two thresholds mark one ready to accept and the reject count marks one ready to reject, the reject mark checked first (policy_verdict,server/memory/app/proposals.py).Client:
NamespaceInfogainsproposal_policy?: ProposalPolicyandcoverage_sweep?: boolean | null;NamespaceRegisterFieldsgains both as optional;registerNamespacesends each only when the caller set it (!== undefined), sonullis sent and an unrelated save keeps both stored values.reregisterNamespaceis unchanged: the server keeps both when they are omitted.Docs:
docs/features/dashboard.mdgains a paragraph on what a namespace's Settings change,docs/features/memory/extraction.mdsays the sweep is also set there, anddocs/features/namespaces-and-sharing.mdsays where both fields are set. That last sentence follows the paragraph on partial updates and stays out of the field table, whoseproposal_policycell is already the widest.Left alone: the Review queue's Proposals tab and any explanation of the policy there;
default_conflict_policy,code_change_policyand the tag registry, which the dialog still does not show;autowith a count of 0, which the op allows and the dialog labels "never rejects".Risk: a save from the dialog writes
proposal_policyorcoverage_sweeponly when its control was used. The dialog reads and writes the namespace it was opened for; a row loaded for another namespace is never used to build a save. No stored data, auth or tenant-isolation path changes.Compatibility, rollout and rollback
namespace.registeralready takes.namespace.register.Tests
Written first. Before the code,
npx vitest run src/flows/NamespaceSettingsDialog.policy.test.tsx src/api/admin.register.test.tsfailed all 27 cases. With the client fields in place and the controls not mounted, the dialog file fails 24 and passes 1 (the repository case). The reject count's cases were changed before the component: with the count still drawn only under "Automatically",shows the defaults when no policy is storedand the two reject-count cases below failed, each finding no field under "By a person only".frontend/src/flows/NamespaceSettingsDialog.policy.test.tsxruns the dialog on the real namespace clients over a fakefetch, so each case reads the body the server would receive:shows the stored policyandshows the defaults when no policy is stored: fail when an unset policy shows blanks or automatic rejection.saves the whole policy with the other settings intact: fails when the register body lacks a policy field, or dropstags,owner_email, the description or the cost cap. Two more cases commit the other two counts on Enter.shows the reject count in both modes and words it by the mode: a stored count of 3 under "By a person only" is shown with that mode's label and line, and after a pick of "Automatically" the same count is shown with the rejecting label and the "0 never rejects" line. Fails when a stored count has no field under "By a person only".clears a stored reject count while rejecting is by a person only: fails when the count cannot be set to 0 without a pick of "Automatically" first.a number out of range, partial or unchanged reverts without a request: nine inputs across the three counts.says that Loom never accepts a proposal: fails when the group's text says that the policy, or Loom, accepts or decides.a refused save shows the server's message and returns to the stored value.Escape restores a typed number before it closes the dialog.shows the three sweep states(true, false, null and absent) andsends null for Let Loom decide, and true and false for the other two: fails whennullis dropped from the body or shown as Never.disables both controls with the reason when the caller may not manage the namespace.shows neither control on a repository.frontend/src/api/admin.register.test.ts:sends coverage_sweep null when set and omits it when not, and the same for the policy.Run on the pushed commit:
npx vitest run src/flows/NamespaceSettingsDialog.policy.test.tsx: 26 passed.npx vitest run --maxWorkers=2onadmin.register.test.tsand the files that render the dialog or read its text (admin.cost.test.ts,NamespaceSettingsDialog.costCap.test.tsx,NamespaceSettingsDialog.roles.test.tsx,NamespaceBudgetAlerts.test.tsx,flows.a11y.test.tsx,DialogStaleLoad.test.tsx,views/copy.rules.test.ts,views/Browse.rows.test.tsx): 90 passed.npm --prefix frontend run buildbuilds, andnpm --prefix frontend run budgetprintsbundle-budget: OK.biome lint frontend/src(the accessibility rules) reports nothing; Biome's format check onfrontend/src/flowsandfrontend/src/apiand Prettier's check on the three changed Markdown pages pass.pytest -n 2on the repository scans (test_package_contracts.py,test_op_transport_contract.py,test_tunable_constants.py,test_store_names_refused.py,test_degraded_unnoted.py,test_public_copy.py,test_doc_links.py,test_agent_instructions.py) withtests/analyzer: 601 passed, 12 skipped. Two of the skipped are the analyzer cases that need a ClickHouse; the diff has no statement.make typecheck: the mypy gate reports 0 errors andmypy --strict sdk/python/loompasses.ruff check server extractor sdk/python tests scripts .claude(the lint target's paths) andruff format --check .pass.Not run: the integration suite, since no handler or statement changed and no ClickHouse or server was started; the full vitest suite and the Playwright run, which CI runs;
make lintandmake format-checkas whole targets, beyond their ruff, Biome and Prettier steps above (the diff has no Python, shell or TOML file and changes no op or setting, so no generator's output moves; this machine has noshfmt,gofmtorrustfmt).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 wrote the diff from an agreed design, wrote the tests before the code, and ran the checks listed under Tests. It read
namespace.register's handler to check that an omitted field keeps its stored value and that an explicitnullsweep is stored, andpolicy_verdictand the coverage-sweep gate to check each sentence the dialog shows. The second commit applies an agent review's finding, that the reject count was hidden under "By a person only" while still in force, with its tests changed first. No person has reviewed it yet.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.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.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