Skip to content

The namespace settings show and change the proposal policy and the coverage sweep - #2213

Merged
zlareb1 merged 2 commits into
mainfrom
feat/namespace-settings-policy-sweep
Dec 5, 2026
Merged

zlareb1 merged 2 commits into
mainfrom
feat/namespace-settings-policy-sweep

Conversation

@zlareb1

@zlareb1 zlareb1 commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Related: #1144
Related: #1232

Changelog category (leave one):

  • Improvement

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_policy and coverage_sweep could be set only by a namespace.register call written by hand. The op takes and returns both, and the SDKs and loom call namespace.register pass 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's save(patch): one namespace.register that carries the fields a re-registration would otherwise reset, then a fresh namespace.get.

  • Proposals. Two counts, "Passed graded runs needed" (1 to 1000) and "Failed graded runs allowed" (0 to 1000), under the line "A proposal is marked ready to accept after this many graded runs passed and at most this many failed." A select, "Rejecting": "By a person only" (mode manual) 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.
  • A count commits on blur or Enter when it is a whole number in its range and differs from the stored one; anything else reverts without a request. Escape restores a typed count before it closes the dialog, as it does for the cost caps. The server replaces the policy whole, so every save sends all four fields.
  • Coverage sweep. One select: "Let Loom decide" (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 explicit null; an answer without the field reads as "Let Loom decide".
  • Who may change them. The dialog's existing rule: both are disabled, with the dialog's reason line, when the caller may not manage the namespace, and while a save is in flight. A refused save shows the server's message in the "Save failed" toast and the control shows the stored value again.
  • A repository namespace shows neither control.

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: NamespaceInfo gains proposal_policy?: ProposalPolicy and coverage_sweep?: boolean | null; NamespaceRegisterFields gains both as optional; registerNamespace sends each only when the caller set it (!== undefined), so null is sent and an unrelated save keeps both stored values. reregisterNamespace is unchanged: the server keeps both when they are omitted.

Docs: docs/features/dashboard.md gains a paragraph on what a namespace's Settings change, docs/features/memory/extraction.md says the sweep is also set there, and docs/features/namespaces-and-sharing.md says where both fields are set. That last sentence follows the paragraph on partial updates and stays out of the field table, whose proposal_policy cell is already the widest.

Left alone: the Review queue's Proposals tab and any explanation of the policy there; default_conflict_policy, code_change_policy and the tag registry, which the dialog still does not show; auto with a count of 0, which the op allows and the dialog labels "never rejects".

Risk: a save from the dialog writes proposal_policy or coverage_sweep only 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

  • Wire: none. No op or field added, changed or removed, and no default changed. The dashboard sends two fields namespace.register already takes.
  • Operator steps: none.
  • Rolling upgrade: a server one release behind takes and returns both fields.
  • Rollback: reverting removes the controls. A policy or sweep saved through them stays on the namespace's row and is still set by namespace.register.

Tests

Written first. Before the code, npx vitest run src/flows/NamespaceSettingsDialog.policy.test.tsx src/api/admin.register.test.ts failed 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 stored and the two reject-count cases below failed, each finding no field under "By a person only".

frontend/src/flows/NamespaceSettingsDialog.policy.test.tsx runs the dialog on the real namespace clients over a fake fetch, so each case reads the body the server would receive:

  • shows the stored policy and shows 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 drops tags, 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) and sends null for Let Loom decide, and true and false for the other two: fails when null is 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=2 on admin.register.test.ts and 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 build builds, and npm --prefix frontend run budget prints bundle-budget: OK.
  • biome lint frontend/src (the accessibility rules) reports nothing; Biome's format check on frontend/src/flows and frontend/src/api and Prettier's check on the three changed Markdown pages pass.
  • pytest -n 2 on 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) with tests/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 and mypy --strict sdk/python/loom passes.
  • ruff check server extractor sdk/python tests scripts .claude (the lint target's paths) and ruff 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 lint and make format-check as 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 no shfmt, gofmt or rustfmt).

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 explicit null sweep is stored, and policy_verdict and 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

  • Local format, lint, type checks and focused tests pass. The full make test-unit and applicable integration results are reported by CI; a full local run is not required before pushing.
  • Generated files are regenerated in this PR, not by hand: the SDK op tables, docs/reference/configuration.md and the docs/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).
  • A new migration is additive and numbered after the latest on main; no merged migration is edited.
  • A behaviour change to any file a plugin ships (hooks/, lib/, bin/, skills/, .mcp.json, the Codex plugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.
  • The frontend builds (npm --prefix frontend run build) and its tests pass, if frontend/ changed.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers; the history goes in this description (tests/unit/test_public_copy.py).
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.
  • I signed the Contributor License Agreement (CLA) if CLA assistant requested a signature.

🤖 Generated with Claude Code

…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>
@vercel

vercel Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Dec 5, 2026 6:23am UTC
loom-telemetry Ready Ready Preview Dec 5, 2026 6:23am UTC

Request Review

…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>
@zlareb1
zlareb1 merged commit b365883 into main Dec 5, 2026
69 of 81 checks passed
@zlareb1
zlareb1 deleted the feat/namespace-settings-policy-sweep branch December 5, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant