Skip to content

Review follow-ups: docs, comments and tests say what the recently merged changes do - #1699

Merged
zlareb1 merged 22 commits into
mainfrom
fix/review-follow-ups
Nov 28, 2026
Merged

zlareb1 merged 22 commits into
mainfrom
fix/review-follow-ups

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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.

Why

About thirty pull requests were merged on an agent review that let findings below a defect through, to be fixed in one follow-up. This is that follow-up. Each finding was read again on current main. The ones that still hold and take a few lines are fixed here, one commit each, with the finding quoted in the commit message. The rest are listed below with what settled them or why they are left.

Almost every fix is a comment, a docstring, a doc sentence or a test that said more or less than the code beside it. Two change how work is done without changing a result: namespace.validate reads the names of unlinked memories in a thread, as the link pass does, and a range's turnover is remembered per file limit.

Scope and risk

No served result, stored row, setting, op or field changes. No plugin file changes, so no plugin version changes.

Fixed here

Finding From Commit
The stored-memory read's docstring did not say the per-call valid_at default is not read #1645 86573ea
unlinked ran the mention patterns over up to 2,000 values on the event loop #1653 785fe7c
A write in flight when the link pass read its queue is counted under its cause, and no text said so #1653 b1aabf5
The code-state probe's comment said its first statement costs nothing; it reads every link row #1653 d9f6163
"all under keys when given" although the 2,000-memory limit applies under keys too (code_unlinked_*; code_rename_edits made the same claim and is reworded with it) #1653 db550c6
.env.example and deploy/standalone/env.example set LOOM_CODE_INGEST_ENABLED=true, the default #1652 c086f98
took in the file re-hash named nothing #1644 314f750
VIA_VALUES was read by nothing and had drifted once #1671 b3ec87d
_now parsed line numbers back out of a cleaned string #1667 01584bd
No test for the note of a definition whose module prefix follows its file #1667 a182ce2
One unwrapped line in the lessons bullet of docs/concepts/memory.md #1667 f536f33
A test case comment told history ("unsure, as before") #1669 fbfd6a9
A sentence of the paragraph on following a renamed definition broken after "is" onto a two-word line #1669 5c0d7eb (the merge of main)
RepoReads.turnover did not hold limit in its remembered key #1672 e610388
Its docstring left out one case that returns None and said all of them are counted #1672 00681a2
docs/features/memory/extraction.md gave a wrong order for a session fact's valid_at #1676 28de679
The same page sized the session prompt in tokens with no tokenizer, against a comment that disagreed #1676 0448ce6
The prompt builder's docstring did not say a coding session takes no flag-gated block #1676 0d9d248

Already settled on main

Left, with the reason

Compatibility, rollout and rollback

  • Wire: none added, changed or removed. The exceptions text of the four code_unlinked_* findings and of code_rename_edits, and the uncertainty text of code_unlinked_pending, read differently in namespace.validate's reply.
  • Operator steps: none. A deployment that copied either env example keeps its LOOM_CODE_INGEST_ENABLED=true line, which is the default.
  • Rollback: reverting leaves nothing behind.

Tests

  • Before the merge of main: pytest tests/unit/test_code_legs_ride_lazy_materialization.py tests/unit/test_coding_session_extraction.py tests/unit/test_memory_code_staleness.py tests/unit/test_memory_code_links.py tests/unit/test_code_unlinked.py: 307 passed. Three of them are test files this change edits; the last covers the one function moved to a thread.
  • After the merge of main, called directly: test_pool_depths_stay_under_the_lazy_materialization_cap, the two rename-note tests of test_memory_code_staleness.py and the coding-session prompt test at both sizes pass, and the turnover check below gives the same result on main's turnover. ruff format --check, ruff check, the function-length gate, every generator's --check and Prettier on the changed pages pass on the merged tree.
  • unlinked: a spy on mentions() ran on the event-loop thread before the commit and on a worker thread after it, with the same report.
  • turnover: on one RepoReads, a call with limit=32 after a call with limit=1 returned None before the commit and a Turnover after it.
  • _now: five link shapes render the same notes before and after.
  • Prompt sizes for the extraction page, with len(): session 8,058 characters, compact conversation 56,898, full conversation 86,041.
  • The fixture-free test functions of test_env_example_vars_are_read, test_stock_env_matches_docs, test_stack_bundle, test_namespace_validate and test_public_copy, called directly: none failed.
  • ruff format --check on the changed files, ruff check, the function-length gate, every generator's --check and Prettier on the three changed pages pass. The mypy gate reports only server/llm/vertex_auth.py, where this machine lacks the stubs of an optional dependency.
  • The full unit suite was not run locally; CI runs it.

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. Each finding was read against the code on main before its fix, and the checks under Tests were run on the result.

  • 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) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.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


Note

Low Risk
Changes are mostly comments and docs; the turnover cache key and threaded unlinked filter are low-risk correctness/performance fixes with no API or schema changes.

Overview
Follow-up after a large review sweep: almost every change is documentation, comments, or tests so prose matches the code beside it, with two small runtime adjustments that do not alter stored rows or wire formats.

Docs and configuration reword memory code-link and extraction behavior (session-capture prompt size in characters, valid_at precedence, the 2,000-memory scan cap wording). .env.example and deploy/standalone/env.example drop explicit LOOM_CODE_INGEST_ENABLED=true because that value is already the default.

Code intelligence cleanup removes the unused VIA_VALUES tuple from server/code/domain/units.py and keeps comments accurate.

Memory / code-link path updates docstrings and operator-facing contract text (namespace.validate exceptions for code_unlinked_* and code_rename_edits, plus code_unlinked_pending uncertainty). RepoReads.turnover now keys its memo on limit so different file limits do not share a cached turnover. unlinked filters whether memories “name code” via asyncio.to_thread so mention matching does not block the event loop. code_change._now reads line numbers from raw link fields (not cleaned display strings). code_link_rehash renames took to adopts_checked for clarity only.

Tests add coverage for pool MAX_DEPTH under the lazy-materialization cap and for stale-code notes when a module prefix follows its file on rename.

Reviewed by Cursor Bugbot for commit b1aabf5. Bugbot is set up for automated code reviews on this repo. Configure here.

zlareb1 and others added 21 commits November 28, 2026 14:56
… is not read

Review nit on the change that drops a coding fact a stored memory states:

> The validity check reads only the fact's own `valid_at`, `valid_to` and
> `foresight`. A capture sent with a per-call `valid_at` default still has
> its facts compared with stored rows and dropped. [...] The
> `_stored_neighbours` docstring could say the per-call default is not
> considered.

The docstring now says so. No behaviour changes.

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

Review nit on the change that publishes no-link causes:

> `unlinked` runs `mentions()` (six regex passes) over the value of up to
> 2,000 memories on the event loop of a serving process. The link pass
> does the same work in `asyncio.to_thread` (`code_links._memory_mentions`).
> A `namespace.validate` without `keys` on a namespace of large values
> stalls other requests on that replica while it runs. Fix: filter the
> heads in `asyncio.to_thread`.

The filter now runs in a thread. The report is the same.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Review nit on the change that publishes link lag and link states:

> the state statement now also runs `SELECT DISTINCT org, code_namespace
> FROM loom.memory_code_links WHERE tombstoned_at IS NULL` over every link
> version, every minute on the lease holder. The comment in
> `_probe_code_state` still says the rows of this statement "cost nothing"
> and that only the counts read every live row. Update the comment, or
> move the linked-repositories leg to the counts clock.

The comment now names what the statement reads. The probe is unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Review nit on the change that publishes no-link causes:

> both say the memories read are "all under `keys` when given", but
> `linkable_of_namespace` applies `LIMIT 2000` with `keys` too (`unlinked`
> always passes `limit=SCANNED`). The claim holds only if
> `NamespaceValidateInput.keys` cannot match more than 2,000 served
> memories; several identities can hold one key. Reword to "the 2,000 last
> written under `keys`", or drop the limit when `keys` is given.

Reworded in the `code_unlinked_*` contract text, the `unlinked` docstring
and the concepts page. `code_rename_edits` reads through the same limit
and made the same claim in its contract text and on the page, so it is
reworded too. No read changes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Review nit on the change that turned the ingest poller on by default:

> the comment "The stock single-node stack enables the non-LLM indexing
> workers" and `LOOM_CODE_INGEST_ENABLED=true` now restate the default;
> `deploy/standalone/env.example:63` does the same. Drop the line or
> reword the comment so the files do not suggest the setting is needed.

Both files drop the line. The stock comment stays for the two workers
below it that are off by default.

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

Review nit on the change that makes a file link follow the lines it cites:

> readability. `took`, `first` and `written` carry the whole baseline rule
> of `_file_rehashed` in three one-word locals; `took` in particular means
> 'no baseline text is readable and the last check matched it'. A name such
> as `adopts_checked` would let the branch at line 133 read without the
> docstring.

`took` is now `adopts_checked`. A rename only.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Review nit on the change that serves a spelled-out definition second:

> `VIA_VALUES` is extended to nine labels but no code or test reads it (the
> only reference at this head is its own definition). It had already
> drifted from what `_extra_via_labels` serves, which is why this PR had to
> add `history`, `card`, `concept` and `hyde` by hand. Delete it, or add a
> unit test that the labels `leg_provenance`, `_extra_via_labels` and
> `_held_definitions` can produce are all in it.

Deleted: nothing read it. The comment above `via` keeps the description.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Review nit on the change that makes readers name where moved code is:

> `_now` reads the line numbers through `_field`, which turns every value
> into a cleaned, truncated string, and then parses them back with
> `int(_field(link, 'start_line') or 0)`. Read the two integers directly;
> `_field` is for the path and name text.

`_now` reads the two integers as they are; `_field` keeps the path and
name text. The notes read the same.

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

Review nit on the change that makes readers name where moved code is:

> the deleted test `test_a_file_move_names_the_files_not_a_rename` covered
> a definition whose module prefix follows its file (`reader::fetch_rows`
> to `loader::fetch_rows` in `loader.py`). `memory.ask`'s note now reads
> that as a rename (`reader::fetch_rows` is now `loader::fetch_rows` at
> loader.py), which is accurate but no test pins the new wording for that
> case.

One test pins that wording.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Review nit on the change that follows a moved and edited definition past
unrelated new definitions:

> The case comment "unsure, as before" narrates history. Say what holds
> instead: a deletion beside an unrelated addition is not called removed.

The comment now says what the case asserts.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Review nit on the change that follows a moved and edited definition past
unrelated new definitions:

> The comment above `moved_and_edited` runs to three lines and stacks
> "never ... nor ... unless". Two lines would do: searched for a live link
> whose same-file answer is certain, or unsure only because no new
> definition there is close (`unmatched`).

Two lines, stated positively. The condition is unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Review nit on the change that follows a rename across files:

> `limit` is a parameter with one caller and one constant value
> (`_MAX_ELSEWHERE`), and it is not part of the `_once` key `("turnover",
> base, head)`, so a second call with another limit would get the first
> call's answer. Drop the parameter or add it to the key.

The key now holds the limit. The one caller passes one value, so no
answer changes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Review nit on the change that follows a rename across files:

> the docstring says None means the range cannot be read or is too wide,
> "counted in `wide_ranges`". None is also returned when no repository
> indexes the namespace (`ingest_scope` is None), and only the too-wide
> case is counted.

The docstring names the three cases and which one is counted.

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

Review nit on the change that gives a coding session its own extraction
prompt:

> `_extraction_base_prompt(agent_learnings=True, coding_session=True)` now
> returns the session prompt and silently drops the agent-learnings block;
> on main both were appended. The pipeline never sets both [...], so no
> capability is lost, but the docstring does not say the flag is ignored
> and tests/unit/test_coding_session_extraction.py:45 passes
> `agent_learnings=True` without saying it is asserting that. Fix: one
> clause in the docstring ("a coding session takes no flag-gated block")
> and the same in the test comment.

Both say it. The prompt is unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Review nit on the change that marked the pool cut's depth as not a
setting:

> The marker says a deeper scan reads every candidate's body, yet nothing
> pins MAX_DEPTH at or under ClickHouse's lazy-materialization cap. [...]
> Raising MAX_DEPTH to 20_000 would pass both files and the tunable gate,
> which the marker now silences. [...] Fix, here or in a follow-up:
> `assert MAX_DEPTH <= LAZY_LIMIT_CAP` in
> test_pool_depths_stay_under_the_lazy_materialization_cap.

The test asserts it. With MAX_DEPTH set to 20,000 the test passed before
this commit and fails after it.

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

Review nit on the change that makes readers name where moved code is:

> the edited `code.search`/lessons bullet leaves one line unwrapped (`any;
> a row another row read for the answer supersedes is not served.
> `lessons_left_out` counts the rows the cap, a cut or that rule left`,
> about 150 columns) in a paragraph wrapped at about 100. Rewrap it.

Rewrapped from that line to the end of the bullet. No word changes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…ntry 66 are wrapped evenly

Review nits on the two changes that follow a moved and edited definition
and a rename across files:

> The added sentence starts mid-line and runs to about 105 characters in a
> paragraph wrapped near 90, and the next sentence is broken after "is"
> onto a two-word line. Rewrap the paragraph.

> the new paragraph is hard-wrapped unevenly ("Two definitions that may be
> it," and "first. A" end short lines mid-sentence), and the same is true
> of entry 66 in docs/architecture/rolling-upgrades.md, where one line
> runs past the others. Re-wrap.

The paragraph is rewrapped from its first short line to its end, and
entry 66 whole. No word changes.

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

Review nit on the change that lists the edits a followed rename allows:

> one unwrapped line ("...or the one `reason` no edit is offered. The
> finding's `totals` count the memories by `edits` and by reason. Loom")
> in a paragraph otherwise wrapped at about 90 columns; rewrap.

Rewrapped from that line to the end of the paragraph. No word changes.

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

Review nit on the change that gives a coding session its own extraction
prompt:

> The page says the extractor sets no `valid_at` on a session capture's
> fact and that the row takes `valid_at` from `temporal_anchor` or the
> observation date. Two unchanged paths set it first:
> `apply_message_timestamps` [...] writes the cited turn's time into
> `temporal_anchor` and `valid_at` when the capture's messages carry a
> `timestamp`, and the write step prefers the call's own `valid_at` [...].
> Fix: say the prompt does not ask for `valid_at`, and name the turn
> timestamp and the per-call default ahead of the anchor and the
> observation date.

The page gives the four sources in the order the write step reads them.

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

Review nit on the change that gives a coding session its own extraction
prompt:

> "about 2,700 tokens where the conversation prompt is 20,000 to 34,000"
> gives token counts with no model or tokenizer, and disagrees with the
> comment above `_COMPACT_EXAMPLE_IDS` [...]. The only pinned size is
> `len(prompt) < 9000` characters in the test. Fix: state the size the
> test pins (under 9,000 characters, against roughly 86,000 for the full
> conversation prompt), or name the tokenizer and make the comment and the
> page agree.

The page gives characters: under 9,000, which the test pins, against
about 57,000 for the compact conversation prompt and 86,000 for the full
one. Measured with len(): 8,058, 56,898 and 86,041.

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

Review nit on the change that publishes no-link causes:

> `has_read` compares the memory's `version` (the writer's clock, at write
> time) with the queue cursor's `queued_at` (ClickHouse's clock, at queue
> insert). A write with `version <= read_to < queued_at` (an insert in
> flight, or clock skew between the server host and ClickHouse) is counted
> under `code_unlinked_name_unresolved` or `code_unlinked_file_not_indexed`
> instead of `code_unlinked_pending` until the next pass reads it. Info
> severity and transient; the check's `uncertainty` text should say so, or
> the read should allow a margin.

`code_unlinked_pending`'s `uncertainty` text and the `has_read` docstring
say so. The comparison is unchanged.

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

vercel Bot commented Nov 28, 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 Nov 28, 2026 1:34pm UTC
loom-telemetry Ready Ready Preview Nov 28, 2026 1:34pm UTC

Request Review

…exical leg without its pool cut

Conflicts and what each side keeps:

- server/memory/app/code_link_pass.py: main's `turnover` (the changed
  paths read once, `turnover_holding` for a wide range) with this
  branch's `limit` in its remembered key and the docstring's case of a
  namespace no repository indexes.
- server/memory/app/code_link_recheck.py: main's. The comment this
  branch reworded is gone with the code it sat on, now `_moved` and its
  docstring.
- docs/architecture/rolling-upgrades.md: main's entry 66, which is
  rewritten and evenly wrapped.
- docs/concepts/memory.md: main's words in both paragraphs. The paragraph
  on following a renamed definition still broke a sentence after "is"
  onto a two-word line, so it is rewrapped from that line to its end, no
  word changes.

One change git merged cleanly and main had made void:
tests/unit/test_code_legs_ride_lazy_materialization.py imported
`MAX_DEPTH` from `server/code/domain/index/pool_cut.py`, which main
removed with the pool cut. The file is main's again: there is no cut
depth left to pin.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
@zlareb1
zlareb1 merged commit 2b0f149 into main Nov 28, 2026
72 of 77 checks passed
@zlareb1
zlareb1 deleted the fix/review-follow-ups branch November 28, 2026 13:36
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