Repository navigation
The tests behind main's red unit and integration jobs follow the code they exercise - #116
Merged
Merged
Conversation
system_prompt appends each property's constraints to its line, and an array property carries its items' constraints, so the test's languages property (items maxLength 20) reads "(array of string, at most 20 characters)". The test expected the line without the bound and failed on every run. Signed-off-by: pufit <[email protected]>
The fold reads its facts through user_facts, which selects memory_id, and hands their ids to write_folded_section, which names them in the section's trace (profile.fold:<label>:<memory ids>) so memory.redact can reach the section. StubCH returned rows with no memory_id, so the fold raised KeyError after the model call: two tests failed on profiles_written, and the high-row test passed with the error logged. StubCH now gives each row a memory_id, and the tests replace write_folded_section, so they record what the fold hands its write. Signed-off-by: pufit <[email protected]>
memory.redact looks up the profile keys built from the memory (profile_keys_built_from) before it scrubs anything, so a lock on one refuses the redact and their versions are scrubbed with the named one. The handler must not skip that lookup when it fails: the redact would report success with the memory's text still in a profile. The CH-free test stubbed every other repository call and reached the unconnected client through this one; it now stubs it with no profile built from the memory, and its expectations are unchanged. Signed-off-by: pufit <[email protected]>
schemas/schema.sql declares the vector columns of memory_embeddings and memory_chunks with CODEC(Quantized(...)). On the ClickHouse release CI runs, clickhouse-local refuses that CREATE without enable_quantized_codec, so all six tests that build these tables failed before the redact ran; the other clickhouse-local tests set it first. With the setting on, the retried-redact test then failed on its embedding rows: a coded column takes vectors of its declared width (3072), not the empty default. Its rows now carry zero vectors of that width in both coded columns. Signed-off-by: pufit <[email protected]>
…efusal profile_schema.set is refused for a token bounded to one user, as memory_schema.register is: a profile schema is namespace-wide, so it is in neither SCOPED_OPS nor NARROW_SAFE_OPS. The walk of refused ops could not build its required json_schema field and listed the op as unbuildable, which fails the test unless _UNBUILDABLE names it. The walk now fills json_schema, so the op's refusal is checked like the others': the gate answers a pinned token 403 before the schema is read, and any other answer fails the walk. Signed-off-by: pufit <[email protected]>
_local_memory writes a test's rows in one INSERT. ClickHouse merges an inserted block by default (optimize_on_insert), so ReplacingMergeTree kept only each key's newest version, and the older unlabelled versions the sweep pages past before a merge were never written. Three tests built on them failed: the key read saw current versions only, and the first pass labelled the row the tests expect a later pass to reach. The fixture turns optimize_on_insert off, so each listed version stays a row, as separate writes leave them until a merge. Signed-off-by: pufit <[email protected]>
… truncated A pass reads the rest of each agent it moved past with the pages it has left, and reports truncated when it could not, as test_a_pass_that_cannot_reread_every_agent_it_moved_past_says_it_was_truncated pins and docs/architecture/security.md states. In test_one_pass_crosses_several_agents_it_finds_nothing_to_label_in the three pages go to `a`, `b` and the PIN row in `c`, so the rest of `a` and `b` is not read and the pass is truncated. The test still expected not truncated, from before truncated covered the whole scan. Signed-off-by: pufit <[email protected]>
…rameters _read_page sends its key read a parameter dict and then adds the FINAL read's upto_* bounds to that same dict. The test kept a reference to each dict, so every key read followed by a FINAL read later held upto_org and was not counted: only the last, empty key read was, and the test failed on len(key_reads) > 1. It now keeps a copy taken when the read is made. Signed-off-by: pufit <[email protected]>
This was referenced Oct 21, 2026
4 of 9 tasks
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: #93
Related: #89
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):
Not required: tests only.
Why
mainhas been red since the profile-schema and sensitivity-sweep changes landed: thepytest unit + coveragejob fails 15 tests andpytest integrationfails one, and both were already red on those pull requests' own heads. Every failure is a test that did not follow the code it exercises; the server code is right in each case, so this changes tests only.system_promptnow names each property's bounds, so the expected line reads(array of string, at most 20 characters).memory_idthatuser_factsalways returns, and the tests stubbed the replacedhandle_profile_setinstead ofwrite_folded_section; the fold crashed after the model call,run_passswallowed it, and nothing was written (assert 0 == 1in CI,KeyError: 'memory_id'locally).profile_keys_built_from; the test did not stub it and reached the unconnected client. The handler stays strict: skipping that lookup would report a redact as done while profile versions still hold the text.schemas/schema.sqlreplayed throughclickhouse_local.ddl(); two of them use theQuantizedcodec, which the CI server refuses withoutSET enable_quantized_codec = 1, as the sibling SQL tests already do. Behind that, one test inserted empty vectors into the coded columns, which need 3072-wide zero vectors.profile_schema.setis correctly refused for a token pinned to one user, asmemory_schema.registeris; the assertion listed the ops the walk could not build a body for, because it never filledjson_schema. The walk now fills it, so the refusal is actually checked (403), and the extraction-policy ops pass the same walk.INSERT, and the defaultoptimize_on_insertkeeps only each key's newest version, so the "old versions waiting for a merge" the tests rely on never existed.SET optimize_on_insert = 0keeps them, as separate writes would until a merge.truncatedwas made to cover the whole scan; the sibling test added at the same time already asserts truncated for the same situation._read_pageadds the FINAL read's bounds to the params dict it already handed to the key read; the test kept references and counted one key read. It records a copy. Production is unaffected.Scope and risk
Six test files, 34 insertions, 15 deletions; no server code, no schema, no generated file. The five profile hunks are identical to the ones carried on
pufit/admin-revocation, so whichever lands first merges cleanly with the other. Nothing here touches concurrency, stored data, auth or tenant isolation.Compatibility, rollout and rollback
Tests
pytest tests/unit -q -p randomly --randomly-seed=<seed> --cov … --cov-fail-under=40) on ClickHouse 26.9.19.9 (the release CI tests),TZ=UTC, two seeds (395652978721, 395537825001): 21983 passed, 74 skipped, 1 xfailed, 0 failed, coverage 89.98% both times. The coverage floors exit 0 for both seeds;pytest bench191 passed;integrations/generic/test.shpasses.scripts/serve.sh):tests/integration/test_read_scope_isolation.py20 passed with auth off and 20 with auth on; the nine auth-on gate files 95 passed;pytest tests/analyzer12 passed. The full integration directory was not re-run locally;main's own run had only the one failure fixed here.ruff check,ruff format --check .,mypy --strict sdk/python/loom, the mypy gate (0 errors), the function-length and secrets gates and every generator--checkexit 0.maxItemsalthough extra array items are dropped silently;tests/unit/cross_replica_fake.pyanswersnow()in host-local time, so twotest_cross_replica_authtests fail on a non-UTC machine (CI runs in UTC).AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): a Claude agent run by Nerve. Checked: each failure reproduced on a clean
main, the root cause read against the commit that introduced it, and the suites above run with CI's ClickHouse release and commands.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed (no server behaviour changed; the fixed integration file and the auth-on gates pass).--checkpasses).main; no merged migration is edited.frontend/changed.docs/describe the system as it now is (unchanged), and this description names any operator steps and wire changes (none).git commit -s), as CONTRIBUTING.md asks.