Skip to content

Accepting a proposal on a key a required regression suite covers needs satisfied checks for its exact content - #2363

Merged
zlareb1 merged 12 commits into
mainfrom
feat/regression-suite-requirement
Dec 6, 2026
Merged

zlareb1 merged 12 commits into
mainfrom
feat/regression-suite-requirement

Conversation

@zlareb1

@zlareb1 zlareb1 commented Dec 6, 2026 •

Copy link
Copy Markdown
Member

Closes: #1767
Part of: #1177

Changelog category (leave one):

  • New Feature

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 regression suite can be required: publish it with required: true, or turn on Require passing results to accept a proposal on the suite's dashboard page. memory.proposal_decide then accepts a proposal on a key the suite covers only when the suite's checks are satisfied for the proposal's exact content at the suite's current revision, and answers the key with the code checks_required otherwise.

Why

A suite's results are shown on each proposal and in its review, and they decide nothing: an acceptance can be sent with the results failed, recorded for other content or an earlier revision, or absent. An owner who wants the suite to hold a change has no way to say so.

This change lets the owner state it on the suite and makes the server check it on the acceptance, for the hash the acceptance binds. The check is on the server because the dashboard is one of several clients of memory.proposal_decide.

Design rationale, for the belief-revision invariant: this narrows Expand. Where an owner required a suite, a proposal becomes a served fact only with a record that its exact text did not break the suite's cases. It adds no revision operator and changes no stored fact. docs/architecture/regression-suites.md has the section "A required suite".

What the linked epic still lacks after this: its criterion that no other write route skips the requirement, and its documents. A direct write by a writer of the namespace, a definition draft approved in the review queue and a promotion are not checked, and the docs and the switch's hint say so. A suite covers memory keys only, so the documents the epic asks to start with are not covered either.

Scope and risk

What it touches:

  • knowledge.suites.publish: the field, the fleet gate for required: true, the audit row written before the revision.
  • memory.proposal_decide: an acceptance reads the suite checks of the rows it picked, in the two statements the listing already uses, inside the call's sequential reads. decide() grows by one statement, to 32 of the gate's 50.
  • memory.proposals: checks.required and the advice blocker.
  • The dashboard's Regression suites page and Proposals tab, the docs, the labelled proposal set.

What it leaves alone: a rejection and the rejection an owner's policy writes read no checks. Direct writes, approved definition drafts and promotions are not checked, and neither is a proposal under a key outside the suite's selection.

What could break:

  • An acceptance makes one more read, and one more for each slice of covered keys when a suite covers one. A read that fails ends the call with a 5xx before any write: an unread state must not pass as satisfied. No broad except surrounds the reads.
  • The check and the write are not one transaction. A revision published or a result set recorded between the acceptance's read and its write is not seen by that acceptance; its audit row records the suite, the revision and the state it read.
  • The check is the last refusal of an acceptance, after the proposer, the independence and the hash checks, so it hides none of them.
  • Tenant isolation: both reads are scoped by the call's (org, namespace).
  • The audit row knowledge.suites.requirement is written with audit.emit_strict under the publish's claim and is not fail-open: a publish whose row cannot be written answers 503 and writes no revision. Its subject holds memory keys and prefixes and counts the cases; it holds no case id or text.
  • A revision that only changes required makes the recorded result sets outdated, like any other revision. The dashboard's confirmation says so.
  • The listing and the acceptance read the state of different hashes for a value whose stored hash differs from the hash a full read serves, such as an object with a null field. The listing's state and advice are for the stored hash, and the acceptance's for the served one, which is the hash a runner records under. Such a row lists outdated and the blocker checks_required while its acceptance goes through. The guide and the architecture page state the limit; serving one state for both needs the listing to read each row's whole value.

Compatibility, rollout and rollback

  • Wire, added:
    • knowledge.suites.publish input required (optional boolean). Omitted, it keeps the suite's value; a first revision without it is not required.
    • required on the answers of knowledge.suites.publish, knowledge.suites.get, each row of knowledge.suites.list, and knowledge.suites.results.
    • checks.required on each proposal of memory.proposals.
    • The per-key result code checks_required of memory.proposal_decide, with a reason that names the suite, its revision and one of four states. It is a result code of a 200 answer, not an error code.
    • The advice reason checks_required, titled "Required checks not satisfied", which blocks accept.
    • The audit kind knowledge.suites.requirement, and checks (suite, revision, state) on a memory.proposal_accept row of a covered key.
    • No op is added and no error code is added. No default changes: no suite is required until one is published so.
  • Stored: loom.knowledge_suites.required, Int8 DEFAULT -1 (migration 138_knowledge_suite_required.sql, additive). 1 or 0 is a stated requirement and -1 states none; reads take the newest stated value with argMaxIf(required, revision, required >= 0).
  • Operator steps: none beyond the migration that the upgrade runs. knowledge.suites.publish with required: true answers 503 OVERLOADED until every live replica runs migration 138 (rolling-upgrades rule 102). A publish without the field, or with false, is not held by that gate.
  • A build a release behind ignores required in a request and names it in ignored_args, and its answers carry no required. The dashboard compares the answer with what it sent and says when the requirement was not turned on, or not turned off.
  • Rollback: the column and the rows stay. The older build accepts without the check, and a revision it publishes states no requirement, so the suite keeps the one it had and the check applies again once the newer build serves. Nothing is turned off first. A publish the older build serves writes no knowledge.suites.requirement row: a key, a prefix or a case it removes from a required suite shows only in the counts of its knowledge.suites.publish row. The generated SDK tables, the operations reference, schemas/schema.sql and the analyzer corpus revert with the commit.

Tests

Run against a server started from this branch and a ClickHouse started for it (ports 19921 and 20921), on the tree merged with main.

  • Unit, with the repository scans (pytest -n 2): 1797 passed. The run holds the new tests/unit/test_proposal_requirement.py (21 tests: a reject reads no checks, an unreadable checks read fails the accept before any write, the reads are sequential, each state's refusal text, the refusal order, the accept's audit row, a row a build without the column wrote keeps the requirement, the requirement's audit row is written before the insert and fails the publish, the fleet gate, the migration constant), the changed suite, proposal, advice and triage tests, the schema baseline, 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, test_pg_durable_reads.py, test_mcp_listing_budget.py and test_sdk_surface_contract.py.
  • tests/analyzer: 12 passed, after python -m tests.analyzer.corpus --write (7 shapes change, the suite head reads).
  • Integration, server with LOOM_AUTH_REQUIRED=true: test_knowledge_suites.py, test_knowledge_suite_drafts.py, test_suite_results.py, test_proposal_checks_state.py and the new test_proposal_checks_requirement.py: 44 passed.
  • Integration, server with LOOM_AUTH_REQUIRED=false: test_proposal_checks_requirement.py 13 passed; test_proposal_triage_set.py (with the new checks_required case), test_proposals.py, test_proposals_listing.py, test_proposal_triage.py, test_proposal_advice.py and test_proposal_independent_review.py: 16 passed.
  • The new integration file covers the three cases of the linked issue: a failing must_not_state case holds the accept, a case that could not run holds it with no failure and no regression, and the rerun then waits only for an independent reviewer. It also covers results for other content, results for an earlier revision, turning the requirement on, a service account and the proposer with satisfied checks, a contradiction, the audit rows, one state across the listing, the results read and the accept, one refused key beside decided ones, and a key no suite covers.
  • Dashboard (vitest --maxWorkers=2): Suites.test.tsx, Proposals.test.tsx, ProposalChecks.test.tsx and suiteChanges.test.ts: 149 passed. npm --prefix frontend run build passes, and the bundle budget is OK with the index chunk at 112.4 kB of 120 kB, the figure on main.
  • ruff format, ruff check, Biome format and lint, Prettier on the changed docs, the function-length gate, the secrets check, make typecheck, and every generator with its --check (Python, TypeScript, Ruby, Rust with its fixtures, Go, the docs reference, the reach census, the plugin eval tools). sdk/rust/src/wire_models.rs is 2,400,913 bytes of its 4,194,304 limit.

After the review fixes, on the tree with them and a ClickHouse started for that run (ports 19924 and 20924):

  • Dashboard: Proposals.test.tsx and Suites.test.tsx, 128 passed, and ReviewQueue.test.tsx, 101 passed. Two tests are new and each failed before its fix: "a review that draws no panel is not held by what the review before it read" and "says the suite is still required when the server did not turn the requirement off". npm --prefix frontend run build passes and the bundle budget is OK.
  • Integration, server with LOOM_AUTH_REQUIRED=true: test_proposal_checks_requirement.py, 13 passed. test_turning_required_on_outdates_recorded_results now reads required back from knowledge.suites.get, at the head and at revision 1, and from the knowledge.suites.list row.
  • Unit (pytest -n 2): test_proposal_requirement.py, the three suite test files that import the changed model module, test_knowledge_sources_sql.py, the repository scans named above and tests/analyzer: 716 passed, 24 skipped. The skipped tests need the clickhouse binary, which this run did not have.
  • ruff format, ruff check, Biome format and lint, Prettier on the changed docs, make typecheck, and the Python, TypeScript, Ruby, docs reference, reach census and plugin eval generators. The changed field comment reaches the docs reference alone. The Rust and Go generators were not run again: rustfmt and gofmt are not installed, and no generated Rust or Go file holds a field comment.
  • The branch is merged with main, which holds rule 101 for knowledge reports and the migration 137_knowledge_reports.sql: the rule for a required suite is rule 102 and its migration is 138_knowledge_suite_required.sql. The merge had two conflicts, the rule list of docs/architecture/rolling-upgrades.md and the migration list of tests/unit/test_schema_baseline.py, and each keeps both sides.

At this head, on the tree merged with main (426 operations, 312 of them experimental), with a ClickHouse started for the run (ports 19921 and 20921):

  • make migrate from an empty store applies 108 migrations, the last 138_knowledge_suite_required.sql, and make schema-dump reports schemas/schema.sql current: it holds loom.knowledge_reports and the required column.
  • Every generator, then its --check: the Python tables with the client and admin tables, TypeScript, Ruby, Rust with its fixtures, Go, the docs reference, the reach census and the plugin eval tools. Each reports every file current, with rustfmt and gofmt from the pinned images. sdk/rust/src/wire_models.rs is 2,400,913 bytes of its 4,194,304 limit. python -m tests.analyzer.corpus --write leaves one shape for the schema dump where the merge had left two.
  • Unit (pytest -n 2): the schema baseline, test_proposal_requirement.py, the suite, proposal, advice and result test files, the column-set, table-classification and write-path scans, the SDK, Go, docs reference, reach census and MCP listing contracts, the session-content census, the repository scans named above and tests/analyzer: 1176 passed, 33 skipped. Six of these files hold tests that need the clickhouse binary; they then ran with it: 159 passed.
  • Integration, server with LOOM_AUTH_REQUIRED=false: test_proposal_checks_requirement.py and test_proposal_triage_set.py: 15 passed. The 16 tests of test_proposal_checks_state.py and test_suite_results.py skip there, because they need a server that enforces auth. Server with LOOM_AUTH_REQUIRED=true: test_suite_results.py, test_proposal_checks_state.py and test_proposal_checks_requirement.py: 29 passed.
  • Dashboard (vitest --maxWorkers=2): ProposalChecks.test.tsx and suiteChanges.test.ts pass, 23 tests. Suites.test.tsx and Proposals.test.tsx: 128 passed with --testTimeout=30000. At the default timeout of 5 s, five tests of the two files timed out in one run and four in the next, not the same tests, on a machine loaded by other work; the merge changes nothing under frontend/src/views/admin, frontend/src/api or frontend/src/lib. npm --prefix frontend run build passes, and the bundle budget is OK with the index chunk at 112.4 kB of 120 kB, the figure on main.
  • ruff format --check, ruff check, the function-length gate, the secrets check, make typecheck and Prettier on the changed docs pages.
  • main gained four commits during these runs, and the head holds them through two more merges with no conflict. They change the code index's history answers with their generated SDK output, the coding-agent plugin, the image build and one docs page. After the first of the two merges every generator reports every file current, and the SDK, Go, docs reference, reach census and MCP listing contracts, the session-content census, the schema baseline, test_public_copy.py, test_doc_links.py, test_agent_instructions.py and tests/analyzer pass: 797 passed, 2 skipped. After the second, every generator's --check passes. The integration and dashboard runs and make typecheck were not repeated after them.

Not run here:

  • The new integration file under the Postgres memory authority. It is listed in the storage profile's pass in ci.yml and written for either authority; its conflict case skips there, because it records the conflict with a direct ClickHouse write.
  • Playwright, which cannot start in this environment. No spec is extended.
  • The full unit suite and the rest of the integration suite, which CI runs.

Tools this environment lacked: rustfmt, gofmt and the clickhouse binary are not installed on the host. The formatters ran from the pinned rust and golang images, and the unit tests that need clickhouse local ran with the binary copied out of this change's own ClickHouse container.

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 reading the whole diff, by the unit and integration runs above against a server and a ClickHouse started for this change, and by the generators' --check runs.

  • 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

zlareb1 and others added 4 commits December 6, 2026 05:39
…s satisfied checks for its content

`knowledge.suites.publish` takes `required`. While a suite is required,
`memory.proposal_decide` accepts a covered key only when the state of the
row's stored content is `satisfied` at the suite's current revision.
Otherwise the key answers the code `checks_required` with the suite, the
revision and what the results say, and stays pending; the other keys of the
call are decided. The check is the last refusal of an acceptance, a
rejection reads no checks, and a failed read of the checks fails the call
before any write.

The requirement is part of the revision (`loom.knowledge_suites.required`,
migration 136). A publish without the field keeps the suite's value, and a
revision written by a build without the column states none, so the suite
keeps the requirement it had. Turning it on, turning it off, and removing a
key, a prefix or a case from a required suite write the audit row
`knowledge.suites.requirement` before the revision; a row that cannot be
written fails the publish with 503. `required: true` answers 503 until every
live replica runs migration 136.

`knowledge.suites.get`, `knowledge.suites.list`, `knowledge.suites.results`
and each proposal's `checks` answer `required`, the proposal advice gains
the blocker `checks_required`, and the acceptance's audit row records the
checks it read.

The dashboard's suite page has the switch, which goes out with Publish. The
list of suites and the Proposals tab say which suite is required, and a
review whose results are not satisfied says why Accept is unavailable.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The analyzer corpus is rewritten from the merged statements, and the
rolling-upgrade rule for a required suite takes the next free number, 100.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The handler raises again from its broad except, so the waiver named a rule
that does not fire there.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ctions

`knowledge.suites.publish` requires `memory_key_prefixes`, so the set's
`require` step sends an empty list beside the case's key.

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 6, 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 6, 2026 9:01am UTC
loom-telemetry Ready Ready Preview Dec 6, 2026 9:01am UTC

Request Review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread frontend/src/views/admin/Proposals.tsx Resolved
zlareb1 and others added 3 commits December 6, 2026 06:52
… it read

The review dialog kept the results its Suite checks panel last reported and
compared them with the open review by content hash alone. A review that draws
no panel, for a key no suite covers or a row listed without checks, sets none,
so Accept stayed unavailable for a text with the hash of a held one until the
page was reloaded. Opening a review clears that read, and the review's own
panel reports again when it is drawn.

The suite page's alert after a publish whose requirement the server did not
take said that accepting needs no results and to turn it on again. A publish
that turned the requirement off and was served by a build a release behind
got the same words, while the requirement stays stored. That publish says the
suite is still required.

The refusal a test of the review mocks is worded as the server words it.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…of the listed checks

The listing reads the checks for a row's stored hash and an acceptance for the
hash a full read serves. The two differ for an object with a null field, so
such a row lists `outdated` and the blocker `checks_required` while its
acceptance goes through. The guide and the architecture page state that limit,
and the integration test that compares the three reads names it.

The guide also said that an accept reads no result, quoted two reason strings
the server does not send, and left out that a proposal under a key outside the
suite's selection is not held. Rule 100, the rollback note and the audit page
say that a publish a build a release behind serves writes no
`knowledge.suites.requirement` row.

The reference row of `knowledge.suites.publish`'s `required` says what an
omitted value does. `test_turning_required_on_outdates_recorded_results` reads
`required` back from `knowledge.suites.get` and `knowledge.suites.list`, which
no test asserted, and the audit-row test asserts `written` on its last publish.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Both sides added rule 100 to docs/architecture/rolling-upgrades.md. The rule
for a Worklist card in a saved chat keeps the number, and the rule for a
required regression suite is rule 101, as the guide, the architecture page,
the audit page and the rollback note name it.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ 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 bd9a1a5. Configure here.

// What was sent is the suite now, with the requirement the answer holds; the read
// after it brings who wrote it and when.
const required = answer.required ?? detail.required;
setRead({ detail: { ...detail, ...next, required, revision: answer.revision }, error: null });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refetch hides a requirement still on

Medium Severity

After a publish whose answer omits required, the page keeps the previous requirement, then setRetry reloads the suite and replaces that value. An older server omits required on the reload too, so the switch shows off while the alert still says the suite is required.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bd9a1a5. Configure here.

// the server refuses that accept. Before the read answers, and when it fails, Accept
// stays available and the server decides.
const unmet = review?.row?.content_sha256 === checksRead?.sha ? requiredHold(checksRead?.results ?? null) : null;
const checksReason = unmet ? `A required suite's checks are not satisfied: ${unmet}` : null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed case read still blocks accept

Medium Severity

Accept is disabled from onResults as soon as the results read returns. If the later case-text read fails, the panel shows "Couldn't load the suite checks" and never clears that report, so Accept stays unavailable even though a failed panel read is supposed to leave the decision to the server.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bd9a1a5. Configure here.

zlareb1 and others added 5 commits December 6, 2026 07:15
…rds the checks state it read

The 503 row of the publish table links the rolling-upgrade rule for a required
regression suite. That rule is 101; rule 100 is the Worklist card rule.

An acceptance reads the checks of every key a suite covers and writes the state
on its audit row, whether or not the suite is required. Only the refusal depends
on the requirement. The runner section says that, as the page's audit section
does, instead of saying an accept reads no result.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The rolling-upgrade rule for knowledge reports is rule 101 and the rule
for a required regression suite is rule 102. The schema baseline test
lists the migrations of both sides. Every generator reports its files
current on the merged tree.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… 102

The migration that adds `loom.knowledge_suites.required` is
`138_knowledge_suite_required.sql`, numbered after the newest migration
on main. `REQUIRED_MIGRATION` is 138, so `knowledge.suites.publish` with
`required: true` answers 503 until every live replica runs schema
version 138.

The pages that cite the rule for a required suite cite rule 102, the
number it holds in `docs/architecture/rolling-upgrades.md` beside rule
101 for knowledge reports.

`tests/analyzer/shapes.txt` is rewritten from the merged tree and holds
one shape for the schema dump.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The merge has no conflict. Every generator reports its files current on
the merged tree, which holds 426 operations.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The merge has no conflict. Every generator reports its files current on
the merged tree, which holds 426 operations.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@zlareb1
zlareb1 merged commit f9cb57f into main Dec 6, 2026
97 of 99 checks passed
@zlareb1
zlareb1 deleted the feat/regression-suite-requirement branch December 6, 2026 09:17
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.

Add a must_not_state case and an unavailable outcome to regression suites

1 participant